Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Storage.interface.ts « src - github.com/jsxc/jsxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a04cfe3106c5c3db2478b68c48092587641387a1 (plain)
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
export default interface IStorage {
   getName(): string;
   generateKey(...args: string[]): string;
   getPrefix(): string;
   getBackend();

   setItem<Data = any>(type: string, key: string, value: Data): void;
   setItem<Data = any>(key: string, value: Data): void;

   getItem<Data = any>(type: string, key: string): Data;
   getItem<Data = any>(key: string): Data;

   removeItem(type, key): void;
   removeItem(key): void;

   updateItem(type, key, variable, value): void;
   updateItem(key, variable, value): void;

   increment(key: string): void;

   removeElement(type, key, name): void;
   removeElement(key, name): void;

   getItemsWithKeyPrefix(keyPrefix: string);

   registerHook(eventName: string, func: (newValue: any, oldValue: any, key: string) => void);

   removeHook(eventName: string, func?: (newValue: any, oldValue: any, key: string) => void);

   removeAllHooks();

   destroy();
}