@upstash/redis 0.1.22 → 0.2.0

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.
Files changed (55) hide show
  1. package/README.md +13 -53
  2. package/dist/main/client.d.ts +21 -0
  3. package/dist/main/client.js +556 -0
  4. package/dist/main/index-cjs.d.ts +1 -0
  5. package/dist/main/index-cjs.js +120 -0
  6. package/dist/main/types.d.ts +177 -0
  7. package/dist/main/{src/type.js → types.js} +0 -1
  8. package/dist/module/client.d.ts +21 -0
  9. package/dist/module/client.js +551 -0
  10. package/dist/module/index.d.ts +3 -0
  11. package/dist/module/index.js +3 -0
  12. package/dist/module/types.d.ts +177 -0
  13. package/dist/module/types.js +1 -0
  14. package/package.json +16 -25
  15. package/src/client.ts +307 -921
  16. package/src/index-cjs.ts +117 -0
  17. package/src/index.ts +4 -119
  18. package/src/types.ts +408 -0
  19. package/tsconfig.json +9 -7
  20. package/tsconfig.module.json +3 -2
  21. package/dist/main/src/client.d.ts +0 -25
  22. package/dist/main/src/client.d.ts.map +0 -1
  23. package/dist/main/src/client.js +0 -748
  24. package/dist/main/src/client.js.map +0 -1
  25. package/dist/main/src/index.d.ts +0 -73
  26. package/dist/main/src/index.d.ts.map +0 -1
  27. package/dist/main/src/index.js +0 -124
  28. package/dist/main/src/index.js.map +0 -1
  29. package/dist/main/src/type.d.ts +0 -466
  30. package/dist/main/src/type.d.ts.map +0 -1
  31. package/dist/main/src/type.js.map +0 -1
  32. package/dist/main/utils/helper.d.ts +0 -5
  33. package/dist/main/utils/helper.d.ts.map +0 -1
  34. package/dist/main/utils/helper.js +0 -20
  35. package/dist/main/utils/helper.js.map +0 -1
  36. package/dist/module/src/client.d.ts +0 -25
  37. package/dist/module/src/client.d.ts.map +0 -1
  38. package/dist/module/src/client.js +0 -743
  39. package/dist/module/src/client.js.map +0 -1
  40. package/dist/module/src/index.d.ts +0 -73
  41. package/dist/module/src/index.d.ts.map +0 -1
  42. package/dist/module/src/index.js +0 -5
  43. package/dist/module/src/index.js.map +0 -1
  44. package/dist/module/src/type.d.ts +0 -466
  45. package/dist/module/src/type.d.ts.map +0 -1
  46. package/dist/module/src/type.js +0 -2
  47. package/dist/module/src/type.js.map +0 -1
  48. package/dist/module/utils/helper.d.ts +0 -5
  49. package/dist/module/utils/helper.d.ts.map +0 -1
  50. package/dist/module/utils/helper.js +0 -13
  51. package/dist/module/utils/helper.js.map +0 -1
  52. package/dist/umd/upstash-redis.js +0 -1
  53. package/src/type.ts +0 -1194
  54. package/utils/helper.ts +0 -17
  55. package/webpack.config.js +0 -34
