koatty_store 1.4.10 → 1.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,57 +1,866 @@
1
- import { MemoryStore } from "./memory";
2
- import { RedisStore } from "./redis";
3
- export { RedisStore, RedisStoreOptions } from "./redis";
4
- export { MemoryStore, MemoryStoreOptions } from "./memory";
5
- /**
6
- *
7
- *
8
- * @export
9
- * @interface StoreOptions
10
- */
11
- export interface StoreOptions {
12
- type: string;
13
- key_prefix: string;
14
- host: string | Array<string>;
15
- port?: number | Array<number>;
16
- name?: string;
17
- username?: string;
18
- password?: string;
19
- db?: number;
20
- timeout?: number;
21
- pool_size?: number;
22
- conn_timeout?: number;
23
- }
24
- /**
25
- * CacheStore interface
26
- *
27
- * @export
28
- * @interface CacheStore
29
- */
30
- export interface CacheStore {
31
- client: any;
32
- getConnection(): any;
33
- close(): Promise<void>;
34
- release(conn: any): Promise<void>;
35
- get(name: string): Promise<any>;
36
- set(name: string, value: string | number, timeout?: number): Promise<any>;
37
- del(name: string): Promise<any>;
38
- defineCommand(name: string, scripts: any): any;
39
- getCompare(name: string, value: string | number): Promise<any>;
40
- }
41
- /**
42
- *
43
- *
44
- * @export
45
- * @class Store
46
- */
47
- export declare class Store {
48
- private static instance;
49
- /**
50
- *
51
- *
52
- * @static
53
- * @returns
54
- * @memberof ValidateUtil
55
- */
56
- static getInstance(options: StoreOptions): MemoryStore | RedisStore;
57
- }
1
+ /*!
2
+ * @Author: richen
3
+ * @Date: 2022-05-27 10:34:41
4
+ * @License: BSD (3-Clause)
5
+ * @Copyright (c) - <richenlin(at)gmail.com>
6
+ * @HomePage: https://koatty.org/
7
+ */
8
+ /// <reference types="node" />
9
+
10
+ import { EventEmitter } from 'events';
11
+
12
+ /**
13
+ *
14
+ *
15
+ * @export
16
+ * @class Store
17
+ */
18
+ export declare class CacheStore {
19
+ client: any;
20
+ pool: any;
21
+ options: StoreOptions;
22
+ /**
23
+ * Creates an instance of CacheStore.
24
+ * @param {StoreOptions} options
25
+ * @memberof CacheStore
26
+ */
27
+ constructor(options: StoreOptions);
28
+ getConnection(): void;
29
+ close(): Promise<void>;
30
+ release(conn: any): Promise<void>;
31
+ defineCommand(name: string, scripts: any): void;
32
+ getCompare(name: string, value: string | number): Promise<any>;
33
+ /**
34
+ * handler for native client
35
+ *
36
+ * @param {string} name
37
+ * @param {any[]} data
38
+ * @returns {*}
39
+ * @memberof RedisStore
40
+ */
41
+ /**
42
+ * 字符串获取
43
+ * @param name
44
+ */
45
+ get(name: string): Promise<any>;
46
+ /**
47
+ * 字符串写入
48
+ * @param name
49
+ * @param value
50
+ * @param timeout
51
+ * @returns {Promise}
52
+ */
53
+ set(name: string, value: string | number, timeout?: number): Promise<any>;
54
+ /**
55
+ * 以秒为单位,返回给定 key 的剩余生存时间
56
+ * @param name
57
+ * @returns {*}
58
+ */
59
+ ttl(name: string): Promise<any>;
60
+ /**
61
+ * 设置key超时属性
62
+ * @param name
63
+ * @param timeout
64
+ */
65
+ expire(name: string, timeout?: number): Promise<any>;
66
+ /**
67
+ * 删除key
68
+ * @param name
69
+ */
70
+ rm(name: string): Promise<any>;
71
+ /**
72
+ *
73
+ *
74
+ * @param {*} name
75
+ * @returns
76
+ */
77
+ del(name: string): Promise<any>;
78
+ /**
79
+ * 判断key是否存在
80
+ * @param name
81
+ */
82
+ exists(name: string): Promise<any>;
83
+ /**
84
+ * 自增
85
+ * @param name
86
+ */
87
+ incr(name: string): Promise<any>;
88
+ /**
89
+ * 自减
90
+ * @param name
91
+ * @returns {*}
92
+ */
93
+ decr(name: string): Promise<any>;
94
+ /**
95
+ * 将 key 所储存的值增加增量
96
+ * @param name
97
+ * @param incr
98
+ * @returns {*}
99
+ */
100
+ incrby(name: string, incr?: number): Promise<any>;
101
+ /**
102
+ * 将 key 所储存的值减去减量
103
+ *
104
+ * @param {any} name
105
+ * @param {any} decr
106
+ */
107
+ decrby(name: string, decr?: number): Promise<any>;
108
+ /**
109
+ * 哈希写入
110
+ * @param name
111
+ * @param key
112
+ * @param value
113
+ * @param timeout
114
+ */
115
+ hset(name: string, key: string, value: string | number, timeout?: number): Promise<any[]>;
116
+ /**
117
+ * 哈希获取
118
+ * @param name
119
+ * @param key
120
+ * @returns {*}
121
+ */
122
+ hget(name: string, key: string): Promise<any>;
123
+ /**
124
+ * 查看哈希表 hashKey 中,给定域 key 是否存在
125
+ * @param name
126
+ * @param key
127
+ * @returns {*}
128
+ */
129
+ hexists(name: string, key: string): Promise<any>;
130
+ /**
131
+ * 哈希删除
132
+ * @param name
133
+ * @param key
134
+ * @returns {*}
135
+ */
136
+ hdel(name: string, key: string): Promise<any[]>;
137
+ /**
138
+ * 返回哈希表 key 中域的数量
139
+ * @param name
140
+ * @returns {*}
141
+ */
142
+ hlen(name: string): Promise<any>;
143
+ /**
144
+ * 给哈希表指定key,增加increment
145
+ * @param name
146
+ * @param key
147
+ * @param incr
148
+ * @returns {*}
149
+ */
150
+ hincrby(name: string, key: string, incr?: number): Promise<any>;
151
+ /**
152
+ * 返回哈希表所有key-value
153
+ * @param name
154
+ * @returns {*}
155
+ */
156
+ hgetall(name: string): Promise<any>;
157
+ /**
158
+ * 返回哈希表所有key
159
+ * @param name
160
+ * @returns {*}
161
+ */
162
+ hkeys(name: string): Promise<any>;
163
+ /**
164
+ * 返回哈希表所有value
165
+ * @param name
166
+ * @returns {*}
167
+ */
168
+ hvals(name: string): Promise<any>;
169
+ /**
170
+ * 判断列表长度,若不存在则表示为空
171
+ * @param name
172
+ * @returns {*}
173
+ */
174
+ llen(name: string): Promise<any>;
175
+ /**
176
+ * 将值插入列表表尾
177
+ * @param name
178
+ * @param value
179
+ * @returns {*}
180
+ */
181
+ rpush(name: string, value: string | number): Promise<any>;
182
+ /**
183
+ *
184
+ *
185
+ * @param {string} name
186
+ * @param {(string | number)} value
187
+ * @returns {*}
188
+ * @memberof RedisStore
189
+ */
190
+ lpush(name: string, value: string | number): Promise<any>;
191
+ /**
192
+ * 将列表表头取出,并去除
193
+ * @param name
194
+ * @returns {*}
195
+ */
196
+ lpop(name: string): Promise<any>;
197
+ /**
198
+ *
199
+ *
200
+ * @param {string} name
201
+ * @returns {*}
202
+ * @memberof RedisStore
203
+ */
204
+ rpop(name: string): Promise<any>;
205
+ /**
206
+ * 返回列表 key 中指定区间内的元素,区间以偏移量 start 和 stop 指定
207
+ * @param name
208
+ * @param start
209
+ * @param stop
210
+ * @returns {*}
211
+ */
212
+ lrange(name: string, start: number, stop: number): Promise<any>;
213
+ /**
214
+ * 集合新增
215
+ * @param name
216
+ * @param value
217
+ * @param timeout
218
+ * @returns {*}
219
+ */
220
+ sadd(name: string, value: string | number, timeout?: number): Promise<any[]>;
221
+ /**
222
+ * 返回集合的基数(集合中元素的数量)
223
+ * @param name
224
+ * @returns {*}
225
+ */
226
+ scard(name: string): Promise<any>;
227
+ /**
228
+ * 判断 member 元素是否集合的成员
229
+ * @param name
230
+ * @param key
231
+ * @returns {*}
232
+ */
233
+ sismember(name: string, key: string): Promise<any>;
234
+ /**
235
+ * 返回集合中的所有成员
236
+ * @param name
237
+ * @returns {*}
238
+ */
239
+ smembers(name: string): Promise<any>;
240
+ /**
241
+ * 移除并返回集合中的一个随机元素
242
+ * @param name
243
+ * @returns {*}
244
+ */
245
+ spop(name: string): Promise<any>;
246
+ /**
247
+ * 移除集合 key 中的一个 member 元素
248
+ * @param name
249
+ * @param key
250
+ * @returns {*}
251
+ */
252
+ srem(name: string, key: string): Promise<any>;
253
+ /**
254
+ * 将 member 元素从 source 集合移动到 destination 集合
255
+ * @param source
256
+ * @param destination
257
+ * @param member
258
+ * @returns {*}
259
+ */
260
+ smove(source: string, destination: string, member: string): Promise<any>;
261
+ }
262
+
263
+ declare class MemoryCache extends EventEmitter {
264
+ options: MemoryCacheOptions;
265
+ currentDBIndex: number;
266
+ connected: boolean;
267
+ lastSave: number;
268
+ multiMode: boolean;
269
+ /**
270
+ * Creates an instance of MemoryCache.
271
+ * @param {*} options
272
+ * @memberof MemoryCache
273
+ */
274
+ constructor(options: MemoryCacheOptions);
275
+ /**
276
+ *
277
+ *
278
+ * @returns {*}
279
+ * @memberof MemoryCache
280
+ */
281
+ createClient(): this;
282
+ /**
283
+ *
284
+ *
285
+ * @returns {*}
286
+ * @memberof MemoryCache
287
+ */
288
+ quit(): this;
289
+ /**
290
+ *
291
+ *
292
+ * @returns {*}
293
+ * @memberof MemoryCache
294
+ */
295
+ end(): this;
296
+ /**
297
+ *
298
+ *
299
+ * @param {string} message
300
+ * @param {Function} [callback]
301
+ * @returns {*}
302
+ * @memberof MemoryCache
303
+ */
304
+ echo(message: string, callback?: Function): any;
305
+ /**
306
+ *
307
+ *
308
+ * @param {string} message
309
+ * @param {Function} [callback]
310
+ * @returns {*}
311
+ * @memberof MemoryCache
312
+ */
313
+ ping(message: string, callback?: Function): any;
314
+ /**
315
+ *
316
+ *
317
+ * @param {string} password
318
+ * @param {Function} [callback]
319
+ * @returns {*}
320
+ * @memberof MemoryCache
321
+ */
322
+ auth(password: string, callback?: Function): any;
323
+ /**
324
+ *
325
+ *
326
+ * @param {number} dbIndex
327
+ * @param {Function} [callback]
328
+ * @returns {*}
329
+ * @memberof MemoryCache
330
+ */
331
+ select(dbIndex: number, callback?: Function): any;
332
+ get(key: string, callback?: Function): any;
333
+ /**
334
+ * set(key, value, ttl, pttl, notexist, onlyexist, callback)
335
+ *
336
+ * @param {string} key
337
+ * @param {(string | number)} value
338
+ * @param {...any[]} params
339
+ * @returns {*}
340
+ * @memberof MemoryCache
341
+ */
342
+ set(key: string, value: string | number, ...params: any[]): any;
343
+ /**
344
+ *
345
+ *
346
+ * @param {string} key
347
+ * @param {Function} [callback]
348
+ * @returns {*}
349
+ * @memberof MemoryCache
350
+ */
351
+ ttl(key: string, callback?: Function): any;
352
+ /**
353
+ *
354
+ *
355
+ * @param {string} key
356
+ * @param {number} seconds
357
+ * @param {Function} [callback]
358
+ * @returns {*}
359
+ * @memberof MemoryCache
360
+ */
361
+ expire(key: string, seconds: number, callback?: Function): any;
362
+ /**
363
+ *
364
+ *
365
+ * @param {...any[]} keys
366
+ * @returns {*}
367
+ * @memberof MemoryCache
368
+ */
369
+ del(...keys: any[]): any;
370
+ /**
371
+ *
372
+ *
373
+ * @param {...any[]} keys
374
+ * @returns {*}
375
+ * @memberof MemoryCache
376
+ */
377
+ exists(...keys: any[]): any;
378
+ /**
379
+ *
380
+ *
381
+ * @param {string} key
382
+ * @param {Function} [callback]
383
+ * @returns {*}
384
+ * @memberof MemoryCache
385
+ */
386
+ incr(key: string, callback?: Function): any;
387
+ /**
388
+ *
389
+ *
390
+ * @param {string} key
391
+ * @param {number} amount
392
+ * @param {Function} [callback]
393
+ * @returns {*}
394
+ * @memberof MemoryCache
395
+ */
396
+ incrby(key: string, amount: number, callback?: Function): any;
397
+ /**
398
+ *
399
+ *
400
+ * @param {string} key
401
+ * @param {Function} [callback]
402
+ * @returns {*}
403
+ * @memberof MemoryCache
404
+ */
405
+ decr(key: string, callback?: Function): any;
406
+ /**
407
+ *
408
+ *
409
+ * @param {string} key
410
+ * @param {number} amount
411
+ * @param {Function} [callback]
412
+ * @returns {*}
413
+ * @memberof MemoryCache
414
+ */
415
+ decrby(key: string, amount: number, callback?: Function): any;
416
+ hset(key: string, field: string, value: string | number, callback?: Function): any;
417
+ /**
418
+ *
419
+ *
420
+ * @param {string} key
421
+ * @param {string} field
422
+ * @param {Function} [callback]
423
+ * @returns {*}
424
+ * @memberof MemoryCache
425
+ */
426
+ hget(key: string, field: string, callback?: Function): any;
427
+ /**
428
+ *
429
+ *
430
+ * @param {string} key
431
+ * @param {string} field
432
+ * @param {Function} [callback]
433
+ * @returns {*}
434
+ * @memberof MemoryCache
435
+ */
436
+ hexists(key: string, field: string, callback?: Function): any;
437
+ /**
438
+ *
439
+ *
440
+ * @param {string} key
441
+ * @param {...any[]} fields
442
+ * @returns {*}
443
+ * @memberof MemoryCache
444
+ */
445
+ hdel(key: string, ...fields: any[]): any;
446
+ /**
447
+ *
448
+ *
449
+ * @param {string} key
450
+ * @param {Function} [callback]
451
+ * @returns {*}
452
+ * @memberof MemoryCache
453
+ */
454
+ hlen(key: string, callback?: Function): any;
455
+ /**
456
+ *
457
+ *
458
+ * @param {string} key
459
+ * @param {string} field
460
+ * @param {*} value
461
+ * @param {Function} [callback]
462
+ * @returns {*}
463
+ * @memberof MemoryCache
464
+ */
465
+ hincrby(key: string, field: string, value: any, callback?: Function): any;
466
+ /**
467
+ *
468
+ *
469
+ * @param {string} key
470
+ * @param {Function} [callback]
471
+ * @returns {*}
472
+ * @memberof MemoryCache
473
+ */
474
+ hgetall(key: string, callback?: Function): any;
475
+ /**
476
+ *
477
+ *
478
+ * @param {string} key
479
+ * @param {Function} [callback]
480
+ * @returns {*}
481
+ * @memberof MemoryCache
482
+ */
483
+ hkeys(key: string, callback?: Function): any;
484
+ /**
485
+ *
486
+ *
487
+ * @param {string} key
488
+ * @param {Function} [callback]
489
+ * @returns {*}
490
+ * @memberof MemoryCache
491
+ */
492
+ hvals(key: string, callback?: Function): any;
493
+ /**
494
+ *
495
+ *
496
+ * @param {string} key
497
+ * @param {Function} [callback]
498
+ * @returns {*}
499
+ * @memberof MemoryCache
500
+ */
501
+ llen(key: string, callback?: Function): any;
502
+ /**
503
+ *
504
+ *
505
+ * @param {string} key
506
+ * @param {(string | number)} value
507
+ * @param {Function} [callback]
508
+ * @returns {*}
509
+ * @memberof MemoryCache
510
+ */
511
+ rpush(key: string, value: string | number, callback?: Function): any;
512
+ /**
513
+ *
514
+ *
515
+ * @param {string} key
516
+ * @param {(string | number)} value
517
+ * @param {Function} [callback]
518
+ * @returns {*}
519
+ * @memberof MemoryCache
520
+ */
521
+ lpush(key: string, value: string | number, callback?: Function): any;
522
+ /**
523
+ *
524
+ *
525
+ * @param {string} key
526
+ * @param {Function} [callback]
527
+ * @returns {*}
528
+ * @memberof MemoryCache
529
+ */
530
+ lpop(key: string, callback?: Function): any;
531
+ /**
532
+ *
533
+ *
534
+ * @param {string} key
535
+ * @param {Function} [callback]
536
+ * @returns {*}
537
+ * @memberof MemoryCache
538
+ */
539
+ rpop(key: string, callback?: Function): any;
540
+ /**
541
+ *
542
+ *
543
+ * @param {string} key
544
+ * @param {number} start
545
+ * @param {number} stop
546
+ * @param {Function} [callback]
547
+ * @returns {*}
548
+ * @memberof MemoryCache
549
+ */
550
+ lrange(key: string, start: number, stop: number, callback?: Function): any;
551
+ /**
552
+ *
553
+ *
554
+ * @param {string} key
555
+ * @param {...any[]} members
556
+ * @returns {*}
557
+ * @memberof MemoryCache
558
+ */
559
+ sadd(key: string, ...members: string[]): any;
560
+ /**
561
+ *
562
+ *
563
+ * @param {string} key
564
+ * @param {Function} [callback]
565
+ * @returns {*}
566
+ * @memberof MemoryCache
567
+ */
568
+ scard(key: string, callback?: Function): any;
569
+ /**
570
+ *
571
+ *
572
+ * @param {string} key
573
+ * @param {string} member
574
+ * @param {Function} [callback]
575
+ * @returns {*}
576
+ * @memberof MemoryCache
577
+ */
578
+ sismember(key: string, member: string, callback?: Function): any;
579
+ /**
580
+ *
581
+ *
582
+ * @param {string} key
583
+ * @param {Function} [callback]
584
+ * @returns {*}
585
+ * @memberof MemoryCache
586
+ */
587
+ smembers(key: string, callback?: Function): any;
588
+ /**
589
+ *
590
+ *
591
+ * @param {string} key
592
+ * @param {number} [count]
593
+ * @param {Function} [callback]
594
+ * @returns {*}
595
+ * @memberof MemoryCache
596
+ */
597
+ spop(key: string, count?: number, callback?: Function): any;
598
+ /**
599
+ *
600
+ *
601
+ * @param {string} key
602
+ * @param {...any[]} members
603
+ * @returns {*}
604
+ * @memberof MemoryCache
605
+ */
606
+ srem(key: string, ...members: any[]): any;
607
+ /**
608
+ *
609
+ *
610
+ * @param {string} sourcekey
611
+ * @param {string} destkey
612
+ * @param {string} member
613
+ * @param {Function} [callback]
614
+ * @returns {*}
615
+ * @memberof MemoryCache
616
+ */
617
+ smove(sourcekey: string, destkey: string, member: string, callback?: Function): any;
618
+ discard(callback?: Function, silent?: boolean): any;
619
+ /**
620
+ *
621
+ *
622
+ * @param {string} key
623
+ * @param {Function} [callback]
624
+ * @returns {*}
625
+ * @memberof MemoryCache
626
+ */
627
+ /**
628
+ *
629
+ *
630
+ * @private
631
+ * @param {string} key
632
+ * @param {Function} [callback]
633
+ * @returns {*}
634
+ * @memberof MemoryCache
635
+ */
636
+ /**
637
+ *
638
+ *
639
+ * @private
640
+ * @param {string} key
641
+ * @returns {*} {boolean}
642
+ * @memberof MemoryCache
643
+ */
644
+ /**
645
+ *
646
+ *
647
+ * @private
648
+ * @param {*} value
649
+ * @param {string} type
650
+ * @param {number} timeout
651
+ * @returns {*}
652
+ * @memberof MemoryCache
653
+ */
654
+ /**
655
+ *
656
+ *
657
+ * @private
658
+ * @param {string} key
659
+ * @returns {*}
660
+ * @memberof MemoryCache
661
+ */
662
+ /**
663
+ *
664
+ *
665
+ * @private
666
+ * @param {string} key
667
+ * @param {number} amount
668
+ * @param {Function} [callback]
669
+ * @returns {*}
670
+ * @memberof MemoryCache
671
+ */
672
+ /**
673
+ *
674
+ *
675
+ * @private
676
+ * @param {string} key
677
+ * @param {string} type
678
+ * @param {boolean} [throwError]
679
+ * @param {Function} [callback]
680
+ * @returns {*}
681
+ * @memberof MemoryCache
682
+ */
683
+ /**
684
+ *
685
+ *
686
+ * @private
687
+ * @param {string} key
688
+ * @returns {*}
689
+ * @memberof MemoryCache
690
+ */
691
+ /**
692
+ *
693
+ *
694
+ * @private
695
+ * @param {string} key
696
+ * @param {(number | string)} value
697
+ * @memberof MemoryCache
698
+ */
699
+ /**
700
+ *
701
+ *
702
+ * @private
703
+ * @param {string} key
704
+ * @param {string} field
705
+ * @param {number} [amount]
706
+ * @param {boolean} [useFloat]
707
+ * @param {Function} [callback]
708
+ * @returns {*}
709
+ * @memberof MemoryCache
710
+ */
711
+ /**
712
+ *
713
+ *
714
+ * @private
715
+ * @param {string} key
716
+ * @param {string} field
717
+ * @returns {*}
718
+ * @memberof MemoryCache
719
+ */
720
+ /**
721
+ *
722
+ *
723
+ * @private
724
+ * @param {string} key
725
+ * @param {string} field
726
+ * @returns {*} {boolean}
727
+ * @memberof MemoryCache
728
+ */
729
+ /**
730
+ *
731
+ *
732
+ * @param {string} key
733
+ * @param {string} field
734
+ * @param {*} value
735
+ * @memberof MemoryCache
736
+ */
737
+ _setField(key: string, field: string, value: any): void;
738
+ /**
739
+ *
740
+ *
741
+ * @private
742
+ * @param {Function} [callback]
743
+ * @param {(any)} [message]
744
+ * @param {*} [error]
745
+ * @param {boolean} [nolog]
746
+ * @returns {*}
747
+ * @memberof MemoryCache
748
+ */
749
+ /**
750
+ *
751
+ *
752
+ * @private
753
+ * @param {any[]} [params]
754
+ * @returns {*}
755
+ * @memberof MemoryCache
756
+ */
757
+ }
758
+
759
+ /**
760
+ *
761
+ *
762
+ * @interface MemoryCacheOptions
763
+ */
764
+ declare interface MemoryCacheOptions {
765
+ database: number;
766
+ }
767
+
768
+ export declare class MemoryStore extends CacheStore {
769
+ client: any;
770
+ pool: any;
771
+ options: StoreOptions;
772
+ /**
773
+ * Creates an instance of MemoryStore.
774
+ * @param {StoreOptions} options
775
+ * @memberof MemoryStore
776
+ */
777
+ constructor(options: StoreOptions);
778
+ /**
779
+ * getConnection
780
+ *
781
+ * @returns {*}
782
+ * @memberof MemoryStore
783
+ */
784
+ getConnection(): MemoryCache;
785
+ /**
786
+ * close
787
+ *
788
+ * @returns {*} {Promise<void>}
789
+ * @memberof MemoryStore
790
+ */
791
+ close(): Promise<void>;
792
+ /**
793
+ * release
794
+ *
795
+ * @param {*} conn
796
+ * @returns {*} {Promise<void>}
797
+ * @memberof MemoryStore
798
+ */
799
+ release(conn: any): Promise<void>;
800
+ /**
801
+ * defineCommand
802
+ *
803
+ * @param {string} name
804
+ * @param {*} scripts
805
+ * @memberof MemoryStore
806
+ */
807
+ defineCommand(name: string, scripts: any): Promise<void>;
808
+ /**
809
+ * get and compare value
810
+ *
811
+ * @param {string} name
812
+ * @param {(string | number)} value
813
+ * @returns {*} {Promise<any>}
814
+ * @memberof MemoryStore
815
+ */
816
+ getCompare(name: string, value: string | number): Promise<any>;
817
+ }
818
+
819
+ /**
820
+ *
821
+ *
822
+ * @export
823
+ * @class Store
824
+ */
825
+ export declare class Store {
826
+ /**
827
+ *
828
+ *
829
+ * @static
830
+ * @returns
831
+ * @memberof ValidateUtil
832
+ */
833
+ static getInstance(options: StoreOptions): CacheStore;
834
+ }
835
+
836
+ /**
837
+ *
838
+ *
839
+ * @export
840
+ * @interface StoreOptions
841
+ */
842
+ export declare interface StoreOptions {
843
+ type?: string;
844
+ keyPrefix?: string;
845
+ host?: string | Array<string>;
846
+ port?: number | Array<number>;
847
+ username?: string;
848
+ password?: string;
849
+ db?: number;
850
+ timeout?: number;
851
+ poolSize?: number;
852
+ connectTimeout?: number;
853
+ name?: string;
854
+ sentinelUsername?: string;
855
+ sentinelPassword?: string;
856
+ sentinels?: Array<{
857
+ host: string;
858
+ port: number;
859
+ }>;
860
+ clusters?: Array<{
861
+ host: string;
862
+ port: number;
863
+ }>;
864
+ }
865
+
866
+ export { }