@@ -5,7 +5,7 @@ export interface ProduceOptions {
5
5
assertion ?: string | Buffer
6
6
audience ?: string
7
7
expiresIn ?: string
8
- footer ?: object | string | Buffer
8
+ footer ?: Record < PropertyKey , unknown > | string | Buffer
9
9
iat ?: boolean
10
10
issuer ?: string
11
11
jti ?: string
@@ -30,7 +30,7 @@ export interface ConsumeOptions<TComplete extends boolean> {
30
30
}
31
31
export interface CompleteResult {
32
32
footer ?: Buffer
33
- payload : object
33
+ payload : Record < string , unknown >
34
34
purpose : 'local' | 'public'
35
35
version : string
36
36
}
@@ -47,7 +47,7 @@ export interface CompleteResultBuffer {
47
47
}
48
48
export interface DecodeResult {
49
49
footer ?: Buffer
50
- payload ?: object
50
+ payload ?: Record < string , unknown >
51
51
purpose : 'local' | 'public'
52
52
version : string
53
53
}
@@ -60,20 +60,20 @@ export interface DecodeResultBuffer {
60
60
export function decode ( token : string ) : DecodeResult
61
61
export namespace V1 {
62
62
function sign (
63
- payload : object | Buffer ,
63
+ payload : Record < PropertyKey , unknown > | Buffer ,
64
64
key : KeyObject | Buffer | PrivateKeyInput | JsonWebKeyInput | string ,
65
65
options ?: Omit < ProduceOptions , 'assertion' > ,
66
66
) : Promise < string >
67
67
function encrypt (
68
- payload : object | Buffer ,
68
+ payload : Record < PropertyKey , unknown > | Buffer ,
69
69
key : KeyObject | Buffer | string ,
70
70
options ?: Omit < ProduceOptions , 'assertion' > ,
71
71
) : Promise < string >
72
72
function verify (
73
73
token : string ,
74
74
key : KeyObject | Buffer | PublicKeyInput | JsonWebKeyInput | string ,
75
75
options ?: Omit < ConsumeOptions < false > , 'assertion' > ,
76
- ) : Promise < object >
76
+ ) : Promise < Record < string , unknown > >
77
77
function verify (
78
78
token : string ,
79
79
key : KeyObject | Buffer | PublicKeyInput | JsonWebKeyInput | string ,
@@ -93,7 +93,7 @@ export namespace V1 {
93
93
token : string ,
94
94
key : KeyObject | Buffer | string ,
95
95
options ?: Omit < ConsumeOptions < false > , 'assertion' > ,
96
- ) : Promise < object >
96
+ ) : Promise < Record < string , unknown > >
97
97
function decrypt (
98
98
token : string ,
99
99
key : KeyObject | Buffer | string ,
@@ -116,15 +116,15 @@ export namespace V1 {
116
116
}
117
117
export namespace V2 {
118
118
function sign (
119
- payload : object | Buffer ,
119
+ payload : Record < PropertyKey , unknown > | Buffer ,
120
120
key : KeyObject | Buffer | PrivateKeyInput | JsonWebKeyInput | string ,
121
121
options ?: Omit < ProduceOptions , 'assertion' > ,
122
122
) : Promise < string >
123
123
function verify (
124
124
token : string ,
125
125
key : KeyObject | Buffer | PublicKeyInput | JsonWebKeyInput | string ,
126
126
options ?: Omit < ConsumeOptions < false > , 'assertion' > ,
127
- ) : Promise < object >
127
+ ) : Promise < Record < string , unknown > >
128
128
function verify (
129
129
token : string ,
130
130
key : KeyObject | Buffer | PublicKeyInput | JsonWebKeyInput | string ,
@@ -148,20 +148,20 @@ export namespace V2 {
148
148
}
149
149
export namespace V3 {
150
150
function sign (
151
- payload : object | Buffer ,
151
+ payload : Record < PropertyKey , unknown > | Buffer ,
152
152
key : KeyObject | Buffer | PrivateKeyInput | JsonWebKeyInput | string ,
153
153
options ?: ProduceOptions ,
154
154
) : Promise < string >
155
155
function encrypt (
156
- payload : object | Buffer ,
156
+ payload : Record < PropertyKey , unknown > | Buffer ,
157
157
key : KeyObject | Buffer | string ,
158
158
options ?: ProduceOptions ,
159
159
) : Promise < string >
160
160
function verify (
161
161
token : string ,
162
162
key : KeyObject | Buffer | PublicKeyInput | JsonWebKeyInput | string ,
163
163
options ?: ConsumeOptions < false > ,
164
- ) : Promise < object >
164
+ ) : Promise < Record < string , unknown > >
165
165
function verify (
166
166
token : string ,
167
167
key : KeyObject | Buffer | PublicKeyInput | JsonWebKeyInput | string ,
@@ -181,7 +181,7 @@ export namespace V3 {
181
181
token : string ,
182
182
key : KeyObject | Buffer | string ,
183
183
options ?: ConsumeOptions < false > ,
184
- ) : Promise < object >
184
+ ) : Promise < Record < string , unknown > >
185
185
function decrypt (
186
186
token : string ,
187
187
key : KeyObject | Buffer | string ,
@@ -206,15 +206,15 @@ export namespace V3 {
206
206
}
207
207
export namespace V4 {
208
208
function sign (
209
- payload : object | Buffer ,
209
+ payload : Record < PropertyKey , unknown > | Buffer ,
210
210
key : KeyObject | Buffer | PrivateKeyInput | JsonWebKeyInput | string ,
211
211
options ?: ProduceOptions ,
212
212
) : Promise < string >
213
213
function verify (
214
214
token : string ,
215
215
key : KeyObject | Buffer | PublicKeyInput | JsonWebKeyInput | string ,
216
216
options ?: ConsumeOptions < false > ,
217
- ) : Promise < object >
217
+ ) : Promise < Record < string , unknown > >
218
218
function verify (
219
219
token : string ,
220
220
key : KeyObject | Buffer | PublicKeyInput | JsonWebKeyInput | string ,
0 commit comments