zod 3.20.2 → 3.20.6
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/README.md +173 -110
- package/lib/ZodError.d.ts +5 -4
- package/lib/__tests__/Mocker.d.ts +17 -0
- package/lib/__tests__/Mocker.js +57 -0
- package/lib/benchmarks/primitives.js +59 -1
- package/lib/helpers/parseUtil.js +1 -1
- package/lib/index.mjs +226 -85
- package/lib/index.umd.js +226 -85
- package/lib/types.d.ts +57 -41
- package/lib/types.js +225 -84
- package/package.json +3 -2
package/lib/types.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare abstract class ZodType<Output = any, Def extends ZodTypeDef = Zod
|
|
|
72
72
|
constructor(def: Def);
|
|
73
73
|
optional(): ZodOptional<this>;
|
|
74
74
|
nullable(): ZodNullable<this>;
|
|
75
|
-
nullish(): ZodNullable<
|
|
75
|
+
nullish(): ZodOptional<ZodNullable<this>>;
|
|
76
76
|
array(): ZodArray<this>;
|
|
77
77
|
promise(): ZodPromise<this>;
|
|
78
78
|
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
|
|
@@ -81,8 +81,8 @@ export declare abstract class ZodType<Output = any, Def extends ZodTypeDef = Zod
|
|
|
81
81
|
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
|
82
82
|
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
|
83
83
|
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
|
84
|
-
catch(def:
|
|
85
|
-
catch(def: () =>
|
|
84
|
+
catch(def: Output): ZodCatch<this>;
|
|
85
|
+
catch(def: () => Output): ZodCatch<this>;
|
|
86
86
|
describe(description: string): this;
|
|
87
87
|
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
|
88
88
|
isOptional(): boolean;
|
|
@@ -112,6 +112,9 @@ export declare type ZodStringCheck = {
|
|
|
112
112
|
} | {
|
|
113
113
|
kind: "cuid";
|
|
114
114
|
message?: string;
|
|
115
|
+
} | {
|
|
116
|
+
kind: "cuid2";
|
|
117
|
+
message?: string;
|
|
115
118
|
} | {
|
|
116
119
|
kind: "startsWith";
|
|
117
120
|
value: string;
|
|
@@ -146,6 +149,7 @@ export declare class ZodString extends ZodType<string, ZodStringDef> {
|
|
|
146
149
|
url(message?: errorUtil.ErrMessage): ZodString;
|
|
147
150
|
uuid(message?: errorUtil.ErrMessage): ZodString;
|
|
148
151
|
cuid(message?: errorUtil.ErrMessage): ZodString;
|
|
152
|
+
cuid2(message?: errorUtil.ErrMessage): ZodString;
|
|
149
153
|
datetime(options?: string | {
|
|
150
154
|
message?: string | undefined;
|
|
151
155
|
precision?: number | null;
|
|
@@ -168,6 +172,7 @@ export declare class ZodString extends ZodType<string, ZodStringDef> {
|
|
|
168
172
|
get isURL(): boolean;
|
|
169
173
|
get isUUID(): boolean;
|
|
170
174
|
get isCUID(): boolean;
|
|
175
|
+
get isCUID2(): boolean;
|
|
171
176
|
get minLength(): number | null;
|
|
172
177
|
get maxLength(): number | null;
|
|
173
178
|
static create: (params?: ({
|
|
@@ -234,6 +239,7 @@ export declare class ZodNumber extends ZodType<number, ZodNumberDef> {
|
|
|
234
239
|
get minValue(): number | null;
|
|
235
240
|
get maxValue(): number | null;
|
|
236
241
|
get isInt(): boolean;
|
|
242
|
+
get isFinite(): boolean;
|
|
237
243
|
}
|
|
238
244
|
export interface ZodBigIntDef extends ZodTypeDef {
|
|
239
245
|
typeName: ZodFirstPartyTypeKind.ZodBigInt;
|
|
@@ -399,7 +405,7 @@ export declare namespace objectUtil {
|
|
|
399
405
|
export const mergeShapes: <U extends ZodRawShape, T extends ZodRawShape>(first: U, second: T) => T & U;
|
|
400
406
|
export {};
|
|
401
407
|
}
|
|
402
|
-
export declare type extendShape<A, B> = Omit<A, keyof B> & B
|
|
408
|
+
export declare type extendShape<A, B> = util.flatten<Omit<A, keyof B> & B>;
|
|
403
409
|
export declare type UnknownKeysParam = "passthrough" | "strict" | "strip";
|
|
404
410
|
export interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
405
411
|
typeName: ZodFirstPartyTypeKind.ZodObject;
|
|
@@ -407,10 +413,14 @@ export interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys e
|
|
|
407
413
|
catchall: Catchall;
|
|
408
414
|
unknownKeys: UnknownKeys;
|
|
409
415
|
}
|
|
410
|
-
export declare type
|
|
416
|
+
export declare type mergeTypes<A, B> = {
|
|
417
|
+
[k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never;
|
|
418
|
+
};
|
|
419
|
+
export declare type processType<T extends object> = util.flatten<objectUtil.addQuestionMarks<T>>;
|
|
420
|
+
export declare type baseObjectOutputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
|
|
411
421
|
[k in keyof Shape]: Shape[k]["_output"];
|
|
412
|
-
}
|
|
413
|
-
export declare type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny> = ZodTypeAny extends Catchall ? baseObjectOutputType<Shape
|
|
422
|
+
}>;
|
|
423
|
+
export declare type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny> = ZodTypeAny extends Catchall ? objectUtil.flatten<baseObjectOutputType<Shape>> : objectUtil.flatten<baseObjectOutputType<Shape> & {
|
|
414
424
|
[k: string]: Catchall["_output"];
|
|
415
425
|
}>;
|
|
416
426
|
export declare type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.flatten<objectUtil.addQuestionMarks<{
|
|
@@ -420,8 +430,14 @@ export declare type objectInputType<Shape extends ZodRawShape, Catchall extends
|
|
|
420
430
|
[k: string]: Catchall["_input"];
|
|
421
431
|
}>;
|
|
422
432
|
export declare type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
|
|
423
|
-
export declare type SomeZodObject = ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny
|
|
424
|
-
export declare
|
|
433
|
+
export declare type SomeZodObject = ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
|
434
|
+
export declare type objectKeyMask<Obj> = {
|
|
435
|
+
[k in keyof Obj]?: true;
|
|
436
|
+
};
|
|
437
|
+
export declare type noUnrecognized<Obj extends object, Shape extends object> = {
|
|
438
|
+
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
|
|
439
|
+
};
|
|
440
|
+
export 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> {
|
|
425
441
|
private _cached;
|
|
426
442
|
_getCached(): {
|
|
427
443
|
shape: T;
|
|
@@ -437,45 +453,40 @@ export declare class ZodObject<T extends ZodRawShape, UnknownKeys extends Unknow
|
|
|
437
453
|
* If you want to pass through unknown properties, use `.passthrough()` instead.
|
|
438
454
|
*/
|
|
439
455
|
nonstrict: () => ZodObject<T, "passthrough", Catchall>;
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}, UnknownKeys, Catchall
|
|
456
|
+
extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
|
457
|
+
/**
|
|
458
|
+
* @deprecated Use `.extend` instead
|
|
459
|
+
* */
|
|
460
|
+
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>>;
|
|
445
461
|
/**
|
|
446
462
|
* Prior to zod@1.0.12 there was a bug in the
|
|
447
463
|
* inferred type of merged objects. Please
|
|
448
464
|
* upgrade if you are experiencing issues.
|
|
449
465
|
*/
|
|
450
|
-
merge<Incoming extends AnyZodObject>(merging: Incoming): ZodObject<extendShape<T,
|
|
466
|
+
merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
|
|
467
|
+
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
|
|
468
|
+
[k in Key]: Schema;
|
|
469
|
+
}, UnknownKeys, Catchall>;
|
|
451
470
|
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
|
|
452
|
-
pick<Mask extends
|
|
453
|
-
|
|
454
|
-
}>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
|
455
|
-
omit<Mask extends {
|
|
456
|
-
[k in keyof T]?: true;
|
|
457
|
-
}>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
|
471
|
+
pick<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, T>): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
|
472
|
+
omit<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
|
458
473
|
deepPartial(): partialUtil.DeepPartial<this>;
|
|
459
474
|
partial(): ZodObject<{
|
|
460
475
|
[k in keyof T]: ZodOptional<T[k]>;
|
|
461
476
|
}, UnknownKeys, Catchall>;
|
|
462
|
-
partial<Mask extends {
|
|
463
|
-
[k in keyof T]?: true;
|
|
464
|
-
}>(mask: Mask): ZodObject<objectUtil.noNever<{
|
|
477
|
+
partial<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<objectUtil.noNever<{
|
|
465
478
|
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
|
|
466
479
|
}>, UnknownKeys, Catchall>;
|
|
467
480
|
required(): ZodObject<{
|
|
468
481
|
[k in keyof T]: deoptional<T[k]>;
|
|
469
482
|
}, UnknownKeys, Catchall>;
|
|
470
|
-
required<Mask extends {
|
|
471
|
-
[k in keyof T]?: true;
|
|
472
|
-
}>(mask: Mask): ZodObject<objectUtil.noNever<{
|
|
483
|
+
required<Mask extends objectKeyMask<T>>(mask: noUnrecognized<Mask, objectKeyMask<T>>): ZodObject<objectUtil.noNever<{
|
|
473
484
|
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
|
474
485
|
}>, UnknownKeys, Catchall>;
|
|
475
486
|
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
|
476
|
-
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [
|
|
477
|
-
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [
|
|
478
|
-
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [
|
|
487
|
+
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]; }>;
|
|
488
|
+
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]; }>;
|
|
489
|
+
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]; }>;
|
|
479
490
|
}
|
|
480
491
|
export declare type AnyZodObject = ZodObject<any, any, any>;
|
|
481
492
|
export declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
|
@@ -494,8 +505,8 @@ export declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[numbe
|
|
|
494
505
|
}
|
|
495
506
|
export declare type ZodDiscriminatedUnionOption<Discriminator extends string> = ZodObject<{
|
|
496
507
|
[key in Discriminator]: ZodTypeAny;
|
|
497
|
-
} & ZodRawShape,
|
|
498
|
-
export interface ZodDiscriminatedUnionDef<Discriminator extends string, Options extends ZodDiscriminatedUnionOption<
|
|
508
|
+
} & ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
|
509
|
+
export interface ZodDiscriminatedUnionDef<Discriminator extends string, Options extends ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> extends ZodTypeDef {
|
|
499
510
|
discriminator: Discriminator;
|
|
500
511
|
options: Options;
|
|
501
512
|
optionsMap: Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
|
@@ -651,6 +662,8 @@ export interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDe
|
|
|
651
662
|
export declare type Writeable<T> = {
|
|
652
663
|
-readonly [P in keyof T]: T[P];
|
|
653
664
|
};
|
|
665
|
+
export declare type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
|
|
666
|
+
export declare type typecast<A, T> = A extends T ? A : never;
|
|
654
667
|
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
|
655
668
|
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
|
656
669
|
export declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>> {
|
|
@@ -659,6 +672,8 @@ export declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[
|
|
|
659
672
|
get enum(): Values<T>;
|
|
660
673
|
get Values(): Values<T>;
|
|
661
674
|
get Enum(): Values<T>;
|
|
675
|
+
extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract): ZodEnum<Writeable<ToExtract>>;
|
|
676
|
+
exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
|
|
662
677
|
static create: typeof createZodEnum;
|
|
663
678
|
}
|
|
664
679
|
export interface ZodNativeEnumDef<T extends EnumLike = EnumLike> extends ZodTypeDef {
|
|
@@ -679,6 +694,7 @@ export interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTyp
|
|
|
679
694
|
typeName: ZodFirstPartyTypeKind.ZodPromise;
|
|
680
695
|
}
|
|
681
696
|
export declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
|
|
697
|
+
unwrap(): T;
|
|
682
698
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
683
699
|
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodPromise<T_1>;
|
|
684
700
|
}
|
|
@@ -747,21 +763,21 @@ export declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUnd
|
|
|
747
763
|
default: T_1["_input"] | (() => util.noUndefined<T_1["_input"]>);
|
|
748
764
|
}) => ZodDefault<T_1>;
|
|
749
765
|
}
|
|
750
|
-
export interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
766
|
+
export interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny, C extends T["_input"] = T["_input"]> extends ZodTypeDef {
|
|
751
767
|
innerType: T;
|
|
752
|
-
|
|
768
|
+
catchValue: () => C;
|
|
753
769
|
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
|
754
770
|
}
|
|
755
|
-
export declare class ZodCatch<T extends ZodTypeAny> extends ZodType<
|
|
771
|
+
export declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
|
|
756
772
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
757
|
-
|
|
773
|
+
removeCatch(): T;
|
|
758
774
|
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
|
759
775
|
errorMap?: ZodErrorMap | undefined;
|
|
760
776
|
invalid_type_error?: string | undefined;
|
|
761
777
|
required_error?: string | undefined;
|
|
762
778
|
description?: string | undefined;
|
|
763
779
|
} & {
|
|
764
|
-
|
|
780
|
+
catch: T_1["_output"] | (() => T_1["_output"]);
|
|
765
781
|
}) => ZodCatch<T_1>;
|
|
766
782
|
}
|
|
767
783
|
export interface ZodNaNDef extends ZodTypeDef {
|
|
@@ -797,7 +813,7 @@ export declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> ext
|
|
|
797
813
|
export declare const custom: <T>(check?: ((data: unknown) => any) | undefined, params?: Parameters<ZodTypeAny["refine"]>[1], fatal?: boolean | undefined) => ZodType<T, ZodTypeDef, T>;
|
|
798
814
|
export { ZodType as Schema, ZodType as ZodSchema };
|
|
799
815
|
export declare const late: {
|
|
800
|
-
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [
|
|
816
|
+
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k in keyof baseObjectOutputType<T>]: baseObjectOutputType<T>[k]; }, { [k_2 in keyof objectUtil.addQuestionMarks<{ [k_1 in keyof T]: T[k_1]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_1 in keyof T]: T[k_1]["_input"]; }>[k_2]; }>;
|
|
801
817
|
};
|
|
802
818
|
export declare enum ZodFirstPartyTypeKind {
|
|
803
819
|
ZodString = "ZodString",
|
|
@@ -836,7 +852,7 @@ export declare enum ZodFirstPartyTypeKind {
|
|
|
836
852
|
ZodBranded = "ZodBranded",
|
|
837
853
|
ZodPipeline = "ZodPipeline"
|
|
838
854
|
}
|
|
839
|
-
export declare type ZodFirstPartySchemaTypes = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid | ZodArray<any, any> | ZodObject<any, any, any
|
|
855
|
+
export declare type ZodFirstPartySchemaTypes = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid | ZodArray<any, any> | ZodObject<any, any, any> | ZodUnion<any> | ZodDiscriminatedUnion<any, any> | ZodIntersection<any, any> | ZodTuple<any, any> | ZodRecord<any, any> | ZodMap<any> | ZodSet<any> | ZodFunction<any, any> | ZodLazy<any> | ZodLiteral<any> | ZodEnum<any> | ZodEffects<any, any, any> | ZodNativeEnum<any> | ZodOptional<any> | ZodNullable<any> | ZodDefault<any> | ZodCatch<any> | ZodPromise<any> | ZodBranded<any, any> | ZodPipeline<any, any>;
|
|
840
856
|
declare abstract class Class {
|
|
841
857
|
constructor(..._: any[]);
|
|
842
858
|
}
|
|
@@ -890,8 +906,8 @@ declare const unknownType: (params?: RawCreateParams) => ZodUnknown;
|
|
|
890
906
|
declare const neverType: (params?: RawCreateParams) => ZodNever;
|
|
891
907
|
declare const voidType: (params?: RawCreateParams) => ZodVoid;
|
|
892
908
|
declare const arrayType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodArray<T, "many">;
|
|
893
|
-
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [
|
|
894
|
-
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict", ZodTypeAny, { [
|
|
909
|
+
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, { [k in keyof baseObjectOutputType<T>]: baseObjectOutputType<T>[k]; }, { [k_2 in keyof objectUtil.addQuestionMarks<{ [k_1 in keyof T]: T[k_1]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_1 in keyof T]: T[k_1]["_input"]; }>[k_2]; }>;
|
|
910
|
+
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict", ZodTypeAny, { [k in keyof baseObjectOutputType<T>]: baseObjectOutputType<T>[k]; }, { [k_2 in keyof objectUtil.addQuestionMarks<{ [k_1 in keyof T]: T[k_1]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_1 in keyof T]: T[k_1]["_input"]; }>[k_2]; }>;
|
|
895
911
|
declare const unionType: <T extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T, params?: RawCreateParams) => ZodUnion<T>;
|
|
896
912
|
declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create;
|
|
897
913
|
declare const intersectionType: <T extends ZodTypeAny, U extends ZodTypeAny>(left: T, right: U, params?: RawCreateParams) => ZodIntersection<T, U>;
|