mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Add angular-fullscreen type definition
- Add interface for Fullscreen type definition - Wrap it in angular.fullscreen module - Add test Angular module
This commit is contained in:
12
angular-fullscreen/angular-fullscreen-tests.ts
Normal file
12
angular-fullscreen/angular-fullscreen-tests.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference path="angular-fullscreen.d.ts" />
|
||||
|
||||
angular
|
||||
.module('TestApp', ['FBAngular'])
|
||||
.controller('TestCtrl', (Fullscreen: ng.fullscreen.IFullscreen) => {
|
||||
Fullscreen.all();
|
||||
Fullscreen.toggleAll();
|
||||
Fullscreen.enable(document.getElementById('test-id'));
|
||||
Fullscreen.cancel();
|
||||
Fullscreen.isEnabled();
|
||||
Fullscreen.isSupported();
|
||||
});
|
||||
34
angular-fullscreen/angular-fullscreen.d.ts
vendored
Normal file
34
angular-fullscreen/angular-fullscreen.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// Type definitions for AngularJS HTML5 Fullscreen v1.0.1
|
||||
// Project: https://github.com/fabiobiondi/angular-fullscreen
|
||||
// Definitions by: Julien Paroche <https://github.com/julienpa>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/angular-fullscreen
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module angular.fullscreen {
|
||||
|
||||
/**
|
||||
* Prefixing interface name with "I" is not recommended: http://www.typescriptlang.org/Handbook#writing-dts-files
|
||||
* However, we let it here to keep consistency with all the other Angular-related definitions
|
||||
*/
|
||||
interface IFullscreen {
|
||||
// enable document fullscreen
|
||||
all(): void;
|
||||
|
||||
// enable or disable the document fullscreen
|
||||
toggleAll(): void;
|
||||
|
||||
// enable fullscreen to a specific element
|
||||
enable(element: Element|HTMLElement): void;
|
||||
|
||||
// disable fullscreen
|
||||
cancel(): void;
|
||||
|
||||
// return true if fullscreen is enabled, otherwise false
|
||||
isEnabled(): boolean;
|
||||
|
||||
// return true if fullscreen API is supported by your browser
|
||||
isSupported(): boolean;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user