-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.d.ts
29 lines (29 loc) · 1.08 KB
/
index.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
declare var _default: {
/**
* Store data into the storage
* @param {*} key - The key under which the value will be stored
* @param {*} newValue - The associated data
* @param {object} options
* @param {boolean} [options.checkForChangesInTheValue=false] - If true, will call subscribers only if the value actually changed
*/
set(key: any, newValue: any, options: {
checkForChangesInTheValue: boolean;
}): void;
/**
* Return the data associated to the key
* @param {*} key
*/
get(key: any): any;
/**
*
* @param {*} key - the key of the data
* @param {function(any, any):void} callback - called when the data chagne
* @param {object} options
* @param {boolean} [options.fireImmediately=false] - if true, the callback is immediately fired with the last stored value
* @returns {function(void):void} - Unregister the listener
*/
subscribe(key: any, callback: (arg0: any, arg1: any) => void, options?: {
fireImmediately: boolean;
}): (arg0: void) => void;
};
export default _default;