-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathindex.d.ts
More file actions
37 lines (31 loc) · 762 Bytes
/
index.d.ts
File metadata and controls
37 lines (31 loc) · 762 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
29
30
31
32
33
34
35
36
37
interface SetValueFunc {
(): any;
(): Promise<any>;
}
interface SetFunc {
(key: string, value: SetValueFunc): Promise<void>;
(key: string, value: any, expire?: number, options?: any): Promise<void>;
}
interface GetValueFunc {
(): any;
}
interface GetFunc {
(key: string): Promise<any>;
(key: string, defaultValue: any): Promise<any>;
(key: string, GetValueFunc, expire?: number, options?: any): Promise<any>;
}
interface Store {
set: SetFunc;
get: GetFunc;
del: (key: string) => Promise<void>;
has: (key: string) => Promise<boolean>;
reset: () => Promise<void>;
}
interface Cache extends Store {
store: (name: string, options?: object) => Store;
}
declare module "egg" {
export interface Application {
cache: Cache;
}
}