forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-localForage.d.ts
63 lines (45 loc) · 1.98 KB
/
angular-localForage.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Type definitions for angular-localForage 1.2.2
// Project: https://github.com/ocombe/angular-localForage
// Definitions by: Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../localForage/localForage.d.ts" />
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.localForage {
interface LocalForageConfig {
driver?:string;
name?:string | number;
version?:number;
storeName?:string;
description?:string;
}
interface ILocalForageProvider {
config(config:LocalForageConfig):void;
setNotify(onItemSet:boolean, onItemRemove:boolean):void;
}
interface ILocalForageService {
driver(): LocalForageDriver;
setDriver(name: string | string[]): angular.IPromise<void>;
setItem(key:string, value:any):angular.IPromise<void>;
setItem(keys:Array<string>, values:Array<any>):angular.IPromise<void>;
getItem(key:string):angular.IPromise<any>;
getItem(keys:Array<string>):angular.IPromise<Array<any>>;
removeItem(key:string | Array<string>):angular.IPromise<void>;
pull(key:string):angular.IPromise<any>;
pull(keys:Array<string>):angular.IPromise<Array<any>>;
clear():angular.IPromise<void>;
key(n:number):angular.IPromise<string>;
keys():angular.IPromise<string>;
length():angular.IPromise<number>;
iterate<T>(iteratorCallback:(value:string | number, key:string)=>T):angular.IPromise<T>;
bind($scope:ng.IScope, key:string):angular.IPromise<any>;
bind($scope:ng.IScope, config:{
key:string;
defaultValue?:any;
scopeKey?:string;
name?:string;
}):angular.IPromise<any>;
unbind($scope:ng.IScope, key:string, scopeKey?:string):void;
createInstance(config:LocalForageConfig):ILocalForageService;
instance(name:string):ILocalForageService;
}
}