From 33735286ede08b854b666e01b25bd9586f8b0352 Mon Sep 17 00:00:00 2001 From: david pichsenmeister Date: Tue, 4 Feb 2014 15:14:35 +0100 Subject: [PATCH] added typing of mozilla localForage library --- localForage/localForage.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 localForage/localForage.d.ts 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