From 769b8b05b1fc0ab48964cccec6b19aa9fbc719de Mon Sep 17 00:00:00 2001 From: YuichiNukiyama Date: Sun, 17 May 2015 11:00:04 +0000 Subject: [PATCH] fix linefield --- localForage/localForage.d.ts | 74 +++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/localForage/localForage.d.ts b/localForage/localForage.d.ts index e6ccdfd59b..14bd6aedb5 100644 --- a/localForage/localForage.d.ts +++ b/localForage/localForage.d.ts @@ -1 +1,73 @@ -// Type definitions for Mozilla's localForage
// Project: https://github.com/mozilla/localforage
// Definitions by: david pichsenmeister , Yuichi Nukiyama
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare module lf {
 interface ILocalForage {
 /**
 * Removes every key from the database, returning it to a blank slate.
 */
 clear(callback: IErrorCallback): void
 /**
 * Iterate over all value/key pairs in datastore.
 */
 iterate(iterateCallback: IIterateCallback): void
 /**
 * Get the name of a key based on its ID.
 */
 key(keyIndex: number, callback: IKeyCallback): void
 /**
 * Get the list of all keys in the datastore.
 */
 keys(callback: IKeysCallback): void;
 /**
 * Gets the number of keys in the offline store (i.e. its “length”).
 */
 length(callback: INumberCallback): void
 /**
 * Gets an item from the storage library and supplies the result to a callback.
 * If the key does not exist, getItem() will return null.
 */
 getItem(key: string, callback: ICallback): void
 getItem(key: string): IPromise
 /**
 * Saves data to an offline store.
 */
 setItem(key: string, value: T, callback: ICallback): void
 setItem(key: string, value: T): IPromise
 /**
 * Removes the value of a key from the offline store.
 */
 removeItem(key: string, callback: IErrorCallback): void
 removeItem(key: string): IPromise
 }

 interface ICallback {
 (err: any, value: T): void
 }

 interface IIterateCallback {
 (value: T, key: string, iterationNumber: number): void
 }

 interface IErrorCallback {
 (err: any): void
 }

 interface IKeyCallback {
 (err: any, keyName: string): void
 }

 interface IKeysCallback {
 (err: any, keys: Array): void
 }

 interface INumberCallback {
 (err: any, numberOfKeys: number): void
 }

 interface IPromise {
 then(callback: ICallback): void
 }
} \ No newline at end of file +// Type definitions for Mozilla's localForage +// Project: https://github.com/mozilla/localforage +// Definitions by: david pichsenmeister , Yuichi Nukiyama +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module lf { + interface ILocalForage { + /** + * Removes every key from the database, returning it to a blank slate. + */ + clear(callback: IErrorCallback): void + /** + * Iterate over all value/key pairs in datastore. + */ + iterate(iterateCallback: IIterateCallback): void + /** + * Get the name of a key based on its ID. + */ + key(keyIndex: number, callback: IKeyCallback): void + /** + * Get the list of all keys in the datastore. + */ + keys(callback: IKeysCallback): void; + /** + * Gets the number of keys in the offline store (i.e. its “length”). + */ + length(callback: INumberCallback): void + /** + * Gets an item from the storage library and supplies the result to a callback. + * If the key does not exist, getItem() will return null. + */ + getItem(key: string, callback: ICallback): void + getItem(key: string): IPromise + /** + * Saves data to an offline store. + */ + setItem(key: string, value: T, callback: ICallback): void + setItem(key: string, value: T): IPromise + /** + * Removes the value of a key from the offline store. + */ + removeItem(key: string, callback: IErrorCallback): void + removeItem(key: string): IPromise + } + + interface ICallback { + (err: any, value: T): void + } + + interface IIterateCallback { + (value: T, key: string, iterationNumber: number): void + } + + interface IErrorCallback { + (err: any): void + } + + interface IKeyCallback { + (err: any, keyName: string): void + } + + interface IKeysCallback { + (err: any, keys: Array): void + } + + interface INumberCallback { + (err: any, numberOfKeys: number): void + } + + interface IPromise { + then(callback: ICallback): void + } +} \ No newline at end of file