zmp-sdk 2.39.0 → 2.39.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/apis/openShareSheet.js +1 -1
- package/apis/common/apis/general/getZMPShareInfo.js +1 -1
- package/apis/common/apis/general/openMediaPicker.js +1 -1
- package/apis/common/apis/general/openShareSheet.js +1 -1
- package/apis/common/token.js +1 -1
- package/apis/constants.js +1 -1
- package/apis/external/@swc/helpers/esm/_array_like_to_array.js +1 -0
- package/apis/external/@swc/helpers/esm/_array_with_holes.js +1 -0
- package/apis/external/@swc/helpers/esm/_array_without_holes.js +1 -0
- package/apis/external/@swc/helpers/esm/_assert_this_initialized.js +1 -0
- package/apis/external/@swc/helpers/esm/_async_to_generator.js +1 -0
- package/apis/external/@swc/helpers/esm/_check_private_redeclaration.js +1 -0
- package/apis/external/@swc/helpers/esm/_class_apply_descriptor_get.js +1 -0
- package/apis/external/@swc/helpers/esm/_class_apply_descriptor_set.js +1 -0
- package/apis/external/@swc/helpers/esm/_class_call_check.js +1 -0
- package/apis/external/@swc/helpers/esm/_class_extract_field_descriptor.js +1 -0
- package/apis/external/@swc/helpers/esm/_class_private_field_get.js +1 -0
- package/apis/external/@swc/helpers/esm/_class_private_field_init.js +1 -0
- package/apis/external/@swc/helpers/esm/_class_private_field_set.js +1 -0
- package/apis/external/@swc/helpers/esm/_create_class.js +1 -0
- package/apis/external/@swc/helpers/esm/_create_super.js +1 -0
- package/apis/external/@swc/helpers/esm/_define_property.js +1 -0
- package/apis/external/@swc/helpers/esm/_get.js +1 -0
- package/apis/external/@swc/helpers/esm/_get_prototype_of.js +1 -0
- package/apis/external/@swc/helpers/esm/_inherits.js +1 -0
- package/apis/external/@swc/helpers/esm/_instanceof.js +1 -0
- package/apis/external/@swc/helpers/esm/_is_native_reflect_construct.js +1 -0
- package/apis/external/@swc/helpers/esm/_iterable_to_array.js +1 -0
- package/apis/external/@swc/helpers/esm/_iterable_to_array_limit.js +1 -0
- package/apis/external/@swc/helpers/esm/_non_iterable_rest.js +1 -0
- package/apis/external/@swc/helpers/esm/_non_iterable_spread.js +1 -0
- package/apis/external/@swc/helpers/esm/_object_spread.js +1 -0
- package/apis/external/@swc/helpers/esm/_object_spread_props.js +1 -0
- package/apis/external/@swc/helpers/esm/_object_without_properties.js +1 -0
- package/apis/external/@swc/helpers/esm/_object_without_properties_loose.js +1 -0
- package/apis/external/@swc/helpers/esm/_possible_constructor_return.js +1 -0
- package/apis/external/@swc/helpers/esm/_set_prototype_of.js +1 -0
- package/apis/external/@swc/helpers/esm/_sliced_to_array.js +1 -0
- package/apis/external/@swc/helpers/esm/_super_prop_base.js +1 -0
- package/apis/external/@swc/helpers/esm/_to_consumable_array.js +1 -0
- package/apis/external/@swc/helpers/esm/_type_of.js +1 -0
- package/apis/external/@swc/helpers/esm/_unsupported_iterable_to_array.js +1 -0
- package/apis/index.d.ts +1153 -1151
- package/apis/package.json.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +1155 -1153
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +3 -3
- package/package.json +1 -1
- package/zmp-sdk-v2.39.0-beta.0.tgz +0 -0
package/apis/index.d.ts
CHANGED
|
@@ -26,1214 +26,1216 @@ declare enum Events {
|
|
|
26
26
|
PaymentClose = "action.payment.close"
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
declare
|
|
29
|
+
declare const AUTHEN_SCOPE_VALUES: readonly ["scope.userInfo", "scope.userLocation", "scope.userPhonenumber"];
|
|
30
|
+
declare const GET_SETTINGS_SCOPE_VALUES: readonly ["scope.userInfo", "scope.userLocation", "scope.userPhonenumber", "scope.camera", "scope.micro"];
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
37
|
-
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
|
38
|
-
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
39
|
-
export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
|
|
40
|
-
export const getValidEnumValues: (obj: any) => any[];
|
|
41
|
-
export const objectValues: (obj: any) => any[];
|
|
42
|
-
export const objectKeys: ObjectConstructor["keys"];
|
|
43
|
-
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
|
|
44
|
-
export type identity<T> = T;
|
|
45
|
-
export type flatten<T> = identity<{
|
|
46
|
-
[k in keyof T]: T[k];
|
|
47
|
-
}>;
|
|
48
|
-
export type noUndefined<T> = T extends undefined ? never : T;
|
|
49
|
-
export const isInteger: NumberConstructor["isInteger"];
|
|
50
|
-
export function joinValues<T extends any[]>(array: T, separator?: string): string;
|
|
51
|
-
export const jsonStringifyReplacer: (_: string, value: any) => any;
|
|
52
|
-
export {};
|
|
53
|
-
}
|
|
54
|
-
declare const ZodParsedType: {
|
|
55
|
-
function: "function";
|
|
56
|
-
number: "number";
|
|
57
|
-
string: "string";
|
|
58
|
-
nan: "nan";
|
|
59
|
-
integer: "integer";
|
|
60
|
-
float: "float";
|
|
61
|
-
boolean: "boolean";
|
|
62
|
-
date: "date";
|
|
63
|
-
bigint: "bigint";
|
|
64
|
-
symbol: "symbol";
|
|
65
|
-
undefined: "undefined";
|
|
66
|
-
null: "null";
|
|
67
|
-
array: "array";
|
|
68
|
-
object: "object";
|
|
69
|
-
unknown: "unknown";
|
|
70
|
-
promise: "promise";
|
|
71
|
-
void: "void";
|
|
72
|
-
never: "never";
|
|
73
|
-
map: "map";
|
|
74
|
-
set: "set";
|
|
32
|
+
type AsyncCallbackFailObject = {
|
|
33
|
+
code: number;
|
|
34
|
+
message?: string | undefined;
|
|
35
|
+
api?: string | undefined;
|
|
36
|
+
[key: string]: any;
|
|
75
37
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
declare type typeToFlattenedError<T, U = string> = {
|
|
80
|
-
formErrors: U[];
|
|
81
|
-
fieldErrors: {
|
|
82
|
-
[P in allKeys<T>]?: U[];
|
|
83
|
-
};
|
|
38
|
+
type AsyncCallback<T = any> = {
|
|
39
|
+
success?: ((res: T) => void) | undefined;
|
|
40
|
+
fail?: ((err: AsyncCallbackFailObject) => void) | undefined;
|
|
84
41
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
custom: "custom";
|
|
89
|
-
invalid_union: "invalid_union";
|
|
90
|
-
invalid_union_discriminator: "invalid_union_discriminator";
|
|
91
|
-
invalid_enum_value: "invalid_enum_value";
|
|
92
|
-
unrecognized_keys: "unrecognized_keys";
|
|
93
|
-
invalid_arguments: "invalid_arguments";
|
|
94
|
-
invalid_return_type: "invalid_return_type";
|
|
95
|
-
invalid_date: "invalid_date";
|
|
96
|
-
invalid_string: "invalid_string";
|
|
97
|
-
too_small: "too_small";
|
|
98
|
-
too_big: "too_big";
|
|
99
|
-
invalid_intersection_types: "invalid_intersection_types";
|
|
100
|
-
not_multiple_of: "not_multiple_of";
|
|
101
|
-
not_finite: "not_finite";
|
|
42
|
+
type AsyncVoidCallback = {
|
|
43
|
+
success?: () => void;
|
|
44
|
+
fail?: ((err: AsyncCallbackFailObject) => void) | undefined;
|
|
102
45
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
46
|
+
type GetLocationReturns = {
|
|
47
|
+
/** latitude */
|
|
48
|
+
latitude?: string;
|
|
49
|
+
/** longitude */
|
|
50
|
+
longitude?: string;
|
|
51
|
+
/** timestamp */
|
|
52
|
+
timestamp?: string;
|
|
53
|
+
/** provider */
|
|
54
|
+
provider?: string;
|
|
55
|
+
token?: string;
|
|
107
56
|
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
interface ZodInvalidLiteralIssue extends ZodIssueBase {
|
|
114
|
-
code: typeof ZodIssueCode.invalid_literal;
|
|
115
|
-
expected: unknown;
|
|
116
|
-
received: unknown;
|
|
117
|
-
}
|
|
118
|
-
interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
|
|
119
|
-
code: typeof ZodIssueCode.unrecognized_keys;
|
|
120
|
-
keys: string[];
|
|
121
|
-
}
|
|
122
|
-
interface ZodInvalidUnionIssue extends ZodIssueBase {
|
|
123
|
-
code: typeof ZodIssueCode.invalid_union;
|
|
124
|
-
unionErrors: ZodError[];
|
|
125
|
-
}
|
|
126
|
-
interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
|
|
127
|
-
code: typeof ZodIssueCode.invalid_union_discriminator;
|
|
128
|
-
options: Primitive[];
|
|
129
|
-
}
|
|
130
|
-
interface ZodInvalidEnumValueIssue extends ZodIssueBase {
|
|
131
|
-
received: string | number;
|
|
132
|
-
code: typeof ZodIssueCode.invalid_enum_value;
|
|
133
|
-
options: (string | number)[];
|
|
134
|
-
}
|
|
135
|
-
interface ZodInvalidArgumentsIssue extends ZodIssueBase {
|
|
136
|
-
code: typeof ZodIssueCode.invalid_arguments;
|
|
137
|
-
argumentsError: ZodError;
|
|
138
|
-
}
|
|
139
|
-
interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
|
140
|
-
code: typeof ZodIssueCode.invalid_return_type;
|
|
141
|
-
returnTypeError: ZodError;
|
|
142
|
-
}
|
|
143
|
-
interface ZodInvalidDateIssue extends ZodIssueBase {
|
|
144
|
-
code: typeof ZodIssueCode.invalid_date;
|
|
145
|
-
}
|
|
146
|
-
declare type StringValidation = "email" | "url" | "uuid" | "regex" | "cuid" | "cuid2" | "datetime" | {
|
|
147
|
-
startsWith: string;
|
|
148
|
-
} | {
|
|
149
|
-
endsWith: string;
|
|
57
|
+
type CameraParams = {
|
|
58
|
+
mediaConstraints?: MediaConstraints;
|
|
59
|
+
canvasElement?: HTMLCanvasElement;
|
|
60
|
+
videoElement: HTMLVideoElement;
|
|
150
61
|
};
|
|
151
|
-
interface
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
exact?: boolean;
|
|
167
|
-
type: "array" | "string" | "number" | "set" | "date";
|
|
168
|
-
}
|
|
169
|
-
interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
|
|
170
|
-
code: typeof ZodIssueCode.invalid_intersection_types;
|
|
171
|
-
}
|
|
172
|
-
interface ZodNotMultipleOfIssue extends ZodIssueBase {
|
|
173
|
-
code: typeof ZodIssueCode.not_multiple_of;
|
|
174
|
-
multipleOf: number;
|
|
175
|
-
}
|
|
176
|
-
interface ZodNotFiniteIssue extends ZodIssueBase {
|
|
177
|
-
code: typeof ZodIssueCode.not_finite;
|
|
178
|
-
}
|
|
179
|
-
interface ZodCustomIssue extends ZodIssueBase {
|
|
180
|
-
code: typeof ZodIssueCode.custom;
|
|
181
|
-
params?: {
|
|
182
|
-
[k: string]: any;
|
|
183
|
-
};
|
|
62
|
+
interface SystemInfo {
|
|
63
|
+
/** Mini app version */
|
|
64
|
+
version: string;
|
|
65
|
+
/** SDK version */
|
|
66
|
+
apiVersion: string;
|
|
67
|
+
/** Zalo version */
|
|
68
|
+
zaloVersion: string;
|
|
69
|
+
/** Client platform */
|
|
70
|
+
platform: string;
|
|
71
|
+
/** Language set in Zalo */
|
|
72
|
+
language: string;
|
|
73
|
+
/** Language set in Zalo */
|
|
74
|
+
zaloLanguage: string;
|
|
75
|
+
/** Theme set in Zalo */
|
|
76
|
+
zaloTheme: string;
|
|
184
77
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
fatal?: boolean;
|
|
188
|
-
message: string;
|
|
78
|
+
type SetStorageReturns = {
|
|
79
|
+
errorKeys: string[];
|
|
189
80
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
} & (NonNullable<T> extends [any, ...any[]] ? {
|
|
193
|
-
[K in keyof NonNullable<T>]?: ZodFormattedError<NonNullable<T>[K], U>;
|
|
194
|
-
} : NonNullable<T> extends any[] ? {
|
|
195
|
-
[k: number]: ZodFormattedError<NonNullable<T>[number], U>;
|
|
196
|
-
} : NonNullable<T> extends object ? {
|
|
197
|
-
[K in keyof NonNullable<T>]?: ZodFormattedError<NonNullable<T>[K], U>;
|
|
198
|
-
} : unknown);
|
|
199
|
-
declare class ZodError<T = any> extends Error {
|
|
200
|
-
issues: ZodIssue[];
|
|
201
|
-
get errors(): ZodIssue[];
|
|
202
|
-
constructor(issues: ZodIssue[]);
|
|
203
|
-
format(): ZodFormattedError<T>;
|
|
204
|
-
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
|
|
205
|
-
static create: (issues: ZodIssue[]) => ZodError<any>;
|
|
206
|
-
toString(): string;
|
|
207
|
-
get message(): string;
|
|
208
|
-
get isEmpty(): boolean;
|
|
209
|
-
addIssue: (sub: ZodIssue) => void;
|
|
210
|
-
addIssues: (subs?: ZodIssue[]) => void;
|
|
211
|
-
flatten(): typeToFlattenedError<T>;
|
|
212
|
-
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
|
213
|
-
get formErrors(): typeToFlattenedError<T, string>;
|
|
214
|
-
}
|
|
215
|
-
declare type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
|
|
216
|
-
declare type IssueData = stripPath<ZodIssueOptionalMessage> & {
|
|
217
|
-
path?: (string | number)[];
|
|
218
|
-
fatal?: boolean;
|
|
81
|
+
type GetStorageReturns = {
|
|
82
|
+
[key: string]: any;
|
|
219
83
|
};
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
84
|
+
type StorageInfo = {
|
|
85
|
+
currentSize: number;
|
|
86
|
+
limitSize: number;
|
|
223
87
|
};
|
|
224
|
-
|
|
225
|
-
|
|
88
|
+
type RemoveStorageReturns = {
|
|
89
|
+
errorKeys: string[];
|
|
226
90
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
91
|
+
type GetUserInfoReturns = {
|
|
92
|
+
userInfo: {
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
avatar: string;
|
|
96
|
+
idByOA?: string;
|
|
97
|
+
isSensitive?: boolean;
|
|
98
|
+
followedOA?: boolean;
|
|
99
|
+
};
|
|
232
100
|
};
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
101
|
+
type GetNetworkTypeReturns = {
|
|
102
|
+
networkType: NetworkType;
|
|
103
|
+
};
|
|
104
|
+
type iBeaconInfo = {
|
|
105
|
+
/** The iBeacon device broadcast UUID. */
|
|
106
|
+
uuid: string;
|
|
107
|
+
/** The iBeacon device primary ID. */
|
|
108
|
+
major: string;
|
|
109
|
+
/** The iBeacon device secondary ID. */
|
|
110
|
+
minor: string;
|
|
111
|
+
/** The iBeacon device distance. */
|
|
112
|
+
distance: number;
|
|
113
|
+
/** The signal strength of the device. */
|
|
114
|
+
rssi: number;
|
|
115
|
+
};
|
|
116
|
+
type GetBeaconDiscoveryReturns = {
|
|
117
|
+
beacons: Array<iBeaconInfo>;
|
|
118
|
+
};
|
|
119
|
+
type ScanQRCodeReturns = {
|
|
120
|
+
content: string;
|
|
121
|
+
};
|
|
122
|
+
type OpenPostFeedReturns = {
|
|
123
|
+
status: 0 | 1;
|
|
124
|
+
shareType: 0 | 1 | 2;
|
|
125
|
+
numberOfUser: number;
|
|
126
|
+
};
|
|
127
|
+
type OpenShareSheetReturns = {
|
|
128
|
+
status: 0 | 2 | 1;
|
|
129
|
+
shareType: 0 | 2 | 1;
|
|
130
|
+
numberOfUser: number;
|
|
131
|
+
};
|
|
132
|
+
type RequestCameraPermissionReturns = {
|
|
133
|
+
userAllow: boolean;
|
|
134
|
+
message: string;
|
|
135
|
+
};
|
|
136
|
+
type CheckZaloCameraPermissionReturns = {
|
|
137
|
+
userAllow: boolean;
|
|
138
|
+
};
|
|
139
|
+
type OpenBioAuthenticationReturns = {
|
|
140
|
+
code: number;
|
|
141
|
+
message: string;
|
|
142
|
+
data: {
|
|
143
|
+
domain: string;
|
|
144
|
+
code: number;
|
|
145
|
+
message: string;
|
|
146
|
+
payToken: string;
|
|
240
147
|
};
|
|
241
|
-
readonly path: ParsePath;
|
|
242
|
-
readonly schemaErrorMap?: ZodErrorMap;
|
|
243
|
-
readonly parent: ParseContext | null;
|
|
244
|
-
readonly data: any;
|
|
245
|
-
readonly parsedType: ZodParsedType;
|
|
246
|
-
}
|
|
247
|
-
declare type ParseInput = {
|
|
248
|
-
data: any;
|
|
249
|
-
path: (string | number)[];
|
|
250
|
-
parent: ParseContext;
|
|
251
148
|
};
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
dirty(): void;
|
|
255
|
-
abort(): void;
|
|
256
|
-
static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
|
|
257
|
-
static mergeObjectAsync(status: ParseStatus, pairs: {
|
|
258
|
-
key: ParseReturnType<any>;
|
|
259
|
-
value: ParseReturnType<any>;
|
|
260
|
-
}[]): Promise<SyncParseReturnType<any>>;
|
|
261
|
-
static mergeObjectSync(status: ParseStatus, pairs: {
|
|
262
|
-
key: SyncParseReturnType<any>;
|
|
263
|
-
value: SyncParseReturnType<any>;
|
|
264
|
-
alwaysSet?: boolean;
|
|
265
|
-
}[]): SyncParseReturnType;
|
|
266
|
-
}
|
|
267
|
-
declare type INVALID = {
|
|
268
|
-
status: "aborted";
|
|
149
|
+
type CheckStateBioAuthenticationReturns = {
|
|
150
|
+
bioState: string;
|
|
269
151
|
};
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
status: "dirty";
|
|
273
|
-
value: T;
|
|
152
|
+
type KeepScreenReturns = {
|
|
153
|
+
success: boolean;
|
|
274
154
|
};
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
155
|
+
type OpenWebviewReturns = {
|
|
156
|
+
success: boolean;
|
|
157
|
+
};
|
|
158
|
+
type GetAppInfoReturns = {
|
|
159
|
+
description: string;
|
|
160
|
+
version: string;
|
|
161
|
+
name: string;
|
|
162
|
+
appUrl: string;
|
|
163
|
+
qrCodeUrl: string;
|
|
164
|
+
logoUrl?: string;
|
|
165
|
+
};
|
|
166
|
+
type GetPhoneNumberReturns = {
|
|
167
|
+
number?: string;
|
|
168
|
+
token?: string;
|
|
169
|
+
};
|
|
170
|
+
type OpenProfilePickerReturns = {
|
|
171
|
+
users: {
|
|
172
|
+
id: string;
|
|
173
|
+
profile: {
|
|
174
|
+
name: string;
|
|
175
|
+
avatar: string;
|
|
176
|
+
};
|
|
177
|
+
code: number;
|
|
178
|
+
message: string;
|
|
179
|
+
}[];
|
|
180
|
+
};
|
|
181
|
+
type OpenMediaPickerReturns = {
|
|
182
|
+
data: string;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Context info
|
|
186
|
+
*/
|
|
187
|
+
type ContextInfo = {
|
|
188
|
+
type?: string;
|
|
189
|
+
id?: string;
|
|
190
|
+
};
|
|
191
|
+
type GetAuthCodeReturns = {
|
|
192
|
+
authCode: string;
|
|
193
|
+
authCodeVerify: string;
|
|
194
|
+
};
|
|
195
|
+
type GetZPITokenReturns = {
|
|
196
|
+
utoken: string;
|
|
197
|
+
gtoken: string;
|
|
198
|
+
zpp: string;
|
|
199
|
+
zpt: string;
|
|
200
|
+
};
|
|
201
|
+
type ChooseImageReturns = {
|
|
202
|
+
filePaths: Array<string>;
|
|
203
|
+
tempFiles: Array<{
|
|
204
|
+
path: string;
|
|
205
|
+
size: number;
|
|
206
|
+
}>;
|
|
207
|
+
};
|
|
208
|
+
type CreateOrderReturns = {
|
|
209
|
+
orderId: string;
|
|
210
|
+
};
|
|
211
|
+
type SelectPaymentMethodReturns = {
|
|
212
|
+
method: string;
|
|
213
|
+
};
|
|
214
|
+
type CheckTransactionReturns = {
|
|
215
|
+
err: number;
|
|
216
|
+
msg: string;
|
|
217
|
+
orderId: string;
|
|
218
|
+
transId: string;
|
|
219
|
+
resultCode: number;
|
|
220
|
+
transTime: string;
|
|
221
|
+
createdAt: string;
|
|
222
|
+
path?: string;
|
|
223
|
+
method: string;
|
|
224
|
+
isCustom: boolean;
|
|
225
|
+
};
|
|
226
|
+
type CreateOrderIAPReturns = {
|
|
227
|
+
orderId: string;
|
|
228
|
+
};
|
|
229
|
+
type ScopeValues = (typeof AUTHEN_SCOPE_VALUES)[number] | (typeof GET_SETTINGS_SCOPE_VALUES)[number];
|
|
230
|
+
type AuthorizeType<T extends ScopeValues> = Partial<{
|
|
231
|
+
[key in T]: boolean;
|
|
232
|
+
}>;
|
|
233
|
+
type GetSettingReturn = {
|
|
234
|
+
authSetting: AuthorizeType<(typeof GET_SETTINGS_SCOPE_VALUES)[number]>;
|
|
279
235
|
};
|
|
280
|
-
declare const OK: <T>(value: T) => OK<T>;
|
|
281
|
-
declare type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
|
|
282
|
-
declare type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
|
|
283
|
-
declare type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
|
|
284
236
|
|
|
285
|
-
declare
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
|
|
290
|
-
export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
|
|
291
|
-
export {};
|
|
237
|
+
declare enum CameraEvents {
|
|
238
|
+
OnFrameCallback = "h5.event.camera.frame",
|
|
239
|
+
OnStartCallback = "h5.event.camera.start",
|
|
240
|
+
OnStopCallback = "h5.event.camera.stop"
|
|
292
241
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
message?: string;
|
|
297
|
-
};
|
|
298
|
-
const errToObj: (message?: ErrMessage | undefined) => {
|
|
299
|
-
message?: string | undefined;
|
|
300
|
-
};
|
|
301
|
-
const toString: (message?: ErrMessage | undefined) => string | undefined;
|
|
242
|
+
declare enum FacingMode {
|
|
243
|
+
FRONT = "user",
|
|
244
|
+
BACK = "environment"
|
|
302
245
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}, Params, Catchall> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
|
|
308
|
-
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
|
|
309
|
-
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
|
|
246
|
+
declare enum PhotoFormat {
|
|
247
|
+
WEBP = "image/webp",
|
|
248
|
+
PNG = "image/png",
|
|
249
|
+
JPEG = "image/jpeg"
|
|
310
250
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
};
|
|
316
|
-
declare type ZodRawShape = {
|
|
317
|
-
[k: string]: ZodTypeAny;
|
|
318
|
-
};
|
|
319
|
-
declare type ZodTypeAny = ZodType<any, any, any>;
|
|
320
|
-
declare type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
|
|
321
|
-
declare type input<T extends ZodType<any, any, any>> = T["_input"];
|
|
322
|
-
declare type output<T extends ZodType<any, any, any>> = T["_output"];
|
|
323
|
-
|
|
324
|
-
declare type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
|
325
|
-
interface ZodTypeDef {
|
|
326
|
-
errorMap?: ZodErrorMap;
|
|
327
|
-
description?: string;
|
|
251
|
+
declare enum PhotoQuality {
|
|
252
|
+
HIGH = "high",
|
|
253
|
+
NORMAL = "normal",
|
|
254
|
+
LOW = "low"
|
|
328
255
|
}
|
|
329
|
-
declare
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
data: Output;
|
|
256
|
+
declare enum StreamType {
|
|
257
|
+
VIDEO = "video",
|
|
258
|
+
AUDIO = "audio"
|
|
259
|
+
}
|
|
260
|
+
type PhotoFrame = {
|
|
261
|
+
data: string;
|
|
262
|
+
width: number;
|
|
263
|
+
height: number;
|
|
338
264
|
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
265
|
+
type MediaDevice = {
|
|
266
|
+
kind: string;
|
|
267
|
+
label: string;
|
|
268
|
+
deviceId: string;
|
|
342
269
|
};
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
_getType(input: ParseInput): string;
|
|
352
|
-
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
|
353
|
-
_processInputParams(input: ParseInput): {
|
|
354
|
-
status: ParseStatus;
|
|
355
|
-
ctx: ParseContext;
|
|
356
|
-
};
|
|
357
|
-
_parseSync(input: ParseInput): SyncParseReturnType<Output>;
|
|
358
|
-
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
|
359
|
-
parse(data: unknown, params?: Partial<ParseParams>): Output;
|
|
360
|
-
safeParse(data: unknown, params?: Partial<ParseParams>): SafeParseReturnType<Input, Output>;
|
|
361
|
-
parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>;
|
|
362
|
-
safeParseAsync(data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
|
363
|
-
/** Alias of safeParseAsync */
|
|
364
|
-
spa: (data: unknown, params?: Partial<ParseParams> | undefined) => Promise<SafeParseReturnType<Input, Output>>;
|
|
365
|
-
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
|
366
|
-
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
|
367
|
-
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
|
368
|
-
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
|
|
369
|
-
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
|
|
370
|
-
superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
|
|
371
|
-
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
|
|
372
|
-
constructor(def: Def);
|
|
373
|
-
optional(): ZodOptional<this>;
|
|
374
|
-
nullable(): ZodNullable<this>;
|
|
375
|
-
nullish(): ZodOptional<ZodNullable<this>>;
|
|
376
|
-
array(): ZodArray<this>;
|
|
377
|
-
promise(): ZodPromise<this>;
|
|
378
|
-
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
|
|
379
|
-
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
|
|
380
|
-
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
|
|
381
|
-
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
|
382
|
-
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
|
383
|
-
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
|
384
|
-
catch(def: Output): ZodCatch<this>;
|
|
385
|
-
catch(def: () => Output): ZodCatch<this>;
|
|
386
|
-
describe(description: string): this;
|
|
387
|
-
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
|
388
|
-
isOptional(): boolean;
|
|
389
|
-
isNullable(): boolean;
|
|
390
|
-
}
|
|
391
|
-
declare type ZodStringCheck = {
|
|
392
|
-
kind: "min";
|
|
393
|
-
value: number;
|
|
394
|
-
message?: string;
|
|
395
|
-
} | {
|
|
396
|
-
kind: "max";
|
|
397
|
-
value: number;
|
|
398
|
-
message?: string;
|
|
399
|
-
} | {
|
|
400
|
-
kind: "length";
|
|
401
|
-
value: number;
|
|
402
|
-
message?: string;
|
|
403
|
-
} | {
|
|
404
|
-
kind: "email";
|
|
405
|
-
message?: string;
|
|
406
|
-
} | {
|
|
407
|
-
kind: "url";
|
|
408
|
-
message?: string;
|
|
409
|
-
} | {
|
|
410
|
-
kind: "uuid";
|
|
411
|
-
message?: string;
|
|
412
|
-
} | {
|
|
413
|
-
kind: "cuid";
|
|
414
|
-
message?: string;
|
|
415
|
-
} | {
|
|
416
|
-
kind: "cuid2";
|
|
417
|
-
message?: string;
|
|
418
|
-
} | {
|
|
419
|
-
kind: "startsWith";
|
|
420
|
-
value: string;
|
|
421
|
-
message?: string;
|
|
422
|
-
} | {
|
|
423
|
-
kind: "endsWith";
|
|
424
|
-
value: string;
|
|
425
|
-
message?: string;
|
|
426
|
-
} | {
|
|
427
|
-
kind: "regex";
|
|
428
|
-
regex: RegExp;
|
|
429
|
-
message?: string;
|
|
430
|
-
} | {
|
|
431
|
-
kind: "trim";
|
|
432
|
-
message?: string;
|
|
433
|
-
} | {
|
|
434
|
-
kind: "datetime";
|
|
435
|
-
offset: boolean;
|
|
436
|
-
precision: number | null;
|
|
437
|
-
message?: string;
|
|
270
|
+
type MediaConstraints = {
|
|
271
|
+
width?: number;
|
|
272
|
+
height?: number;
|
|
273
|
+
facingMode?: FacingMode;
|
|
274
|
+
deviceId?: string;
|
|
275
|
+
audio?: boolean;
|
|
276
|
+
video?: boolean;
|
|
277
|
+
mirrored?: boolean;
|
|
438
278
|
};
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
description?: string | undefined;
|
|
483
|
-
} & {
|
|
484
|
-
coerce?: true | undefined;
|
|
485
|
-
}) | undefined) => ZodString;
|
|
279
|
+
type PhotoConstraint = {
|
|
280
|
+
width?: number;
|
|
281
|
+
height?: number;
|
|
282
|
+
format?: PhotoFormat;
|
|
283
|
+
quality?: PhotoQuality;
|
|
284
|
+
mirrored?: boolean;
|
|
285
|
+
useVideoSourceSize?: boolean;
|
|
286
|
+
minScreenshotWidth?: number;
|
|
287
|
+
minScreenshotHeight?: number;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
declare function login(args?: AsyncCallback<string>): Promise<string>;
|
|
291
|
+
|
|
292
|
+
declare function getAccessToken(args?: AsyncCallback<string>): Promise<string>;
|
|
293
|
+
|
|
294
|
+
declare function getVersion(): string;
|
|
295
|
+
|
|
296
|
+
declare function getSystemInfo(): SystemInfo;
|
|
297
|
+
|
|
298
|
+
declare type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
299
|
+
|
|
300
|
+
declare namespace util {
|
|
301
|
+
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
|
302
|
+
export const assertEqual: <A, B>(val: AssertEqual<A, B>) => AssertEqual<A, B>;
|
|
303
|
+
export function assertIs<T>(_arg: T): void;
|
|
304
|
+
export function assertNever(_x: never): never;
|
|
305
|
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
306
|
+
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
|
307
|
+
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
308
|
+
export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
|
|
309
|
+
export const getValidEnumValues: (obj: any) => any[];
|
|
310
|
+
export const objectValues: (obj: any) => any[];
|
|
311
|
+
export const objectKeys: ObjectConstructor["keys"];
|
|
312
|
+
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
|
|
313
|
+
export type identity<T> = T;
|
|
314
|
+
export type flatten<T> = identity<{
|
|
315
|
+
[k in keyof T]: T[k];
|
|
316
|
+
}>;
|
|
317
|
+
export type noUndefined<T> = T extends undefined ? never : T;
|
|
318
|
+
export const isInteger: NumberConstructor["isInteger"];
|
|
319
|
+
export function joinValues<T extends any[]>(array: T, separator?: string): string;
|
|
320
|
+
export const jsonStringifyReplacer: (_: string, value: any) => any;
|
|
321
|
+
export {};
|
|
486
322
|
}
|
|
487
|
-
declare
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
323
|
+
declare const ZodParsedType: {
|
|
324
|
+
function: "function";
|
|
325
|
+
number: "number";
|
|
326
|
+
string: "string";
|
|
327
|
+
nan: "nan";
|
|
328
|
+
integer: "integer";
|
|
329
|
+
float: "float";
|
|
330
|
+
boolean: "boolean";
|
|
331
|
+
date: "date";
|
|
332
|
+
bigint: "bigint";
|
|
333
|
+
symbol: "symbol";
|
|
334
|
+
undefined: "undefined";
|
|
335
|
+
null: "null";
|
|
336
|
+
array: "array";
|
|
337
|
+
object: "object";
|
|
338
|
+
unknown: "unknown";
|
|
339
|
+
promise: "promise";
|
|
340
|
+
void: "void";
|
|
341
|
+
never: "never";
|
|
342
|
+
map: "map";
|
|
343
|
+
set: "set";
|
|
344
|
+
};
|
|
345
|
+
declare type ZodParsedType = keyof typeof ZodParsedType;
|
|
346
|
+
|
|
347
|
+
declare type allKeys<T> = T extends any ? keyof T : never;
|
|
348
|
+
declare type typeToFlattenedError<T, U = string> = {
|
|
349
|
+
formErrors: U[];
|
|
350
|
+
fieldErrors: {
|
|
351
|
+
[P in allKeys<T>]?: U[];
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
declare const ZodIssueCode: {
|
|
355
|
+
invalid_type: "invalid_type";
|
|
356
|
+
invalid_literal: "invalid_literal";
|
|
357
|
+
custom: "custom";
|
|
358
|
+
invalid_union: "invalid_union";
|
|
359
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
360
|
+
invalid_enum_value: "invalid_enum_value";
|
|
361
|
+
unrecognized_keys: "unrecognized_keys";
|
|
362
|
+
invalid_arguments: "invalid_arguments";
|
|
363
|
+
invalid_return_type: "invalid_return_type";
|
|
364
|
+
invalid_date: "invalid_date";
|
|
365
|
+
invalid_string: "invalid_string";
|
|
366
|
+
too_small: "too_small";
|
|
367
|
+
too_big: "too_big";
|
|
368
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
369
|
+
not_multiple_of: "not_multiple_of";
|
|
370
|
+
not_finite: "not_finite";
|
|
371
|
+
};
|
|
372
|
+
declare type ZodIssueCode = keyof typeof ZodIssueCode;
|
|
373
|
+
declare type ZodIssueBase = {
|
|
374
|
+
path: (string | number)[];
|
|
506
375
|
message?: string;
|
|
507
376
|
};
|
|
508
|
-
interface
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
declare class ZodNumber extends ZodType<number, ZodNumberDef> {
|
|
514
|
-
_parse(input: ParseInput): ParseReturnType<number>;
|
|
515
|
-
static create: (params?: ({
|
|
516
|
-
errorMap?: ZodErrorMap | undefined;
|
|
517
|
-
invalid_type_error?: string | undefined;
|
|
518
|
-
required_error?: string | undefined;
|
|
519
|
-
description?: string | undefined;
|
|
520
|
-
} & {
|
|
521
|
-
coerce?: boolean | undefined;
|
|
522
|
-
}) | undefined) => ZodNumber;
|
|
523
|
-
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
524
|
-
min: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
525
|
-
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
526
|
-
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
527
|
-
max: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
528
|
-
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
529
|
-
protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
|
|
530
|
-
_addCheck(check: ZodNumberCheck): ZodNumber;
|
|
531
|
-
int(message?: errorUtil.ErrMessage): ZodNumber;
|
|
532
|
-
positive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
533
|
-
negative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
534
|
-
nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
535
|
-
nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
536
|
-
multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
537
|
-
finite(message?: errorUtil.ErrMessage): ZodNumber;
|
|
538
|
-
step: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
539
|
-
get minValue(): number | null;
|
|
540
|
-
get maxValue(): number | null;
|
|
541
|
-
get isInt(): boolean;
|
|
542
|
-
get isFinite(): boolean;
|
|
543
|
-
}
|
|
544
|
-
interface ZodBooleanDef extends ZodTypeDef {
|
|
545
|
-
typeName: ZodFirstPartyTypeKind.ZodBoolean;
|
|
546
|
-
coerce: boolean;
|
|
547
|
-
}
|
|
548
|
-
declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef> {
|
|
549
|
-
_parse(input: ParseInput): ParseReturnType<boolean>;
|
|
550
|
-
static create: (params?: ({
|
|
551
|
-
errorMap?: ZodErrorMap | undefined;
|
|
552
|
-
invalid_type_error?: string | undefined;
|
|
553
|
-
required_error?: string | undefined;
|
|
554
|
-
description?: string | undefined;
|
|
555
|
-
} & {
|
|
556
|
-
coerce?: boolean | undefined;
|
|
557
|
-
}) | undefined) => ZodBoolean;
|
|
558
|
-
}
|
|
559
|
-
interface ZodAnyDef extends ZodTypeDef {
|
|
560
|
-
typeName: ZodFirstPartyTypeKind.ZodAny;
|
|
561
|
-
}
|
|
562
|
-
declare class ZodAny extends ZodType<any, ZodAnyDef> {
|
|
563
|
-
_any: true;
|
|
564
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
565
|
-
static create: (params?: RawCreateParams) => ZodAny;
|
|
566
|
-
}
|
|
567
|
-
interface ZodUnknownDef extends ZodTypeDef {
|
|
568
|
-
typeName: ZodFirstPartyTypeKind.ZodUnknown;
|
|
569
|
-
}
|
|
570
|
-
declare class ZodUnknown extends ZodType<unknown, ZodUnknownDef> {
|
|
571
|
-
_unknown: true;
|
|
572
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
573
|
-
static create: (params?: RawCreateParams) => ZodUnknown;
|
|
377
|
+
interface ZodInvalidTypeIssue extends ZodIssueBase {
|
|
378
|
+
code: typeof ZodIssueCode.invalid_type;
|
|
379
|
+
expected: ZodParsedType;
|
|
380
|
+
received: ZodParsedType;
|
|
574
381
|
}
|
|
575
|
-
interface
|
|
576
|
-
|
|
382
|
+
interface ZodInvalidLiteralIssue extends ZodIssueBase {
|
|
383
|
+
code: typeof ZodIssueCode.invalid_literal;
|
|
384
|
+
expected: unknown;
|
|
385
|
+
received: unknown;
|
|
577
386
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
387
|
+
interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
|
|
388
|
+
code: typeof ZodIssueCode.unrecognized_keys;
|
|
389
|
+
keys: string[];
|
|
581
390
|
}
|
|
582
|
-
interface
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
exactLength: {
|
|
586
|
-
value: number;
|
|
587
|
-
message?: string;
|
|
588
|
-
} | null;
|
|
589
|
-
minLength: {
|
|
590
|
-
value: number;
|
|
591
|
-
message?: string;
|
|
592
|
-
} | null;
|
|
593
|
-
maxLength: {
|
|
594
|
-
value: number;
|
|
595
|
-
message?: string;
|
|
596
|
-
} | null;
|
|
391
|
+
interface ZodInvalidUnionIssue extends ZodIssueBase {
|
|
392
|
+
code: typeof ZodIssueCode.invalid_union;
|
|
393
|
+
unionErrors: ZodError[];
|
|
597
394
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
602
|
-
get element(): T;
|
|
603
|
-
min(minLength: number, message?: errorUtil.ErrMessage): this;
|
|
604
|
-
max(maxLength: number, message?: errorUtil.ErrMessage): this;
|
|
605
|
-
length(len: number, message?: errorUtil.ErrMessage): this;
|
|
606
|
-
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
|
607
|
-
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodArray<T_1, "many">;
|
|
395
|
+
interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
|
|
396
|
+
code: typeof ZodIssueCode.invalid_union_discriminator;
|
|
397
|
+
options: Primitive[];
|
|
608
398
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
type optionalKeys<T extends object> = {
|
|
614
|
-
[k in keyof T]: undefined extends T[k] ? k : never;
|
|
615
|
-
}[keyof T];
|
|
616
|
-
type requiredKeys<T extends object> = {
|
|
617
|
-
[k in keyof T]: undefined extends T[k] ? never : k;
|
|
618
|
-
}[keyof T];
|
|
619
|
-
export type addQuestionMarks<T extends object> = Partial<Pick<T, optionalKeys<T>>> & Pick<T, requiredKeys<T>>;
|
|
620
|
-
export type identity<T> = T;
|
|
621
|
-
export type flatten<T extends object> = identity<{
|
|
622
|
-
[k in keyof T]: T[k];
|
|
623
|
-
}>;
|
|
624
|
-
export type noNeverKeys<T extends ZodRawShape> = {
|
|
625
|
-
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
|
626
|
-
}[keyof T];
|
|
627
|
-
export type noNever<T extends ZodRawShape> = identity<{
|
|
628
|
-
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
|
629
|
-
}>;
|
|
630
|
-
export const mergeShapes: <U extends ZodRawShape, T extends ZodRawShape>(first: U, second: T) => T & U;
|
|
631
|
-
export {};
|
|
399
|
+
interface ZodInvalidEnumValueIssue extends ZodIssueBase {
|
|
400
|
+
received: string | number;
|
|
401
|
+
code: typeof ZodIssueCode.invalid_enum_value;
|
|
402
|
+
options: (string | number)[];
|
|
632
403
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
typeName: ZodFirstPartyTypeKind.ZodObject;
|
|
637
|
-
shape: () => T;
|
|
638
|
-
catchall: Catchall;
|
|
639
|
-
unknownKeys: UnknownKeys;
|
|
404
|
+
interface ZodInvalidArgumentsIssue extends ZodIssueBase {
|
|
405
|
+
code: typeof ZodIssueCode.invalid_arguments;
|
|
406
|
+
argumentsError: ZodError;
|
|
640
407
|
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
declare type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny> = ZodTypeAny extends Catchall ? objectUtil.flatten<baseObjectOutputType<Shape>> : objectUtil.flatten<baseObjectOutputType<Shape> & {
|
|
645
|
-
[k: string]: Catchall["_output"];
|
|
646
|
-
}>;
|
|
647
|
-
declare type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.flatten<objectUtil.addQuestionMarks<{
|
|
648
|
-
[k in keyof Shape]: Shape[k]["_input"];
|
|
649
|
-
}>>;
|
|
650
|
-
declare type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny> = ZodTypeAny extends Catchall ? baseObjectInputType<Shape> : objectUtil.flatten<baseObjectInputType<Shape> & {
|
|
651
|
-
[k: string]: Catchall["_input"];
|
|
652
|
-
}>;
|
|
653
|
-
declare type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
|
|
654
|
-
declare type objectKeyMask<Obj> = {
|
|
655
|
-
[k in keyof Obj]?: true;
|
|
656
|
-
};
|
|
657
|
-
declare type noUnrecognized<Obj extends object, Shape extends object> = {
|
|
658
|
-
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
|
|
659
|
-
};
|
|
660
|
-
declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall>, Input = objectInputType<T, Catchall>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
|
|
661
|
-
private _cached;
|
|
662
|
-
_getCached(): {
|
|
663
|
-
shape: T;
|
|
664
|
-
keys: string[];
|
|
665
|
-
};
|
|
666
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
667
|
-
get shape(): T;
|
|
668
|
-
strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
|
|
669
|
-
strip(): ZodObject<T, "strip", Catchall>;
|
|
670
|
-
passthrough(): ZodObject<T, "passthrough", Catchall>;
|
|
671
|
-
/**
|
|
672
|
-
* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
|
|
673
|
-
* If you want to pass through unknown properties, use `.passthrough()` instead.
|
|
674
|
-
*/
|
|
675
|
-
nonstrict: () => ZodObject<T, "passthrough", Catchall>;
|
|
676
|
-
extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
|
677
|
-
/**
|
|
678
|
-
* @deprecated Use `.extend` instead
|
|
679
|
-
* */
|
|
680
|
-
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, UnknownKeys, Catchall, objectOutputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall>, objectInputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall>>;
|
|
681
|
-
/**
|
|
682
|
-
* Prior to zod@1.0.12 there was a bug in the
|
|
683
|
-
* inferred type of merged objects. Please
|
|
684
|
-
* upgrade if you are experiencing issues.
|
|
685
|
-
*/
|
|
686
|
-
merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
|
|
687
|
-
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
|
|
688
|
-
[k in Key]: Schema;
|
|
689
|
-
}, UnknownKeys, Catchall>;
|
|
690
|
-
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
|
|
691
|
-
pick<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, T>): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
|
692
|
-
omit<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
|
693
|
-
deepPartial(): partialUtil.DeepPartial<this>;
|
|
694
|
-
partial(): ZodObject<{
|
|
695
|
-
[k in keyof T]: ZodOptional<T[k]>;
|
|
696
|
-
}, UnknownKeys, Catchall>;
|
|
697
|
-
partial<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<objectUtil.noNever<{
|
|
698
|
-
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
|
|
699
|
-
}>, UnknownKeys, Catchall>;
|
|
700
|
-
required(): ZodObject<{
|
|
701
|
-
[k in keyof T]: deoptional<T[k]>;
|
|
702
|
-
}, UnknownKeys, Catchall>;
|
|
703
|
-
required<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<objectUtil.noNever<{
|
|
704
|
-
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
|
705
|
-
}>, UnknownKeys, Catchall>;
|
|
706
|
-
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
|
707
|
-
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof baseObjectOutputType<T_1>]: baseObjectOutputType<T_1>[k]; }, { [k_2 in keyof objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>[k_2]; }>;
|
|
708
|
-
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k in keyof baseObjectOutputType<T_1>]: baseObjectOutputType<T_1>[k]; }, { [k_2 in keyof objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>[k_2]; }>;
|
|
709
|
-
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof baseObjectOutputType<T_1>]: baseObjectOutputType<T_1>[k]; }, { [k_2 in keyof objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>[k_2]; }>;
|
|
408
|
+
interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
|
409
|
+
code: typeof ZodIssueCode.invalid_return_type;
|
|
410
|
+
returnTypeError: ZodError;
|
|
710
411
|
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[
|
|
714
|
-
ZodTypeAny,
|
|
715
|
-
ZodTypeAny,
|
|
716
|
-
...ZodTypeAny[]
|
|
717
|
-
]>> extends ZodTypeDef {
|
|
718
|
-
options: T;
|
|
719
|
-
typeName: ZodFirstPartyTypeKind.ZodUnion;
|
|
412
|
+
interface ZodInvalidDateIssue extends ZodIssueBase {
|
|
413
|
+
code: typeof ZodIssueCode.invalid_date;
|
|
720
414
|
}
|
|
721
|
-
declare
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
415
|
+
declare type StringValidation = "email" | "url" | "uuid" | "regex" | "cuid" | "cuid2" | "datetime" | {
|
|
416
|
+
startsWith: string;
|
|
417
|
+
} | {
|
|
418
|
+
endsWith: string;
|
|
419
|
+
};
|
|
420
|
+
interface ZodInvalidStringIssue extends ZodIssueBase {
|
|
421
|
+
code: typeof ZodIssueCode.invalid_string;
|
|
422
|
+
validation: StringValidation;
|
|
725
423
|
}
|
|
726
|
-
interface
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
424
|
+
interface ZodTooSmallIssue extends ZodIssueBase {
|
|
425
|
+
code: typeof ZodIssueCode.too_small;
|
|
426
|
+
minimum: number;
|
|
427
|
+
inclusive: boolean;
|
|
428
|
+
exact?: boolean;
|
|
429
|
+
type: "array" | "string" | "number" | "set" | "date";
|
|
730
430
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
431
|
+
interface ZodTooBigIssue extends ZodIssueBase {
|
|
432
|
+
code: typeof ZodIssueCode.too_big;
|
|
433
|
+
maximum: number;
|
|
434
|
+
inclusive: boolean;
|
|
435
|
+
exact?: boolean;
|
|
436
|
+
type: "array" | "string" | "number" | "set" | "date";
|
|
734
437
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
declare type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
738
|
-
[k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_output"] : never;
|
|
739
|
-
}>;
|
|
740
|
-
declare type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
|
|
741
|
-
declare type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
742
|
-
[k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_input"] : never;
|
|
743
|
-
}>;
|
|
744
|
-
declare type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
|
|
745
|
-
interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
|
|
746
|
-
items: T;
|
|
747
|
-
rest: Rest;
|
|
748
|
-
typeName: ZodFirstPartyTypeKind.ZodTuple;
|
|
438
|
+
interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
|
|
439
|
+
code: typeof ZodIssueCode.invalid_intersection_types;
|
|
749
440
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
] | [], ZodTypeAny | null>;
|
|
754
|
-
declare class ZodTuple<T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
|
|
755
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
756
|
-
get items(): T;
|
|
757
|
-
rest<Rest extends ZodTypeAny>(rest: Rest): ZodTuple<T, Rest>;
|
|
758
|
-
static create: <T_1 extends [] | [ZodTypeAny, ...ZodTypeAny[]]>(schemas: T_1, params?: RawCreateParams) => ZodTuple<T_1, null>;
|
|
441
|
+
interface ZodNotMultipleOfIssue extends ZodIssueBase {
|
|
442
|
+
code: typeof ZodIssueCode.not_multiple_of;
|
|
443
|
+
multipleOf: number;
|
|
759
444
|
}
|
|
760
|
-
interface
|
|
761
|
-
|
|
762
|
-
keyType: Key;
|
|
763
|
-
typeName: ZodFirstPartyTypeKind.ZodRecord;
|
|
445
|
+
interface ZodNotFiniteIssue extends ZodIssueBase {
|
|
446
|
+
code: typeof ZodIssueCode.not_finite;
|
|
764
447
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
get keySchema(): Key;
|
|
771
|
-
get valueSchema(): Value;
|
|
772
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
773
|
-
get element(): Value;
|
|
774
|
-
static create<Value extends ZodTypeAny>(valueType: Value, params?: RawCreateParams): ZodRecord<ZodString, Value>;
|
|
775
|
-
static create<Keys extends KeySchema, Value extends ZodTypeAny>(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord<Keys, Value>;
|
|
448
|
+
interface ZodCustomIssue extends ZodIssueBase {
|
|
449
|
+
code: typeof ZodIssueCode.custom;
|
|
450
|
+
params?: {
|
|
451
|
+
[k: string]: any;
|
|
452
|
+
};
|
|
776
453
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
454
|
+
declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
|
|
455
|
+
declare type ZodIssue = ZodIssueOptionalMessage & {
|
|
456
|
+
fatal?: boolean;
|
|
457
|
+
message: string;
|
|
458
|
+
};
|
|
459
|
+
declare type ZodFormattedError<T, U = string> = {
|
|
460
|
+
_errors: U[];
|
|
461
|
+
} & (NonNullable<T> extends [any, ...any[]] ? {
|
|
462
|
+
[K in keyof NonNullable<T>]?: ZodFormattedError<NonNullable<T>[K], U>;
|
|
463
|
+
} : NonNullable<T> extends any[] ? {
|
|
464
|
+
[k: number]: ZodFormattedError<NonNullable<T>[number], U>;
|
|
465
|
+
} : NonNullable<T> extends object ? {
|
|
466
|
+
[K in keyof NonNullable<T>]?: ZodFormattedError<NonNullable<T>[K], U>;
|
|
467
|
+
} : unknown);
|
|
468
|
+
declare class ZodError<T = any> extends Error {
|
|
469
|
+
issues: ZodIssue[];
|
|
470
|
+
get errors(): ZodIssue[];
|
|
471
|
+
constructor(issues: ZodIssue[]);
|
|
472
|
+
format(): ZodFormattedError<T>;
|
|
473
|
+
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
|
|
474
|
+
static create: (issues: ZodIssue[]) => ZodError<any>;
|
|
475
|
+
toString(): string;
|
|
476
|
+
get message(): string;
|
|
477
|
+
get isEmpty(): boolean;
|
|
478
|
+
addIssue: (sub: ZodIssue) => void;
|
|
479
|
+
addIssues: (subs?: ZodIssue[]) => void;
|
|
480
|
+
flatten(): typeToFlattenedError<T>;
|
|
481
|
+
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
|
482
|
+
get formErrors(): typeToFlattenedError<T, string>;
|
|
781
483
|
}
|
|
782
|
-
declare type
|
|
783
|
-
declare type
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
484
|
+
declare type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
|
|
485
|
+
declare type IssueData = stripPath<ZodIssueOptionalMessage> & {
|
|
486
|
+
path?: (string | number)[];
|
|
487
|
+
fatal?: boolean;
|
|
488
|
+
};
|
|
489
|
+
declare type ErrorMapCtx = {
|
|
490
|
+
defaultError: string;
|
|
491
|
+
data: any;
|
|
492
|
+
};
|
|
493
|
+
declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
|
|
494
|
+
message: string;
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
declare type ParseParams = {
|
|
498
|
+
path: (string | number)[];
|
|
499
|
+
errorMap: ZodErrorMap;
|
|
500
|
+
async: boolean;
|
|
501
|
+
};
|
|
502
|
+
declare type ParsePathComponent = string | number;
|
|
503
|
+
declare type ParsePath = ParsePathComponent[];
|
|
504
|
+
interface ParseContext {
|
|
505
|
+
readonly common: {
|
|
506
|
+
readonly issues: ZodIssue[];
|
|
507
|
+
readonly contextualErrorMap?: ZodErrorMap;
|
|
508
|
+
readonly async: boolean;
|
|
509
|
+
};
|
|
510
|
+
readonly path: ParsePath;
|
|
511
|
+
readonly schemaErrorMap?: ZodErrorMap;
|
|
512
|
+
readonly parent: ParseContext | null;
|
|
513
|
+
readonly data: any;
|
|
514
|
+
readonly parsedType: ZodParsedType;
|
|
797
515
|
}
|
|
798
|
-
declare type
|
|
799
|
-
|
|
800
|
-
|
|
516
|
+
declare type ParseInput = {
|
|
517
|
+
data: any;
|
|
518
|
+
path: (string | number)[];
|
|
519
|
+
parent: ParseContext;
|
|
801
520
|
};
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
521
|
+
declare class ParseStatus {
|
|
522
|
+
value: "aborted" | "dirty" | "valid";
|
|
523
|
+
dirty(): void;
|
|
524
|
+
abort(): void;
|
|
525
|
+
static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
|
|
526
|
+
static mergeObjectAsync(status: ParseStatus, pairs: {
|
|
527
|
+
key: ParseReturnType<any>;
|
|
528
|
+
value: ParseReturnType<any>;
|
|
529
|
+
}[]): Promise<SyncParseReturnType<any>>;
|
|
530
|
+
static mergeObjectSync(status: ParseStatus, pairs: {
|
|
531
|
+
key: SyncParseReturnType<any>;
|
|
532
|
+
value: SyncParseReturnType<any>;
|
|
533
|
+
alwaysSet?: boolean;
|
|
534
|
+
}[]): SyncParseReturnType;
|
|
805
535
|
}
|
|
806
|
-
declare type
|
|
807
|
-
|
|
536
|
+
declare type INVALID = {
|
|
537
|
+
status: "aborted";
|
|
808
538
|
};
|
|
809
|
-
declare
|
|
810
|
-
declare type
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
539
|
+
declare const INVALID: INVALID;
|
|
540
|
+
declare type DIRTY<T> = {
|
|
541
|
+
status: "dirty";
|
|
542
|
+
value: T;
|
|
543
|
+
};
|
|
544
|
+
declare const DIRTY: <T>(value: T) => DIRTY<T>;
|
|
545
|
+
declare type OK<T> = {
|
|
546
|
+
status: "valid";
|
|
547
|
+
value: T;
|
|
548
|
+
};
|
|
549
|
+
declare const OK: <T>(value: T) => OK<T>;
|
|
550
|
+
declare type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
|
|
551
|
+
declare type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
|
|
552
|
+
declare type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
|
|
553
|
+
|
|
554
|
+
declare namespace enumUtil {
|
|
555
|
+
type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
|
556
|
+
type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
|
|
557
|
+
type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
|
|
558
|
+
type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
|
|
559
|
+
export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
|
|
560
|
+
export {};
|
|
822
561
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
562
|
+
|
|
563
|
+
declare namespace errorUtil {
|
|
564
|
+
type ErrMessage = string | {
|
|
565
|
+
message?: string;
|
|
566
|
+
};
|
|
567
|
+
const errToObj: (message?: ErrMessage | undefined) => {
|
|
568
|
+
message?: string | undefined;
|
|
569
|
+
};
|
|
570
|
+
const toString: (message?: ErrMessage | undefined) => string | undefined;
|
|
826
571
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
572
|
+
|
|
573
|
+
declare namespace partialUtil {
|
|
574
|
+
type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<infer Shape, infer Params, infer Catchall> ? ZodObject<{
|
|
575
|
+
[k in keyof Shape]: ZodOptional<DeepPartial<Shape[k]>>;
|
|
576
|
+
}, Params, Catchall> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
|
|
577
|
+
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
|
|
578
|
+
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
declare type RefinementCtx = {
|
|
582
|
+
addIssue: (arg: IssueData) => void;
|
|
583
|
+
path: (string | number)[];
|
|
584
|
+
};
|
|
585
|
+
declare type ZodRawShape = {
|
|
586
|
+
[k: string]: ZodTypeAny;
|
|
587
|
+
};
|
|
588
|
+
declare type ZodTypeAny = ZodType<any, any, any>;
|
|
589
|
+
declare type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
|
|
590
|
+
declare type input<T extends ZodType<any, any, any>> = T["_input"];
|
|
591
|
+
declare type output<T extends ZodType<any, any, any>> = T["_output"];
|
|
592
|
+
|
|
593
|
+
declare type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
|
594
|
+
interface ZodTypeDef {
|
|
595
|
+
errorMap?: ZodErrorMap;
|
|
596
|
+
description?: string;
|
|
831
597
|
}
|
|
832
|
-
declare type
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
598
|
+
declare type RawCreateParams = {
|
|
599
|
+
errorMap?: ZodErrorMap;
|
|
600
|
+
invalid_type_error?: string;
|
|
601
|
+
required_error?: string;
|
|
602
|
+
description?: string;
|
|
603
|
+
} | undefined;
|
|
604
|
+
declare type SafeParseSuccess<Output> = {
|
|
605
|
+
success: true;
|
|
606
|
+
data: Output;
|
|
839
607
|
};
|
|
840
|
-
declare type
|
|
841
|
-
|
|
842
|
-
|
|
608
|
+
declare type SafeParseError<Input> = {
|
|
609
|
+
success: false;
|
|
610
|
+
error: ZodError<Input>;
|
|
843
611
|
};
|
|
844
|
-
declare type
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
612
|
+
declare type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
|
613
|
+
declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
|
|
614
|
+
readonly _type: Output;
|
|
615
|
+
readonly _output: Output;
|
|
616
|
+
readonly _input: Input;
|
|
617
|
+
readonly _def: Def;
|
|
618
|
+
get description(): string | undefined;
|
|
619
|
+
abstract _parse(input: ParseInput): ParseReturnType<Output>;
|
|
620
|
+
_getType(input: ParseInput): string;
|
|
621
|
+
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
|
622
|
+
_processInputParams(input: ParseInput): {
|
|
623
|
+
status: ParseStatus;
|
|
624
|
+
ctx: ParseContext;
|
|
625
|
+
};
|
|
626
|
+
_parseSync(input: ParseInput): SyncParseReturnType<Output>;
|
|
627
|
+
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
|
628
|
+
parse(data: unknown, params?: Partial<ParseParams>): Output;
|
|
629
|
+
safeParse(data: unknown, params?: Partial<ParseParams>): SafeParseReturnType<Input, Output>;
|
|
630
|
+
parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>;
|
|
631
|
+
safeParseAsync(data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
|
632
|
+
/** Alias of safeParseAsync */
|
|
633
|
+
spa: (data: unknown, params?: Partial<ParseParams> | undefined) => Promise<SafeParseReturnType<Input, Output>>;
|
|
634
|
+
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
|
635
|
+
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
|
636
|
+
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
|
637
|
+
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
|
|
638
|
+
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
|
|
639
|
+
superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
|
|
640
|
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
|
|
641
|
+
constructor(def: Def);
|
|
642
|
+
optional(): ZodOptional<this>;
|
|
643
|
+
nullable(): ZodNullable<this>;
|
|
644
|
+
nullish(): ZodOptional<ZodNullable<this>>;
|
|
645
|
+
array(): ZodArray<this>;
|
|
646
|
+
promise(): ZodPromise<this>;
|
|
647
|
+
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
|
|
648
|
+
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
|
|
649
|
+
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
|
|
650
|
+
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
|
651
|
+
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
|
652
|
+
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
|
653
|
+
catch(def: Output): ZodCatch<this>;
|
|
654
|
+
catch(def: () => Output): ZodCatch<this>;
|
|
655
|
+
describe(description: string): this;
|
|
656
|
+
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
|
657
|
+
isOptional(): boolean;
|
|
658
|
+
isNullable(): boolean;
|
|
856
659
|
}
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
660
|
+
declare type ZodStringCheck = {
|
|
661
|
+
kind: "min";
|
|
662
|
+
value: number;
|
|
663
|
+
message?: string;
|
|
664
|
+
} | {
|
|
665
|
+
kind: "max";
|
|
666
|
+
value: number;
|
|
667
|
+
message?: string;
|
|
668
|
+
} | {
|
|
669
|
+
kind: "length";
|
|
670
|
+
value: number;
|
|
671
|
+
message?: string;
|
|
672
|
+
} | {
|
|
673
|
+
kind: "email";
|
|
674
|
+
message?: string;
|
|
675
|
+
} | {
|
|
676
|
+
kind: "url";
|
|
677
|
+
message?: string;
|
|
678
|
+
} | {
|
|
679
|
+
kind: "uuid";
|
|
680
|
+
message?: string;
|
|
681
|
+
} | {
|
|
682
|
+
kind: "cuid";
|
|
683
|
+
message?: string;
|
|
684
|
+
} | {
|
|
685
|
+
kind: "cuid2";
|
|
686
|
+
message?: string;
|
|
687
|
+
} | {
|
|
688
|
+
kind: "startsWith";
|
|
689
|
+
value: string;
|
|
690
|
+
message?: string;
|
|
691
|
+
} | {
|
|
692
|
+
kind: "endsWith";
|
|
693
|
+
value: string;
|
|
694
|
+
message?: string;
|
|
695
|
+
} | {
|
|
696
|
+
kind: "regex";
|
|
697
|
+
regex: RegExp;
|
|
698
|
+
message?: string;
|
|
699
|
+
} | {
|
|
700
|
+
kind: "trim";
|
|
701
|
+
message?: string;
|
|
702
|
+
} | {
|
|
703
|
+
kind: "datetime";
|
|
704
|
+
offset: boolean;
|
|
705
|
+
precision: number | null;
|
|
706
|
+
message?: string;
|
|
707
|
+
};
|
|
708
|
+
interface ZodStringDef extends ZodTypeDef {
|
|
709
|
+
checks: ZodStringCheck[];
|
|
710
|
+
typeName: ZodFirstPartyTypeKind.ZodString;
|
|
711
|
+
coerce: boolean;
|
|
861
712
|
}
|
|
862
|
-
declare class
|
|
863
|
-
_parse(input: ParseInput): ParseReturnType<
|
|
864
|
-
|
|
865
|
-
|
|
713
|
+
declare class ZodString extends ZodType<string, ZodStringDef> {
|
|
714
|
+
_parse(input: ParseInput): ParseReturnType<string>;
|
|
715
|
+
protected _regex: (regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage | undefined) => ZodEffects<this, string, string>;
|
|
716
|
+
_addCheck(check: ZodStringCheck): ZodString;
|
|
717
|
+
email(message?: errorUtil.ErrMessage): ZodString;
|
|
718
|
+
url(message?: errorUtil.ErrMessage): ZodString;
|
|
719
|
+
uuid(message?: errorUtil.ErrMessage): ZodString;
|
|
720
|
+
cuid(message?: errorUtil.ErrMessage): ZodString;
|
|
721
|
+
cuid2(message?: errorUtil.ErrMessage): ZodString;
|
|
722
|
+
datetime(options?: string | {
|
|
723
|
+
message?: string | undefined;
|
|
724
|
+
precision?: number | null;
|
|
725
|
+
offset?: boolean;
|
|
726
|
+
}): ZodString;
|
|
727
|
+
regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
|
|
728
|
+
startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
|
729
|
+
endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
|
730
|
+
min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
|
|
731
|
+
max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
|
|
732
|
+
length(len: number, message?: errorUtil.ErrMessage): ZodString;
|
|
733
|
+
/**
|
|
734
|
+
* @deprecated Use z.string().min(1) instead.
|
|
735
|
+
* @see {@link ZodString.min}
|
|
736
|
+
*/
|
|
737
|
+
nonempty: (message?: errorUtil.ErrMessage | undefined) => ZodString;
|
|
738
|
+
trim: () => ZodString;
|
|
739
|
+
get isDatetime(): boolean;
|
|
740
|
+
get isEmail(): boolean;
|
|
741
|
+
get isURL(): boolean;
|
|
742
|
+
get isUUID(): boolean;
|
|
743
|
+
get isCUID(): boolean;
|
|
744
|
+
get isCUID2(): boolean;
|
|
745
|
+
get minLength(): number | null;
|
|
746
|
+
get maxLength(): number | null;
|
|
747
|
+
static create: (params?: ({
|
|
748
|
+
errorMap?: ZodErrorMap | undefined;
|
|
749
|
+
invalid_type_error?: string | undefined;
|
|
750
|
+
required_error?: string | undefined;
|
|
751
|
+
description?: string | undefined;
|
|
752
|
+
} & {
|
|
753
|
+
coerce?: true | undefined;
|
|
754
|
+
}) | undefined) => ZodString;
|
|
866
755
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
756
|
+
declare type ZodNumberCheck = {
|
|
757
|
+
kind: "min";
|
|
758
|
+
value: number;
|
|
759
|
+
inclusive: boolean;
|
|
760
|
+
message?: string;
|
|
761
|
+
} | {
|
|
762
|
+
kind: "max";
|
|
763
|
+
value: number;
|
|
764
|
+
inclusive: boolean;
|
|
765
|
+
message?: string;
|
|
766
|
+
} | {
|
|
767
|
+
kind: "int";
|
|
768
|
+
message?: string;
|
|
769
|
+
} | {
|
|
770
|
+
kind: "multipleOf";
|
|
771
|
+
value: number;
|
|
772
|
+
message?: string;
|
|
773
|
+
} | {
|
|
774
|
+
kind: "finite";
|
|
775
|
+
message?: string;
|
|
776
|
+
};
|
|
777
|
+
interface ZodNumberDef extends ZodTypeDef {
|
|
778
|
+
checks: ZodNumberCheck[];
|
|
779
|
+
typeName: ZodFirstPartyTypeKind.ZodNumber;
|
|
780
|
+
coerce: boolean;
|
|
870
781
|
}
|
|
871
|
-
declare class
|
|
872
|
-
_parse(input: ParseInput): ParseReturnType<
|
|
873
|
-
|
|
874
|
-
|
|
782
|
+
declare class ZodNumber extends ZodType<number, ZodNumberDef> {
|
|
783
|
+
_parse(input: ParseInput): ParseReturnType<number>;
|
|
784
|
+
static create: (params?: ({
|
|
785
|
+
errorMap?: ZodErrorMap | undefined;
|
|
786
|
+
invalid_type_error?: string | undefined;
|
|
787
|
+
required_error?: string | undefined;
|
|
788
|
+
description?: string | undefined;
|
|
789
|
+
} & {
|
|
790
|
+
coerce?: boolean | undefined;
|
|
791
|
+
}) | undefined) => ZodNumber;
|
|
792
|
+
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
793
|
+
min: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
794
|
+
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
795
|
+
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
796
|
+
max: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
797
|
+
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
798
|
+
protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
|
|
799
|
+
_addCheck(check: ZodNumberCheck): ZodNumber;
|
|
800
|
+
int(message?: errorUtil.ErrMessage): ZodNumber;
|
|
801
|
+
positive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
802
|
+
negative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
803
|
+
nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
804
|
+
nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
805
|
+
multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
806
|
+
finite(message?: errorUtil.ErrMessage): ZodNumber;
|
|
807
|
+
step: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
808
|
+
get minValue(): number | null;
|
|
809
|
+
get maxValue(): number | null;
|
|
810
|
+
get isInt(): boolean;
|
|
811
|
+
get isFinite(): boolean;
|
|
875
812
|
}
|
|
876
|
-
interface
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
typeName: ZodFirstPartyTypeKind.ZodDefault;
|
|
813
|
+
interface ZodBooleanDef extends ZodTypeDef {
|
|
814
|
+
typeName: ZodFirstPartyTypeKind.ZodBoolean;
|
|
815
|
+
coerce: boolean;
|
|
880
816
|
}
|
|
881
|
-
declare class
|
|
882
|
-
_parse(input: ParseInput): ParseReturnType<
|
|
883
|
-
|
|
884
|
-
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
|
817
|
+
declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef> {
|
|
818
|
+
_parse(input: ParseInput): ParseReturnType<boolean>;
|
|
819
|
+
static create: (params?: ({
|
|
885
820
|
errorMap?: ZodErrorMap | undefined;
|
|
886
821
|
invalid_type_error?: string | undefined;
|
|
887
822
|
required_error?: string | undefined;
|
|
888
823
|
description?: string | undefined;
|
|
889
824
|
} & {
|
|
890
|
-
|
|
891
|
-
}) =>
|
|
825
|
+
coerce?: boolean | undefined;
|
|
826
|
+
}) | undefined) => ZodBoolean;
|
|
892
827
|
}
|
|
893
|
-
interface
|
|
894
|
-
|
|
895
|
-
catchValue: () => C;
|
|
896
|
-
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
|
828
|
+
interface ZodAnyDef extends ZodTypeDef {
|
|
829
|
+
typeName: ZodFirstPartyTypeKind.ZodAny;
|
|
897
830
|
}
|
|
898
|
-
declare class
|
|
831
|
+
declare class ZodAny extends ZodType<any, ZodAnyDef> {
|
|
832
|
+
_any: true;
|
|
899
833
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
900
|
-
|
|
901
|
-
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
|
902
|
-
errorMap?: ZodErrorMap | undefined;
|
|
903
|
-
invalid_type_error?: string | undefined;
|
|
904
|
-
required_error?: string | undefined;
|
|
905
|
-
description?: string | undefined;
|
|
906
|
-
} & {
|
|
907
|
-
catch: T_1["_output"] | (() => T_1["_output"]);
|
|
908
|
-
}) => ZodCatch<T_1>;
|
|
834
|
+
static create: (params?: RawCreateParams) => ZodAny;
|
|
909
835
|
}
|
|
910
|
-
interface
|
|
911
|
-
|
|
912
|
-
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
|
836
|
+
interface ZodUnknownDef extends ZodTypeDef {
|
|
837
|
+
typeName: ZodFirstPartyTypeKind.ZodUnknown;
|
|
913
838
|
}
|
|
914
|
-
declare
|
|
915
|
-
|
|
916
|
-
[
|
|
917
|
-
|
|
918
|
-
};
|
|
919
|
-
};
|
|
920
|
-
declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
|
|
921
|
-
_parse(input: ParseInput): ParseReturnType<any>;
|
|
922
|
-
unwrap(): T;
|
|
839
|
+
declare class ZodUnknown extends ZodType<unknown, ZodUnknownDef> {
|
|
840
|
+
_unknown: true;
|
|
841
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
842
|
+
static create: (params?: RawCreateParams) => ZodUnknown;
|
|
923
843
|
}
|
|
924
|
-
interface
|
|
925
|
-
|
|
926
|
-
out: B;
|
|
927
|
-
typeName: ZodFirstPartyTypeKind.ZodPipeline;
|
|
844
|
+
interface ZodVoidDef extends ZodTypeDef {
|
|
845
|
+
typeName: ZodFirstPartyTypeKind.ZodVoid;
|
|
928
846
|
}
|
|
929
|
-
declare class
|
|
930
|
-
_parse(input: ParseInput): ParseReturnType<
|
|
931
|
-
static create
|
|
847
|
+
declare class ZodVoid extends ZodType<void, ZodVoidDef> {
|
|
848
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
849
|
+
static create: (params?: RawCreateParams) => ZodVoid;
|
|
932
850
|
}
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
ZodObject = "ZodObject",
|
|
949
|
-
ZodUnion = "ZodUnion",
|
|
950
|
-
ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
|
|
951
|
-
ZodIntersection = "ZodIntersection",
|
|
952
|
-
ZodTuple = "ZodTuple",
|
|
953
|
-
ZodRecord = "ZodRecord",
|
|
954
|
-
ZodMap = "ZodMap",
|
|
955
|
-
ZodSet = "ZodSet",
|
|
956
|
-
ZodFunction = "ZodFunction",
|
|
957
|
-
ZodLazy = "ZodLazy",
|
|
958
|
-
ZodLiteral = "ZodLiteral",
|
|
959
|
-
ZodEnum = "ZodEnum",
|
|
960
|
-
ZodEffects = "ZodEffects",
|
|
961
|
-
ZodNativeEnum = "ZodNativeEnum",
|
|
962
|
-
ZodOptional = "ZodOptional",
|
|
963
|
-
ZodNullable = "ZodNullable",
|
|
964
|
-
ZodDefault = "ZodDefault",
|
|
965
|
-
ZodCatch = "ZodCatch",
|
|
966
|
-
ZodPromise = "ZodPromise",
|
|
967
|
-
ZodBranded = "ZodBranded",
|
|
968
|
-
ZodPipeline = "ZodPipeline"
|
|
851
|
+
interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
852
|
+
type: T;
|
|
853
|
+
typeName: ZodFirstPartyTypeKind.ZodArray;
|
|
854
|
+
exactLength: {
|
|
855
|
+
value: number;
|
|
856
|
+
message?: string;
|
|
857
|
+
} | null;
|
|
858
|
+
minLength: {
|
|
859
|
+
value: number;
|
|
860
|
+
message?: string;
|
|
861
|
+
} | null;
|
|
862
|
+
maxLength: {
|
|
863
|
+
value: number;
|
|
864
|
+
message?: string;
|
|
865
|
+
} | null;
|
|
969
866
|
}
|
|
970
|
-
|
|
971
|
-
type
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
};
|
|
981
|
-
type AsyncVoidCallback = {
|
|
982
|
-
success?: () => void;
|
|
983
|
-
fail?: ((err: AsyncCallbackFailObject) => void) | undefined;
|
|
984
|
-
};
|
|
985
|
-
type GetLocationReturns = {
|
|
986
|
-
/** latitude */
|
|
987
|
-
latitude?: string;
|
|
988
|
-
/** longitude */
|
|
989
|
-
longitude?: string;
|
|
990
|
-
/** timestamp */
|
|
991
|
-
timestamp?: string;
|
|
992
|
-
/** provider */
|
|
993
|
-
provider?: string;
|
|
994
|
-
token?: string;
|
|
995
|
-
};
|
|
996
|
-
type CameraParams = {
|
|
997
|
-
mediaConstraints?: MediaConstraints;
|
|
998
|
-
canvasElement?: HTMLCanvasElement;
|
|
999
|
-
videoElement: HTMLVideoElement;
|
|
1000
|
-
};
|
|
1001
|
-
interface SystemInfo {
|
|
1002
|
-
/** Mini app version */
|
|
1003
|
-
version: string;
|
|
1004
|
-
/** SDK version */
|
|
1005
|
-
apiVersion: string;
|
|
1006
|
-
/** Zalo version */
|
|
1007
|
-
zaloVersion: string;
|
|
1008
|
-
/** Client platform */
|
|
1009
|
-
platform: string;
|
|
1010
|
-
/** Language set in Zalo */
|
|
1011
|
-
language: string;
|
|
1012
|
-
/** Language set in Zalo */
|
|
1013
|
-
zaloLanguage: string;
|
|
1014
|
-
/** Theme set in Zalo */
|
|
1015
|
-
zaloTheme: string;
|
|
867
|
+
declare type ArrayCardinality = "many" | "atleastone";
|
|
868
|
+
declare type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
|
|
869
|
+
declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
|
|
870
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
871
|
+
get element(): T;
|
|
872
|
+
min(minLength: number, message?: errorUtil.ErrMessage): this;
|
|
873
|
+
max(maxLength: number, message?: errorUtil.ErrMessage): this;
|
|
874
|
+
length(len: number, message?: errorUtil.ErrMessage): this;
|
|
875
|
+
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
|
876
|
+
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodArray<T_1, "many">;
|
|
1016
877
|
}
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
};
|
|
1027
|
-
type
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
};
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
}
|
|
1055
|
-
type
|
|
1056
|
-
|
|
1057
|
-
}
|
|
1058
|
-
type
|
|
1059
|
-
|
|
1060
|
-
}
|
|
1061
|
-
type
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
numberOfUser: number;
|
|
1065
|
-
};
|
|
1066
|
-
type OpenShareSheetReturns = {
|
|
1067
|
-
status: 0 | 2 | 1;
|
|
1068
|
-
shareType: 0 | 2 | 1;
|
|
1069
|
-
numberOfUser: number;
|
|
1070
|
-
};
|
|
1071
|
-
type RequestCameraPermissionReturns = {
|
|
1072
|
-
userAllow: boolean;
|
|
1073
|
-
message: string;
|
|
878
|
+
declare namespace objectUtil {
|
|
879
|
+
export type MergeShapes<U extends ZodRawShape, V extends ZodRawShape> = {
|
|
880
|
+
[k in Exclude<keyof U, keyof V>]: U[k];
|
|
881
|
+
} & V;
|
|
882
|
+
type optionalKeys<T extends object> = {
|
|
883
|
+
[k in keyof T]: undefined extends T[k] ? k : never;
|
|
884
|
+
}[keyof T];
|
|
885
|
+
type requiredKeys<T extends object> = {
|
|
886
|
+
[k in keyof T]: undefined extends T[k] ? never : k;
|
|
887
|
+
}[keyof T];
|
|
888
|
+
export type addQuestionMarks<T extends object> = Partial<Pick<T, optionalKeys<T>>> & Pick<T, requiredKeys<T>>;
|
|
889
|
+
export type identity<T> = T;
|
|
890
|
+
export type flatten<T extends object> = identity<{
|
|
891
|
+
[k in keyof T]: T[k];
|
|
892
|
+
}>;
|
|
893
|
+
export type noNeverKeys<T extends ZodRawShape> = {
|
|
894
|
+
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
|
895
|
+
}[keyof T];
|
|
896
|
+
export type noNever<T extends ZodRawShape> = identity<{
|
|
897
|
+
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
|
898
|
+
}>;
|
|
899
|
+
export const mergeShapes: <U extends ZodRawShape, T extends ZodRawShape>(first: U, second: T) => T & U;
|
|
900
|
+
export {};
|
|
901
|
+
}
|
|
902
|
+
declare type extendShape<A, B> = util.flatten<Omit<A, keyof B> & B>;
|
|
903
|
+
declare type UnknownKeysParam = "passthrough" | "strict" | "strip";
|
|
904
|
+
interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
905
|
+
typeName: ZodFirstPartyTypeKind.ZodObject;
|
|
906
|
+
shape: () => T;
|
|
907
|
+
catchall: Catchall;
|
|
908
|
+
unknownKeys: UnknownKeys;
|
|
909
|
+
}
|
|
910
|
+
declare type baseObjectOutputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
|
|
911
|
+
[k in keyof Shape]: Shape[k]["_output"];
|
|
912
|
+
}>;
|
|
913
|
+
declare type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny> = ZodTypeAny extends Catchall ? objectUtil.flatten<baseObjectOutputType<Shape>> : objectUtil.flatten<baseObjectOutputType<Shape> & {
|
|
914
|
+
[k: string]: Catchall["_output"];
|
|
915
|
+
}>;
|
|
916
|
+
declare type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.flatten<objectUtil.addQuestionMarks<{
|
|
917
|
+
[k in keyof Shape]: Shape[k]["_input"];
|
|
918
|
+
}>>;
|
|
919
|
+
declare type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny> = ZodTypeAny extends Catchall ? baseObjectInputType<Shape> : objectUtil.flatten<baseObjectInputType<Shape> & {
|
|
920
|
+
[k: string]: Catchall["_input"];
|
|
921
|
+
}>;
|
|
922
|
+
declare type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
|
|
923
|
+
declare type objectKeyMask<Obj> = {
|
|
924
|
+
[k in keyof Obj]?: true;
|
|
1074
925
|
};
|
|
1075
|
-
type
|
|
1076
|
-
|
|
926
|
+
declare type noUnrecognized<Obj extends object, Shape extends object> = {
|
|
927
|
+
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
|
|
1077
928
|
};
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
code: number;
|
|
1084
|
-
message: string;
|
|
1085
|
-
payToken: string;
|
|
929
|
+
declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall>, Input = objectInputType<T, Catchall>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
|
|
930
|
+
private _cached;
|
|
931
|
+
_getCached(): {
|
|
932
|
+
shape: T;
|
|
933
|
+
keys: string[];
|
|
1086
934
|
};
|
|
935
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
936
|
+
get shape(): T;
|
|
937
|
+
strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
|
|
938
|
+
strip(): ZodObject<T, "strip", Catchall>;
|
|
939
|
+
passthrough(): ZodObject<T, "passthrough", Catchall>;
|
|
940
|
+
/**
|
|
941
|
+
* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
|
|
942
|
+
* If you want to pass through unknown properties, use `.passthrough()` instead.
|
|
943
|
+
*/
|
|
944
|
+
nonstrict: () => ZodObject<T, "passthrough", Catchall>;
|
|
945
|
+
extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
|
946
|
+
/**
|
|
947
|
+
* @deprecated Use `.extend` instead
|
|
948
|
+
* */
|
|
949
|
+
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, UnknownKeys, Catchall, objectOutputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall>, objectInputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall>>;
|
|
950
|
+
/**
|
|
951
|
+
* Prior to zod@1.0.12 there was a bug in the
|
|
952
|
+
* inferred type of merged objects. Please
|
|
953
|
+
* upgrade if you are experiencing issues.
|
|
954
|
+
*/
|
|
955
|
+
merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
|
|
956
|
+
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
|
|
957
|
+
[k in Key]: Schema;
|
|
958
|
+
}, UnknownKeys, Catchall>;
|
|
959
|
+
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
|
|
960
|
+
pick<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, T>): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
|
961
|
+
omit<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
|
962
|
+
deepPartial(): partialUtil.DeepPartial<this>;
|
|
963
|
+
partial(): ZodObject<{
|
|
964
|
+
[k in keyof T]: ZodOptional<T[k]>;
|
|
965
|
+
}, UnknownKeys, Catchall>;
|
|
966
|
+
partial<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<objectUtil.noNever<{
|
|
967
|
+
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
|
|
968
|
+
}>, UnknownKeys, Catchall>;
|
|
969
|
+
required(): ZodObject<{
|
|
970
|
+
[k in keyof T]: deoptional<T[k]>;
|
|
971
|
+
}, UnknownKeys, Catchall>;
|
|
972
|
+
required<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<objectUtil.noNever<{
|
|
973
|
+
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
|
974
|
+
}>, UnknownKeys, Catchall>;
|
|
975
|
+
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
|
976
|
+
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof baseObjectOutputType<T_1>]: baseObjectOutputType<T_1>[k]; }, { [k_2 in keyof objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>[k_2]; }>;
|
|
977
|
+
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k in keyof baseObjectOutputType<T_1>]: baseObjectOutputType<T_1>[k]; }, { [k_2 in keyof objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>[k_2]; }>;
|
|
978
|
+
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof baseObjectOutputType<T_1>]: baseObjectOutputType<T_1>[k]; }, { [k_2 in keyof objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_1 in keyof T_1]: T_1[k_1]["_input"]; }>[k_2]; }>;
|
|
979
|
+
}
|
|
980
|
+
declare type AnyZodObject = ZodObject<any, any, any>;
|
|
981
|
+
declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
|
982
|
+
interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[
|
|
983
|
+
ZodTypeAny,
|
|
984
|
+
ZodTypeAny,
|
|
985
|
+
...ZodTypeAny[]
|
|
986
|
+
]>> extends ZodTypeDef {
|
|
987
|
+
options: T;
|
|
988
|
+
typeName: ZodFirstPartyTypeKind.ZodUnion;
|
|
989
|
+
}
|
|
990
|
+
declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
|
|
991
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
992
|
+
get options(): T;
|
|
993
|
+
static create: <T_1 extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T_1, params?: RawCreateParams) => ZodUnion<T_1>;
|
|
994
|
+
}
|
|
995
|
+
interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
996
|
+
left: T;
|
|
997
|
+
right: U;
|
|
998
|
+
typeName: ZodFirstPartyTypeKind.ZodIntersection;
|
|
999
|
+
}
|
|
1000
|
+
declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
|
|
1001
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1002
|
+
static create: <T_1 extends ZodTypeAny, U_1 extends ZodTypeAny>(left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection<T_1, U_1>;
|
|
1003
|
+
}
|
|
1004
|
+
declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
|
|
1005
|
+
declare type AssertArray<T> = T extends any[] ? T : never;
|
|
1006
|
+
declare type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
1007
|
+
[k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_output"] : never;
|
|
1008
|
+
}>;
|
|
1009
|
+
declare type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
|
|
1010
|
+
declare type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
1011
|
+
[k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_input"] : never;
|
|
1012
|
+
}>;
|
|
1013
|
+
declare type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
|
|
1014
|
+
interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
|
|
1015
|
+
items: T;
|
|
1016
|
+
rest: Rest;
|
|
1017
|
+
typeName: ZodFirstPartyTypeKind.ZodTuple;
|
|
1018
|
+
}
|
|
1019
|
+
declare type AnyZodTuple = ZodTuple<[
|
|
1020
|
+
ZodTypeAny,
|
|
1021
|
+
...ZodTypeAny[]
|
|
1022
|
+
] | [], ZodTypeAny | null>;
|
|
1023
|
+
declare class ZodTuple<T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
|
|
1024
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1025
|
+
get items(): T;
|
|
1026
|
+
rest<Rest extends ZodTypeAny>(rest: Rest): ZodTuple<T, Rest>;
|
|
1027
|
+
static create: <T_1 extends [] | [ZodTypeAny, ...ZodTypeAny[]]>(schemas: T_1, params?: RawCreateParams) => ZodTuple<T_1, null>;
|
|
1028
|
+
}
|
|
1029
|
+
interface ZodRecordDef<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1030
|
+
valueType: Value;
|
|
1031
|
+
keyType: Key;
|
|
1032
|
+
typeName: ZodFirstPartyTypeKind.ZodRecord;
|
|
1033
|
+
}
|
|
1034
|
+
declare type KeySchema = ZodType<string | number | symbol, any, any>;
|
|
1035
|
+
declare type RecordType<K extends string | number | symbol, V> = [
|
|
1036
|
+
string
|
|
1037
|
+
] extends [K] ? Record<K, V> : [number] extends [K] ? Record<K, V> : [symbol] extends [K] ? Record<K, V> : Partial<Record<K, V>>;
|
|
1038
|
+
declare class ZodRecord<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodType<RecordType<Key["_output"], Value["_output"]>, ZodRecordDef<Key, Value>, RecordType<Key["_input"], Value["_input"]>> {
|
|
1039
|
+
get keySchema(): Key;
|
|
1040
|
+
get valueSchema(): Value;
|
|
1041
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1042
|
+
get element(): Value;
|
|
1043
|
+
static create<Value extends ZodTypeAny>(valueType: Value, params?: RawCreateParams): ZodRecord<ZodString, Value>;
|
|
1044
|
+
static create<Keys extends KeySchema, Value extends ZodTypeAny>(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord<Keys, Value>;
|
|
1045
|
+
}
|
|
1046
|
+
interface ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1047
|
+
args: Args;
|
|
1048
|
+
returns: Returns;
|
|
1049
|
+
typeName: ZodFirstPartyTypeKind.ZodFunction;
|
|
1050
|
+
}
|
|
1051
|
+
declare type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
|
|
1052
|
+
declare type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
|
|
1053
|
+
declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {
|
|
1054
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1055
|
+
parameters(): Args;
|
|
1056
|
+
returnType(): Returns;
|
|
1057
|
+
args<Items extends Parameters<typeof ZodTuple["create"]>[0]>(...items: Items): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns>;
|
|
1058
|
+
returns<NewReturnType extends ZodType<any, any>>(returnType: NewReturnType): ZodFunction<Args, NewReturnType>;
|
|
1059
|
+
implement<F extends InnerTypeOfFunction<Args, Returns>>(func: F): ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
|
1060
|
+
strictImplement(func: InnerTypeOfFunction<Args, Returns>): InnerTypeOfFunction<Args, Returns>;
|
|
1061
|
+
validate: <F extends InnerTypeOfFunction<Args, Returns>>(func: F) => ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
|
1062
|
+
static create(): ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>;
|
|
1063
|
+
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>>(args: T): ZodFunction<T, ZodUnknown>;
|
|
1064
|
+
static create<T extends AnyZodTuple, U extends ZodTypeAny>(args: T, returns: U): ZodFunction<T, U>;
|
|
1065
|
+
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction<T, U>;
|
|
1066
|
+
}
|
|
1067
|
+
declare type EnumValues = [string, ...string[]];
|
|
1068
|
+
declare type Values<T extends EnumValues> = {
|
|
1069
|
+
[k in T[number]]: k;
|
|
1087
1070
|
};
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
type OpenWebviewReturns = {
|
|
1095
|
-
success: boolean;
|
|
1096
|
-
};
|
|
1097
|
-
type GetAppInfoReturns = {
|
|
1098
|
-
description: string;
|
|
1099
|
-
version: string;
|
|
1100
|
-
name: string;
|
|
1101
|
-
appUrl: string;
|
|
1102
|
-
qrCodeUrl: string;
|
|
1103
|
-
logoUrl?: string;
|
|
1104
|
-
};
|
|
1105
|
-
type GetPhoneNumberReturns = {
|
|
1106
|
-
number?: string;
|
|
1107
|
-
token?: string;
|
|
1108
|
-
};
|
|
1109
|
-
type OpenProfilePickerReturns = {
|
|
1110
|
-
users: {
|
|
1111
|
-
id: string;
|
|
1112
|
-
profile: {
|
|
1113
|
-
name: string;
|
|
1114
|
-
avatar: string;
|
|
1115
|
-
};
|
|
1116
|
-
code: number;
|
|
1117
|
-
message: string;
|
|
1118
|
-
}[];
|
|
1119
|
-
};
|
|
1120
|
-
type OpenMediaPickerReturns = {
|
|
1121
|
-
data: string;
|
|
1122
|
-
};
|
|
1123
|
-
/**
|
|
1124
|
-
* Context info
|
|
1125
|
-
*/
|
|
1126
|
-
type ContextInfo = {
|
|
1127
|
-
type?: string;
|
|
1128
|
-
id?: string;
|
|
1129
|
-
};
|
|
1130
|
-
type GetAuthCodeReturns = {
|
|
1131
|
-
authCode: string;
|
|
1132
|
-
authCodeVerify: string;
|
|
1133
|
-
};
|
|
1134
|
-
type GetZPITokenReturns = {
|
|
1135
|
-
utoken: string;
|
|
1136
|
-
gtoken: string;
|
|
1137
|
-
zpp: string;
|
|
1138
|
-
zpt: string;
|
|
1139
|
-
};
|
|
1140
|
-
type ChooseImageReturns = {
|
|
1141
|
-
filePaths: Array<string>;
|
|
1142
|
-
tempFiles: Array<{
|
|
1143
|
-
path: string;
|
|
1144
|
-
size: number;
|
|
1145
|
-
}>;
|
|
1146
|
-
};
|
|
1147
|
-
type CreateOrderReturns = {
|
|
1148
|
-
orderId: string;
|
|
1149
|
-
};
|
|
1150
|
-
type SelectPaymentMethodReturns = {
|
|
1151
|
-
method: string;
|
|
1071
|
+
interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
|
|
1072
|
+
values: T;
|
|
1073
|
+
typeName: ZodFirstPartyTypeKind.ZodEnum;
|
|
1074
|
+
}
|
|
1075
|
+
declare type Writeable<T> = {
|
|
1076
|
+
-readonly [P in keyof T]: T[P];
|
|
1152
1077
|
};
|
|
1153
|
-
type
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1078
|
+
declare type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
|
|
1079
|
+
declare type typecast<A, T> = A extends T ? A : never;
|
|
1080
|
+
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
|
1081
|
+
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
|
1082
|
+
declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>> {
|
|
1083
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1084
|
+
get options(): T;
|
|
1085
|
+
get enum(): Values<T>;
|
|
1086
|
+
get Values(): Values<T>;
|
|
1087
|
+
get Enum(): Values<T>;
|
|
1088
|
+
extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract): ZodEnum<Writeable<ToExtract>>;
|
|
1089
|
+
exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
|
|
1090
|
+
static create: typeof createZodEnum;
|
|
1091
|
+
}
|
|
1092
|
+
interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1093
|
+
type: T;
|
|
1094
|
+
typeName: ZodFirstPartyTypeKind.ZodPromise;
|
|
1095
|
+
}
|
|
1096
|
+
declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
|
|
1097
|
+
unwrap(): T;
|
|
1098
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1099
|
+
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodPromise<T_1>;
|
|
1100
|
+
}
|
|
1101
|
+
declare type RefinementEffect<T> = {
|
|
1102
|
+
type: "refinement";
|
|
1103
|
+
refinement: (arg: T, ctx: RefinementCtx) => any;
|
|
1164
1104
|
};
|
|
1165
|
-
type
|
|
1166
|
-
|
|
1105
|
+
declare type TransformEffect<T> = {
|
|
1106
|
+
type: "transform";
|
|
1107
|
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
1167
1108
|
};
|
|
1168
|
-
declare
|
|
1169
|
-
type
|
|
1170
|
-
|
|
1171
|
-
[key in AuthenScopeType]: boolean;
|
|
1172
|
-
}>;
|
|
1173
|
-
type GetSettingReturn = {
|
|
1174
|
-
authSetting: AuthenResponse;
|
|
1109
|
+
declare type PreprocessEffect<T> = {
|
|
1110
|
+
type: "preprocess";
|
|
1111
|
+
transform: (arg: T) => any;
|
|
1175
1112
|
};
|
|
1113
|
+
declare type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
|
|
1114
|
+
interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1115
|
+
schema: T;
|
|
1116
|
+
typeName: ZodFirstPartyTypeKind.ZodEffects;
|
|
1117
|
+
effect: Effect<any>;
|
|
1118
|
+
}
|
|
1119
|
+
declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
|
|
1120
|
+
innerType(): T;
|
|
1121
|
+
sourceType(): T;
|
|
1122
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1123
|
+
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"], input<I>>;
|
|
1124
|
+
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
|
1125
|
+
}
|
|
1176
1126
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
OnStopCallback = "h5.event.camera.stop"
|
|
1127
|
+
interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1128
|
+
innerType: T;
|
|
1129
|
+
typeName: ZodFirstPartyTypeKind.ZodOptional;
|
|
1181
1130
|
}
|
|
1182
|
-
declare
|
|
1183
|
-
|
|
1184
|
-
|
|
1131
|
+
declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
|
|
1132
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1133
|
+
unwrap(): T;
|
|
1134
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodOptional<T_1>;
|
|
1185
1135
|
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
JPEG = "image/jpeg"
|
|
1136
|
+
interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1137
|
+
innerType: T;
|
|
1138
|
+
typeName: ZodFirstPartyTypeKind.ZodNullable;
|
|
1190
1139
|
}
|
|
1191
|
-
declare
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1140
|
+
declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
|
|
1141
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1142
|
+
unwrap(): T;
|
|
1143
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodNullable<T_1>;
|
|
1195
1144
|
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1145
|
+
interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1146
|
+
innerType: T;
|
|
1147
|
+
defaultValue: () => util.noUndefined<T["_input"]>;
|
|
1148
|
+
typeName: ZodFirstPartyTypeKind.ZodDefault;
|
|
1199
1149
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1150
|
+
declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
|
|
1151
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1152
|
+
removeDefault(): T;
|
|
1153
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
|
1154
|
+
errorMap?: ZodErrorMap | undefined;
|
|
1155
|
+
invalid_type_error?: string | undefined;
|
|
1156
|
+
required_error?: string | undefined;
|
|
1157
|
+
description?: string | undefined;
|
|
1158
|
+
} & {
|
|
1159
|
+
default: T_1["_input"] | (() => util.noUndefined<T_1["_input"]>);
|
|
1160
|
+
}) => ZodDefault<T_1>;
|
|
1161
|
+
}
|
|
1162
|
+
interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny, C extends T["_input"] = T["_input"]> extends ZodTypeDef {
|
|
1163
|
+
innerType: T;
|
|
1164
|
+
catchValue: () => C;
|
|
1165
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
|
1166
|
+
}
|
|
1167
|
+
declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
|
|
1168
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1169
|
+
removeCatch(): T;
|
|
1170
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
|
1171
|
+
errorMap?: ZodErrorMap | undefined;
|
|
1172
|
+
invalid_type_error?: string | undefined;
|
|
1173
|
+
required_error?: string | undefined;
|
|
1174
|
+
description?: string | undefined;
|
|
1175
|
+
} & {
|
|
1176
|
+
catch: T_1["_output"] | (() => T_1["_output"]);
|
|
1177
|
+
}) => ZodCatch<T_1>;
|
|
1178
|
+
}
|
|
1179
|
+
interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
|
|
1180
|
+
type: T;
|
|
1181
|
+
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
|
1182
|
+
}
|
|
1183
|
+
declare const BRAND: unique symbol;
|
|
1184
|
+
declare type BRAND<T extends string | number | symbol> = {
|
|
1185
|
+
[BRAND]: {
|
|
1186
|
+
[k in T]: true;
|
|
1187
|
+
};
|
|
1228
1188
|
};
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1189
|
+
declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
|
|
1190
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1191
|
+
unwrap(): T;
|
|
1192
|
+
}
|
|
1193
|
+
interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
|
|
1194
|
+
in: A;
|
|
1195
|
+
out: B;
|
|
1196
|
+
typeName: ZodFirstPartyTypeKind.ZodPipeline;
|
|
1197
|
+
}
|
|
1198
|
+
declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
|
|
1199
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1200
|
+
static create<A extends ZodTypeAny, B extends ZodTypeAny>(a: A, b: B): ZodPipeline<A, B>;
|
|
1201
|
+
}
|
|
1202
|
+
declare enum ZodFirstPartyTypeKind {
|
|
1203
|
+
ZodString = "ZodString",
|
|
1204
|
+
ZodNumber = "ZodNumber",
|
|
1205
|
+
ZodNaN = "ZodNaN",
|
|
1206
|
+
ZodBigInt = "ZodBigInt",
|
|
1207
|
+
ZodBoolean = "ZodBoolean",
|
|
1208
|
+
ZodDate = "ZodDate",
|
|
1209
|
+
ZodSymbol = "ZodSymbol",
|
|
1210
|
+
ZodUndefined = "ZodUndefined",
|
|
1211
|
+
ZodNull = "ZodNull",
|
|
1212
|
+
ZodAny = "ZodAny",
|
|
1213
|
+
ZodUnknown = "ZodUnknown",
|
|
1214
|
+
ZodNever = "ZodNever",
|
|
1215
|
+
ZodVoid = "ZodVoid",
|
|
1216
|
+
ZodArray = "ZodArray",
|
|
1217
|
+
ZodObject = "ZodObject",
|
|
1218
|
+
ZodUnion = "ZodUnion",
|
|
1219
|
+
ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
|
|
1220
|
+
ZodIntersection = "ZodIntersection",
|
|
1221
|
+
ZodTuple = "ZodTuple",
|
|
1222
|
+
ZodRecord = "ZodRecord",
|
|
1223
|
+
ZodMap = "ZodMap",
|
|
1224
|
+
ZodSet = "ZodSet",
|
|
1225
|
+
ZodFunction = "ZodFunction",
|
|
1226
|
+
ZodLazy = "ZodLazy",
|
|
1227
|
+
ZodLiteral = "ZodLiteral",
|
|
1228
|
+
ZodEnum = "ZodEnum",
|
|
1229
|
+
ZodEffects = "ZodEffects",
|
|
1230
|
+
ZodNativeEnum = "ZodNativeEnum",
|
|
1231
|
+
ZodOptional = "ZodOptional",
|
|
1232
|
+
ZodNullable = "ZodNullable",
|
|
1233
|
+
ZodDefault = "ZodDefault",
|
|
1234
|
+
ZodCatch = "ZodCatch",
|
|
1235
|
+
ZodPromise = "ZodPromise",
|
|
1236
|
+
ZodBranded = "ZodBranded",
|
|
1237
|
+
ZodPipeline = "ZodPipeline"
|
|
1238
|
+
}
|
|
1237
1239
|
|
|
1238
1240
|
declare const setNavigationBarTitleArgs: ZodOptional<ZodObject<{
|
|
1239
1241
|
title: ZodString;
|
|
@@ -1487,15 +1489,15 @@ declare const openPostFeedArgs: ZodUnion<[ZodObject<{
|
|
|
1487
1489
|
imageUrl?: string | undefined;
|
|
1488
1490
|
}>;
|
|
1489
1491
|
}, "strip", ZodTypeAny, {
|
|
1490
|
-
type: "image";
|
|
1491
1492
|
data: {
|
|
1492
1493
|
imageUrl?: string | undefined;
|
|
1493
1494
|
};
|
|
1494
|
-
}, {
|
|
1495
1495
|
type: "image";
|
|
1496
|
+
}, {
|
|
1496
1497
|
data: {
|
|
1497
1498
|
imageUrl?: string | undefined;
|
|
1498
1499
|
};
|
|
1500
|
+
type: "image";
|
|
1499
1501
|
}>, ZodObject<{
|
|
1500
1502
|
type: ZodEnum<["link"]>;
|
|
1501
1503
|
data: ZodObject<{
|
|
@@ -1515,21 +1517,21 @@ declare const openPostFeedArgs: ZodUnion<[ZodObject<{
|
|
|
1515
1517
|
link: string;
|
|
1516
1518
|
}>;
|
|
1517
1519
|
}, "strip", ZodTypeAny, {
|
|
1518
|
-
type: "link";
|
|
1519
1520
|
data: {
|
|
1520
1521
|
description?: string | undefined;
|
|
1521
1522
|
title?: string | undefined;
|
|
1522
1523
|
thumb?: string | undefined;
|
|
1523
1524
|
link: string;
|
|
1524
1525
|
};
|
|
1525
|
-
}, {
|
|
1526
1526
|
type: "link";
|
|
1527
|
+
}, {
|
|
1527
1528
|
data: {
|
|
1528
1529
|
description?: string | undefined;
|
|
1529
1530
|
title?: string | undefined;
|
|
1530
1531
|
thumb?: string | undefined;
|
|
1531
1532
|
link: string;
|
|
1532
1533
|
};
|
|
1534
|
+
type: "link";
|
|
1533
1535
|
}>, ZodObject<{
|
|
1534
1536
|
type: ZodEnum<["profile"]>;
|
|
1535
1537
|
data: ZodObject<{
|
|
@@ -1540,15 +1542,15 @@ declare const openPostFeedArgs: ZodUnion<[ZodObject<{
|
|
|
1540
1542
|
id?: string | undefined;
|
|
1541
1543
|
}>;
|
|
1542
1544
|
}, "strip", ZodTypeAny, {
|
|
1543
|
-
type: "profile";
|
|
1544
1545
|
data: {
|
|
1545
1546
|
id?: string | undefined;
|
|
1546
1547
|
};
|
|
1547
|
-
}, {
|
|
1548
1548
|
type: "profile";
|
|
1549
|
+
}, {
|
|
1549
1550
|
data: {
|
|
1550
1551
|
id?: string | undefined;
|
|
1551
1552
|
};
|
|
1553
|
+
type: "profile";
|
|
1552
1554
|
}>]>[];
|
|
1553
1555
|
declare function openPostFeed(args: AsyncCallback<OpenPostFeedReturns> & TypeOf<(typeof openPostFeedArgs)[0]>): Promise<OpenPostFeedReturns>;
|
|
1554
1556
|
|
|
@@ -1577,31 +1579,31 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
|
|
|
1577
1579
|
type: ZodEnum<["text"]>;
|
|
1578
1580
|
data: ZodObject<{
|
|
1579
1581
|
text: ZodString;
|
|
1580
|
-
|
|
1582
|
+
description: ZodOptional<ZodDefault<ZodString>>;
|
|
1581
1583
|
autoParseLink: ZodOptional<ZodDefault<ZodBoolean>>;
|
|
1582
1584
|
}, "strip", ZodTypeAny, {
|
|
1583
|
-
|
|
1585
|
+
description?: string | undefined;
|
|
1584
1586
|
autoParseLink?: boolean | undefined;
|
|
1585
1587
|
text: string;
|
|
1586
1588
|
}, {
|
|
1587
|
-
|
|
1589
|
+
description?: string | undefined;
|
|
1588
1590
|
autoParseLink?: boolean | undefined;
|
|
1589
1591
|
text: string;
|
|
1590
1592
|
}>;
|
|
1591
1593
|
}, "strip", ZodTypeAny, {
|
|
1592
|
-
type: "text";
|
|
1593
1594
|
data: {
|
|
1594
|
-
|
|
1595
|
+
description?: string | undefined;
|
|
1595
1596
|
autoParseLink?: boolean | undefined;
|
|
1596
1597
|
text: string;
|
|
1597
1598
|
};
|
|
1598
|
-
}, {
|
|
1599
1599
|
type: "text";
|
|
1600
|
+
}, {
|
|
1600
1601
|
data: {
|
|
1601
|
-
|
|
1602
|
+
description?: string | undefined;
|
|
1602
1603
|
autoParseLink?: boolean | undefined;
|
|
1603
1604
|
text: string;
|
|
1604
1605
|
};
|
|
1606
|
+
type: "text";
|
|
1605
1607
|
}>, ZodObject<{
|
|
1606
1608
|
type: ZodEnum<["image"]>;
|
|
1607
1609
|
data: ZodObject<{
|
|
@@ -1615,17 +1617,17 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
|
|
|
1615
1617
|
imageUrl: string;
|
|
1616
1618
|
}>;
|
|
1617
1619
|
}, "strip", ZodTypeAny, {
|
|
1618
|
-
type: "image";
|
|
1619
1620
|
data: {
|
|
1620
1621
|
imageUrls?: string[] | undefined;
|
|
1621
1622
|
imageUrl: string;
|
|
1622
1623
|
};
|
|
1623
|
-
}, {
|
|
1624
1624
|
type: "image";
|
|
1625
|
+
}, {
|
|
1625
1626
|
data: {
|
|
1626
1627
|
imageUrls?: string[] | undefined;
|
|
1627
1628
|
imageUrl: string;
|
|
1628
1629
|
};
|
|
1630
|
+
type: "image";
|
|
1629
1631
|
}>, ZodObject<{
|
|
1630
1632
|
type: ZodEnum<["link"]>;
|
|
1631
1633
|
data: ZodObject<{
|
|
@@ -1639,17 +1641,17 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
|
|
|
1639
1641
|
link: string;
|
|
1640
1642
|
}>;
|
|
1641
1643
|
}, "strip", ZodTypeAny, {
|
|
1642
|
-
type: "link";
|
|
1643
1644
|
data: {
|
|
1644
1645
|
chatOnly?: boolean | undefined;
|
|
1645
1646
|
link: string;
|
|
1646
1647
|
};
|
|
1647
|
-
}, {
|
|
1648
1648
|
type: "link";
|
|
1649
|
+
}, {
|
|
1649
1650
|
data: {
|
|
1650
1651
|
chatOnly?: boolean | undefined;
|
|
1651
1652
|
link: string;
|
|
1652
1653
|
};
|
|
1654
|
+
type: "link";
|
|
1653
1655
|
}>, ZodObject<{
|
|
1654
1656
|
type: ZodEnum<["oa"]>;
|
|
1655
1657
|
data: ZodObject<{
|
|
@@ -1660,15 +1662,15 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
|
|
|
1660
1662
|
id: string;
|
|
1661
1663
|
}>;
|
|
1662
1664
|
}, "strip", ZodTypeAny, {
|
|
1663
|
-
type: "oa";
|
|
1664
1665
|
data: {
|
|
1665
1666
|
id: string;
|
|
1666
1667
|
};
|
|
1667
|
-
}, {
|
|
1668
1668
|
type: "oa";
|
|
1669
|
+
}, {
|
|
1669
1670
|
data: {
|
|
1670
1671
|
id: string;
|
|
1671
1672
|
};
|
|
1673
|
+
type: "oa";
|
|
1672
1674
|
}>, ZodObject<{
|
|
1673
1675
|
type: ZodEnum<["gif"]>;
|
|
1674
1676
|
data: ZodObject<{
|
|
@@ -1688,21 +1690,21 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
|
|
|
1688
1690
|
gifUrl: string;
|
|
1689
1691
|
}>;
|
|
1690
1692
|
}, "strip", ZodTypeAny, {
|
|
1691
|
-
type: "gif";
|
|
1692
1693
|
data: {
|
|
1693
1694
|
height?: number | undefined;
|
|
1694
1695
|
width?: number | undefined;
|
|
1695
1696
|
imageUrl?: string | undefined;
|
|
1696
1697
|
gifUrl: string;
|
|
1697
1698
|
};
|
|
1698
|
-
}, {
|
|
1699
1699
|
type: "gif";
|
|
1700
|
+
}, {
|
|
1700
1701
|
data: {
|
|
1701
1702
|
height?: number | undefined;
|
|
1702
1703
|
width?: number | undefined;
|
|
1703
1704
|
imageUrl?: string | undefined;
|
|
1704
1705
|
gifUrl: string;
|
|
1705
1706
|
};
|
|
1707
|
+
type: "gif";
|
|
1706
1708
|
}>, ZodObject<{
|
|
1707
1709
|
type: ZodEnum<["video"]>;
|
|
1708
1710
|
data: ZodObject<{
|
|
@@ -1722,21 +1724,21 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
|
|
|
1722
1724
|
videoUrl: string;
|
|
1723
1725
|
}>;
|
|
1724
1726
|
}, "strip", ZodTypeAny, {
|
|
1725
|
-
type: "video";
|
|
1726
1727
|
data: {
|
|
1727
1728
|
height?: number | undefined;
|
|
1728
1729
|
width?: number | undefined;
|
|
1729
1730
|
videoThumb: string;
|
|
1730
1731
|
videoUrl: string;
|
|
1731
1732
|
};
|
|
1732
|
-
}, {
|
|
1733
1733
|
type: "video";
|
|
1734
|
+
}, {
|
|
1734
1735
|
data: {
|
|
1735
1736
|
height?: number | undefined;
|
|
1736
1737
|
width?: number | undefined;
|
|
1737
1738
|
videoThumb: string;
|
|
1738
1739
|
videoUrl: string;
|
|
1739
1740
|
};
|
|
1741
|
+
type: "video";
|
|
1740
1742
|
}>, ZodObject<{
|
|
1741
1743
|
type: ZodEnum<["zmp", "zmp_deep_link"]>;
|
|
1742
1744
|
data: ZodObject<{
|
|
@@ -1745,32 +1747,32 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
|
|
|
1745
1747
|
path: ZodOptional<ZodString>;
|
|
1746
1748
|
description: ZodOptional<ZodDefault<ZodString>>;
|
|
1747
1749
|
}, "strip", ZodTypeAny, {
|
|
1748
|
-
path?: string | undefined;
|
|
1749
1750
|
description?: string | undefined;
|
|
1751
|
+
path?: string | undefined;
|
|
1750
1752
|
title: string;
|
|
1751
1753
|
thumbnail: string;
|
|
1752
1754
|
}, {
|
|
1753
|
-
path?: string | undefined;
|
|
1754
1755
|
description?: string | undefined;
|
|
1756
|
+
path?: string | undefined;
|
|
1755
1757
|
title: string;
|
|
1756
1758
|
thumbnail: string;
|
|
1757
1759
|
}>;
|
|
1758
1760
|
}, "strip", ZodTypeAny, {
|
|
1759
|
-
type: "zmp" | "zmp_deep_link";
|
|
1760
1761
|
data: {
|
|
1761
|
-
path?: string | undefined;
|
|
1762
1762
|
description?: string | undefined;
|
|
1763
|
+
path?: string | undefined;
|
|
1763
1764
|
title: string;
|
|
1764
1765
|
thumbnail: string;
|
|
1765
1766
|
};
|
|
1766
|
-
}, {
|
|
1767
1767
|
type: "zmp" | "zmp_deep_link";
|
|
1768
|
+
}, {
|
|
1768
1769
|
data: {
|
|
1769
|
-
path?: string | undefined;
|
|
1770
1770
|
description?: string | undefined;
|
|
1771
|
+
path?: string | undefined;
|
|
1771
1772
|
title: string;
|
|
1772
1773
|
thumbnail: string;
|
|
1773
1774
|
};
|
|
1775
|
+
type: "zmp" | "zmp_deep_link";
|
|
1774
1776
|
}>]>[];
|
|
1775
1777
|
declare function openShareSheet(args: AsyncCallback<OpenShareSheetReturns> & TypeOf<(typeof openShareSheetArgs)[0]>): Promise<OpenShareSheetReturns>;
|
|
1776
1778
|
|
|
@@ -2034,8 +2036,8 @@ declare const getShareableLinkArgs: ZodObject<{
|
|
|
2034
2036
|
description: string;
|
|
2035
2037
|
title: string;
|
|
2036
2038
|
}, {
|
|
2037
|
-
path?: string | undefined;
|
|
2038
2039
|
description?: string | undefined;
|
|
2040
|
+
path?: string | undefined;
|
|
2039
2041
|
thumbnail?: string | undefined;
|
|
2040
2042
|
title: string;
|
|
2041
2043
|
}>[];
|
|
@@ -2437,7 +2439,7 @@ declare const authorizeArgs: ZodOptional<ZodObject<{
|
|
|
2437
2439
|
}, {
|
|
2438
2440
|
scopes?: ("scope.userInfo" | "scope.userLocation" | "scope.userPhonenumber")[] | undefined;
|
|
2439
2441
|
}>>[];
|
|
2440
|
-
declare function authorize(args?: AsyncVoidCallback & TypeOf<(typeof authorizeArgs)[0]>): Promise<
|
|
2442
|
+
declare function authorize(args?: AsyncVoidCallback & TypeOf<(typeof authorizeArgs)[0]>): Promise<AuthorizeType<(typeof AUTHEN_SCOPE_VALUES)[number]>>;
|
|
2441
2443
|
|
|
2442
2444
|
declare function checkZaloCameraPermission(args?: AsyncCallback<CheckZaloCameraPermissionReturns>): Promise<CheckZaloCameraPermissionReturns>;
|
|
2443
2445
|
|
|
@@ -2661,16 +2663,16 @@ declare const showFunctionButtonWidgetArgs: ZodObject<{
|
|
|
2661
2663
|
disabled?: boolean | undefined;
|
|
2662
2664
|
onDataReceived?: ((...args: unknown[]) => unknown) | undefined;
|
|
2663
2665
|
onError?: ((...args: unknown[]) => unknown) | undefined;
|
|
2664
|
-
type: string;
|
|
2665
2666
|
text: string;
|
|
2667
|
+
type: string;
|
|
2666
2668
|
id: string;
|
|
2667
2669
|
}, {
|
|
2668
2670
|
color?: string | undefined;
|
|
2669
2671
|
disabled?: boolean | undefined;
|
|
2670
2672
|
onDataReceived?: ((...args: unknown[]) => unknown) | undefined;
|
|
2671
2673
|
onError?: ((...args: unknown[]) => unknown) | undefined;
|
|
2672
|
-
type: string;
|
|
2673
2674
|
text: string;
|
|
2675
|
+
type: string;
|
|
2674
2676
|
id: string;
|
|
2675
2677
|
}>[];
|
|
2676
2678
|
declare function showFunctionButtonWidget(args: AsyncVoidCallback & TypeOf<(typeof showFunctionButtonWidgetArgs)[0]>): Promise<void>;
|