@@ -0,0 +1,117 @@
1
+ import upstash from './client';
2
+
3
+ const redis = upstash();
4
+
5
+ module.exports = upstash;
6
+ module.exports.auth = redis.auth;
7
+ module.exports.append = redis.append;
8
+ module.exports.decr = redis.decr;
9
+ module.exports.decrby = redis.decrby;
10
+ module.exports.get = redis.get;
11
+ module.exports.getrange = redis.getrange;
12
+ module.exports.getset = redis.getset;
13
+ module.exports.incr = redis.incr;
14
+ module.exports.incrby = redis.incrby;
15
+ module.exports.incrbyfloat = redis.incrbyfloat;
16
+ module.exports.mget = redis.mget;
17
+ module.exports.mset = redis.mset;
18
+ module.exports.msetnx = redis.msetnx;
19
+ module.exports.psetex = redis.psetex;
20
+ module.exports.set = redis.set;
21
+ module.exports.setex = redis.setex;
22
+ module.exports.setnx = redis.setnx;
23
+ module.exports.setrange = redis.setrange;
24
+ module.exports.strlen = redis.strlen;
25
+ module.exports.bitcount = redis.bitcount;
26
+ module.exports.bitop = redis.bitop;
27
+ module.exports.bitpos = redis.bitpos;
28
+ module.exports.getbit = redis.getbit;
29
+ module.exports.setbit = redis.setbit;
30
+ module.exports.echo = redis.echo;
31
+ module.exports.ping = redis.ping;
32
+ module.exports.hdel = redis.hdel;
33
+ module.exports.hexists = redis.hexists;
34
+ module.exports.hget = redis.hget;
35
+ module.exports.hgetall = redis.hgetall;
36
+ module.exports.hincrby = redis.hincrby;
37
+ module.exports.hincrbyfloat = redis.hincrbyfloat;
38
+ module.exports.hkeys = redis.hkeys;
39
+ module.exports.hlen = redis.hlen;
40
+ module.exports.hmget = redis.hmget;
41
+ module.exports.hmset = redis.hmset;
42
+ module.exports.hscan = redis.hscan;
43
+ module.exports.hset = redis.hset;
44
+ module.exports.hsetnx = redis.hsetnx;
45
+ module.exports.hvals = redis.hvals;
46
+ module.exports.del = redis.del;
47
+ module.exports.exists = redis.exists;
48
+ module.exports.expire = redis.expire;
49
+ module.exports.expireat = redis.expireat;
50
+ module.exports.keys = redis.keys;
51
+ module.exports.persist = redis.persist;
52
+ module.exports.pexpire = redis.pexpire;
53
+ module.exports.pexpireat = redis.pexpireat;
54
+ module.exports.pttl = redis.pttl;
55
+ module.exports.randomkey = redis.randomkey;
56
+ module.exports.rename = redis.rename;
57
+ module.exports.renamenx = redis.renamenx;
58
+ module.exports.scan = redis.scan;
59
+ module.exports.touch = redis.touch;
60
+ module.exports.ttl = redis.ttl;
61
+ module.exports.type = redis.type;
62
+ module.exports.unlink = redis.unlink;
63
+ module.exports.lindex = redis.lindex;
64
+ module.exports.linsert = redis.linsert;
65
+ module.exports.llen = redis.llen;
66
+ module.exports.lpop = redis.lpop;
67
+ module.exports.lpush = redis.lpush;
68
+ module.exports.lpushx = redis.lpushx;
69
+ module.exports.lrange = redis.lrange;
70
+ module.exports.lrem = redis.lrem;
71
+ module.exports.lset = redis.lset;
72
+ module.exports.ltrim = redis.ltrim;
73
+ module.exports.rpop = redis.rpop;
74
+ module.exports.rpoplpush = redis.rpoplpush;
75
+ module.exports.rpush = redis.rpush;
76
+ module.exports.rpushx = redis.rpushx;
77
+ module.exports.dbsize = redis.dbsize;
78
+ module.exports.flushall = redis.flushall;
79
+ module.exports.flushdb = redis.flushdb;
80
+ module.exports.info = redis.info;
81
+ module.exports.time = redis.time;
82
+ module.exports.sadd = redis.sadd;
83
+ module.exports.scard = redis.scard;
84
+ module.exports.sdiff = redis.sdiff;
85
+ module.exports.sdiffstore = redis.sdiffstore;
86
+ module.exports.sinter = redis.sinter;
87
+ module.exports.sinterstore = redis.sinterstore;
88
+ module.exports.sismember = redis.sismember;
89
+ module.exports.smembers = redis.smembers;
90
+ module.exports.smove = redis.smove;
91
+ module.exports.spop = redis.spop;
92
+ module.exports.srandmember = redis.srandmember;
93
+ module.exports.srem = redis.srem;
94
+ module.exports.sunion = redis.sunion;
95
+ module.exports.sunionstore = redis.sunionstore;
96
+ module.exports.zadd = redis.zadd;
97
+ module.exports.zcard = redis.zcard;
98
+ module.exports.zcount = redis.zcount;
99
+ module.exports.zincrby = redis.zincrby;
100
+ module.exports.zinterstore = redis.zinterstore;
101
+ module.exports.zlexcount = redis.zlexcount;
102
+ module.exports.zpopmax = redis.zpopmax;
103
+ module.exports.zpopmin = redis.zpopmin;
104
+ module.exports.zrange = redis.zrange;
105
+ module.exports.zrangebylex = redis.zrangebylex;
106
+ module.exports.zrangebyscore = redis.zrangebyscore;
107
+ module.exports.zrank = redis.zrank;
108
+ module.exports.zrem = redis.zrem;
109
+ module.exports.zremrangebylex = redis.zremrangebylex;
110
+ module.exports.zremrangebyrank = redis.zremrangebyrank;
111
+ module.exports.zremrangebyscore = redis.zremrangebyscore;
112
+ module.exports.zrevrange = redis.zrevrange;
113
+ module.exports.zrevrangebylex = redis.zrevrangebylex;
114
+ module.exports.zrevrangebyscore = redis.zrevrangebyscore;
115
+ module.exports.zrevrank = redis.zrevrank;
116
+ module.exports.zscore = redis.zscore;
117
+ module.exports.zunionstore = redis.zunionstore;
package/src/index.ts CHANGED
@@ -1,8 +1,8 @@
1
- import Upstash from './client';
1
+ import upstash from './client';
2
2
 
