Merge pull request #1731 from dduugg/master

create bigscreen.d.ts
This commit is contained in:
Basarat Ali Syed 2014-02-25 15:54:23 +11:00
commit c2b5a97965
3 changed files with 44 additions and 0 deletions

View File

@ -40,6 +40,7 @@ List of Definitions
* [async](https://github.com/caolan/async) (by [Boris Yankov](https://github.com/borisyankov))
* [Backbone.js](http://backbonejs.org/) (by [Boris Yankov](https://github.com/borisyankov))
* [Backbone Relational](http://backbonerelational.org/) (by [Eirik Hoem](https://github.com/eirikhm))
* [BigScreen](http://brad.is/coding/BigScreen/) (by [Douglas Eichelberger](https://github.com/dduugg))
* [Bluebird](https://github.com/petkaantonov/bluebird) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Bootbox](https://github.com/makeusabrew/bootbox) (by [Vincent Bortone](https://github.com/vbortone/))
* [Bootstrap](http://twitter.github.com/bootstrap/) (by [Boris Yankov](https://github.com/borisyankov))

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
bigscreen/bigscreen.d.ts vendored Normal file
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;