forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-storage.d.ts
53 lines (47 loc) · 1.59 KB
/
angular-storage.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
// Type definitions for angular-storage v0.0.11
// Project: https://github.com/auth0/angular-storage
// Definitions by: Matthew DeKrey <https://github.com/mdekrey>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace angular.a0.storage {
interface IStoreService extends INamespacedStoreService {
/**
* Returns a namespaced store
*
* @param {String} namespace - The namespace
* @param {String} storage - The name of the storage service. Defaults to local storage.
* @param {String} delimiter - The delimiter to use to separate the namespace and the keys.
* @returns {INamespacedStoreService}
*/
getNamespacedStore(namespace: string, storage?: string, delimiter?: string): INamespacedStoreService;
}
interface INamespacedStoreService {
/**
* Sets a new value to the storage with the key name. It can be any object.
*
* @param {String} name - The key name for the location of the value
* @param value - The value to store
*/
set(name: string, value: any): void;
/**
* Returns the saved value with they key name.
*
* @param {String} name - The key name for the location of the value
* @returns The saved value; if you saved an object, you get an object
*/
get(name: string): any;
/**
* Deletes the saved value with the key name
*
* @param {String} name - The key name for the location of the value to remove
*/
remove(name: string): void;
}
interface IStoreProvider {
/**
* Sets the storage.
*
* @param {String} storage - The storage name
*/
setStore(storage: string): void;
}
}