2
0
Эх сурвалжийг харах

[js] Update the externs related to the Fullscreen API (#10620)

Cédric Belin 3 жил өмнө
parent
commit
5cbe429119

+ 2 - 2
std/js/html/DOMElement.hx

@@ -504,8 +504,8 @@ extern class DOMElement extends Node {
 		Asynchronously asks the browser to make the element full-screen.
 		Asynchronously asks the browser to make the element full-screen.
 		@throws DOMError
 		@throws DOMError
 	**/
 	**/
-	function requestFullscreen() : Void;
-	
+	function requestFullscreen(?options: FullscreenOptions) : js.lib.Promise<Void>;
+
 	/**
 	/**
 		Allows to asynchronously ask for the pointer to be locked on the given element.
 		Allows to asynchronously ask for the pointer to be locked on the given element.
 	**/
 	**/

+ 7 - 2
std/js/html/Document.hx

@@ -510,8 +510,13 @@ extern class Document extends Node {
 		Releases the current mouse capture if it's on an element in this document.
 		Releases the current mouse capture if it's on an element in this document.
 	**/
 	**/
 	function releaseCapture() : Void;
 	function releaseCapture() : Void;
-	function exitFullscreen() : Void;
-	
+
+	/**
+		Requests that the element on this document which is currently being presented in fullscreen mode
+		be taken out of fullscreen mode, restoring the previous state of the screen.
+	**/
+	function exitFullscreen() : js.lib.Promise<Void>;
+
 	/**
 	/**
 		Release the pointer lock.
 		Release the pointer lock.
 	**/
 	**/

+ 40 - 0
std/js/html/FullscreenOptions.hx

@@ -0,0 +1,40 @@
+/*
+ * Copyright (C)2005-2022 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package js.html;
+
+/**
+	An object that controls the behavior of the transition to fullscreen mode.
+**/
+typedef FullscreenOptions = {
+
+	/**
+		Controls whether or not to show navigation UI while the element is in fullscreen mode.
+	**/
+	var ?navigationUI: FullscreenOptionsNavigationUI;
+}
+
+enum abstract FullscreenOptionsNavigationUI(String) {
+	var Auto = "auto";
+	var Hide = "hide";
+	var Show = "show";
+}