3
- export default Upstash;
3
+ export default upstash;
4
4
 
5
- const {
5
+ export const {
6
6
  auth,
7
7
  append,
8
8
  decr,
@@ -115,119 +115,4 @@ const {
115
115
  zrevrank,
116
116
  zscore,
117
117
  zunionstore,
118
- } = Upstash();
119
-
120
- export {
121
- auth,
122
- append,
123
- decr,
124
- decrby,
125
- get,
126
- getrange,
127
- getset,
128
- incr,
129
- incrby,
130
- incrbyfloat,
131
- mget,
132
- mset,
133
- msetnx,
134
- psetex,
135
- set,
136
- setex,
137
- setnx,
138
- setrange,
139
- strlen,
140
- bitcount,
141
- bitop,
142
- bitpos,
143
- getbit,
144
- setbit,
145
- echo,
146
- ping,
147
- hdel,
148
- hexists,
149
- hget,
150
- hgetall,
151
- hincrby,
152
- hincrbyfloat,
153
- hkeys,
154
- hlen,
155
- hmget,
156
- hmset,
157
- hscan,
158
- hset,
159
- hsetnx,
160
- hvals,
161
- del,
162
- exists,
163
- expire,
164
- expireat,
165
- keys,
166
- persist,
167
- pexpire,
168
- pexpireat,
169
- pttl,
170
- randomkey,
171
- rename,
172
- renamenx,
173
- scan,
174
- touch,
175
- ttl,
176
- type,
177
- unlink,
178
- lindex,
179
- linsert,
180
- llen,
181
- lpop,
182
- lpush,
183
- lpushx,
184
- lrange,
185
- lrem,
186
- lset,
187
- ltrim,
188
- rpop,
189
- rpoplpush,
190
- rpush,
191
- rpushx,
192
- dbsize,
193
- flushall,
194
- flushdb,
195
- info,
196
- time,
197
- sadd,
198
- scard,
199
- sdiff,
200
- sdiffstore,
201
- sinter,
202
- sinterstore,
203
- sismember,
204
- smembers,
205
- smove,
206
- spop,
207
- srandmember,
208
- srem,
209
- sunion,
210
- sunionstore,
211
- zadd,
212
- zcard,
213
- zcount,
214
- zincrby,
215
- zinterstore,
216
- zlexcount,
217
- zpopmax,
218
- zpopmin,
219
- zrange,
220
- zrangebylex,
221
- zrangebyscore,
222
- zrank,
223
- zrem,
224
- zremrangebylex,
225
- zremrangebyrank,
226
- zremrangebyscore,
227
- zrevrange,
228
- zrevrangebylex,
229
- zrevrangebyscore,
230
- zrevrank,
231
- zscore,
232
- zunionstore,
233
- };
118
+ } = upstash();
package/src/types.ts ADDED
@@ -0,0 +1,408 @@
1
+ export type ClientObjectProps = {
2
+ url?: undefined | string;
3
+ token?: undefined | string;
4
+ requestOptions?: undefined | RequestInit;
5
+ };
6
+
7
+ export type ReturnType = {
8
+ data: string | number | [] | any;
9
+ error: string | null;
10
+ };
11
+
12
+ export type MethodReturn = Promise<ReturnType>;
13
+
14
+ export type Part = string | boolean | number;
15
+
16
+ export type Bit = 0 | 1;
17
+
18
+ export type Infinities = '+inf' | '-inf';
19
+
20
+ export type ZSetNumber = Infinities | number | string;
21
+
22
+ type Auth1 = (options?: ClientObjectProps) => void;
23
+ type Auth2 = (url?: string, token?: string) => void;
24
+ type Auth3 = (url?: string | ClientObjectProps, token?: string) => void;
25
+
26
+ type SET1 = (key: string, value: string | number) => MethodReturn;
27
+ type SET2 = (
28
+ key: string,
29
+ value: string | number,
30
+ timeType: 'EX' | 'PX',
31
+ time: number | string
32
+ ) => MethodReturn;
33
+
34
+ type BITCOUNT1 = (key: string) => MethodReturn;
35
+ type BITCOUNT2 = (
36
+ key: string,
37
+ start: number | string,
38
+ end: number | string
39
+ ) => MethodReturn;
40
+
41
+ type BITPOS1 = (key: string, bit: Bit) => MethodReturn;
42
+ type BITPOS2 = (key: string, bit: Bit, start: number) => MethodReturn;
43
+ type BITPOS3 = (
44
+ key: string,
45
+ bit: Bit,
46
+ start: number,
47
+ end: number
48
+ ) => MethodReturn;
49
+
50
+ type PING1 = () => MethodReturn;
51
+ type PING2 = (message: string) => MethodReturn;
52
+
53
+ type HSCAN1 = (key: string, cursor: number | string) => MethodReturn;
54
+ type HSCAN2 = (
55
+ key: string,
56
+ cursor: number | string,
57
+ match: 'MATCH',
58
+ pattern: string
59
+ ) => MethodReturn;
60
+ type HSCAN3 = (
61
+ key: string,
62
+ cursor: number | string,
63
+ count: 'COUNT',
64
+ value: number | string
65
+ ) => MethodReturn;
66
+ type HSCAN4 = (
67
+ key: string,
68
+ cursor: number | string,
69
+ match: 'MATCH',
70
+ pattern: string,
71
+ count: 'COUNT',
72
+ value: number | string
73
+ ) => MethodReturn;
74
+
75
+ type SCAN1 = (cursor: number | string) => MethodReturn;
76
+ type SCAN2 = (
77
+ cursor: number | string,
78
+ match: 'MATCH',
79
+ pattern: string
80
+ ) => MethodReturn;
81
+ type SCAN3 = (
82
+ cursor: number | string,
83
+ count: 'COUNT',
84
+ value: number | string
85
+ ) => MethodReturn;
86
+ type SCAN4 = (
87
+ cursor: number | string,
88
+ match: 'MATCH',
89
+ pattern: string,
90
+ count: 'COUNT',
91
+ value: number | string
92
+ ) => MethodReturn;
93
+
94
+ type FLUSHALL1 = () => MethodReturn;
95
+ type FLUSHALL2 = (mode: 'ASYNC') => MethodReturn;
96
+
97
+ type FLUSHDB1 = () => MethodReturn;
98
+ type FLUSHDB2 = (mode: 'ASYNC' | 'SYNC') => MethodReturn;
99
+
100
+ type INFO1 = () => MethodReturn;
101
+ type INFO2 = (section: string) => MethodReturn;
102
+
103
+ type SPOP1 = (key: string) => MethodReturn;
104
+ type SPOP2 = (key: string, count: number) => MethodReturn;
105
+
106
+ type SRANDMEMBER1 = (key: string) => MethodReturn;
107
+ type SRANDMEMBER2 = (key: string, count: number) => MethodReturn;
108
+
109
+ type ZPOPMAX1 = (key: string) => MethodReturn;
110
+ type ZPOPMAX2 = (key: string, count: number | string) => MethodReturn;
111
+
112
+ type ZRANGE1 = (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
113
+ type ZRANGE2 = (
114
+ key: string,
115
+ min: ZSetNumber,
116
+ max: ZSetNumber,
117
+ withscores: 'WITHSCORES'
118
+ ) => MethodReturn;
119
+
120
+ type ZRANGEBYLEX1 = (
121
+ key: string,
122
+ min: ZSetNumber,
123
+ max: ZSetNumber
124
+ ) => MethodReturn;
125
+ type ZRANGEBYLEX2 = (
126
+ key: string,
127
+ min: ZSetNumber,
128
+ max: ZSetNumber,
129
+ limit: 'LIMIT',
130
+ offset: number | string,
131
+ count: number | string
132
+ ) => MethodReturn;
133
+
134
+ type ZRANGEBYSCORE1 = (
135
+ key: string,
136
+ min: ZSetNumber,
137
+ max: ZSetNumber
138
+ ) => MethodReturn;
139
+ type ZRANGEBYSCORE2 = (
140
+ key: string,
141
+ min: ZSetNumber,
142
+ max: ZSetNumber,
143
+ withScores: 'WITHSCORES'
144
+ ) => MethodReturn;
145
+ type ZRANGEBYSCORE3 = (
146
+ key: string,
147
+ min: ZSetNumber,
148
+ max: ZSetNumber,
149
+ limit: 'LIMIT',
150
+ offset: number | string,
151
+ count: number | string
152
+ ) => MethodReturn;
153
+ type ZRANGEBYSCORE4 = (
154
+ key: string,
155
+ min: ZSetNumber,
156
+ max: ZSetNumber,
157
+ withScores: 'WITHSCORES',
158
+ limit: 'LIMIT',
159
+ offset: number | string,
160
+ count: number | string
161
+ ) => MethodReturn;
162
+
163
+ type ZREVRANGEBYLEX1 = (
164
+ key: string,
165
+ max: ZSetNumber,
166
+ min: ZSetNumber
167
+ ) => MethodReturn;
168
+ type ZREVRANGEBYLEX2 = (
169
+ key: string,
170
+ max: ZSetNumber,
171
+ min: ZSetNumber,
172
+ limit: 'LIMIT',
173
+ offset: number | string,
174
+ count: number | string
175
+ ) => MethodReturn;
176
+
177
+ type ZREVRANGEBYSCORE1 = (
178
+ key: string,
179
+ max: ZSetNumber,
180
+ min: ZSetNumber
181
+ ) => MethodReturn;
182
+ type ZREVRANGEBYSCORE2 = (
183
+ key: string,
184
+ max: ZSetNumber,
185
+ min: ZSetNumber,
186
+ withScores: 'WITHSCORES'
187
+ ) => MethodReturn;
188
+ type ZREVRANGEBYSCORE3 = (
189
+ key: string,
190
+ max: ZSetNumber,
191
+ min: ZSetNumber,
192
+ limit: 'LIMIT',
193
+ offset: number | string,
194
+ count: number | string
195
+ ) => MethodReturn;
196
+ type ZREVRANGEBYSCORE4 = (
197
+ key: string,
198
+ max: ZSetNumber,
199
+ min: ZSetNumber,
200
+ withScores: 'WITHSCORES',
201
+ limit: 'LIMIT',
202
+ offset: number | string,
203
+ count: number | string
204
+ ) => MethodReturn;
205
+
206
+ type ZREVRANGE1 = (
207
+ key: string,
208
+ start: number | string,
209
+ stop: number | string
210
+ ) => MethodReturn;
211
+ type ZREVRANGE2 = (
212
+ key: string,
213
+ start: number | string,
214
+ stop: number | string,
215
+ withscores: 'WITHSCORES'
216
+ ) => MethodReturn;
217
+
218
+ export type Upstash = {
219
+ auth: Auth1 & Auth2 & Auth3;
220
+ //
221
+ append: (key: string, value: string) => MethodReturn;
222
+ decr: (key: string) => MethodReturn;
223
+ decrby: (key: string, decrement: number | string) => MethodReturn;
224
+ get: (key: string) => MethodReturn;
225
+ getrange: (
226
+ key: string,
227
+ start: number | string,
228
+ end: number | string
229
+ ) => MethodReturn;
230
+ getset: (key: string, value: string) => MethodReturn;
231
+ incr: (key: string) => MethodReturn;
232
+ incrby: (key: string, increment: number | string) => MethodReturn;
233
+ incrbyfloat: (key: string, increment: number | string) => MethodReturn;
234
+ mget: (...key: any) => MethodReturn;
235
+ mset: (...keyValue: any) => MethodReturn;
236
+ msetnx: (...keyValue: any) => MethodReturn;
237
+ psetex: (
238
+ key: string,
239
+ miliseconds: number | string,
240
+ value: string
241
+ ) => MethodReturn;
242
+ set: SET1 & SET2;
243
+ setex: (key: string, seconds: number | string, value: string) => MethodReturn;
244
+ setnx: (key: string, value: string) => MethodReturn;
245
+ setrange: (
246
+ key: string,
247
+ offset: number | string,
248
+ value: string
249
+ ) => MethodReturn;
250
+ strlen: (key: string) => MethodReturn;
251
+ //
252
+ bitcount: BITCOUNT1 & BITCOUNT2;
253
+ bitop: (
254
+ operation: 'AND' | 'OR' | 'XOR' | 'NOT',
255
+ destKey: string,
256
+ ...key: any
257
+ ) => MethodReturn;
258
+ bitpos: BITPOS1 & BITPOS2 & BITPOS3;
259
+ getbit: (key: string, offset: number | string) => MethodReturn;
260
+ setbit: (key: string, offset: number | string, value: Bit) => MethodReturn;
261
+ //
262
+ echo: (message: string) => MethodReturn;
263
+ ping: PING1 & PING2;
264
+ //
265
+ hdel: (key: string, ...field: any) => MethodReturn;
266
+ hexists: (key: string, field: string) => MethodReturn;
267
+ hget: (key: string, field: string) => MethodReturn;
268
+ hgetall: (key: string) => MethodReturn;
269
+ hincrby: (
270
+ key: string,
271
+ field: string,
272
+ increment: number | string
273
+ ) => MethodReturn;
274
+ hincrbyfloat: (
275
+ key: string,
276
+ field: string,
277
+ increment: number | string
278
+ ) => MethodReturn;
279
+ hkeys: (key: string) => MethodReturn;
280
+ hlen: (key: string) => MethodReturn;
281
+ hmget: (key: string, ...field: any) => MethodReturn;
282
+ hmset: (key: string, ...fieldValue: any) => MethodReturn;
283
+ hscan: HSCAN1 & HSCAN2 & HSCAN3 & HSCAN4;
284
+ hset: (key: string, ...fieldValue: any) => MethodReturn;
285
+ hsetnx: (key: string, field: string, value: string) => MethodReturn;
286
+ hvals: (key: string) => MethodReturn;
287
+ //
288
+ del: (...key: any) => MethodReturn;
289
+ exists: (...key: any) => MethodReturn;
290
+ expire: (key: string, seconds: number | string) => MethodReturn;
291
+ expireat: (key: string, timestamp: number | string) => MethodReturn;
292
+ keys: (pattern: string) => MethodReturn;
293
+ persist: (key: string) => MethodReturn;
294
+ pexpire: (key: string, miliseconds: number | string) => MethodReturn;
295
+ pexpireat: (
296
+ key: string,
297
+ milisecondsTimestamp: number | string
298
+ ) => MethodReturn;
299
+ pttl: (key: string) => MethodReturn;
300
+ randomkey: () => MethodReturn;
301
+ rename: (key: string, newKey: string) => MethodReturn;
302
+ renamenx: (key: string, newKey: string) => MethodReturn;
303
+ scan: SCAN1 & SCAN2 & SCAN3 & SCAN4;
304
+ touch: (...key: any) => MethodReturn;
305
+ ttl: (key: string) => MethodReturn;
306
+ type: (key: string) => MethodReturn;
307
+ unlink: (...key: any) => MethodReturn;
308
+ //
309
+ lindex: (key: string, index: number | string) => MethodReturn;
310
+ linsert: (
311
+ key: string,
312
+ option: 'BEFORE' | 'AFTER',
313
+ pivot: string,
314
+ element: string
315
+ ) => MethodReturn;
316
+ llen: (key: string) => MethodReturn;
317
+ lpop: (key: string) => MethodReturn;
318
+ lpush: (key: string, ...element: any) => MethodReturn;
319
+ lpushx: (key: string, ...element: any) => MethodReturn;
320
+ lrange: (
321
+ key: string,
322
+ start: number | string,
323
+ stop: number | string
324
+ ) => MethodReturn;
325
+ lrem: (key: string, count: number | string, element: string) => MethodReturn;
326
+ lset: (key: string, index: number | string, element: string) => MethodReturn;
327
+ ltrim: (
328
+ key: string,
329
+ start: number | string,
330
+ stop: number | string
331
+ ) => MethodReturn;
332
+ rpop: (key: string) => MethodReturn;
333
+ rpoplpush: (source: string, destination: string) => MethodReturn;
334
+ rpush: (key: string, ...element: any) => MethodReturn;
335
+ rpushx: (key: string, ...element: any) => MethodReturn;
336
+ //
337
+ dbsize: () => MethodReturn;
338
+ flushall: FLUSHALL1 & FLUSHALL2;
339
+ flushdb: FLUSHDB1 & FLUSHDB2;
340
+ info: INFO1 & INFO2;
341
+ time: () => MethodReturn;
342
+ //
343
+ sadd: (key: string, ...member: any) => MethodReturn;
344
+ scard: (key: string) => MethodReturn;
345
+ sdiff: (...key: any) => MethodReturn;
346
+ sdiffstore: (destination: string, ...key: any) => MethodReturn;
347
+ sinter: (...key: any) => MethodReturn;
348
+ sinterstore: (destination: string, ...key: any) => MethodReturn;
349
+ sismember: (key: string, member: string) => MethodReturn;
350
+ smembers: (key: string) => MethodReturn;
351
+ smove: (source: string, destination: string, member: string) => MethodReturn;
352
+ spop: SPOP1 & SPOP2;
353
+ srandmember: SRANDMEMBER1 & SRANDMEMBER2;
354
+ srem: (key: string, ...member: any) => MethodReturn;
355
+ sunion: (...key: any) => MethodReturn;
356
+ sunionstore: (destination: string, ...key: any) => MethodReturn;
357
+ //
358
+ zadd: (key: string, ...scoreMember: any) => MethodReturn;
359
+ zcard: (key: string) => MethodReturn;
360
+ zcount: (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
361
+ zincrby: (
362
+ key: string,
363
+ increment: number | string,
364
+ member: string
365
+ ) => MethodReturn;
366
+ // TODO: fix args
367
+ zinterstore: (
368
+ destination: string,
369
+ numkeys: number | string,
370
+ ...key: any
371
+ ) => MethodReturn;
372
+ zlexcount: (key: string, min: ZSetNumber, max: ZSetNumber) => MethodReturn;
373
+ zpopmax: ZPOPMAX1 & ZPOPMAX2;
374
+ zpopmin: ZPOPMAX1 & ZPOPMAX2;
375
+ zrange: ZRANGE1 & ZRANGE2;
376
+ zrangebylex: ZRANGEBYLEX1 & ZRANGEBYLEX2;
377
+ zrangebyscore: ZRANGEBYSCORE1 &
378
+ ZRANGEBYSCORE2 &
379
+ ZRANGEBYSCORE3 &
380
+ ZRANGEBYSCORE4;
381
+ zrank: (key: string, member: string) => MethodReturn;
382
+ zrem: (key: string, ...member: any) => MethodReturn;
383
+ zremrangebylex: (
384
+ key: string,
385
+ min: ZSetNumber,
386
+ max: ZSetNumber
387
+ ) => MethodReturn;
388
+ zremrangebyrank: (
389
+ key: string,
390
+ start: number | string,
391
+ stop: number | string
392
+ ) => MethodReturn;
393
+ zremrangebyscore: (
394
+ key: string,
395
+ min: ZSetNumber,
396
+ max: ZSetNumber
397
+ ) => MethodReturn;
398
+ zrevrange: ZREVRANGE1 & ZREVRANGE2;
399
+ zrevrangebylex: ZREVRANGEBYLEX1 & ZREVRANGEBYLEX2;
400
+ zrevrangebyscore: ZREVRANGEBYSCORE1 &
401
+ ZREVRANGEBYSCORE2 &
402
+ ZREVRANGEBYSCORE3 &
403
+ ZREVRANGEBYSCORE4;
404
+ zrevrank: (key: string, member: string) => MethodReturn;
405
+ zscore: (key: string, member: string) => MethodReturn;
406
+ // TODO: fix args
407
+ zunionstore: (destination: string, ...numkeys: any) => MethodReturn;
408
+ };
package/tsconfig.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
- "include": ["src", "types"],
3
- "exclude": ["node_modules/**/*.ts"],
2
+ "files": ["src/index-cjs.ts"],
3
+ "exclude": ["./**/dist", "node_modules"],
4
4
  "compilerOptions": {
5
5
  "declaration": true,
6
- "declarationMap": true,
6
+ "lib": ["ES2015", "DOM"],
7
7
  "module": "CommonJS",
8
+ "rootDir": "src",
8
9
  "outDir": "dist/main",
9
- "sourceMap": true,
10
- "target": "ES2019",
10
+ "target": "ES2015",
11
11
  "strict": true,
12
- "esModuleInterop": true,
13
12
  "moduleResolution": "Node",
14
13
  "forceConsistentCasingInFileNames": true,
15
14
  "stripInternal": true,
16
- "allowSyntheticDefaultImports": true
15
+ "allowSyntheticDefaultImports": true,
16
+ "esModuleInterop": true,
17
+ "baseUrl": ".",
18
+ "typeRoots": ["./src/types", "node_modules/@types"]
17
19
  }
18
20
  }
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "extends": "./tsconfig",
3
+ "files": ["src/index.ts"],
3
4
  "compilerOptions": {
4
- "module": "ES2015",
5
- "outDir": "dist/module"
5
+ "outDir": "dist/module",
6
+ "module": "ES2015"
6
7
  }
7
8
  }