-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
74 lines (62 loc) · 1.22 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
export default JSMemcache;
declare class JSMemcache {
/**
* Set limit value
*/
setLimit(limit: number): Window & typeof globalThis;
/**
* Set separator value
*/
setSeparator(separator: string): Window & typeof globalThis;
/**
* Get limit value
*/
getLimit(): number;
/**
* Get separator value
*/
getSeparator(): string;
/**
* Get cache size
*/
getSize(): number;
/**
* Set data to cache
*/
add(key: string | string[], val: unknown): void;
/**
* Get data from cache
*/
get(key: string | string[]): unknown | boolean;
/**
* Update data in cache
*/
update(
key: string | string[],
newValue: unknown
): (Window & typeof globalThis) | ReferenceError;
/**
* Remove data in cache
*/
remove(key: string | string[]): (Window & typeof globalThis) | ReferenceError;
/**
* Get all data in cache
*/
all(): Record<string, unknown>;
/**
* Get all keys in cache
*/
keys(): string[];
/**
* Clear all data in cache
*/
clear(): void;
/**
* Add methods aliases
*/
set: (key: string, val: unknown) => void;
replace: (
key: string,
newValue: unknown
) => (Window & typeof globalThis) | ReferenceError;
}