-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathindex.d.ts
More file actions
28 lines (26 loc) · 866 Bytes
/
index.d.ts
File metadata and controls
28 lines (26 loc) · 866 Bytes
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
import { StoreonModule } from 'storeon';
declare namespace StoreonLocalStorage {
export interface Config {
key?: string;
storage?: Storage;
serializer?: (object: any) => string;
deserializer?: (data: string) => any;
debug?: boolean;
}
}
/**
* Storeon module to persist state to local storage
*
* @param {String[]|RegExp[]} paths The keys of state object
* that will be store in local storage
* @param {Config} config The config object
* @param {String} [config.key='storeon'] The default key
* to use in local storage
* @param {Storage} [config.storage] Can be set as `sessionStorage` or
* `localStorage`. Defaults value is `localStorage`.
* Defaults value is `localStorage`.
*/
export declare function persistState<State>(
paths?: string[]|RegExp[],
config?: StoreonLocalStorage.Config
): StoreonModule<State>;