create bigscreen.d.ts

This commit is contained in:
Douglas Eichelberger
2014-02-24 17:33:22 -08:00
parent 237406ac2c
commit e49bdda008
3 changed files with 44 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
/// <reference path="bigscreen.d.ts"/>
BigScreen.onchange = function(element: Element) {
console.log("Full-screen element " + element + " changed.");
}
BigScreen.onenter = function(element: Element) {
console.log(BigScreen.element + " entered full-screen.");
};
BigScreen.onexit = function() {
console.log("Exited full-screen.");
}
BigScreen.onerror = function(element: Element, reason: string) {
console.log("Error sending " + element + " into full-screen: " + reason);
}
console.log("full-screen-enabled? " + BigScreen.enabled);
BigScreen.request(document.documentElement);
BigScreen.exit();
BigScreen.toggle(document.documentElement);
+20
View File
@@ -0,0 +1,20 @@
// Type definitions for BigScreen 2.0.4
// Project: http://brad.is/coding/BigScreen/
// Definitions by: Douglas Eichelberger <https://github.com/dduugg/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface BigScreenStatic {
element: any;
enabled: boolean;
exit(): void;
onchange(element: Element): void;
onenter(element: Element): void;
onerror(element: Element, reason: string): void;
onexit(): void;
request(element: Element, onEnter?: (element: Element) => void, onExit?: () => void, onError?: (element: Element, reason: string) => void): void;
toggle(element: Element, onEnter?: (element: Element) => void, onExit?: () => void, onError?: (element: Element, reason: string) => void): void;
videoEnabled(video: HTMLVideoElement): boolean;
}
declare var BigScreen: BigScreenStatic;