diff --git a/localForage/localForage-tests.ts b/localForage/localForage-tests.ts index f1a416dcf..5267dc798 100644 --- a/localForage/localForage-tests.ts +++ b/localForage/localForage-tests.ts @@ -1,34 +1,68 @@ /// -declare var localForage: lf.ILocalForage -declare var callback: lf.ICallback -declare var promise: lf.IPromise +declare var localForage: lf.ILocalForage; +declare var callback: lf.ICallback; +declare var iterateCallback: lf.IIterateCallback; +declare var errorCallback: lf.IErrorCallback; +declare var keyCallback: lf.IKeyCallback; +declare var keysCallback: lf.IKeysCallback; +declare var numberCallback: lf.INumberCallback; +declare var promise: lf.IPromise; () => { - localForage.clear() - localForage.length - localForage.key(0) + localForage.clear((err: any) => { + var newError: any = err; + }); + + localforage.iterate((str: string, key: string, num: number) => { + var newStr: string = str; + var newKey: string = key; + var newNum: number = num; + }); + + localForage.length((err: any, num: number) => { + var newError: any = err; + var newNumber: number = num; + }); + + localForage.key(0,(err: any, value: string) => { + var newError: any = err; + var newValue: string = value; + }); + + localforage.keys((err: any, keys: Array) => { + var newError: any = err; + var newArray: Array = keys; + }); + + localForage.getItem("key",(err: any, str: string) => { + var newError: any = err; + var newStr: string = str + }); + + localForage.getItem("key").then((err: any, str: string) => { + var newError: any = err; + var newStr: string = str + }); - localForage.getItem("key", (str: string) => { - var newStr: string = str - }) - localForage.getItem("key").then((str: string) => { - var newStr: string = str - }) + localForage.setItem("key", "value",(err: any, str: string) => { + var newError: any = err; + var newStr: string = str + }); + + localForage.setItem("key", "value").then((err: any, str: string) => { + var newError: any = err; + var newStr: string = str; + }); - localForage.setItem("key", "value", (str: string) => { - var newStr: string = str - }) - localForage.setItem("key", "value").then((str: string) => { - var newStr: string = str - }) + localForage.removeItem("key",(err: any) => { + var newError: any = err; + }); + + localForage.removeItem("key").then((err: any, str: string) => { + var newError: any = err; + var newStr: string = str + }); - localForage.removeItem("key", (str: string) => { - var newStr: string = str - }) - localForage.removeItem("key").then((str: string) => { - var newStr: string = str - }) - - promise.then(callback) + promise.then(callback); } diff --git a/localForage/localForage.d.ts b/localForage/localForage.d.ts index c3d0371d0..6cef3a9ea 100644 Binary files a/localForage/localForage.d.ts and b/localForage/localForage.d.ts differ