mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
40 lines
830 B
TypeScript
40 lines
830 B
TypeScript
// 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/DefinitelyTyped/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>;
|
|
}
|
|
|