forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firefox.d.ts
39 lines (32 loc) · 827 Bytes
/
firefox.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Type definitions for Mozilla Web API
// Project: https://developer.mozilla.org/en-US/docs/Web/API
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// required lib.d.ts
// expand Navigator definietion.
interface Navigator {
mozApps:Apps;
}
interface Apps {
install(url:string, receipts?:any[]):DOMRequest<App>;
getSelf():DOMRequest<App>;
getInstalled():DOMRequest<App[]>;
checkInstalled(url:string): DOMRequest<App>;
}
interface DOMRequest<T> {
onsuccess: Function;
onerror: Function;
readyState:string; // "done" or "pending"
result:T;
error:DOMError;
}
interface App {
manifest:any;
manifestURL:string;
origin:string;
installOrigin:string;
installTime:number;
receipts:any[];
launch():void;
checkForUpdate():DOMRequest<any>;
}