1 |
|
2 |
|
3 | interface StoreJsAPI {
|
4 | readonly version: string;
|
5 | readonly enabled: boolean;
|
6 | get(key: string, optionalDefaultValue?: any): any;
|
7 | set(key: string, value: any): any;
|
8 | remove(key: string): void;
|
9 | each(callback: (val: any, namespacedKey: string) => void): void;
|
10 | clearAll(): void;
|
11 | hasNamespace(namespace: string): boolean;
|
12 | createStore(plugins?: Function[], namespace?: string): StoreJsAPI;
|
13 | addPlugin(plugin: Function): void;
|
14 | namespace(namespace: string): StoreJsAPI;
|
15 | }
|
16 |
|
17 | interface StoreJsEngine {
|
18 | createStore(storages: any[], plugins?: any[], namespace?: string): StoreJsAPI;
|
19 | }
|
20 |
|
21 | interface StoreJsStorage {
|
22 | name: string;
|
23 | read: (key: string) => string | null;
|
24 | write: (key: string, data: string) => void;
|
25 | each: (callback: (val: string, key: string) => any) => void;
|
26 | remove: (key: string) => void;
|
27 | clearAll: () => void;
|
28 | }
|
29 |
|
30 | declare const store: StoreJsAPI;
|
31 | declare module "store" {
|
32 | export = store;
|
33 | }
|
34 | declare module "store/dist/store.legacy" {
|
35 | export = store;
|
36 | }
|
37 | declare module "store/dist/store.legacy.min" {
|
38 | export = store;
|
39 | }
|
40 | declare module "store/dist/store.modern" {
|
41 | export = store;
|
42 | }
|
43 | declare module "store/dist/store.modern.min" {
|
44 | export = store;
|
45 | }
|
46 |
|
47 | declare const engine: StoreJsEngine;
|
48 | declare module "store/src/store-engine" {
|
49 | export = engine;
|
50 | }
|
51 | declare module "store/plugins/all" {
|
52 | export = Function;
|
53 | }
|
54 | declare module "store/plugins/defaults" {
|
55 | export = Function;
|
56 | }
|
57 | declare module "store/plugins/dump" {
|
58 | export = Function;
|
59 | }
|
60 | declare module "store/plugins/events" {
|
61 | export = Function;
|
62 | }
|
63 | declare module "store/plugins/expire" {
|
64 | export = Function;
|
65 | }
|
66 | declare module "store/plugins/observe" {
|
67 | export = Function;
|
68 | }
|
69 | declare module "store/plugins/operations" {
|
70 | export = Function;
|
71 | }
|
72 | declare module "store/plugins/update" {
|
73 | export = Function;
|
74 | }
|
75 | declare module "store/plugins/v1-backcompat" {
|
76 | export = Function;
|
77 | }
|
78 |
|
79 | declare const storage: StoreJsStorage;
|
80 | declare module "store/storages/cookieStorage" {
|
81 | export = storage;
|
82 | }
|
83 | declare module "store/storages/localStorage" {
|
84 | export = storage;
|
85 | }
|
86 | declare module "store/storages/memoryStorage" {
|
87 | export = storage;
|
88 | }
|
89 | declare module "store/storages/oldFF-globalStorage" {
|
90 | export = storage;
|
91 | }
|
92 | declare module "store/storages/oldIE-userDataStorage" {
|
93 | export = storage;
|
94 | }
|
95 | declare module "store/storages/sessionStorage" {
|
96 | export = storage;
|
97 | }
|