1 | # Installation
|
2 | > `npm install --save @types/store`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for store (https://github.com/marcuswestin/store.js#readme).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/store.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/store/index.d.ts)
|
10 | ````ts
|
11 | // Cross-browser storage for all use cases, used across the web.
|
12 |
|
13 | interface StoreJsAPI {
|
14 | readonly version: string;
|
15 | readonly enabled: boolean;
|
16 | get(key: string, optionalDefaultValue?: any): any;
|
17 | set(key: string, value: any): any;
|
18 | remove(key: string): void;
|
19 | each(callback: (val: any, namespacedKey: string) => void): void;
|
20 | clearAll(): void;
|
21 | hasNamespace(namespace: string): boolean;
|
22 | createStore(plugins?: Function[], namespace?: string): StoreJsAPI;
|
23 | addPlugin(plugin: Function): void;
|
24 | namespace(namespace: string): StoreJsAPI;
|
25 | }
|
26 |
|
27 | interface StoreJsEngine {
|
28 | createStore(storages: any[], plugins?: any[], namespace?: string): StoreJsAPI;
|
29 | }
|
30 |
|
31 | interface StoreJsStorage {
|
32 | name: string;
|
33 | read: (key: string) => string | null;
|
34 | write: (key: string, data: string) => void;
|
35 | each: (callback: (val: string, key: string) => any) => void;
|
36 | remove: (key: string) => void;
|
37 | clearAll: () => void;
|
38 | }
|
39 |
|
40 | declare const store: StoreJsAPI;
|
41 | declare module "store" {
|
42 | export = store;
|
43 | }
|
44 | declare module "store/dist/store.legacy" {
|
45 | export = store;
|
46 | }
|
47 | declare module "store/dist/store.legacy.min" {
|
48 | export = store;
|
49 | }
|
50 | declare module "store/dist/store.modern" {
|
51 | export = store;
|
52 | }
|
53 | declare module "store/dist/store.modern.min" {
|
54 | export = store;
|
55 | }
|
56 |
|
57 | declare const engine: StoreJsEngine;
|
58 | declare module "store/src/store-engine" {
|
59 | export = engine;
|
60 | }
|
61 | declare module "store/plugins/all" {
|
62 | export = Function;
|
63 | }
|
64 | declare module "store/plugins/defaults" {
|
65 | export = Function;
|
66 | }
|
67 | declare module "store/plugins/dump" {
|
68 | export = Function;
|
69 | }
|
70 | declare module "store/plugins/events" {
|
71 | export = Function;
|
72 | }
|
73 | declare module "store/plugins/expire" {
|
74 | export = Function;
|
75 | }
|
76 | declare module "store/plugins/observe" {
|
77 | export = Function;
|
78 | }
|
79 | declare module "store/plugins/operations" {
|
80 | export = Function;
|
81 | }
|
82 | declare module "store/plugins/update" {
|
83 | export = Function;
|
84 | }
|
85 | declare module "store/plugins/v1-backcompat" {
|
86 | export = Function;
|
87 | }
|
88 |
|
89 | declare const storage: StoreJsStorage;
|
90 | declare module "store/storages/cookieStorage" {
|
91 | export = storage;
|
92 | }
|
93 | declare module "store/storages/localStorage" {
|
94 | export = storage;
|
95 | }
|
96 | declare module "store/storages/memoryStorage" {
|
97 | export = storage;
|
98 | }
|
99 | declare module "store/storages/oldFF-globalStorage" {
|
100 | export = storage;
|
101 | }
|
102 | declare module "store/storages/oldIE-userDataStorage" {
|
103 | export = storage;
|
104 | }
|
105 | declare module "store/storages/sessionStorage" {
|
106 | export = storage;
|
107 | }
|
108 |
|
109 | ````
|
110 |
|
111 | ### Additional Details
|
112 | * Last updated: Tue, 07 Nov 2023 20:08:00 GMT
|
113 | * Dependencies: none
|
114 |
|
115 | # Credits
|
116 | These definitions were written by [Vincent Bortone](https://github.com/vbortone), [harry0000](https://github.com/harry0000), [Roman Nuritdinov (Ky6uk)](https://github.com/Ky6uk), [Johnny Edwards (igl00)](https://github.com/igl00), and [Jason Kwok (JasonHK)](https://github.com/JasonHK).
|
117 |
|
\ | No newline at end of file |