diff --git a/localForage/localForage.d.ts b/localForage/localForage.d.ts new file mode 100644 index 000000000..71ccaba3c --- /dev/null +++ b/localForage/localForage.d.ts @@ -0,0 +1,26 @@ +// Type definitions for Mozilla's localForage +// Project: https://github.com/mozilla/localforage +// Definitions by: david pichsenmeister +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module lf { + interface ILocalForage { + clear(): void + key(index: number): T + length: number + getItem(key: string, callback: ICallback) + getItem(key: string): IPromise + setItem(key: string, value: T, callback: ICallback) + setItem(key: string, value: T): IPromise + removeItem(key: string, callback: ICallback) + removeItem(key: string): IPromise + } + + interface ICallback { + (data: T): void + } + + interface IPromise { + then(callback: ICallback): void + } +} \ No newline at end of file