Add vendor-specific TS declarations for the Fullscreen API.

Fixes #8660.
This commit is contained in:
Kevin Schmidt
2018-09-18 12:00:30 -06:00
parent 5910e4d207
commit 4d26ab751d
3 changed files with 43 additions and 5 deletions

29
types/dom.d.ts vendored Normal file
View File

@@ -0,0 +1,29 @@
/**
* Type declarations extending TypeScript's lib/lib.dom.d.ts.
* https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts
*/
interface Document {
readonly mozFullScreen: boolean;
readonly webkitIsFullScreen: boolean;
readonly fullscreenElement: Element;
readonly mozFullScreenElement: Element;
readonly msFullscreenElement: Element;
readonly webkitFullscreenElement: Element;
readonly mozFullScreenEnabled: boolean;
readonly msFullscreenEnabled: boolean;
readonly webkitFullscreenEnabled: boolean;
mozCancelFullScreen(): void;
msExitFullscreen(): void;
webkitExitFullscreen(): void;
}
interface Element {
mozRequestFullScreen(): Promise<void>;
mozRequestFullScreenWithKeys(): Promise<void>;
msRequestFullscreen(): Promise<void>;
webkitRequestFullscreen(allowKeyboardInput?: number): Promise<void>;
}