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