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 | import { ConnectionOptions } from 'tls';
|
30 | import { Readable } from 'stream';
|
31 | import { EventEmitter } from 'events';
|
32 |
|
33 | interface RedisStatic {
|
34 | new (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
35 | new (host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
36 | new (options?: IORedis.RedisOptions): IORedis.Redis;
|
37 | (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
38 | (host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
39 | (options?: IORedis.RedisOptions): IORedis.Redis;
|
40 | Cluster: IORedis.ClusterStatic;
|
41 | Command: typeof Command;
|
42 | }
|
43 |
|
44 | declare var IORedis: RedisStatic;
|
45 | export = IORedis;
|
46 |
|
47 | declare class Commander {
|
48 | getBuiltinCommands(): string[];
|
49 | createBuiltinCommand(commandName: string): {};
|
50 | defineCommand(
|
51 | name: string,
|
52 | definition: {
|
53 | numberOfKeys?: number;
|
54 | lua?: string;
|
55 | },
|
56 | ): void;
|
57 | sendCommand(): void;
|
58 | }
|
59 |
|
60 | interface CommandOptions {
|
61 | replyEncoding?: string | null;
|
62 | errorStack?: string;
|
63 | keyPrefix?: string;
|
64 | }
|
65 | declare class Command {
|
66 | isCustomCommand: boolean;
|
67 | args: IORedis.ValueType[];
|
68 | getSlot(): number | null;
|
69 | getKeys(): Array<string | Buffer>;
|
70 | constructor(
|
71 | name: string,
|
72 | args: IORedis.ValueType[],
|
73 | opts?: CommandOptions,
|
74 | callback?: (err: null, result: any) => void,
|
75 | );
|
76 | static setArgumentTransformer(name: string, fn: (args: IORedis.ValueType[]) => IORedis.ValueType[]): void;
|
77 | static setReplyTransformer(name: string, fn: (result: any) => any): void;
|
78 | }
|
79 |
|
80 | // For backwards compatibility
|
81 | type _Command = typeof Command;
|
82 |
|
83 | declare namespace IORedis {
|
84 | type BooleanResponse = 1 | 0;
|
85 | type Callback<T> = (err: Error | null, res: T) => void;
|
86 | type KeyType = string | Buffer;
|
87 | type ValueType = string | Buffer | number | any[];
|
88 |
|
89 | interface OverloadedCommand<T, U> {
|
90 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, cb: Callback<U>): void;
|
91 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, cb: Callback<U>): void;
|
92 | (arg1: T, arg2: T, arg3: T, arg4: T, cb: Callback<U>): void;
|
93 | (arg1: T, arg2: T, arg3: T, cb: Callback<U>): void;
|
94 | (arg1: T, arg2: T, cb: Callback<U>): void;
|
95 | (arg1: T | T[], cb: Callback<U>): void;
|
96 | (cb: Callback<U>): void;
|
97 | (...args: T[]): Promise<U>;
|
98 | (arg1: T[]): Promise<U>;
|
99 | }
|
100 |
|
101 | interface OverloadedListCommand<T, U> {
|
102 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, cb: Callback<U>): void;
|
103 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, cb: Callback<U>): void;
|
104 | (arg1: T, arg2: T, arg3: T, arg4: T, cb: Callback<U>): void;
|
105 | (arg1: T, arg2: T, arg3: T, cb: Callback<U>): void;
|
106 | (arg1: T, arg2: T, cb: Callback<U>): void;
|
107 | (arg1: T | T[], cb: Callback<U>): void;
|
108 | (...args: T[]): Promise<U>;
|
109 | (arg1: T[]): Promise<U>;
|
110 | }
|
111 |
|
112 | interface OverloadedBlockingListCommand<T, U> {
|
113 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, timeout: number, cb: Callback<U>): void;
|
114 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, timeout: number, cb: Callback<U>): void;
|
115 | (arg1: T, arg2: T, arg3: T, arg4: T, timeout: number, cb: Callback<U>): void;
|
116 | (arg1: T, arg2: T, arg3: T, timeout: number, cb: Callback<U>): void;
|
117 | (arg1: T, arg2: T, timeout: number, cb: Callback<U>): void;
|
118 | (arg1: T, timeout: number, cb: Callback<U>): void;
|
119 | (arg1: Array<T | number>, cb: Callback<U>): void;
|
120 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, timeout: number): Promise<U>;
|
121 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, timeout: number): Promise<U>;
|
122 | (arg1: T, arg2: T, arg3: T, arg4: T, timeout: number): Promise<U>;
|
123 | (arg1: T, arg2: T, arg3: T, timeout: number): Promise<U>;
|
124 | (arg1: T, arg2: T, timeout: number): Promise<U>;
|
125 | (arg1: T, timeout: number): Promise<U>;
|
126 | (arg1: Array<T | number>): Promise<U>;
|
127 | (...args: Array<T | number>): Promise<U>;
|
128 | }
|
129 |
|
130 | interface OverloadedSubCommand<T, U> {
|
131 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, cb: Callback<U>): void;
|
132 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, cb: Callback<U>): void;
|
133 | (arg1: T, arg2: T, arg3: T, arg4: T, cb: Callback<U>): void;
|
134 | (arg1: T, arg2: T, arg3: T, cb: Callback<U>): void;
|
135 | (arg1: T, arg2: T | T[], cb: Callback<U>): void;
|
136 | (arg1: T | T[], cb: Callback<U>): void;
|
137 | (...args: T[]): Promise<U>;
|
138 | (arg1: T[]): Promise<U>;
|
139 | }
|
140 |
|
141 | interface OverloadedKeyCommand<T, U> {
|
142 | (key: KeyType, arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, cb: Callback<U>): void;
|
143 | (key: KeyType, arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, cb: Callback<U>): void;
|
144 | (key: KeyType, arg1: T, arg2: T, arg3: T, arg4: T, cb: Callback<U>): void;
|
145 | (key: KeyType, arg1: T, arg2: T, arg3: T, cb: Callback<U>): void;
|
146 | (key: KeyType, arg1: T, arg2: T, cb: Callback<U>): void;
|
147 | (key: KeyType, arg1: T | T[], cb: Callback<U>): void;
|
148 | (key: KeyType, ...args: T[]): Promise<U>;
|
149 | (key: KeyType, arg1: T[]): Promise<U>;
|
150 | }
|
151 |
|
152 | interface OverloadedHashCommand<T, U> {
|
153 | (arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, cb: Callback<U>): void;
|
154 | (arg1: T, arg2: T, arg3: T, arg4: T, cb: Callback<U>): void;
|
155 | (arg1: T, arg2: T, cb: Callback<U>): void;
|
156 | (data: T[] | { [key: string]: T } | Map<string, T>, cb: Callback<U>): void;
|
157 | (data: T[] | { [key: string]: T } | Map<string, T>): Promise<U>;
|
158 | (...args: T[]): Promise<U>;
|
159 | }
|
160 |
|
161 | interface OverloadedKeyedHashCommand<T, U> {
|
162 | (key: KeyType, arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, cb: Callback<U>): void;
|
163 | (key: KeyType, arg1: T, arg2: T, arg3: T, arg4: T, cb: Callback<U>): void;
|
164 | (key: KeyType, arg1: T, arg2: T, cb: Callback<U>): void;
|
165 | (key: KeyType, data: T[] | { [key: string]: T } | Map<string, ValueType>, cb: Callback<U>): void;
|
166 | (key: KeyType, data: T[] | { [key: string]: T } | Map<string, ValueType>): Promise<U>;
|
167 | (key: KeyType, ...args: T[]): Promise<U>;
|
168 | }
|
169 |
|
170 | interface OverloadedEvalCommand<T, U> {
|
171 | (script: string, numKeys: number, arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, cb: Callback<U>): void;
|
172 | (script: string, numKeys: number, arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, cb: Callback<U>): void;
|
173 | (script: string, numKeys: number, arg1: T, arg2: T, arg3: T, arg4: T, cb: Callback<U>): void;
|
174 | (script: string, numKeys: number, arg1: T, arg2: T, arg3: T, cb: Callback<U>): void;
|
175 | (script: string, numKeys: number, arg1: T, arg2: T, cb: Callback<U>): void;
|
176 | (script: string, numKeys: number, arg1: T | T[], cb: Callback<U>): void;
|
177 | (script: string, numKeys: number, ...args: T[]): Promise<U>;
|
178 | (script: string, numKeys: number, arg1: T[]): Promise<U>;
|
179 |
|
180 |
|
181 |
|
182 | (args: ValueType[], callback?: Callback<any>): any;
|
183 | }
|
184 |
|
185 | interface OverloadedScanCommand<T, U> {
|
186 | (key: string, cursor: number, arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, arg6: T, cb: Callback<U>): void;
|
187 | (key: string, cursor: number, arg1: T, arg2: T, arg3: T, arg4: T, arg5: T, cb: Callback<U>): void;
|
188 | (key: string, cursor: number, arg1: T, arg2: T, arg3: T, arg4: T, cb: Callback<U>): void;
|
189 | (key: string, cursor: number, arg1: T, arg2: T, arg3: T, cb: Callback<U>): void;
|
190 | (key: string, cursor: number, arg1: T, arg2: T, cb: Callback<U>): void;
|
191 | (key: string, cursor: number, arg1: T | T[], cb: Callback<U>): void;
|
192 | (key: string, cursor: number, cb: Callback<U>): void;
|
193 | (key: string, cursor: number, ...args: T[]): Promise<U>;
|
194 | (key: string, cursor: number, arg1: T[]): Promise<U>;
|
195 | }
|
196 |
|
197 | type Command = _Command;
|
198 |
|
199 | interface Commands {
|
200 | bitcount(key: KeyType, callback: Callback<number>): void;
|
201 | bitcount(key: KeyType, start: number, end: number, callback: (err: Error, res: number) => void): void;
|
202 | bitcount(key: KeyType): Promise<number>;
|
203 | bitcount(key: KeyType, start: number, end: number): Promise<number>;
|
204 |
|
205 | get(key: KeyType, callback: Callback<string | null>): void;
|
206 | get(key: KeyType): Promise<string | null>;
|
207 |
|
208 | getBuffer(key: KeyType, callback: Callback<Buffer>): void;
|
209 | getBuffer(key: KeyType): Promise<Buffer>;
|
210 |
|
211 | set(
|
212 | key: KeyType,
|
213 | value: ValueType,
|
214 | expiryMode?: string | any[],
|
215 | time?: number | string,
|
216 | setMode?: number | string,
|
217 | ): Promise<Ok | null>;
|
218 |
|
219 | set(key: KeyType, value: ValueType, callback: Callback<Ok>): void;
|
220 | set(key: KeyType, value: ValueType, setMode: string | any[], callback: Callback<Ok | null>): void;
|
221 | set(key: KeyType, value: ValueType, expiryMode: string, time: number | string, callback: Callback<Ok>): void;
|
222 | set(
|
223 | key: KeyType,
|
224 | value: ValueType,
|
225 | expiryMode: string,
|
226 | time: number | string,
|
227 | setMode: number | string,
|
228 | callback: Callback<Ok | null>,
|
229 | ): void;
|
230 |
|
231 | setBuffer(
|
232 | key: KeyType,
|
233 | value: ValueType,
|
234 | expiryMode?: string | any[],
|
235 | time?: number | string,
|
236 | setMode?: number | string,
|
237 | ): Promise<Buffer>;
|
238 |
|
239 | setBuffer(key: KeyType, value: ValueType, callback: Callback<Buffer>): void;
|
240 | setBuffer(key: KeyType, value: ValueType, setMode: string, callback: Callback<Buffer>): void;
|
241 | setBuffer(key: KeyType, value: ValueType, expiryMode: string, time: number, callback: Callback<Buffer>): void;
|
242 | setBuffer(
|
243 | key: KeyType,
|
244 | value: ValueType,
|
245 | expiryMode: string,
|
246 | time: number | string,
|
247 | setMode: number | string,
|
248 | callback: Callback<Buffer>,
|
249 | ): void;
|
250 |
|
251 | setnx(key: KeyType, value: ValueType, callback: Callback<BooleanResponse>): void;
|
252 | setnx(key: KeyType, value: ValueType): Promise<BooleanResponse>;
|
253 |
|
254 | setex(key: KeyType, seconds: number, value: ValueType, callback: Callback<Ok>): void;
|
255 | setex(key: KeyType, seconds: number, value: ValueType): Promise<Ok>;
|
256 |
|
257 | psetex(key: KeyType, milliseconds: number, value: ValueType, callback: Callback<Ok>): void;
|
258 | psetex(key: KeyType, milliseconds: number, value: ValueType): Promise<Ok>;
|
259 |
|
260 | append(key: KeyType, value: ValueType, callback: Callback<number>): void;
|
261 | append(key: KeyType, value: ValueType): Promise<number>;
|
262 |
|
263 | strlen(key: KeyType, callback: Callback<number>): void;
|
264 | strlen(key: KeyType): Promise<number>;
|
265 |
|
266 | del: OverloadedListCommand<KeyType, number>;
|
267 |
|
268 | unlink: OverloadedListCommand<KeyType, number>;
|
269 |
|
270 | exists(...keys: KeyType[]): Promise<number>;
|
271 | exists(key: KeyType, callback: Callback<number>): void;
|
272 |
|
273 | setbit(key: KeyType, offset: number, value: ValueType, callback: Callback<number>): void;
|
274 | setbit(key: KeyType, offset: number, value: ValueType): Promise<number>;
|
275 |
|
276 | getbit(key: KeyType, offset: number, callback: Callback<number>): void;
|
277 | getbit(key: KeyType, offset: number): Promise<number>;
|
278 |
|
279 | setrange(key: KeyType, offset: number, value: ValueType, callback: Callback<number>): void;
|
280 | setrange(key: KeyType, offset: number, value: ValueType): Promise<number>;
|
281 |
|
282 | getrange(key: KeyType, start: number, end: number, callback: Callback<string>): void;
|
283 | getrange(key: KeyType, start: number, end: number): Promise<string>;
|
284 |
|
285 | getrangeBuffer(key: KeyType, start: number, end: number, callback: Callback<Buffer>): void;
|
286 | getrangeBuffer(key: KeyType, start: number, end: number): Promise<Buffer>;
|
287 |
|
288 | substr(key: KeyType, start: number, end: number, callback: Callback<string>): void;
|
289 | substr(key: KeyType, start: number, end: number): Promise<string>;
|
290 |
|
291 | incr(key: KeyType, callback: Callback<number>): void;
|
292 | incr(key: KeyType): Promise<number>;
|
293 |
|
294 | decr(key: KeyType, callback: Callback<number>): void;
|
295 | decr(key: KeyType): Promise<number>;
|
296 |
|
297 | mget: OverloadedListCommand<KeyType, Array<string | null>>;
|
298 |
|
299 | rpush: OverloadedKeyCommand<ValueType, number>;
|
300 | rpushBuffer: OverloadedKeyCommand<Buffer, number>;
|
301 |
|
302 | lpush: OverloadedKeyCommand<ValueType, number>;
|
303 | lpushBuffer: OverloadedKeyCommand<Buffer, number>;
|
304 |
|
305 | rpushx: OverloadedKeyCommand<ValueType, number>;
|
306 |
|
307 | lpushx: OverloadedKeyCommand<ValueType, number>;
|
308 |
|
309 | linsert(
|
310 | key: KeyType,
|
311 | direction: 'BEFORE' | 'AFTER',
|
312 | pivot: string,
|
313 | value: ValueType,
|
314 | callback: Callback<number>,
|
315 | ): void;
|
316 | linsert(key: KeyType, direction: 'BEFORE' | 'AFTER', pivot: string, value: ValueType): Promise<number>;
|
317 |
|
318 | rpop(key: KeyType, callback: Callback<string>): void;
|
319 | rpop(key: KeyType): Promise<string>;
|
320 |
|
321 | lpop(key: KeyType, callback: Callback<string>): void;
|
322 | lpop(key: KeyType): Promise<string>;
|
323 |
|
324 | lpopBuffer(key: KeyType, callback: Callback<Buffer>): void;
|
325 | lpopBuffer(key: KeyType): Promise<Buffer>;
|
326 |
|
327 | brpop: OverloadedBlockingListCommand<KeyType, [string, string]>;
|
328 |
|
329 | blpop: OverloadedBlockingListCommand<KeyType, [string, string]>;
|
330 |
|
331 | brpoplpush(source: string, destination: string, timeout: number, callback: Callback<string>): void;
|
332 | brpoplpush(source: string, destination: string, timeout: number): Promise<string>;
|
333 |
|
334 | llen(key: KeyType, callback: Callback<number>): void;
|
335 | llen(key: KeyType): Promise<number>;
|
336 |
|
337 | lindex(key: KeyType, index: number, callback: Callback<string>): void;
|
338 | lindex(key: KeyType, index: number): Promise<string>;
|
339 |
|
340 | lset(key: KeyType, index: number, value: ValueType, callback: Callback<Ok>): void;
|
341 | lset(key: KeyType, index: number, value: ValueType): Promise<Ok>;
|
342 |
|
343 | lrange(key: KeyType, start: number, stop: number, callback: Callback<string[]>): void;
|
344 | lrange(key: KeyType, start: number, stop: number): Promise<string[]>;
|
345 |
|
346 | lrangeBuffer(key: KeyType, start: number, stop: number, callback: Callback<Buffer[]>): void;
|
347 | lrangeBuffer(key: KeyType, start: number, stop: number): Promise<Buffer[]>;
|
348 |
|
349 | ltrim(key: KeyType, start: number, stop: number, callback: Callback<Ok>): void;
|
350 | ltrim(key: KeyType, start: number, stop: number): Promise<Ok>;
|
351 |
|
352 | lrem(key: KeyType, count: number, value: ValueType, callback: Callback<number>): void;
|
353 | lrem(key: KeyType, count: number, value: ValueType): Promise<number>;
|
354 |
|
355 | rpoplpush(source: string, destination: string, callback: Callback<string>): void;
|
356 | rpoplpush(source: string, destination: string): Promise<string>;
|
357 |
|
358 | rpoplpushBuffer(source: string, destination: string, callback: Callback<Buffer>): void;
|
359 | rpoplpushBuffer(source: string, destination: string): Promise<Buffer>;
|
360 |
|
361 | sadd: OverloadedKeyCommand<ValueType, number>;
|
362 |
|
363 | srem: OverloadedKeyCommand<ValueType, number>;
|
364 |
|
365 | smove(source: string, destination: string, member: string, callback: Callback<BooleanResponse>): void;
|
366 | smove(source: string, destination: string, member: string): Promise<BooleanResponse>;
|
367 |
|
368 | sismember(key: KeyType, member: string, callback: Callback<BooleanResponse>): void;
|
369 | sismember(key: KeyType, member: string): Promise<BooleanResponse>;
|
370 |
|
371 | scard(key: KeyType, callback: Callback<number>): void;
|
372 | scard(key: KeyType): Promise<number>;
|
373 |
|
374 | spop(key: KeyType, callback: Callback<string | null>): void;
|
375 | spop(key: KeyType): Promise<string | null>;
|
376 | spop(key: KeyType, count: number, callback: Callback<string[]>): void;
|
377 | spop(key: KeyType, count: number): Promise<string[]>;
|
378 |
|
379 | srandmember(key: KeyType, callback: Callback<string | null>): void;
|
380 | srandmember(key: KeyType): Promise<string | null>;
|
381 | srandmember(key: KeyType, count: number, callback: Callback<string[]>): void;
|
382 | srandmember(key: KeyType, count: number): Promise<string[]>;
|
383 |
|
384 | sinter: OverloadedListCommand<KeyType, string[]>;
|
385 |
|
386 | sinterstore: OverloadedKeyCommand<KeyType, number>;
|
387 |
|
388 | sunion: OverloadedListCommand<KeyType, string[]>;
|
389 |
|
390 | sunionstore: OverloadedKeyCommand<KeyType, number>;
|
391 |
|
392 | sdiff: OverloadedListCommand<KeyType, string[]>;
|
393 |
|
394 | sdiffstore: OverloadedKeyCommand<KeyType, number>;
|
395 |
|
396 | smembers(key: KeyType, callback: Callback<string[]>): void;
|
397 | smembers(key: KeyType): Promise<string[]>;
|
398 |
|
399 | zadd: OverloadedKeyCommand<KeyType | number, number | string>;
|
400 |
|
401 | zaddBuffer(key: KeyType, score1: number, member1: Buffer, callback: Callback<string | number>): void;
|
402 | zaddBuffer(key: KeyType, score1: number, member1: Buffer): Promise<string | number>;
|
403 |
|
404 | zincrby(key: KeyType, increment: number, member: string, callback: Callback<string>): void;
|
405 | zincrby(key: KeyType, increment: number, member: string): Promise<string>;
|
406 |
|
407 | zpopmin(key: KeyType, callback: Callback<string[]>): void;
|
408 | zpopmin(key: KeyType, count: number, callback: Callback<string[]>): void;
|
409 | zpopmin(key: KeyType, count?: number): Promise<string[]>;
|
410 |
|
411 | zpopmax(key: KeyType, callback: Callback<string[]>): void;
|
412 | zpopmax(key: KeyType, count: number, callback: Callback<string[]>): void;
|
413 | zpopmax(key: KeyType, count?: number): Promise<string[]>;
|
414 |
|
415 | bzpopmin: OverloadedBlockingListCommand<KeyType, [string, string, string]>;
|
416 |
|
417 | bzpopmax: OverloadedBlockingListCommand<KeyType, [string, string, string]>;
|
418 |
|
419 | zrem: OverloadedKeyCommand<ValueType, number>;
|
420 |
|
421 | zremrangebyscore(key: KeyType, min: number | string, max: number | string, callback: Callback<number>): void;
|
422 | zremrangebyscore(key: KeyType, min: number | string, max: number | string): Promise<number>;
|
423 |
|
424 | zremrangebyrank(key: KeyType, start: number, stop: number, callback: Callback<number>): void;
|
425 | zremrangebyrank(key: KeyType, start: number, stop: number): Promise<number>;
|
426 |
|
427 | zremrangebylex(
|
428 | key: KeyType,
|
429 | min: string,
|
430 | max: string,
|
431 | ): Promise<number>;
|
432 | zremrangebylex(
|
433 | key: KeyType,
|
434 | min: string,
|
435 | max: string,
|
436 | callback: Callback<number>
|
437 | ): void;
|
438 |
|
439 | zunionstore: OverloadedKeyCommand<KeyType | number, number>;
|
440 |
|
441 | zinterstore: OverloadedKeyCommand<KeyType | number, number>;
|
442 |
|
443 | zrange(key: KeyType, start: number, stop: number, callback: Callback<string[]>): void;
|
444 | zrange(key: KeyType, start: number, stop: number, withScores: 'WITHSCORES', callback: Callback<string[]>): void;
|
445 | zrange(key: KeyType, start: number, stop: number, withScores?: 'WITHSCORES'): Promise<string[]>;
|
446 |
|
447 | zrevrange(key: KeyType, start: number, stop: number, callback: Callback<string[]>): void;
|
448 | zrevrange(
|
449 | key: KeyType,
|
450 | start: number,
|
451 | stop: number,
|
452 | withScores: 'WITHSCORES',
|
453 | callback: Callback<string[]>,
|
454 | ): void;
|
455 | zrevrange(key: KeyType, start: number, stop: number, withScores?: 'WITHSCORES'): Promise<string[]>;
|
456 |
|
457 | zrangebyscore(
|
458 | key: KeyType,
|
459 | min: number | string,
|
460 | max: number | string,
|
461 | withScores?: 'WITHSCORES',
|
462 | ): Promise<string[]>;
|
463 | zrangebyscore(
|
464 | key: KeyType,
|
465 | min: number | string,
|
466 | max: number | string,
|
467 | withScores: 'WITHSCORES',
|
468 | limit: 'LIMIT',
|
469 | offset: number,
|
470 | count: number,
|
471 | ): Promise<string[]>;
|
472 | zrangebyscore(
|
473 | key: KeyType,
|
474 | min: number | string,
|
475 | max: number | string,
|
476 | limit: 'LIMIT',
|
477 | offset: number,
|
478 | count: number,
|
479 | ): Promise<string[]>;
|
480 | zrangebyscore(key: KeyType, min: number | string, max: number | string, callback: Callback<string[]>): void;
|
481 | zrangebyscore(
|
482 | key: KeyType,
|
483 | min: number | string,
|
484 | max: number | string,
|
485 | withScores: 'WITHSCORES',
|
486 | callback: Callback<string[]>,
|
487 | ): void;
|
488 | zrangebyscore(
|
489 | key: KeyType,
|
490 | min: number | string,
|
491 | max: number | string,
|
492 | withScores: 'WITHSCORES',
|
493 | limit: 'LIMIT',
|
494 | offset: number,
|
495 | count: number,
|
496 | callback: Callback<string[]>,
|
497 | ): void;
|
498 | zrangebyscore(
|
499 | key: KeyType,
|
500 | min: number | string,
|
501 | max: number | string,
|
502 | limit: 'LIMIT',
|
503 | offset: number,
|
504 | count: number,
|
505 | callback: Callback<string[]>,
|
506 | ): void;
|
507 |
|
508 | zrevrangebyscore(
|
509 | key: KeyType,
|
510 | max: number | string,
|
511 | min: number | string,
|
512 | withScores?: 'WITHSCORES',
|
513 | ): Promise<string[]>;
|
514 | zrevrangebyscore(
|
515 | key: KeyType,
|
516 | max: number | string,
|
517 | min: number | string,
|
518 | withScores: 'WITHSCORES',
|
519 | limit: 'LIMIT',
|
520 | offset: number,
|
521 | count: number,
|
522 | ): Promise<string[]>;
|
523 | zrevrangebyscore(
|
524 | key: KeyType,
|
525 | max: number | string,
|
526 | min: number | string,
|
527 | limit: 'LIMIT',
|
528 | offset: number,
|
529 | count: number,
|
530 | ): Promise<string[]>;
|
531 | zrevrangebyscore(key: KeyType, max: number | string, min: number | string, callback: Callback<string[]>): void;
|
532 | zrevrangebyscore(
|
533 | key: KeyType,
|
534 | max: number | string,
|
535 | min: number | string,
|
536 | withScores: 'WITHSCORES',
|
537 | callback: Callback<string[]>,
|
538 | ): void;
|
539 | zrevrangebyscore(
|
540 | key: KeyType,
|
541 | max: number | string,
|
542 | min: number | string,
|
543 | withScores: 'WITHSCORES',
|
544 | limit: 'LIMIT',
|
545 | offset: number,
|
546 | count: number,
|
547 | callback: Callback<string[]>,
|
548 | ): void;
|
549 | zrevrangebyscore(
|
550 | key: KeyType,
|
551 | max: number | string,
|
552 | min: number | string,
|
553 | limit: 'LIMIT',
|
554 | offset: number,
|
555 | count: number,
|
556 | callback: Callback<string[]>,
|
557 | ): void;
|
558 |
|
559 | zrangebylex(
|
560 | key: KeyType,
|
561 | min: string,
|
562 | max: string,
|
563 | ): Promise<string[]>;
|
564 | zrangebylex(
|
565 | key: KeyType,
|
566 | min: string,
|
567 | max: string,
|
568 | limit: 'LIMIT',
|
569 | offset: number,
|
570 | count: number,
|
571 | ): Promise<string[]>;
|
572 | zrangebylex(
|
573 | key: KeyType,
|
574 | min: string,
|
575 | max: string,
|
576 | callback: Callback<string[]>,
|
577 | ): void;
|
578 | zrangebylex(
|
579 | key: KeyType,
|
580 | min: string,
|
581 | max: string,
|
582 | limit: 'LIMIT',
|
583 | offset: number,
|
584 | count: number,
|
585 | callback: Callback<string[]>,
|
586 | ): void;
|
587 |
|
588 | zrevrangebylex(
|
589 | key: KeyType,
|
590 | min: string,
|
591 | max: string,
|
592 | ): Promise<string[]>;
|
593 | zrevrangebylex(
|
594 | key: KeyType,
|
595 | min: string,
|
596 | max: string,
|
597 | limit: 'LIMIT',
|
598 | offset: number,
|
599 | count: number,
|
600 | ): Promise<string[]>;
|
601 | zrevrangebylex(
|
602 | key: KeyType,
|
603 | min: string,
|
604 | max: string,
|
605 | callback: Callback<string[]>,
|
606 | ): void;
|
607 | zrevrangebylex(
|
608 | key: KeyType,
|
609 | min: string,
|
610 | max: string,
|
611 | limit: 'LIMIT',
|
612 | offset: number,
|
613 | count: number,
|
614 | callback: Callback<string[]>,
|
615 | ): void;
|
616 |
|
617 | zcount(key: KeyType, min: number | string, max: number | string, callback: Callback<number>): void;
|
618 | zcount(key: KeyType, min: number | string, max: number | string): Promise<number>;
|
619 |
|
620 | zcard(key: KeyType, callback: Callback<number>): void;
|
621 | zcard(key: KeyType): Promise<number>;
|
622 |
|
623 | zscore(key: KeyType, member: string, callback: Callback<string>): void;
|
624 | zscore(key: KeyType, member: string): Promise<string>;
|
625 |
|
626 | zrank(key: KeyType, member: string, callback: Callback<number | null>): void;
|
627 | zrank(key: KeyType, member: string): Promise<number | null>;
|
628 |
|
629 | zrevrank(key: KeyType, member: string, callback: Callback<number | null>): void;
|
630 | zrevrank(key: KeyType, member: string): Promise<number | null>;
|
631 |
|
632 | hset: OverloadedKeyedHashCommand<ValueType, Ok>;
|
633 |
|
634 | hsetBuffer(key: KeyType, field: string, value: ValueType, callback: Callback<BooleanResponse>): void;
|
635 | hsetBuffer(key: KeyType, field: string, value: ValueType): Promise<Buffer>;
|
636 |
|
637 | hsetnx(key: KeyType, field: string, value: ValueType, callback: Callback<BooleanResponse>): void;
|
638 | hsetnx(key: KeyType, field: string, value: ValueType): Promise<BooleanResponse>;
|
639 |
|
640 | hget(key: KeyType, field: string, callback: Callback<string | null>): void;
|
641 | hget(key: KeyType, field: string): Promise<string | null>;
|
642 | hgetBuffer(key: KeyType, field: string, callback: Callback<Buffer>): void;
|
643 | hgetBuffer(key: KeyType, field: string): Promise<Buffer>;
|
644 |
|
645 | hmset: OverloadedKeyedHashCommand<ValueType, Ok>;
|
646 |
|
647 | hmget: OverloadedKeyCommand<KeyType, Array<string | null>>;
|
648 |
|
649 | hstrlen(key: KeyType, field: string, callback: Callback<number>): void;
|
650 | hstrlen(key: KeyType, field: string): Promise<number>;
|
651 |
|
652 | hincrby(key: KeyType, field: string, increment: number, callback: Callback<number>): void;
|
653 | hincrby(key: KeyType, field: string, increment: number): Promise<number>;
|
654 |
|
655 | hincrbyfloat(key: KeyType, field: string, increment: number, callback: Callback<number>): void;
|
656 | hincrbyfloat(key: KeyType, field: string, increment: number): Promise<number>;
|
657 |
|
658 | hdel: OverloadedKeyCommand<KeyType, number>;
|
659 |
|
660 | hlen(key: KeyType, callback: Callback<number>): void;
|
661 | hlen(key: KeyType): Promise<number>;
|
662 |
|
663 | hkeys(key: KeyType, callback: Callback<string[]>): void;
|
664 | hkeys(key: KeyType): Promise<string[]>;
|
665 |
|
666 | hvals(key: KeyType, callback: Callback<string[]>): void;
|
667 | hvals(key: KeyType): Promise<string[]>;
|
668 |
|
669 | hgetall(key: KeyType, callback: Callback<Record<string, string>>): void;
|
670 | hgetall(key: KeyType): Promise<Record<string, string>>;
|
671 |
|
672 | hexists(key: KeyType, field: string, callback: Callback<BooleanResponse>): void;
|
673 | hexists(key: KeyType, field: string): Promise<BooleanResponse>;
|
674 |
|
675 | geoadd(key: KeyType, longitude: number, latitude: number, member: string, callback: Callback<number>): void;
|
676 | geoadd(key: KeyType, longitude: number, latitude: number, member: string): Promise<number>;
|
677 |
|
678 | geodist(key: KeyType, member1: string, member2: string, unit: 'm'|'km'|'ft'|'mi', callback: Callback<string | null>): void;
|
679 | geodist(key: KeyType, member1: string, member2: string, unit: 'm'|'km'|'ft'|'mi'): Promise<string | null>;
|
680 |
|
681 | geohash: OverloadedKeyCommand<string, string[]>;
|
682 |
|
683 | geopos: OverloadedKeyCommand<string, string[]>;
|
684 |
|
685 | georadius(
|
686 | key: KeyType,
|
687 | longitude: number,
|
688 | latitude: number,
|
689 | radius: number,
|
690 | unit: 'm'|'km'|'ft'|'mi',
|
691 | callback: Callback<string[]>,
|
692 | ): void;
|
693 | georadius(
|
694 | key: KeyType,
|
695 | longitude: number,
|
696 | latitude: number,
|
697 | radius: number,
|
698 | unit: 'm'|'km'|'ft'|'mi',
|
699 | sort?: 'ASC' | 'DESC'
|
700 | ): Promise<string[]>;
|
701 | georadius(
|
702 | key: KeyType,
|
703 | longitude: number,
|
704 | latitude: number,
|
705 | radius: number,
|
706 | unit: 'm'|'km'|'ft'|'mi',
|
707 | count: 'COUNT',
|
708 | countValue: number,
|
709 | sort?: 'ASC' | 'DESC'
|
710 | ): Promise<string[]>;
|
711 |
|
712 | georadiusbymember(key: KeyType, member: string, radius: number, unit: 'm'|'km'|'ft'|'mi', callback: Callback<string[]>): void;
|
713 | georadiusbymember(key: KeyType, member: string, radius: number, unit: 'm'|'km'|'ft'|'mi', count: 'COUNT', countValue: number, callback: Callback<string[]>): void;
|
714 | georadiusbymember(key: KeyType, member: string, radius: number, unit: 'm'|'km'|'ft'|'mi'): Promise<string[]>;
|
715 | georadiusbymember(key: KeyType, member: string, radius: number, unit: 'm'|'km'|'ft'|'mi', count: 'COUNT', countValue: number): Promise<string[]>;
|
716 |
|
717 | incrby(key: KeyType, increment: number, callback: Callback<number>): void;
|
718 | incrby(key: KeyType, increment: number): Promise<number>;
|
719 |
|
720 | incrbyfloat(key: KeyType, increment: number, callback: Callback<number>): void;
|
721 | incrbyfloat(key: KeyType, increment: number): Promise<number>;
|
722 |
|
723 | decrby(key: KeyType, decrement: number, callback: Callback<number>): void;
|
724 | decrby(key: KeyType, decrement: number): Promise<number>;
|
725 |
|
726 | getset(key: KeyType, value: ValueType, callback: Callback<string | null>): void;
|
727 | getset(key: KeyType, value: ValueType): Promise<string | null>;
|
728 |
|
729 | mset: OverloadedHashCommand<ValueType, Ok>;
|
730 | msetnx: OverloadedHashCommand<ValueType, BooleanResponse>;
|
731 |
|
732 | memory(argument: 'USAGE', key: KeyType, callback?: Callback<number>): Promise<number>;
|
733 |
|
734 | randomkey(callback: Callback<string>): void;
|
735 | randomkey(): Promise<string>;
|
736 |
|
737 | select(index: number, callback: Callback<Ok>): void;
|
738 | select(index: number): Promise<Ok>;
|
739 |
|
740 | move(key: KeyType, db: string, callback: Callback<BooleanResponse>): void;
|
741 | move(key: KeyType, db: string): Promise<BooleanResponse>;
|
742 |
|
743 | rename(key: KeyType, newkey: KeyType, callback: Callback<Ok>): void;
|
744 | rename(key: KeyType, newkey: KeyType): Promise<Ok>;
|
745 |
|
746 | renamenx(key: KeyType, newkey: KeyType, callback: Callback<BooleanResponse>): void;
|
747 | renamenx(key: KeyType, newkey: KeyType): Promise<BooleanResponse>;
|
748 |
|
749 | expire(key: KeyType, seconds: number, callback: Callback<BooleanResponse>): void;
|
750 | expire(key: KeyType, seconds: number): Promise<BooleanResponse>;
|
751 |
|
752 | pexpire(key: KeyType, milliseconds: number, callback: Callback<BooleanResponse>): void;
|
753 | pexpire(key: KeyType, milliseconds: number): Promise<BooleanResponse>;
|
754 |
|
755 | expireat(key: KeyType, timestamp: number, callback: Callback<BooleanResponse>): void;
|
756 | expireat(key: KeyType, timestamp: number): Promise<BooleanResponse>;
|
757 |
|
758 | pexpireat(key: KeyType, millisecondsTimestamp: number, callback: Callback<BooleanResponse>): void;
|
759 | pexpireat(key: KeyType, millisecondsTimestamp: number): Promise<BooleanResponse>;
|
760 |
|
761 | keys(pattern: string, callback: Callback<string[]>): void;
|
762 | keys(pattern: string): Promise<string[]>;
|
763 |
|
764 | dbsize(callback: Callback<number>): void;
|
765 | dbsize(): Promise<number>;
|
766 |
|
767 | auth(username: string, password: string, callback: Callback<string>): void;
|
768 | auth(password: string, callback: Callback<string>): void;
|
769 |
|
770 | auth(username: string, password: string): Promise<string>;
|
771 | auth(password: string): Promise<string>;
|
772 |
|
773 | ping(callback: Callback<string>): void;
|
774 | ping(message: string, callback: Callback<string>): void;
|
775 | ping(message?: string): Promise<string>;
|
776 |
|
777 | echo(message: string, callback: Callback<string>): void;
|
778 | echo(message: string): Promise<string>;
|
779 |
|
780 | save(callback: Callback<string>): void;
|
781 | save(): Promise<string>;
|
782 |
|
783 | bgsave(callback: Callback<string>): void;
|
784 | bgsave(): Promise<string>;
|
785 |
|
786 | bgrewriteaof(callback: Callback<string>): void;
|
787 | bgrewriteaof(): Promise<string>;
|
788 |
|
789 | shutdown(save: 'SAVE' | 'NOSAVE', callback: Callback<never>): void;
|
790 | shutdown(save: 'SAVE' | 'NOSAVE'): Promise<never>;
|
791 |
|
792 | lastsave(callback: Callback<number>): void;
|
793 | lastsave(): Promise<number>;
|
794 |
|
795 | type(key: KeyType, callback: Callback<string>): void;
|
796 | type(key: KeyType): Promise<string>;
|
797 |
|
798 | multi(commands?: string[][], options?: MultiOptions): Pipeline;
|
799 | multi(options: { pipeline: false }): Promise<Ok>;
|
800 |
|
801 | exec(callback: Callback<Array<[Error | null, string]>>): void;
|
802 | exec(): Promise<Array<[Error | null, string]>>;
|
803 |
|
804 | discard(callback: Callback<Ok>): void;
|
805 | discard(): Promise<Ok>;
|
806 |
|
807 | sync(callback: Callback<any>): void;
|
808 | sync(): Promise<any>;
|
809 |
|
810 | flushdb(callback: Callback<Ok>): void;
|
811 | flushdb(): Promise<Ok>;
|
812 |
|
813 | flushall(callback: Callback<Ok>): void;
|
814 | flushall(): Promise<Ok>;
|
815 |
|
816 | sort: OverloadedListCommand<KeyType | number, string[] | number>;
|
817 |
|
818 | info(callback: Callback<string>): void;
|
819 | info(section: string, callback: Callback<string>): void;
|
820 | info(section?: string): Promise<string>;
|
821 |
|
822 | time(callback: Callback<[string, string]>): void;
|
823 | time(): Promise<[string, string]>;
|
824 |
|
825 | monitor(callback: Callback<EventEmitter>): void;
|
826 | monitor(): Promise<EventEmitter>;
|
827 |
|
828 | ttl(key: KeyType, callback: Callback<number>): void;
|
829 | ttl(key: KeyType): Promise<number>;
|
830 |
|
831 | pttl(key: KeyType, callback: Callback<number>): void;
|
832 | pttl(key: KeyType): Promise<number>;
|
833 |
|
834 | persist(key: KeyType, callback: Callback<BooleanResponse>): void;
|
835 | persist(key: KeyType): Promise<BooleanResponse>;
|
836 |
|
837 | slaveof(host: string, port: number, callback: Callback<string>): void;
|
838 | slaveof(host: string, port: number): Promise<string>;
|
839 |
|
840 | debug: OverloadedSubCommand<ValueType, any>;
|
841 |
|
842 | config(op: 'GET', cfg: string): Promise<string[]>;
|
843 | config(op: 'GET', cfg: string, callback: Callback<string[]>): void;
|
844 | config(op: 'REWRITE' | 'RESETSTAT'): Promise<Ok>;
|
845 | config(op: 'REWRITE' | 'RESETSTAT', callback: Callback<Ok>): void;
|
846 | config(op: 'SET', key: string, value: ValueType): Promise<Ok>;
|
847 | config(op: 'SET', key: string, value: ValueType, callback: Callback<Ok>): void;
|
848 |
|
849 | subscribe: OverloadedListCommand<string, number>;
|
850 |
|
851 | unsubscribe: OverloadedCommand<string, number>;
|
852 |
|
853 | psubscribe: OverloadedListCommand<string, number>;
|
854 |
|
855 | punsubscribe: OverloadedCommand<string, number>;
|
856 |
|
857 | publish(channel: string, message: string, callback: Callback<number>): void;
|
858 | publish(channel: string, message: string): Promise<number>;
|
859 |
|
860 | publishBuffer(channel: string, message: Buffer): Promise<number>;
|
861 |
|
862 | watch: OverloadedListCommand<KeyType, Ok>;
|
863 |
|
864 | unwatch(callback: Callback<string>): void;
|
865 | unwatch(): Promise<string>;
|
866 |
|
867 | cluster: OverloadedSubCommand<ValueType, any>;
|
868 |
|
869 | restore: OverloadedListCommand<ValueType, Ok>;
|
870 |
|
871 | migrate: OverloadedListCommand<ValueType, Ok | 'NOKEY'>;
|
872 |
|
873 | dump(key: KeyType, callback: Callback<string>): void;
|
874 | dump(key: KeyType): Promise<string>;
|
875 |
|
876 | object: OverloadedListCommand<ValueType, any>;
|
877 |
|
878 | client: OverloadedSubCommand<ValueType, any>;
|
879 |
|
880 | eval: OverloadedEvalCommand<ValueType, any>;
|
881 |
|
882 | evalsha: OverloadedEvalCommand<ValueType, any>;
|
883 |
|
884 | script: OverloadedSubCommand<ValueType, any>;
|
885 |
|
886 | quit(callback: Callback<Ok>): void;
|
887 | quit(): Promise<Ok>;
|
888 |
|
889 | scan(cursor: number | string, matchOption: 'match' | 'MATCH', pattern: string): Promise<[string, string[]]>;
|
890 | scan(
|
891 | cursor: number | string,
|
892 | matchOption: 'match' | 'MATCH',
|
893 | pattern: string,
|
894 | callback: Callback<[string, string[]]>,
|
895 | ): void;
|
896 | scan(cursor: number | string, countOption: 'count' | 'COUNT', count: number): Promise<[string, string[]]>;
|
897 | scan(
|
898 | cursor: number | string,
|
899 | countOption: 'count' | 'COUNT',
|
900 | count: number,
|
901 | callback: Callback<[string, string[]]>,
|
902 | ): void;
|
903 |
|
904 | scan(
|
905 | cursor: number | string,
|
906 | matchOption: 'match' | 'MATCH',
|
907 | pattern: string,
|
908 | countOption: 'count' | 'COUNT',
|
909 | count: number,
|
910 | ): Promise<[string, string[]]>;
|
911 | scan(
|
912 | cursor: number | string,
|
913 | matchOption: 'match' | 'MATCH',
|
914 | pattern: string,
|
915 | countOption: 'count' | 'COUNT',
|
916 | count: number,
|
917 | callback: Callback<[string, string[]]>,
|
918 | ): void;
|
919 | scan(
|
920 | cursor: number | string,
|
921 | countOption: 'count' | 'COUNT',
|
922 | count: number,
|
923 | matchOption: 'match' | 'MATCH',
|
924 | pattern: string,
|
925 | ): Promise<[string, string[]]>;
|
926 | scan(
|
927 | cursor: number | string,
|
928 | countOption: 'count' | 'COUNT',
|
929 | count: number,
|
930 | matchOption: 'match' | 'MATCH',
|
931 | pattern: string,
|
932 | callback: Callback<[string, string[]]>,
|
933 | ): void;
|
934 |
|
935 | sscan: OverloadedKeyCommand<ValueType, [string, string[]]>;
|
936 |
|
937 | hscan: OverloadedKeyCommand<ValueType, [string, string[]]>;
|
938 |
|
939 | zscan: OverloadedKeyCommand<ValueType, [string, string[]]>;
|
940 |
|
941 | pfmerge: OverloadedKeyCommand<KeyType, Ok>;
|
942 |
|
943 | pfadd: OverloadedKeyCommand<string, number>;
|
944 |
|
945 | pfcount: OverloadedListCommand<KeyType, number>;
|
946 |
|
947 | pipeline(commands?: string[][]): Pipeline;
|
948 |
|
949 | scanStream(options?: ScanStreamOption): Readable;
|
950 | sscanStream(key: KeyType, options?: ScanStreamOption): Readable;
|
951 | hscanStream(key: KeyType, options?: ScanStreamOption): Readable;
|
952 | zscanStream(key: KeyType, options?: ScanStreamOption): Readable;
|
953 |
|
954 | xack: OverloadedKeyCommand<ValueType, number>;
|
955 |
|
956 | xadd: OverloadedKeyCommand<ValueType, string>;
|
957 |
|
958 | xclaim: OverloadedKeyCommand<ValueType, Array<[string, string[]]>>;
|
959 |
|
960 | xdel: OverloadedKeyCommand<string, number>;
|
961 |
|
962 | xgroup: OverloadedSubCommand<ValueType, Ok>;
|
963 |
|
964 | xinfo: OverloadedSubCommand<ValueType, any>;
|
965 |
|
966 | xlen(key: KeyType): Promise<number>;
|
967 | xlen(key: KeyType, callback: Callback<number>): void;
|
968 |
|
969 | xpending: OverloadedKeyCommand<ValueType, any>;
|
970 |
|
971 | xrange: OverloadedKeyCommand<ValueType, Array<[string, string[]]>>;
|
972 |
|
973 | xread: OverloadedListCommand<ValueType, Array<[string, string[]]>>;
|
974 |
|
975 | xreadgroup: OverloadedKeyCommand<ValueType, Array<[string, string[]]>>;
|
976 |
|
977 | xrevrange: OverloadedKeyCommand<ValueType, Array<[string, string[]]>>;
|
978 |
|
979 | xtrim: OverloadedKeyCommand<ValueType, number>;
|
980 | }
|
981 |
|
982 | interface Redis extends EventEmitter, Commander, Commands {
|
983 | Promise: typeof Promise;
|
984 | readonly options: RedisOptions;
|
985 | readonly status: string;
|
986 | connect(callback?: () => void): Promise<void>;
|
987 | disconnect(): void;
|
988 | duplicate(): Redis;
|
989 |
|
990 | send_command(command: string, ...args: ValueType[]): Promise<any>;
|
991 | }
|
992 |
|
993 | interface Pipeline {
|
994 | readonly redis: Redis | Cluster;
|
995 | readonly isCluster: boolean;
|
996 | readonly options: RedisOptions | ClusterOptions;
|
997 | readonly length: number;
|
998 |
|
999 | bitcount(key: KeyType, callback?: Callback<number>): Pipeline;
|
1000 | bitcount(key: KeyType, start: number, end: number, callback?: Callback<number>): Pipeline;
|
1001 |
|
1002 | get(key: KeyType, callback?: Callback<string>): Pipeline;
|
1003 | getBuffer(key: KeyType, callback?: Callback<Buffer>): Pipeline;
|
1004 |
|
1005 | set(key: KeyType, value: ValueType, callback?: Callback<string>): Pipeline;
|
1006 | set(key: KeyType, value: ValueType, setMode: string, callback?: Callback<string>): Pipeline;
|
1007 | set(key: KeyType, value: ValueType, expiryMode: string, time: number, callback?: Callback<string>): Pipeline;
|
1008 | set(
|
1009 | key: KeyType,
|
1010 | value: ValueType,
|
1011 | expiryMode: string,
|
1012 | time: number,
|
1013 | setMode: string,
|
1014 | callback?: Callback<string>,
|
1015 | ): Pipeline;
|
1016 |
|
1017 | setBuffer(key: KeyType, value: ValueType, callback?: Callback<Buffer>): Pipeline;
|
1018 | setBuffer(key: KeyType, value: ValueType, setMode: string, callback?: Callback<Buffer>): Pipeline;
|
1019 | setBuffer(
|
1020 | key: KeyType,
|
1021 | value: ValueType,
|
1022 | expiryMode: string,
|
1023 | time: number,
|
1024 | callback?: Callback<Buffer>,
|
1025 | ): Pipeline;
|
1026 | setBuffer(
|
1027 | key: KeyType,
|
1028 | value: ValueType,
|
1029 | expiryMode: string,
|
1030 | time: number,
|
1031 | setMode: string,
|
1032 | callback?: Callback<Buffer>,
|
1033 | ): Pipeline;
|
1034 |
|
1035 | setnx(key: KeyType, value: ValueType, callback?: Callback<BooleanResponse>): Pipeline;
|
1036 |
|
1037 | setex(key: KeyType, seconds: number, value: ValueType, callback?: Callback<Ok>): Pipeline;
|
1038 |
|
1039 | psetex(key: KeyType, milliseconds: number, value: ValueType, callback?: Callback<Ok>): Pipeline;
|
1040 |
|
1041 | append(key: KeyType, value: ValueType, callback?: Callback<number>): Pipeline;
|
1042 |
|
1043 | strlen(key: KeyType, callback?: Callback<number>): Pipeline;
|
1044 |
|
1045 | del(...keys: KeyType[]): Pipeline;
|
1046 |
|
1047 | unlink(...keys: KeyType[]): Pipeline;
|
1048 |
|
1049 | exists(...keys: KeyType[]): Pipeline;
|
1050 |
|
1051 | setbit(key: KeyType, offset: number, value: ValueType, callback?: Callback<number>): Pipeline;
|
1052 |
|
1053 | getbit(key: KeyType, offset: number, callback?: Callback<number>): Pipeline;
|
1054 |
|
1055 | setrange(key: KeyType, offset: number, value: ValueType, callback?: Callback<number>): Pipeline;
|
1056 |
|
1057 | getrange(key: KeyType, start: number, end: number, callback?: Callback<string>): Pipeline;
|
1058 |
|
1059 | getrangeBuffer(key: KeyType, start: number, end: number, callback?: Callback<Buffer>): Pipeline;
|
1060 |
|
1061 | substr(key: KeyType, start: number, end: number, callback?: Callback<string>): Pipeline;
|
1062 |
|
1063 | incr(key: KeyType, callback?: Callback<number>): Pipeline;
|
1064 |
|
1065 | decr(key: KeyType, callback?: Callback<number>): Pipeline;
|
1066 |
|
1067 | mget(...keys: KeyType[]): Pipeline;
|
1068 |
|
1069 | rpush(key: KeyType, ...values: ValueType[]): Pipeline;
|
1070 |
|
1071 | rpushBuffer(key: string, ...values: Buffer[]): Pipeline;
|
1072 |
|
1073 | lpush(key: KeyType, ...values: ValueType[]): Pipeline;
|
1074 |
|
1075 | rpushx(key: KeyType, value: ValueType, callback?: Callback<number>): Pipeline;
|
1076 |
|
1077 | lpushx(key: KeyType, value: ValueType, callback?: Callback<number>): Pipeline;
|
1078 |
|
1079 | linsert(
|
1080 | key: KeyType,
|
1081 | direction: 'BEFORE' | 'AFTER',
|
1082 | pivot: string,
|
1083 | value: ValueType,
|
1084 | callback?: Callback<number>,
|
1085 | ): Pipeline;
|
1086 |
|
1087 | rpop(key: KeyType, callback?: Callback<string>): Pipeline;
|
1088 |
|
1089 | lpop(key: KeyType, callback?: Callback<string>): Pipeline;
|
1090 |
|
1091 | lpopBuffer(key: KeyType, callback?: Callback<Buffer>): Pipeline;
|
1092 |
|
1093 | brpop(...keys: KeyType[]): Pipeline;
|
1094 |
|
1095 | blpop(...keys: KeyType[]): Pipeline;
|
1096 |
|
1097 | brpoplpush(source: string, destination: string, timeout: number, callback?: Callback<string>): Pipeline;
|
1098 |
|
1099 | llen(key: KeyType, callback?: Callback<number>): Pipeline;
|
1100 |
|
1101 | lindex(key: KeyType, index: number, callback?: Callback<string>): Pipeline;
|
1102 |
|
1103 | lset(key: KeyType, index: number, value: ValueType, callback?: Callback<Ok>): Pipeline;
|
1104 |
|
1105 | lrange(key: KeyType, start: number, stop: number, callback?: Callback<string[]>): Pipeline;
|
1106 |
|
1107 | lrangeBuffer(key: KeyType, start: number, stop: number, callback?: Callback<Buffer[]>): Pipeline;
|
1108 |
|
1109 | ltrim(key: KeyType, start: number, stop: number, callback?: Callback<Ok>): Pipeline;
|
1110 |
|
1111 | lrem(key: KeyType, count: number, value: ValueType, callback?: Callback<number>): Pipeline;
|
1112 |
|
1113 | rpoplpush(source: string, destination: string, callback?: Callback<string>): Pipeline;
|
1114 |
|
1115 | sadd(key: KeyType, ...members: ValueType[]): Pipeline;
|
1116 |
|
1117 | srem(key: KeyType, ...members: ValueType[]): Pipeline;
|
1118 |
|
1119 | smove(source: string, destination: string, member: string, callback?: Callback<string>): Pipeline;
|
1120 |
|
1121 | sismember(key: KeyType, member: string, callback?: Callback<BooleanResponse>): Pipeline;
|
1122 |
|
1123 | scard(key: KeyType, callback?: Callback<number>): Pipeline;
|
1124 |
|
1125 | spop(key: KeyType, callback?: Callback<string | null>): Pipeline;
|
1126 | spop(key: KeyType, count: number, callback?: Callback<string[]>): Pipeline;
|
1127 |
|
1128 | srandmember(key: KeyType, callback?: Callback<string | null>): Pipeline;
|
1129 | srandmember(key: KeyType, count: number, callback?: Callback<string[]>): Pipeline;
|
1130 |
|
1131 | sinter(...keys: KeyType[]): Pipeline;
|
1132 |
|
1133 | sinterstore(destination: string, ...keys: KeyType[]): Pipeline;
|
1134 |
|
1135 | sunion(...keys: KeyType[]): Pipeline;
|
1136 |
|
1137 | sunionstore(destination: string, ...keys: KeyType[]): Pipeline;
|
1138 |
|
1139 | sdiff(...keys: KeyType[]): Pipeline;
|
1140 |
|
1141 | sdiffstore(destination: string, ...keys: KeyType[]): Pipeline;
|
1142 |
|
1143 | smembers(key: KeyType, callback?: Callback<string[]>): Pipeline;
|
1144 |
|
1145 | zadd(key: KeyType, ...args: string[]): Pipeline;
|
1146 |
|
1147 | zincrby(key: KeyType, increment: number, member: string, callback?: Callback<string>): Pipeline;
|
1148 |
|
1149 | zpopmin(key: KeyType, count: number, callback?: Callback<string[]>): Pipeline;
|
1150 |
|
1151 | zpopmax(key: KeyType, count: number, callback?: Callback<string[]>): Pipeline;
|
1152 |
|
1153 | bzpopmin(...args: Array<string | number | Callback<[string, string, string]>>): Pipeline;
|
1154 |
|
1155 | bzpopmax(...args: Array<string | number | Callback<[string, string, string]>>): Pipeline;
|
1156 |
|
1157 | zrem(key: KeyType, ...members: ValueType[]): Pipeline;
|
1158 |
|
1159 | zremrangebyscore(
|
1160 | key: KeyType,
|
1161 | min: number | string,
|
1162 | max: number | string,
|
1163 | callback?: Callback<number>,
|
1164 | ): Pipeline;
|
1165 |
|
1166 | zremrangebyrank(key: KeyType, start: number, stop: number, callback?: Callback<number>): Pipeline;
|
1167 |
|
1168 | zremrangebylex(
|
1169 | key: KeyType,
|
1170 | min: string,
|
1171 | max: string,
|
1172 | callback?: Callback<number>,
|
1173 | ): Pipeline;
|
1174 |
|
1175 | zunionstore(destination: string, numkeys: number, key: KeyType, ...args: string[]): Pipeline;
|
1176 |
|
1177 | zinterstore(destination: string, numkeys: number, key: KeyType, ...args: string[]): Pipeline;
|
1178 |
|
1179 | zrange(key: KeyType, start: number, stop: number, callback?: Callback<string[]>): Pipeline;
|
1180 | zrange(
|
1181 | key: KeyType,
|
1182 | start: number,
|
1183 | stop: number,
|
1184 | withScores: 'WITHSCORES',
|
1185 | callback?: Callback<string[]>,
|
1186 | ): Pipeline;
|
1187 |
|
1188 | zrevrange(key: KeyType, start: number, stop: number, callback?: Callback<string[]>): Pipeline;
|
1189 | zrevrange(
|
1190 | key: KeyType,
|
1191 | start: number,
|
1192 | stop: number,
|
1193 | withScores: 'WITHSCORES',
|
1194 | callback?: Callback<string[]>,
|
1195 | ): Pipeline;
|
1196 |
|
1197 | zrangebyscore(key: KeyType, min: number | string, max: number | string, ...args: string[]): Pipeline;
|
1198 |
|
1199 | zrevrangebyscore(key: KeyType, max: number | string, min: number | string, ...args: string[]): Pipeline;
|
1200 |
|
1201 | zrangebylex(
|
1202 | key: KeyType,
|
1203 | min: string,
|
1204 | max: string,
|
1205 | callback?: Callback<string[]>,
|
1206 | ): Pipeline;
|
1207 | zrangebylex(
|
1208 | key: KeyType,
|
1209 | min: string,
|
1210 | max: string,
|
1211 | limit: 'LIMIT',
|
1212 | offset: number,
|
1213 | count: number,
|
1214 | callback?: Callback<string[]>,
|
1215 | ): Pipeline;
|
1216 | zrevrangebylex(
|
1217 | key: KeyType,
|
1218 | min: string,
|
1219 | max: string,
|
1220 | callback?: Callback<string[]>,
|
1221 | ): Pipeline;
|
1222 | zrevrangebylex(
|
1223 | key: KeyType,
|
1224 | min: string,
|
1225 | max: string,
|
1226 | limit: 'LIMIT',
|
1227 | offset: number,
|
1228 | count: number,
|
1229 | callback?: Callback<string[]>,
|
1230 | ): Pipeline;
|
1231 |
|
1232 | zcount(key: KeyType, min: number | string, max: number | string, callback?: Callback<number>): Pipeline;
|
1233 |
|
1234 | zcard(key: KeyType, callback?: Callback<number>): Pipeline;
|
1235 |
|
1236 | zscore(key: KeyType, member: string, callback?: Callback<number>): Pipeline;
|
1237 |
|
1238 | zrank(key: KeyType, member: string, callback?: Callback<number>): Pipeline;
|
1239 |
|
1240 | zrevrank(key: KeyType, member: string, callback?: Callback<number>): Pipeline;
|
1241 |
|
1242 | hset(key: KeyType, ...args: ValueType[]): Pipeline;
|
1243 | hset(key: KeyType, data: object | Map<string, any>, callback?: Callback<BooleanResponse>): Pipeline;
|
1244 | hset(key: KeyType, field: string, value: ValueType, callback?: Callback<BooleanResponse>): Pipeline;
|
1245 | hsetBuffer(key: KeyType, field: string, value: ValueType, callback?: Callback<Buffer>): Pipeline;
|
1246 |
|
1247 | hsetnx(key: KeyType, field: string, value: ValueType, callback?: Callback<BooleanResponse>): Pipeline;
|
1248 |
|
1249 | hget(key: KeyType, field: string, callback?: Callback<string | string>): Pipeline;
|
1250 | hgetBuffer(key: KeyType, field: string, callback?: Callback<Buffer>): Pipeline;
|
1251 |
|
1252 | hmset(key: KeyType, ...args: ValueType[]): Pipeline;
|
1253 | hmset(key: KeyType, data: object | Map<string, any>, callback?: Callback<BooleanResponse>): Pipeline;
|
1254 |
|
1255 | hmget(key: KeyType, ...fields: string[]): Pipeline;
|
1256 |
|
1257 | hstrlen(key: KeyType, field: string, callback?: Callback<number>): Pipeline;
|
1258 |
|
1259 | hincrby(key: KeyType, field: string, increment: number, callback?: Callback<number>): Pipeline;
|
1260 |
|
1261 | hincrbyfloat(key: KeyType, field: string, increment: number, callback?: Callback<number>): Pipeline;
|
1262 |
|
1263 | hdel(key: KeyType, ...fields: string[]): Pipeline;
|
1264 |
|
1265 | hlen(key: KeyType, callback?: Callback<number>): Pipeline;
|
1266 |
|
1267 | hkeys(key: KeyType, callback?: Callback<string[]>): Pipeline;
|
1268 |
|
1269 | hvals(key: KeyType, callback?: Callback<string[]>): Pipeline;
|
1270 |
|
1271 | hgetall(key: KeyType, callback?: Callback<Record<string, string>>): Pipeline;
|
1272 |
|
1273 | hexists(key: KeyType, field: string, callback?: Callback<BooleanResponse>): Pipeline;
|
1274 |
|
1275 | geoadd(key: KeyType, longitude: number, latitude: number, member: string, callback?: Callback<number>): Pipeline;
|
1276 |
|
1277 | geodist(key: KeyType, member1: string, member2: string, unit: 'm'|'km'|'ft'|'mi', callback?: Callback<string | null>): Pipeline;
|
1278 |
|
1279 | geohash(key: KeyType, ...fields: string[]): Pipeline;
|
1280 |
|
1281 | geopos(key: KeyType, ...fields: string[]): Pipeline;
|
1282 |
|
1283 | georadius(key: KeyType, longitude: number, latitude: number, radius: number, unit: 'm'|'km'|'ft'|'mi', callback?: Callback<string[]>): Pipeline;
|
1284 | georadius(key: KeyType, longitude: number, latitude: number, radius: number, unit: 'm'|'km'|'ft'|'mi', count: 'COUNT', countValue: number, callback?: Callback<string[]>): Pipeline;
|
1285 |
|
1286 | georadiusbymember(key: KeyType, member: string, radius: number, unit: 'm'|'km'|'ft'|'mi', callback?: Callback<string[]>): Pipeline;
|
1287 | georadiusbymember(key: KeyType, member: string, radius: number, unit: 'm'|'km'|'ft'|'mi', count: 'COUNT', countValue: number, callback?: Callback<string[]>): Pipeline;
|
1288 |
|
1289 | incrby(key: KeyType, increment: number, callback?: Callback<number>): Pipeline;
|
1290 |
|
1291 | incrbyfloat(key: KeyType, increment: number, callback?: Callback<number>): Pipeline;
|
1292 |
|
1293 | decrby(key: KeyType, decrement: number, callback?: Callback<number>): Pipeline;
|
1294 |
|
1295 | getset(key: KeyType, value: ValueType, callback?: Callback<string>): Pipeline;
|
1296 |
|
1297 | mset(...args: ValueType[]): Pipeline;
|
1298 | mset(data: object | Map<string, any>, callback?: Callback<string>): Pipeline;
|
1299 |
|
1300 | msetnx(...args: ValueType[]): Pipeline;
|
1301 | msetnx(data: object | Map<string, any>, callback?: Callback<BooleanResponse>): Pipeline;
|
1302 |
|
1303 | memory(argument: 'USAGE', key: KeyType, callback?: Callback<number>): Pipeline;
|
1304 |
|
1305 | randomkey(callback?: Callback<string>): Pipeline;
|
1306 |
|
1307 | select(index: number, callback?: Callback<string>): Pipeline;
|
1308 |
|
1309 | move(key: KeyType, db: string, callback?: Callback<BooleanResponse>): Pipeline;
|
1310 |
|
1311 | rename(key: KeyType, newkey: KeyType, callback?: Callback<string>): Pipeline;
|
1312 |
|
1313 | renamenx(key: KeyType, newkey: KeyType, callback?: Callback<BooleanResponse>): Pipeline;
|
1314 |
|
1315 | expire(key: KeyType, seconds: number, callback?: Callback<BooleanResponse>): Pipeline;
|
1316 |
|
1317 | pexpire(key: KeyType, milliseconds: number, callback?: Callback<BooleanResponse>): Pipeline;
|
1318 |
|
1319 | expireat(key: KeyType, timestamp: number, callback?: Callback<BooleanResponse>): Pipeline;
|
1320 |
|
1321 | pexpireat(key: KeyType, millisecondsTimestamp: number, callback?: Callback<BooleanResponse>): Pipeline;
|
1322 |
|
1323 | keys(pattern: string, callback?: Callback<string[]>): Pipeline;
|
1324 |
|
1325 | dbsize(callback?: Callback<number>): Pipeline;
|
1326 |
|
1327 | auth(password: string, callback?: Callback<string>): Pipeline;
|
1328 | auth(username: string, password: string, callback?: Callback<string>): Pipeline;
|
1329 |
|
1330 | ping(callback?: Callback<string>): Pipeline;
|
1331 | ping(message: string, callback?: Callback<string>): Pipeline;
|
1332 |
|
1333 | echo(message: string, callback?: Callback<string>): Pipeline;
|
1334 |
|
1335 | save(callback?: Callback<string>): Pipeline;
|
1336 |
|
1337 | bgsave(callback?: Callback<string>): Pipeline;
|
1338 |
|
1339 | bgrewriteaof(callback?: Callback<string>): Pipeline;
|
1340 |
|
1341 | shutdown(save: 'SAVE' | 'NOSAVE', callback?: Callback<never>): Pipeline;
|
1342 |
|
1343 | lastsave(callback?: Callback<number>): Pipeline;
|
1344 |
|
1345 | type(key: KeyType, callback?: Callback<string>): Pipeline;
|
1346 |
|
1347 | multi(callback?: Callback<string>): Pipeline;
|
1348 |
|
1349 | exec(callback?: Callback<Array<[Error | null, any]>>): Promise<Array<[Error | null, any]>>;
|
1350 |
|
1351 | discard(callback?: Callback<any>): Pipeline;
|
1352 |
|
1353 | sync(callback?: Callback<any>): Pipeline;
|
1354 |
|
1355 | flushdb(callback?: Callback<string>): Pipeline;
|
1356 |
|
1357 | flushall(callback?: Callback<string>): Pipeline;
|
1358 |
|
1359 | sort(key: KeyType, ...args: string[]): Pipeline;
|
1360 |
|
1361 | info(callback?: Callback<string>): Pipeline;
|
1362 | info(section: string, callback?: Callback<string>): Pipeline;
|
1363 |
|
1364 | time(callback?: Callback<[string, string]>): Pipeline;
|
1365 |
|
1366 | monitor(callback?: Callback<EventEmitter>): Pipeline;
|
1367 |
|
1368 | ttl(key: KeyType, callback?: Callback<number>): Pipeline;
|
1369 |
|
1370 | pttl(key: KeyType, callback?: Callback<number>): Pipeline;
|
1371 |
|
1372 | persist(key: KeyType, callback?: Callback<BooleanResponse>): Pipeline;
|
1373 |
|
1374 | slaveof(host: string, port: number, callback?: Callback<string>): Pipeline;
|
1375 |
|
1376 | debug(...args: ValueType[]): Pipeline;
|
1377 |
|
1378 | config(...args: ValueType[]): Pipeline;
|
1379 |
|
1380 | subscribe(...channels: ValueType[]): Pipeline;
|
1381 |
|
1382 | unsubscribe(...channels: string[]): Pipeline;
|
1383 |
|
1384 | psubscribe(...patterns: string[]): Pipeline;
|
1385 |
|
1386 | punsubscribe(...patterns: string[]): Pipeline;
|
1387 |
|
1388 | publish(channel: string, message: string, callback?: Callback<number>): Pipeline;
|
1389 |
|
1390 | watch(...keys: KeyType[]): Pipeline;
|
1391 |
|
1392 | unwatch(callback?: Callback<string>): Pipeline;
|
1393 |
|
1394 | cluster(...args: ValueType[]): Pipeline;
|
1395 |
|
1396 | restore(...args: ValueType[]): Pipeline;
|
1397 |
|
1398 | migrate(...args: ValueType[]): Pipeline;
|
1399 |
|
1400 | dump(key: KeyType, callback?: Callback<string>): Pipeline;
|
1401 |
|
1402 | object(subcommand: string, ...args: ValueType[]): Pipeline;
|
1403 |
|
1404 | client(...args: ValueType[]): Pipeline;
|
1405 |
|
1406 | eval(script: string, numKeys: number, ...args: ValueType[]): Pipeline;
|
1407 |
|
1408 | evalsha(scriptSha: string, numKeys: string, ...args: ValueType[]): Pipeline;
|
1409 |
|
1410 | script(...args: ValueType[]): Pipeline;
|
1411 |
|
1412 | quit(callback?: Callback<string>): Pipeline;
|
1413 |
|
1414 | scan(cursor: number | string): Pipeline;
|
1415 |
|
1416 | scan(cursor: number | string, matchOption: 'match' | 'MATCH', pattern: string): Pipeline;
|
1417 | scan(cursor: number | string, countOption: 'count' | 'COUNT', count: number): Pipeline;
|
1418 |
|
1419 | scan(
|
1420 | cursor: number | string,
|
1421 | matchOption: 'match' | 'MATCH',
|
1422 | pattern: string,
|
1423 | countOption: 'count' | 'COUNT',
|
1424 | count: number,
|
1425 | ): Pipeline;
|
1426 | scan(
|
1427 | cursor: number | string,
|
1428 | countOption: 'count' | 'COUNT',
|
1429 | count: number,
|
1430 | matchOption: 'match' | 'MATCH',
|
1431 | pattern: string,
|
1432 | ): Pipeline;
|
1433 | sscan(key: KeyType, cursor: number | string, ...args: ValueType[]): Pipeline;
|
1434 |
|
1435 | hscan(key: KeyType, cursor: number | string, ...args: ValueType[]): Pipeline;
|
1436 |
|
1437 | zscan(key: KeyType, cursor: number | string, ...args: ValueType[]): Pipeline;
|
1438 |
|
1439 | pfmerge(destkey: KeyType, ...sourcekeys: KeyType[]): Pipeline;
|
1440 |
|
1441 | pfadd(key: KeyType, ...elements: string[]): Pipeline;
|
1442 |
|
1443 | pfcount(...keys: KeyType[]): Pipeline;
|
1444 |
|
1445 | xack(key: KeyType, group: string, ...ids: string[]): Pipeline;
|
1446 |
|
1447 | xadd(key: KeyType, id: string, ...args: string[]): Pipeline;
|
1448 |
|
1449 | xclaim(
|
1450 | key: KeyType,
|
1451 | group: string,
|
1452 | consumer: string,
|
1453 | minIdleTime: number,
|
1454 | id: string,
|
1455 | ...args: ValueType[]
|
1456 | ): Pipeline;
|
1457 |
|
1458 | xdel(key: KeyType, ...ids: string[]): Pipeline;
|
1459 |
|
1460 | xgroup(...args: ValueType[]): Pipeline;
|
1461 |
|
1462 | xinfo(...args: ValueType[]): Pipeline;
|
1463 |
|
1464 | xlen(key: KeyType): Pipeline;
|
1465 |
|
1466 | xpending(key: KeyType, group: string, ...args: ValueType[]): Pipeline;
|
1467 |
|
1468 | xrange(key: KeyType, start: string, end: string, ...args: ValueType[]): Pipeline;
|
1469 |
|
1470 | xread(...args: ValueType[]): Pipeline;
|
1471 |
|
1472 | xreadgroup(command: 'GROUP' | 'group', group: string, consumer: string, ...args: ValueType[]): Pipeline;
|
1473 |
|
1474 | xrevrange(key: KeyType, end: string, start: string, ...args: ValueType[]): Pipeline;
|
1475 |
|
1476 | xtrim(key: KeyType, strategy: 'MAXLEN' | 'maxlen', ...args: ValueType[]): Pipeline;
|
1477 | }
|
1478 |
|
1479 | interface NodeConfiguration {
|
1480 | host?: string;
|
1481 | port?: number;
|
1482 | }
|
1483 |
|
1484 | type ClusterNode = string | number | NodeConfiguration;
|
1485 |
|
1486 | type NodeRole = 'master' | 'slave' | 'all';
|
1487 |
|
1488 | type CallbackFunction<T = any> = (err?: NodeJS.ErrnoException | null, result?: T) => void;
|
1489 |
|
1490 | type Ok = 'OK';
|
1491 |
|
1492 | interface Cluster extends EventEmitter, Commander, Commands {
|
1493 | readonly options: ClusterOptions;
|
1494 | readonly status: string;
|
1495 | connect(): Promise<void>;
|
1496 | disconnect(): void;
|
1497 | nodes(role?: NodeRole): Redis[];
|
1498 | }
|
1499 |
|
1500 | interface ClusterStatic extends EventEmitter {
|
1501 | new (nodes: ClusterNode[], options?: ClusterOptions): Cluster;
|
1502 | }
|
1503 |
|
1504 | interface RedisOptions {
|
1505 | port?: number;
|
1506 | host?: string;
|
1507 | |
1508 |
|
1509 |
|
1510 | family?: number;
|
1511 | |
1512 |
|
1513 |
|
1514 | path?: string;
|
1515 | |
1516 |
|
1517 |
|
1518 | keepAlive?: number;
|
1519 | connectionName?: string;
|
1520 | |
1521 |
|
1522 |
|
1523 | username?: string;
|
1524 | |
1525 |
|
1526 |
|
1527 | password?: string;
|
1528 | |
1529 |
|
1530 |
|
1531 | db?: number;
|
1532 | |
1533 |
|
1534 |
|
1535 |
|
1536 |
|
1537 |
|
1538 | enableReadyCheck?: boolean;
|
1539 | keyPrefix?: string;
|
1540 | |
1541 |
|
1542 |
|
1543 |
|
1544 | retryStrategy?(times: number): number | void | null;
|
1545 | |
1546 |
|
1547 |
|
1548 |
|
1549 |
|
1550 |
|
1551 |
|
1552 |
|
1553 |
|
1554 |
|
1555 | maxRetriesPerRequest?: number | null;
|
1556 | |
1557 |
|
1558 |
|
1559 |
|
1560 | reconnectOnError?(error: Error): boolean | 1 | 2;
|
1561 | |
1562 |
|
1563 |
|
1564 |
|
1565 |
|
1566 |
|
1567 |
|
1568 | enableOfflineQueue?: boolean;
|
1569 | |
1570 |
|
1571 |
|
1572 |
|
1573 | connectTimeout?: number;
|
1574 | |
1575 |
|
1576 |
|
1577 |
|
1578 | autoResubscribe?: boolean;
|
1579 | |
1580 |
|
1581 |
|
1582 |
|
1583 | autoResendUnfulfilledCommands?: boolean;
|
1584 | lazyConnect?: boolean;
|
1585 | tls?: ConnectionOptions;
|
1586 | |
1587 |
|
1588 |
|
1589 | role?: 'master' | 'slave';
|
1590 | |
1591 |
|
1592 |
|
1593 | name?: string;
|
1594 | sentinelUsername?: string;
|
1595 | sentinelPassword?: string;
|
1596 | sentinels?: Array<{ host: string; port: number }>;
|
1597 | |
1598 |
|
1599 |
|
1600 |
|
1601 | sentinelRetryStrategy?(times: number): number | void | null;
|
1602 | |
1603 |
|
1604 |
|
1605 | preferredSlaves?: PreferredSlaves;
|
1606 | |
1607 |
|
1608 |
|
1609 |
|
1610 | enableTLSForSentinelMode?: boolean;
|
1611 | sentinelTLS?: SecureContextOptions;
|
1612 | |
1613 |
|
1614 |
|
1615 |
|
1616 | natMap?: NatMap;
|
1617 | |
1618 |
|
1619 |
|
1620 |
|
1621 | updateSentinels?: boolean;
|
1622 | |
1623 |
|
1624 |
|
1625 |
|
1626 | readOnly?: boolean;
|
1627 | |
1628 |
|
1629 |
|
1630 |
|
1631 | dropBufferSupport?: boolean;
|
1632 | |
1633 |
|
1634 |
|
1635 | showFriendlyErrorStack?: boolean;
|
1636 | |
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 | enableAutoPipelining?: boolean;
|
1642 | }
|
1643 |
|
1644 | interface AddressFromResponse {
|
1645 | port: string;
|
1646 | ip: string;
|
1647 | flags?: string;
|
1648 | }
|
1649 |
|
1650 | type PreferredSlaves =
|
1651 | | ((slaves: AddressFromResponse[]) => AddressFromResponse | null)
|
1652 | | Array<{ port: string; ip: string; prio?: number }>
|
1653 | | { port: string; ip: string; prio?: number };
|
1654 |
|
1655 | type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1';
|
1656 |
|
1657 | interface SecureContextOptions {
|
1658 | pfx?: string | Buffer | Array<string | Buffer | object>;
|
1659 | key?: string | Buffer | Array<Buffer | object>;
|
1660 | passphrase?: string;
|
1661 | cert?: string | Buffer | Array<string | Buffer>;
|
1662 | ca?: string | Buffer | Array<string | Buffer>;
|
1663 | ciphers?: string;
|
1664 | honorCipherOrder?: boolean;
|
1665 | ecdhCurve?: string;
|
1666 | clientCertEngine?: string;
|
1667 | crl?: string | Buffer | Array<string | Buffer>;
|
1668 | dhparam?: string | Buffer;
|
1669 | secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options
|
1670 | secureProtocol?: string; // SSL Method, e.g. SSLv23_method
|
1671 | sessionIdContext?: string;
|
1672 | /**
|
1673 | * Optionally set the maximum TLS version to allow. One
|
1674 | * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
|
1675 | * `secureProtocol` option, use one or the other.
|
1676 | * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using
|
1677 | * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
|
1678 | * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
|
1679 | */
|
1680 | maxVersion?: SecureVersion;
|
1681 | /**
|
1682 | * Optionally set the minimum TLS version to allow. One
|
1683 | * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
|
1684 | * `secureProtocol` option, use one or the other. It is not recommended to use
|
1685 | * less than TLSv1.2, but it may be required for interoperability.
|
1686 | * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using
|
1687 | * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to
|
1688 | * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
|
1689 | * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
|
1690 | */
|
1691 | minVersion?: SecureVersion;
|
1692 | }
|
1693 |
|
1694 | interface ScanStreamOption {
|
1695 | match?: string;
|
1696 | count?: number;
|
1697 | }
|
1698 |
|
1699 | type DNSLookupFunction = (
|
1700 | hostname: string,
|
1701 | callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
1702 | ) => void;
|
1703 | interface NatMap {
|
1704 | [key: string]: { host: string; port: number };
|
1705 | }
|
1706 |
|
1707 | interface ClusterOptions {
|
1708 | clusterRetryStrategy?(times: number, reason?: Error): number | null;
|
1709 | enableOfflineQueue?: boolean;
|
1710 | enableReadyCheck?: boolean;
|
1711 | scaleReads?: string;
|
1712 | maxRedirections?: number;
|
1713 | retryDelayOnFailover?: number;
|
1714 | retryDelayOnClusterDown?: number;
|
1715 | retryDelayOnTryAgain?: number;
|
1716 | slotsRefreshTimeout?: number;
|
1717 | slotsRefreshInterval?: number;
|
1718 | redisOptions?: RedisOptions;
|
1719 | lazyConnect?: boolean;
|
1720 | dnsLookup?: DNSLookupFunction;
|
1721 | natMap?: NatMap;
|
1722 | }
|
1723 |
|
1724 | interface MultiOptions {
|
1725 | pipeline: boolean;
|
1726 | }
|
1727 | }
|