-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
47 lines (45 loc) · 1.06 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
interface db {
/**
* Get item from db via key {key}
*/
get: (key: string) => Promise<string | null>;
/**
* Set item in db at key {key} with value {value}
*/
set: (key: string, value: string) => Promise<string | null>;
/**
* Get multiple keys from db via {keys}
*/
mget: (keys: string[]) => Promise<(string | null)[] | null>;
/**
* Set multiple keys in db via {keys} {values}
*/
mset: (keys: string[], values: string[]) => Promise<(string | null)[]>;
/**
* Delete key/value from db
*/
delete: (key: string) => Promise<bool>;
/**
* Delete multiple keys from db
*/
mdelete: (keys: string[]) => Promise<bool>;
/**
* Scan db for all keys with pagination
*/
scan: (cursor: number | null) => Promise<{ cursor: number; keys: string[] }>;
/**
* The complete client used (current upstash Redis client)
*/
complete?: any;
}
/**
* @param {string} url
* @param {string} token
* @param {string} local
* @returns {db}
*/
export async function create(
url: string,
token: string,
local: boolean
): Promise<db>;