@temporary-name/zod 1.9.3-alpha.cf2fe368e72e6a6ab0ce041b812dbf8134f70b0b → 1.9.3-alpha.d0c8ba895f81e5ee5f2f893da0804bd96a5aa41c
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/dist/index.d.mts +339 -362
- package/dist/index.d.ts +339 -362
- package/dist/index.mjs +542 -514
- package/package.json +3 -13
- package/dist/zod4/index.d.mts +0 -12
- package/dist/zod4/index.d.ts +0 -12
- package/dist/zod4/index.mjs +0 -259
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as core from 'zod/v4/core';
|
|
2
|
-
import { $ZodError, util
|
|
2
|
+
import { $ZodError, util } from 'zod/v4/core';
|
|
3
3
|
export { core };
|
|
4
4
|
export { $RefinementCtx as RefinementCtx, _endsWith as endsWith, _gt as gt, _gte as gte, _includes as includes, infer, input, _length as length, _lowercase as lowercase, _lt as lt, _lte as lte, _maxLength as maxLength, _maxSize as maxSize, _mime as mime, _minLength as minLength, _minSize as minSize, _multipleOf as multipleOf, _negative as negative, _nonnegative as nonnegative, _nonpositive as nonpositive, _normalize as normalize, output, _overwrite as overwrite, _positive as positive, _property as property, _regex as regex, _size as size, _startsWith as startsWith, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _trim as trim, _uppercase as uppercase } from 'zod/v4/core';
|
|
5
5
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
6
|
-
import { CustomErrorParams, ZodType, ZodTypeDef } from 'zod/v3';
|
|
7
6
|
|
|
8
7
|
/** @deprecated Use `z.core.$ZodIssue` from `@zod/core` instead, especially if you are building a library on top of Zod. */
|
|
9
8
|
type ZodIssue = core.$ZodIssue;
|
|
@@ -27,6 +26,9 @@ declare const ZodRealError: core.$constructor<ZodError>;
|
|
|
27
26
|
/** @deprecated Use `z.core.$ZodRawIssue` instead. */
|
|
28
27
|
type IssueData = core.$ZodRawIssue;
|
|
29
28
|
|
|
29
|
+
interface ParseContext extends core.ParseContextInternal<core.$ZodIssue> {
|
|
30
|
+
parseType?: 'query' | 'body' | 'path' | 'header' | 'output';
|
|
31
|
+
}
|
|
30
32
|
type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
|
|
31
33
|
type ZodSafeParseSuccess<T> = {
|
|
32
34
|
success: true;
|
|
@@ -38,24 +40,24 @@ type ZodSafeParseError<T> = {
|
|
|
38
40
|
data?: never;
|
|
39
41
|
error: ZodError<T>;
|
|
40
42
|
};
|
|
41
|
-
declare const parse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?:
|
|
43
|
+
declare const parse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: ParseContext, _params?: {
|
|
42
44
|
callee?: core.util.AnyFunc;
|
|
43
45
|
Err?: core.$ZodErrorClass;
|
|
44
46
|
}) => core.output<T>;
|
|
45
|
-
declare const parseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?:
|
|
47
|
+
declare const parseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: ParseContext, _params?: {
|
|
46
48
|
callee?: core.util.AnyFunc;
|
|
47
49
|
Err?: core.$ZodErrorClass;
|
|
48
50
|
}) => Promise<core.output<T>>;
|
|
49
|
-
declare const safeParse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?:
|
|
50
|
-
declare const safeParseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?:
|
|
51
|
-
declare const encode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?:
|
|
52
|
-
declare const decode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?:
|
|
53
|
-
declare const encodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?:
|
|
54
|
-
declare const decodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?:
|
|
55
|
-
declare const safeEncode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?:
|
|
56
|
-
declare const safeDecode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?:
|
|
57
|
-
declare const safeEncodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?:
|
|
58
|
-
declare const safeDecodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?:
|
|
51
|
+
declare const safeParse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: ParseContext) => ZodSafeParseResult<core.output<T>>;
|
|
52
|
+
declare const safeParseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: ParseContext) => Promise<ZodSafeParseResult<core.output<T>>>;
|
|
53
|
+
declare const encode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: ParseContext) => core.input<T>;
|
|
54
|
+
declare const decode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: ParseContext) => core.output<T>;
|
|
55
|
+
declare const encodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: ParseContext) => Promise<core.input<T>>;
|
|
56
|
+
declare const decodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: ParseContext) => Promise<core.output<T>>;
|
|
57
|
+
declare const safeEncode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: ParseContext) => ZodSafeParseResult<core.input<T>>;
|
|
58
|
+
declare const safeDecode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: ParseContext) => ZodSafeParseResult<core.output<T>>;
|
|
59
|
+
declare const safeEncodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: ParseContext) => Promise<ZodSafeParseResult<core.input<T>>>;
|
|
60
|
+
declare const safeDecodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: ParseContext) => Promise<ZodSafeParseResult<core.output<T>>>;
|
|
59
61
|
|
|
60
62
|
type IsGateEnabled = (gate: string) => boolean;
|
|
61
63
|
declare const gatingContext: AsyncLocalStorage<IsGateEnabled>;
|
|
@@ -71,75 +73,76 @@ interface $ZodGate<T extends core.SomeType = core.$ZodType> extends core.$ZodTyp
|
|
|
71
73
|
_zod: $ZodGateInternals<T>;
|
|
72
74
|
}
|
|
73
75
|
declare const $ZodGate: core.$constructor<$ZodGate>;
|
|
74
|
-
interface
|
|
76
|
+
interface KrustyGate<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<$ZodGateInternals<T>, K>, $ZodGate<T> {
|
|
75
77
|
unwrap(): T;
|
|
76
78
|
}
|
|
77
|
-
declare const
|
|
78
|
-
declare function gate<T extends core.SomeType, K extends KrustyInternals>(innerType: T, gateName: K['gateNames']):
|
|
79
|
+
declare const KrustyGate: core.$constructor<KrustyGate>;
|
|
80
|
+
declare function gate<T extends core.SomeType, K extends KrustyInternals>(innerType: T, gateName: K['gateNames']): KrustyGate<T, K>;
|
|
81
|
+
|
|
82
|
+
interface KrustyISODateTime extends KrustyStringFormat {
|
|
83
|
+
_zod: core.$ZodISODateTimeInternals;
|
|
84
|
+
}
|
|
85
|
+
declare const KrustyISODateTime: core.$constructor<KrustyISODateTime>;
|
|
86
|
+
interface KrustyISODate extends KrustyStringFormat {
|
|
87
|
+
_zod: core.$ZodISODateInternals;
|
|
88
|
+
}
|
|
89
|
+
declare const KrustyISODate: core.$constructor<KrustyISODate>;
|
|
79
90
|
|
|
80
91
|
type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
|
|
81
92
|
[K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
|
|
82
93
|
};
|
|
83
|
-
interface
|
|
94
|
+
interface KrustyObject<
|
|
84
95
|
/** @ts-expect-error Cast variance */
|
|
85
96
|
out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.$ZodObjectConfig = core.$strip, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodObjectInternals<Shape, Config>, K>, core.$ZodObject<Shape, Config> {
|
|
86
97
|
shape: Shape;
|
|
87
|
-
keyof():
|
|
98
|
+
keyof(): KrustyEnum<util.ToEnum<keyof Shape & string>, K>;
|
|
88
99
|
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
|
|
89
|
-
catchall<T extends core.SomeType>(schema: T):
|
|
100
|
+
catchall<T extends core.SomeType>(schema: T): KrustyObject<Shape, core.$catchall<T>, K>;
|
|
90
101
|
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
|
|
91
|
-
passthrough():
|
|
102
|
+
passthrough(): KrustyObject<Shape, core.$loose, K>;
|
|
92
103
|
/** Consider `z.looseObject(A.shape)` instead */
|
|
93
|
-
loose():
|
|
104
|
+
loose(): KrustyObject<Shape, core.$loose, K>;
|
|
94
105
|
/** Consider `z.strictObject(A.shape)` instead */
|
|
95
|
-
strict():
|
|
106
|
+
strict(): KrustyObject<Shape, core.$strict, K>;
|
|
96
107
|
/** This is the default behavior. This method call is likely unnecessary. */
|
|
97
|
-
strip():
|
|
98
|
-
extend<U extends core.$ZodLooseShape>(shape: U):
|
|
99
|
-
safeExtend<U extends core.$ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>):
|
|
108
|
+
strip(): KrustyObject<Shape, core.$strip, K>;
|
|
109
|
+
extend<U extends core.$ZodLooseShape>(shape: U): KrustyObject<util.Extend<Shape, U>, Config, K>;
|
|
110
|
+
safeExtend<U extends core.$ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>): KrustyObject<util.Extend<Shape, U>, Config, K>;
|
|
100
111
|
/**
|
|
101
112
|
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
102
113
|
*/
|
|
103
|
-
merge<U extends
|
|
104
|
-
pick<M extends util.Mask<keyof Shape>>(mask: M):
|
|
105
|
-
omit<M extends util.Mask<keyof Shape>>(mask: M):
|
|
106
|
-
partial():
|
|
107
|
-
[k in keyof Shape]:
|
|
114
|
+
merge<U extends KrustyObject>(other: U): KrustyObject<util.Extend<Shape, U['shape']>, U['_zod']['config'], K>;
|
|
115
|
+
pick<M extends util.Mask<keyof Shape>>(mask: M): KrustyObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config, K>;
|
|
116
|
+
omit<M extends util.Mask<keyof Shape>>(mask: M): KrustyObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config, K>;
|
|
117
|
+
partial(): KrustyObject<{
|
|
118
|
+
[k in keyof Shape]: KrustyOptional<Shape[k], K>;
|
|
108
119
|
}, Config, K>;
|
|
109
|
-
partial<M extends util.Mask<keyof Shape>>(mask: M):
|
|
110
|
-
[k in keyof Shape]: k extends keyof M ?
|
|
120
|
+
partial<M extends util.Mask<keyof Shape>>(mask: M): KrustyObject<{
|
|
121
|
+
[k in keyof Shape]: k extends keyof M ? KrustyOptional<Shape[k], K> : Shape[k];
|
|
111
122
|
}, Config, K>;
|
|
112
|
-
required():
|
|
113
|
-
[k in keyof Shape]:
|
|
123
|
+
required(): KrustyObject<{
|
|
124
|
+
[k in keyof Shape]: KrustyNonOptional<Shape[k], K>;
|
|
114
125
|
}, Config, K>;
|
|
115
|
-
required<M extends util.Mask<keyof Shape>>(mask: M):
|
|
116
|
-
[k in keyof Shape]: k extends keyof M ?
|
|
126
|
+
required<M extends util.Mask<keyof Shape>>(mask: M): KrustyObject<{
|
|
127
|
+
[k in keyof Shape]: k extends keyof M ? KrustyNonOptional<Shape[k], K> : Shape[k];
|
|
117
128
|
}, Config, K>;
|
|
118
129
|
}
|
|
119
|
-
declare const
|
|
120
|
-
declare function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>, K extends KrustyInternals = KrustyInternals>(shape?: T, params?: string | core.$ZodObjectParams):
|
|
121
|
-
declare function strictObject<T extends core.$ZodLooseShape, K extends KrustyInternals>(shape: T, params?: string | core.$ZodObjectParams):
|
|
122
|
-
declare function looseObject<T extends core.$ZodLooseShape, K extends KrustyInternals>(shape: T, params?: string | core.$ZodObjectParams):
|
|
130
|
+
declare const KrustyObject: core.$constructor<KrustyObject>;
|
|
131
|
+
declare function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>, K extends KrustyInternals = KrustyInternals>(shape?: T, params?: string | core.$ZodObjectParams): KrustyObject<util.Writeable<T>, core.$strip, K>;
|
|
132
|
+
declare function strictObject<T extends core.$ZodLooseShape, K extends KrustyInternals>(shape: T, params?: string | core.$ZodObjectParams): KrustyObject<T, core.$strict, K>;
|
|
133
|
+
declare function looseObject<T extends core.$ZodLooseShape, K extends KrustyInternals>(shape: T, params?: string | core.$ZodObjectParams): KrustyObject<T, core.$loose, K>;
|
|
123
134
|
|
|
124
|
-
interface
|
|
135
|
+
interface KrustyUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[], K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodUnionInternals<T>, K>, core.$ZodUnion<T> {
|
|
125
136
|
options: T;
|
|
126
137
|
}
|
|
127
|
-
declare const
|
|
128
|
-
declare function union<const T extends readonly core.SomeType[], K extends KrustyInternals>(options: T, params?: string | core.$ZodUnionParams):
|
|
129
|
-
interface
|
|
138
|
+
declare const KrustyUnion: core.$constructor<KrustyUnion>;
|
|
139
|
+
declare function union<const T extends readonly core.SomeType[], K extends KrustyInternals>(options: T, params?: string | core.$ZodUnionParams): KrustyUnion<T, K>;
|
|
140
|
+
interface KrustyDiscriminatedUnion<Options extends readonly core.SomeType[] = readonly core.$ZodType[], Disc extends string = string, K extends KrustyInternals = KrustyInternals> extends KrustyUnion<Options, K>, core.$ZodDiscriminatedUnion<Options, Disc> {
|
|
130
141
|
_zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
|
|
131
142
|
def: core.$ZodDiscriminatedUnionDef<Options, Disc>;
|
|
132
143
|
}
|
|
133
|
-
declare const
|
|
134
|
-
declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string, K extends KrustyInternals = KrustyInternals>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams):
|
|
135
|
-
|
|
136
|
-
type CustomParams = CustomErrorParams & {
|
|
137
|
-
fatal?: boolean;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
declare function blob(params?: string | CustomParams | ((input: unknown) => CustomParams)): ZodType<Blob, ZodTypeDef, Blob>;
|
|
141
|
-
|
|
142
|
-
declare function regexp(params?: string | CustomParams | ((input: unknown) => CustomParams)): ZodType<RegExp, ZodTypeDef, RegExp>;
|
|
144
|
+
declare const KrustyDiscriminatedUnion: core.$constructor<KrustyDiscriminatedUnion>;
|
|
145
|
+
declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string, K extends KrustyInternals = KrustyInternals>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): KrustyDiscriminatedUnion<Types, Disc, K>;
|
|
143
146
|
|
|
144
147
|
interface KrustyInternals<GateNames extends string = string> {
|
|
145
148
|
gateNames: GateNames;
|
|
@@ -157,39 +160,22 @@ interface KrustyType<out Output = unknown, out Input = unknown, out Internals ex
|
|
|
157
160
|
core.$replace<R['_meta'], this>?
|
|
158
161
|
] : [core.$replace<R['_meta'], this>] : ['Incompatible schema']): this;
|
|
159
162
|
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T>;
|
|
160
|
-
parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
|
|
161
|
-
safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): ZodSafeParseResult<core.output<this>>;
|
|
162
|
-
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
|
|
163
|
-
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<ZodSafeParseResult<core.output<this>>>;
|
|
164
|
-
spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.output<this>>>;
|
|
165
|
-
encode(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): core.input<this>;
|
|
166
|
-
decode(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
|
|
167
|
-
encodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.input<this>>;
|
|
168
|
-
decodeAsync(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
|
|
169
|
-
safeEncode(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): ZodSafeParseResult<core.input<this>>;
|
|
170
|
-
safeDecode(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): ZodSafeParseResult<core.output<this>>;
|
|
171
|
-
safeEncodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<ZodSafeParseResult<core.input<this>>>;
|
|
172
|
-
safeDecodeAsync(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<ZodSafeParseResult<core.output<this>>>;
|
|
173
163
|
refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
|
|
174
164
|
superRefine(refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>): this;
|
|
175
165
|
overwrite(fn: (x: core.output<this>) => core.output<this>): this;
|
|
176
|
-
gate(gateName: KInternals['gateNames']):
|
|
177
|
-
optional():
|
|
178
|
-
nonoptional(params?: string | core.$ZodNonOptionalParams):
|
|
179
|
-
nullable():
|
|
180
|
-
nullish():
|
|
181
|
-
default(def: util.NoUndefined<core.output<this>>):
|
|
182
|
-
default(def: () => util.NoUndefined<core.output<this>>):
|
|
183
|
-
prefault(def: () => core.input<this>):
|
|
184
|
-
prefault(def: core.input<this>):
|
|
185
|
-
array():
|
|
186
|
-
or<T extends core.SomeType>(option: T):
|
|
187
|
-
and<T extends core.SomeType>(incoming: T):
|
|
188
|
-
transform<NewOut>(transform: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>):
|
|
189
|
-
catch(def: core.output<this>): ZodCatch<this, KInternals>;
|
|
190
|
-
catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this, KInternals>;
|
|
191
|
-
pipe<T extends core.$ZodType<any, core.output<this>>>(target: T | core.$ZodType<any, core.output<this>>): ZodPipe<this, T, KInternals>;
|
|
192
|
-
readonly(): ZodReadonly<this, KInternals>;
|
|
166
|
+
gate(gateName: KInternals['gateNames']): KrustyGate<this, KInternals>;
|
|
167
|
+
optional(): KrustyOptional<this, KInternals>;
|
|
168
|
+
nonoptional(params?: string | core.$ZodNonOptionalParams): KrustyNonOptional<this, KInternals>;
|
|
169
|
+
nullable(): KrustyNullable<this, KInternals>;
|
|
170
|
+
nullish(): KrustyOptional<KrustyNullable<this, KInternals>, KInternals>;
|
|
171
|
+
default(def: util.NoUndefined<core.output<this>>): KrustyDefault<this, KInternals>;
|
|
172
|
+
default(def: () => util.NoUndefined<core.output<this>>): KrustyDefault<this, KInternals>;
|
|
173
|
+
prefault(def: () => core.input<this>): KrustyPrefault<this, KInternals>;
|
|
174
|
+
prefault(def: core.input<this>): KrustyPrefault<this, KInternals>;
|
|
175
|
+
array(): KrustyArray<this, KInternals>;
|
|
176
|
+
or<T extends core.SomeType>(option: T): KrustyUnion<[this, T], KInternals>;
|
|
177
|
+
and<T extends core.SomeType>(incoming: T): KrustyIntersection<this, T, KInternals>;
|
|
178
|
+
transform<NewOut>(transform: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>): KrustyPipe<this, KrustyTransform<Awaited<NewOut>, core.output<this>>, KInternals>;
|
|
193
179
|
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
|
|
194
180
|
describe(description: string): this;
|
|
195
181
|
description?: string;
|
|
@@ -198,8 +184,8 @@ interface KrustyType<out Output = unknown, out Input = unknown, out Internals ex
|
|
|
198
184
|
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
|
|
199
185
|
meta(data: core.$replace<core.GlobalMeta, this>): this;
|
|
200
186
|
}
|
|
201
|
-
declare const KrustyType: core.$constructor<
|
|
202
|
-
interface
|
|
187
|
+
declare const KrustyType: core.$constructor<_KrustyType>;
|
|
188
|
+
interface _KrustyString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>, K extends KrustyInternals = KrustyInternals> extends _KrustyType<T, K> {
|
|
203
189
|
format: string | null;
|
|
204
190
|
minLength: number | null;
|
|
205
191
|
maxLength: number | null;
|
|
@@ -219,8 +205,8 @@ interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStri
|
|
|
219
205
|
toUpperCase(): this;
|
|
220
206
|
}
|
|
221
207
|
/** @internal */
|
|
222
|
-
declare const
|
|
223
|
-
interface
|
|
208
|
+
declare const _KrustyString: core.$constructor<_KrustyString>;
|
|
209
|
+
interface KrustyString<K extends KrustyInternals = KrustyInternals> extends _KrustyString<core.$ZodStringInternals<string>, K> {
|
|
224
210
|
/** @deprecated Use `z.email()` instead. */
|
|
225
211
|
email(params?: string | core.$ZodCheckEmailParams): this;
|
|
226
212
|
/** @deprecated Use `z.url()` instead. */
|
|
@@ -267,130 +253,122 @@ interface ZodString<K extends KrustyInternals = KrustyInternals> extends _ZodStr
|
|
|
267
253
|
cidrv6(params?: string | core.$ZodCheckCIDRv6Params): this;
|
|
268
254
|
/** @deprecated Use `z.e164()` instead. */
|
|
269
255
|
e164(params?: string | core.$ZodCheckE164Params): this;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
duration(params?: string | core.$ZodCheckISODurationParams): this;
|
|
278
|
-
}
|
|
279
|
-
declare const ZodString: core.$constructor<ZodString>;
|
|
280
|
-
declare function string<K extends KrustyInternals = KrustyInternals>(params?: string | core.$ZodStringParams): ZodString<K>;
|
|
281
|
-
interface ZodStringFormat<Format extends string = string, K extends KrustyInternals = KrustyInternals> extends _ZodString<core.$ZodStringFormatInternals<Format>, K> {
|
|
282
|
-
}
|
|
283
|
-
declare const ZodStringFormat: core.$constructor<ZodStringFormat>;
|
|
284
|
-
interface ZodEmail<K extends KrustyInternals = KrustyInternals> extends ZodStringFormat<'email', K> {
|
|
256
|
+
}
|
|
257
|
+
declare const KrustyString: core.$constructor<KrustyString>;
|
|
258
|
+
declare function string<K extends KrustyInternals = KrustyInternals>(params?: string | core.$ZodStringParams): KrustyString<K>;
|
|
259
|
+
interface KrustyStringFormat<Format extends string = string, K extends KrustyInternals = KrustyInternals> extends _KrustyString<core.$ZodStringFormatInternals<Format>, K> {
|
|
260
|
+
}
|
|
261
|
+
declare const KrustyStringFormat: core.$constructor<KrustyStringFormat>;
|
|
262
|
+
interface KrustyEmail<K extends KrustyInternals = KrustyInternals> extends KrustyStringFormat<'email', K> {
|
|
285
263
|
_zod: core.$ZodEmailInternals;
|
|
286
264
|
}
|
|
287
|
-
declare const
|
|
288
|
-
declare function email(params?: string | core.$ZodEmailParams):
|
|
289
|
-
interface
|
|
265
|
+
declare const KrustyEmail: core.$constructor<KrustyEmail>;
|
|
266
|
+
declare function email(params?: string | core.$ZodEmailParams): KrustyEmail;
|
|
267
|
+
interface KrustyGUID<K extends KrustyInternals = KrustyInternals> extends KrustyStringFormat<'guid', K> {
|
|
290
268
|
_zod: core.$ZodGUIDInternals;
|
|
291
269
|
}
|
|
292
|
-
declare const
|
|
293
|
-
declare function guid(params?: string | core.$ZodGUIDParams):
|
|
294
|
-
interface
|
|
270
|
+
declare const KrustyGUID: core.$constructor<KrustyGUID>;
|
|
271
|
+
declare function guid(params?: string | core.$ZodGUIDParams): KrustyGUID;
|
|
272
|
+
interface KrustyUUID<K extends KrustyInternals = KrustyInternals> extends KrustyStringFormat<'uuid', K> {
|
|
295
273
|
_zod: core.$ZodUUIDInternals;
|
|
296
274
|
}
|
|
297
|
-
declare const
|
|
298
|
-
declare function uuid(params?: string | core.$ZodUUIDParams):
|
|
299
|
-
declare function uuidv4(params?: string | core.$ZodUUIDv4Params):
|
|
300
|
-
declare function uuidv6(params?: string | core.$ZodUUIDv6Params):
|
|
301
|
-
declare function uuidv7(params?: string | core.$ZodUUIDv7Params):
|
|
302
|
-
interface
|
|
275
|
+
declare const KrustyUUID: core.$constructor<KrustyUUID>;
|
|
276
|
+
declare function uuid(params?: string | core.$ZodUUIDParams): KrustyUUID;
|
|
277
|
+
declare function uuidv4(params?: string | core.$ZodUUIDv4Params): KrustyUUID;
|
|
278
|
+
declare function uuidv6(params?: string | core.$ZodUUIDv6Params): KrustyUUID;
|
|
279
|
+
declare function uuidv7(params?: string | core.$ZodUUIDv7Params): KrustyUUID;
|
|
280
|
+
interface KrustyURL extends KrustyStringFormat<'url'> {
|
|
303
281
|
_zod: core.$ZodURLInternals;
|
|
304
282
|
}
|
|
305
|
-
declare const
|
|
306
|
-
declare function url(params?: string | core.$ZodURLParams):
|
|
307
|
-
declare function httpUrl(params?: string | Omit<core.$ZodURLParams, 'protocol' | 'hostname'>):
|
|
308
|
-
interface
|
|
283
|
+
declare const KrustyURL: core.$constructor<KrustyURL>;
|
|
284
|
+
declare function url(params?: string | core.$ZodURLParams): KrustyURL;
|
|
285
|
+
declare function httpUrl(params?: string | Omit<core.$ZodURLParams, 'protocol' | 'hostname'>): KrustyURL;
|
|
286
|
+
interface KrustyEmoji extends KrustyStringFormat<'emoji'> {
|
|
309
287
|
_zod: core.$ZodEmojiInternals;
|
|
310
288
|
}
|
|
311
|
-
declare const
|
|
312
|
-
declare function emoji(params?: string | core.$ZodEmojiParams):
|
|
313
|
-
interface
|
|
289
|
+
declare const KrustyEmoji: core.$constructor<KrustyEmoji>;
|
|
290
|
+
declare function emoji(params?: string | core.$ZodEmojiParams): KrustyEmoji;
|
|
291
|
+
interface KrustyNanoID extends KrustyStringFormat<'nanoid'> {
|
|
314
292
|
_zod: core.$ZodNanoIDInternals;
|
|
315
293
|
}
|
|
316
|
-
declare const
|
|
317
|
-
declare function nanoid(params?: string | core.$ZodNanoIDParams):
|
|
318
|
-
interface
|
|
294
|
+
declare const KrustyNanoID: core.$constructor<KrustyNanoID>;
|
|
295
|
+
declare function nanoid(params?: string | core.$ZodNanoIDParams): KrustyNanoID;
|
|
296
|
+
interface KrustyCUID extends KrustyStringFormat<'cuid'> {
|
|
319
297
|
_zod: core.$ZodCUIDInternals;
|
|
320
298
|
}
|
|
321
|
-
declare const
|
|
322
|
-
declare function cuid(params?: string | core.$ZodCUIDParams):
|
|
323
|
-
interface
|
|
299
|
+
declare const KrustyCUID: core.$constructor<KrustyCUID>;
|
|
300
|
+
declare function cuid(params?: string | core.$ZodCUIDParams): KrustyCUID;
|
|
301
|
+
interface KrustyCUID2 extends KrustyStringFormat<'cuid2'> {
|
|
324
302
|
_zod: core.$ZodCUID2Internals;
|
|
325
303
|
}
|
|
326
|
-
declare const
|
|
327
|
-
declare function cuid2(params?: string | core.$ZodCUID2Params):
|
|
328
|
-
interface
|
|
304
|
+
declare const KrustyCUID2: core.$constructor<KrustyCUID2>;
|
|
305
|
+
declare function cuid2(params?: string | core.$ZodCUID2Params): KrustyCUID2;
|
|
306
|
+
interface KrustyULID extends KrustyStringFormat<'ulid'> {
|
|
329
307
|
_zod: core.$ZodULIDInternals;
|
|
330
308
|
}
|
|
331
|
-
declare const
|
|
332
|
-
declare function ulid(params?: string | core.$ZodULIDParams):
|
|
333
|
-
interface
|
|
309
|
+
declare const KrustyULID: core.$constructor<KrustyULID>;
|
|
310
|
+
declare function ulid(params?: string | core.$ZodULIDParams): KrustyULID;
|
|
311
|
+
interface KrustyXID extends KrustyStringFormat<'xid'> {
|
|
334
312
|
_zod: core.$ZodXIDInternals;
|
|
335
313
|
}
|
|
336
|
-
declare const
|
|
337
|
-
declare function xid(params?: string | core.$ZodXIDParams):
|
|
338
|
-
interface
|
|
314
|
+
declare const KrustyXID: core.$constructor<KrustyXID>;
|
|
315
|
+
declare function xid(params?: string | core.$ZodXIDParams): KrustyXID;
|
|
316
|
+
interface KrustyKSUID extends KrustyStringFormat<'ksuid'> {
|
|
339
317
|
_zod: core.$ZodKSUIDInternals;
|
|
340
318
|
}
|
|
341
|
-
declare const
|
|
342
|
-
declare function ksuid(params?: string | core.$ZodKSUIDParams):
|
|
343
|
-
interface
|
|
319
|
+
declare const KrustyKSUID: core.$constructor<KrustyKSUID>;
|
|
320
|
+
declare function ksuid(params?: string | core.$ZodKSUIDParams): KrustyKSUID;
|
|
321
|
+
interface KrustyIPv4 extends KrustyStringFormat<'ipv4'> {
|
|
344
322
|
_zod: core.$ZodIPv4Internals;
|
|
345
323
|
}
|
|
346
|
-
declare const
|
|
347
|
-
declare function ipv4(params?: string | core.$ZodIPv4Params):
|
|
348
|
-
interface
|
|
324
|
+
declare const KrustyIPv4: core.$constructor<KrustyIPv4>;
|
|
325
|
+
declare function ipv4(params?: string | core.$ZodIPv4Params): KrustyIPv4;
|
|
326
|
+
interface KrustyIPv6 extends KrustyStringFormat<'ipv6'> {
|
|
349
327
|
_zod: core.$ZodIPv6Internals;
|
|
350
328
|
}
|
|
351
|
-
declare const
|
|
352
|
-
declare function ipv6(params?: string | core.$ZodIPv6Params):
|
|
353
|
-
interface
|
|
329
|
+
declare const KrustyIPv6: core.$constructor<KrustyIPv6>;
|
|
330
|
+
declare function ipv6(params?: string | core.$ZodIPv6Params): KrustyIPv6;
|
|
331
|
+
interface KrustyCIDRv4 extends KrustyStringFormat<'cidrv4'> {
|
|
354
332
|
_zod: core.$ZodCIDRv4Internals;
|
|
355
333
|
}
|
|
356
|
-
declare const
|
|
357
|
-
declare function cidrv4(params?: string | core.$ZodCIDRv4Params):
|
|
358
|
-
interface
|
|
334
|
+
declare const KrustyCIDRv4: core.$constructor<KrustyCIDRv4>;
|
|
335
|
+
declare function cidrv4(params?: string | core.$ZodCIDRv4Params): KrustyCIDRv4;
|
|
336
|
+
interface KrustyCIDRv6 extends KrustyStringFormat<'cidrv6'> {
|
|
359
337
|
_zod: core.$ZodCIDRv6Internals;
|
|
360
338
|
}
|
|
361
|
-
declare const
|
|
362
|
-
declare function cidrv6(params?: string | core.$ZodCIDRv6Params):
|
|
363
|
-
interface
|
|
339
|
+
declare const KrustyCIDRv6: core.$constructor<KrustyCIDRv6>;
|
|
340
|
+
declare function cidrv6(params?: string | core.$ZodCIDRv6Params): KrustyCIDRv6;
|
|
341
|
+
interface KrustyBase64 extends KrustyStringFormat<'base64'> {
|
|
364
342
|
_zod: core.$ZodBase64Internals;
|
|
365
343
|
}
|
|
366
|
-
declare const
|
|
367
|
-
declare function base64(params?: string | core.$ZodBase64Params):
|
|
368
|
-
interface
|
|
344
|
+
declare const KrustyBase64: core.$constructor<KrustyBase64>;
|
|
345
|
+
declare function base64(params?: string | core.$ZodBase64Params): KrustyBase64;
|
|
346
|
+
interface KrustyBase64URL extends KrustyStringFormat<'base64url'> {
|
|
369
347
|
_zod: core.$ZodBase64URLInternals;
|
|
370
348
|
}
|
|
371
|
-
declare const
|
|
372
|
-
declare function base64url(params?: string | core.$ZodBase64URLParams):
|
|
373
|
-
interface
|
|
349
|
+
declare const KrustyBase64URL: core.$constructor<KrustyBase64URL>;
|
|
350
|
+
declare function base64url(params?: string | core.$ZodBase64URLParams): KrustyBase64URL;
|
|
351
|
+
interface KrustyE164 extends KrustyStringFormat<'e164'> {
|
|
374
352
|
_zod: core.$ZodE164Internals;
|
|
375
353
|
}
|
|
376
|
-
declare const
|
|
377
|
-
declare function e164(params?: string | core.$ZodE164Params):
|
|
378
|
-
interface
|
|
354
|
+
declare const KrustyE164: core.$constructor<KrustyE164>;
|
|
355
|
+
declare function e164(params?: string | core.$ZodE164Params): KrustyE164;
|
|
356
|
+
interface KrustyJWT extends KrustyStringFormat<'jwt'> {
|
|
379
357
|
_zod: core.$ZodJWTInternals;
|
|
380
358
|
}
|
|
381
|
-
declare const
|
|
382
|
-
declare function jwt(params?: string | core.$ZodJWTParams):
|
|
383
|
-
interface
|
|
359
|
+
declare const KrustyJWT: core.$constructor<KrustyJWT>;
|
|
360
|
+
declare function jwt(params?: string | core.$ZodJWTParams): KrustyJWT;
|
|
361
|
+
interface KrustyCustomStringFormat<Format extends string = string> extends KrustyStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
|
|
384
362
|
_zod: core.$ZodCustomStringFormatInternals<Format>;
|
|
385
363
|
}
|
|
386
|
-
declare const
|
|
387
|
-
declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams):
|
|
388
|
-
declare function hostname(_params?: string | core.$ZodStringFormatParams):
|
|
389
|
-
declare function hex(_params?: string | core.$ZodStringFormatParams):
|
|
364
|
+
declare const KrustyCustomStringFormat: core.$constructor<KrustyCustomStringFormat>;
|
|
365
|
+
declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): KrustyCustomStringFormat<Format>;
|
|
366
|
+
declare function hostname(_params?: string | core.$ZodStringFormatParams): KrustyCustomStringFormat<'hostname'>;
|
|
367
|
+
declare function hex(_params?: string | core.$ZodStringFormatParams): KrustyCustomStringFormat<'hex'>;
|
|
390
368
|
declare function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = 'hex'>(alg: Alg, params?: {
|
|
391
369
|
enc?: Enc;
|
|
392
|
-
} & core.$ZodStringFormatParams):
|
|
393
|
-
interface
|
|
370
|
+
} & core.$ZodStringFormatParams): KrustyCustomStringFormat<`${Alg}_${Enc}`>;
|
|
371
|
+
interface _KrustyNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals, K extends KrustyInternals = KrustyInternals> extends _KrustyType<Internals, K> {
|
|
394
372
|
gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
395
373
|
/** Identical to .min() */
|
|
396
374
|
gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
@@ -401,8 +379,6 @@ interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumbe
|
|
|
401
379
|
max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
|
|
402
380
|
/** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
|
|
403
381
|
int(params?: string | core.$ZodCheckNumberFormatParams): this;
|
|
404
|
-
/** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
|
|
405
|
-
safe(params?: string | core.$ZodCheckNumberFormatParams): this;
|
|
406
382
|
positive(params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
407
383
|
nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
408
384
|
negative(params?: string | core.$ZodCheckLessThanParams): this;
|
|
@@ -420,36 +396,36 @@ interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumbe
|
|
|
420
396
|
isFinite: boolean;
|
|
421
397
|
format: string | null;
|
|
422
398
|
}
|
|
423
|
-
interface
|
|
399
|
+
interface KrustyNumber<K extends KrustyInternals = KrustyInternals> extends _KrustyNumber<core.$ZodNumberInternals<number>, K> {
|
|
424
400
|
}
|
|
425
|
-
declare const
|
|
426
|
-
declare function number(params?: string | core.$ZodNumberParams):
|
|
427
|
-
interface
|
|
401
|
+
declare const KrustyNumber: core.$constructor<KrustyNumber>;
|
|
402
|
+
declare function number(params?: string | core.$ZodNumberParams): KrustyNumber;
|
|
403
|
+
interface KrustyNumberFormat extends KrustyNumber {
|
|
428
404
|
_zod: core.$ZodNumberFormatInternals;
|
|
429
405
|
}
|
|
430
|
-
declare const
|
|
431
|
-
interface
|
|
406
|
+
declare const KrustyNumberFormat: core.$constructor<KrustyNumberFormat>;
|
|
407
|
+
interface KrustyInt extends KrustyNumberFormat {
|
|
432
408
|
}
|
|
433
|
-
declare function int(params?: string | core.$ZodCheckNumberFormatParams):
|
|
434
|
-
interface
|
|
409
|
+
declare function int(params?: string | core.$ZodCheckNumberFormatParams): KrustyInt;
|
|
410
|
+
interface KrustyFloat32 extends KrustyNumberFormat {
|
|
435
411
|
}
|
|
436
|
-
declare function float32(params?: string | core.$ZodCheckNumberFormatParams):
|
|
437
|
-
interface
|
|
412
|
+
declare function float32(params?: string | core.$ZodCheckNumberFormatParams): KrustyFloat32;
|
|
413
|
+
interface KrustyFloat64 extends KrustyNumberFormat {
|
|
438
414
|
}
|
|
439
|
-
declare function float64(params?: string | core.$ZodCheckNumberFormatParams):
|
|
440
|
-
interface
|
|
415
|
+
declare function float64(params?: string | core.$ZodCheckNumberFormatParams): KrustyFloat64;
|
|
416
|
+
interface KrustyInt32 extends KrustyNumberFormat {
|
|
441
417
|
}
|
|
442
|
-
declare function int32(params?: string | core.$ZodCheckNumberFormatParams):
|
|
443
|
-
interface
|
|
418
|
+
declare function int32(params?: string | core.$ZodCheckNumberFormatParams): KrustyInt32;
|
|
419
|
+
interface KrustyUInt32 extends KrustyNumberFormat {
|
|
444
420
|
}
|
|
445
|
-
declare function uint32(params?: string | core.$ZodCheckNumberFormatParams):
|
|
446
|
-
interface
|
|
421
|
+
declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): KrustyUInt32;
|
|
422
|
+
interface _KrustyBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals, K extends KrustyInternals = KrustyInternals> extends _KrustyType<T, K> {
|
|
447
423
|
}
|
|
448
|
-
interface
|
|
424
|
+
interface KrustyBoolean<K extends KrustyInternals = KrustyInternals> extends _KrustyBoolean<core.$ZodBooleanInternals<boolean>, K> {
|
|
449
425
|
}
|
|
450
|
-
declare const
|
|
451
|
-
declare function boolean(params?: string | core.$ZodBooleanParams):
|
|
452
|
-
interface
|
|
426
|
+
declare const KrustyBoolean: core.$constructor<KrustyBoolean>;
|
|
427
|
+
declare function boolean(params?: string | core.$ZodBooleanParams): KrustyBoolean;
|
|
428
|
+
interface _KrustyBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals, K extends KrustyInternals = KrustyInternals> extends _KrustyType<T, K> {
|
|
453
429
|
gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
454
430
|
/** Alias of `.gte()` */
|
|
455
431
|
min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
@@ -467,48 +443,48 @@ interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInterna
|
|
|
467
443
|
maxValue: bigint | null;
|
|
468
444
|
format: string | null;
|
|
469
445
|
}
|
|
470
|
-
interface
|
|
446
|
+
interface KrustyBigInt<K extends KrustyInternals = KrustyInternals> extends _KrustyBigInt<core.$ZodBigIntInternals<bigint>, K> {
|
|
471
447
|
}
|
|
472
|
-
declare const
|
|
473
|
-
declare function bigint(params?: string | core.$ZodBigIntParams):
|
|
474
|
-
interface
|
|
448
|
+
declare const KrustyBigInt: core.$constructor<KrustyBigInt>;
|
|
449
|
+
declare function bigint(params?: string | core.$ZodBigIntParams): KrustyBigInt;
|
|
450
|
+
interface KrustyBigIntFormat extends KrustyBigInt {
|
|
475
451
|
_zod: core.$ZodBigIntFormatInternals;
|
|
476
452
|
}
|
|
477
|
-
declare const
|
|
478
|
-
declare function int64(params?: string | core.$ZodBigIntFormatParams):
|
|
479
|
-
declare function uint64(params?: string | core.$ZodBigIntFormatParams):
|
|
480
|
-
interface
|
|
453
|
+
declare const KrustyBigIntFormat: core.$constructor<KrustyBigIntFormat>;
|
|
454
|
+
declare function int64(params?: string | core.$ZodBigIntFormatParams): KrustyBigIntFormat;
|
|
455
|
+
declare function uint64(params?: string | core.$ZodBigIntFormatParams): KrustyBigIntFormat;
|
|
456
|
+
interface KrustySymbol<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodSymbolInternals, K> {
|
|
481
457
|
}
|
|
482
|
-
declare const
|
|
483
|
-
declare function symbol(params?: string | core.$ZodSymbolParams):
|
|
484
|
-
interface
|
|
458
|
+
declare const KrustySymbol: core.$constructor<KrustySymbol>;
|
|
459
|
+
declare function symbol(params?: string | core.$ZodSymbolParams): KrustySymbol;
|
|
460
|
+
interface KrustyUndefined<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodUndefinedInternals, K> {
|
|
485
461
|
}
|
|
486
|
-
declare const
|
|
487
|
-
declare function _undefined(params?: string | core.$ZodUndefinedParams):
|
|
462
|
+
declare const KrustyUndefined: core.$constructor<KrustyUndefined>;
|
|
463
|
+
declare function _undefined(params?: string | core.$ZodUndefinedParams): KrustyUndefined;
|
|
488
464
|
|
|
489
|
-
interface
|
|
465
|
+
interface KrustyNull<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNullInternals, K> {
|
|
490
466
|
}
|
|
491
|
-
declare const
|
|
492
|
-
declare function _null(params?: string | core.$ZodNullParams):
|
|
467
|
+
declare const KrustyNull: core.$constructor<KrustyNull>;
|
|
468
|
+
declare function _null(params?: string | core.$ZodNullParams): KrustyNull;
|
|
493
469
|
|
|
494
|
-
interface
|
|
470
|
+
interface KrustyAny<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodAnyInternals, K> {
|
|
495
471
|
}
|
|
496
|
-
declare const
|
|
497
|
-
declare function any():
|
|
498
|
-
interface
|
|
472
|
+
declare const KrustyAny: core.$constructor<KrustyAny>;
|
|
473
|
+
declare function any(): KrustyAny;
|
|
474
|
+
interface KrustyUnknown<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodUnknownInternals, K> {
|
|
499
475
|
}
|
|
500
|
-
declare const
|
|
501
|
-
declare function unknown():
|
|
502
|
-
interface
|
|
476
|
+
declare const KrustyUnknown: core.$constructor<KrustyUnknown>;
|
|
477
|
+
declare function unknown(): KrustyUnknown;
|
|
478
|
+
interface KrustyNever<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNeverInternals, K> {
|
|
503
479
|
}
|
|
504
|
-
declare const
|
|
505
|
-
declare function never(params?: string | core.$ZodNeverParams):
|
|
506
|
-
interface
|
|
480
|
+
declare const KrustyNever: core.$constructor<KrustyNever>;
|
|
481
|
+
declare function never(params?: string | core.$ZodNeverParams): KrustyNever;
|
|
482
|
+
interface KrustyVoid<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodVoidInternals, K> {
|
|
507
483
|
}
|
|
508
|
-
declare const
|
|
509
|
-
declare function _void(params?: string | core.$ZodVoidParams):
|
|
484
|
+
declare const KrustyVoid: core.$constructor<KrustyVoid>;
|
|
485
|
+
declare function _void(params?: string | core.$ZodVoidParams): KrustyVoid;
|
|
510
486
|
|
|
511
|
-
interface
|
|
487
|
+
interface _KrustyDate<T extends core.$ZodDateInternals = core.$ZodDateInternals, K extends KrustyInternals = KrustyInternals> extends _KrustyType<T, K> {
|
|
512
488
|
min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
513
489
|
max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
|
|
514
490
|
/** @deprecated Not recommended. */
|
|
@@ -516,11 +492,14 @@ interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateInternals, K
|
|
|
516
492
|
/** @deprecated Not recommended. */
|
|
517
493
|
maxDate: Date | null;
|
|
518
494
|
}
|
|
519
|
-
interface
|
|
495
|
+
interface KrustyDate<K extends KrustyInternals = KrustyInternals> extends _KrustyDate<core.$ZodDateInternals<Date>, K> {
|
|
520
496
|
}
|
|
521
|
-
declare const
|
|
522
|
-
|
|
523
|
-
|
|
497
|
+
declare const KrustyDate: core.$constructor<KrustyDate>;
|
|
498
|
+
type KrustyDateCodec<K extends KrustyInternals = KrustyInternals> = KrustyCodec<KrustyISODate, KrustyDate, K>;
|
|
499
|
+
declare function date<K extends KrustyInternals = KrustyInternals>(params?: string | (core.$ZodDateParams & core.$ZodISODateParams)): KrustyDateCodec<K>;
|
|
500
|
+
type KrustyDateTimeCodec<K extends KrustyInternals = KrustyInternals> = KrustyCodec<KrustyISODateTime, KrustyDate, K>;
|
|
501
|
+
declare function datetime<K extends KrustyInternals = KrustyInternals>(params?: string | (core.$ZodDateParams & core.$ZodISODateTimeParams)): KrustyDateTimeCodec<K>;
|
|
502
|
+
interface KrustyArray<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodArrayInternals<T>, K>, core.$ZodArray<T> {
|
|
524
503
|
element: T;
|
|
525
504
|
min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
|
|
526
505
|
nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
|
|
@@ -528,52 +507,52 @@ interface ZodArray<T extends core.SomeType = core.$ZodType, K extends KrustyInte
|
|
|
528
507
|
length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
|
|
529
508
|
unwrap(): T;
|
|
530
509
|
}
|
|
531
|
-
declare const
|
|
532
|
-
declare function array<T extends core.SomeType, K extends KrustyInternals>(element: T, params?: string | core.$ZodArrayParams):
|
|
533
|
-
declare function keyof<T extends
|
|
534
|
-
interface
|
|
535
|
-
}
|
|
536
|
-
declare const
|
|
537
|
-
declare function intersection<T extends core.SomeType, U extends core.SomeType, K extends KrustyInternals>(left: T, right: U):
|
|
538
|
-
interface
|
|
539
|
-
rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest):
|
|
540
|
-
}
|
|
541
|
-
declare const
|
|
542
|
-
declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], K extends KrustyInternals>(items: T, params?: string | core.$ZodTupleParams):
|
|
543
|
-
declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], Rest extends core.SomeType, K extends KrustyInternals>(items: T, rest: Rest, params?: string | core.$ZodTupleParams):
|
|
544
|
-
declare function tuple(items: [], params?: string | core.$ZodTupleParams):
|
|
545
|
-
interface
|
|
510
|
+
declare const KrustyArray: core.$constructor<KrustyArray>;
|
|
511
|
+
declare function array<T extends core.SomeType, K extends KrustyInternals>(element: T, params?: string | core.$ZodArrayParams): KrustyArray<T, K>;
|
|
512
|
+
declare function keyof<T extends KrustyObject, K extends KrustyInternals>(schema: T): KrustyEnum<util.KeysEnum<T['_zod']['output']>, K>;
|
|
513
|
+
interface KrustyIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodIntersectionInternals<A, B>, K>, core.$ZodIntersection<A, B> {
|
|
514
|
+
}
|
|
515
|
+
declare const KrustyIntersection: core.$constructor<KrustyIntersection>;
|
|
516
|
+
declare function intersection<T extends core.SomeType, U extends core.SomeType, K extends KrustyInternals>(left: T, right: U): KrustyIntersection<T, U, K>;
|
|
517
|
+
interface KrustyTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends core.SomeType | null = core.$ZodType | null, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodTupleInternals<T, Rest>, K>, core.$ZodTuple<T, Rest> {
|
|
518
|
+
rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): KrustyTuple<T, Rest, K>;
|
|
519
|
+
}
|
|
520
|
+
declare const KrustyTuple: core.$constructor<KrustyTuple>;
|
|
521
|
+
declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], K extends KrustyInternals>(items: T, params?: string | core.$ZodTupleParams): KrustyTuple<T, null, K>;
|
|
522
|
+
declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], Rest extends core.SomeType, K extends KrustyInternals>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): KrustyTuple<T, Rest, K>;
|
|
523
|
+
declare function tuple(items: [], params?: string | core.$ZodTupleParams): KrustyTuple<[], null, KrustyInternals>;
|
|
524
|
+
interface KrustyRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodRecordInternals<Key, Value>, K>, core.$ZodRecord<Key, Value> {
|
|
546
525
|
keyType: Key;
|
|
547
526
|
valueType: Value;
|
|
548
527
|
}
|
|
549
|
-
declare const
|
|
550
|
-
declare function record<Key extends core.$ZodRecordKey, Value extends core.SomeType, K extends KrustyInternals>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams):
|
|
551
|
-
declare function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams):
|
|
552
|
-
interface
|
|
528
|
+
declare const KrustyRecord: core.$constructor<KrustyRecord>;
|
|
529
|
+
declare function record<Key extends core.$ZodRecordKey, Value extends core.SomeType, K extends KrustyInternals>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): KrustyRecord<Key, Value, K>;
|
|
530
|
+
declare function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): KrustyRecord<Key & core.$partial, Value>;
|
|
531
|
+
interface KrustyMap<Key extends core.SomeType = core.$ZodType, Value extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodMapInternals<Key, Value>, K>, core.$ZodMap<Key, Value> {
|
|
553
532
|
keyType: Key;
|
|
554
533
|
valueType: Value;
|
|
555
534
|
}
|
|
556
|
-
declare const
|
|
557
|
-
declare function map<Key extends core.SomeType, Value extends core.SomeType, K extends KrustyInternals>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams):
|
|
558
|
-
interface
|
|
535
|
+
declare const KrustyMap: core.$constructor<KrustyMap>;
|
|
536
|
+
declare function map<Key extends core.SomeType, Value extends core.SomeType, K extends KrustyInternals>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): KrustyMap<Key, Value, K>;
|
|
537
|
+
interface KrustySet<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodSetInternals<T>, K>, core.$ZodSet<T> {
|
|
559
538
|
min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
|
|
560
539
|
nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
|
|
561
540
|
max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
|
|
562
541
|
size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
|
|
563
542
|
}
|
|
564
|
-
declare const
|
|
565
|
-
declare function set<Value extends core.SomeType, K extends KrustyInternals>(valueType: Value, params?: string | core.$ZodSetParams):
|
|
566
|
-
interface
|
|
543
|
+
declare const KrustySet: core.$constructor<KrustySet>;
|
|
544
|
+
declare function set<Value extends core.SomeType, K extends KrustyInternals>(valueType: Value, params?: string | core.$ZodSetParams): KrustySet<Value, K>;
|
|
545
|
+
interface KrustyEnum<
|
|
567
546
|
/** @ts-expect-error Cast variance */
|
|
568
547
|
out T extends util.EnumLike = util.EnumLike, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodEnumInternals<T>, K>, core.$ZodEnum<T> {
|
|
569
548
|
enum: T;
|
|
570
549
|
options: Array<T[keyof T]>;
|
|
571
|
-
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams):
|
|
572
|
-
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams):
|
|
550
|
+
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): KrustyEnum<util.Flatten<Pick<T, U[number]>>, K>;
|
|
551
|
+
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): KrustyEnum<util.Flatten<Omit<T, U[number]>>, K>;
|
|
573
552
|
}
|
|
574
|
-
declare const
|
|
575
|
-
declare function _enum<const T extends readonly string[], K extends KrustyInternals>(values: T, params?: string | core.$ZodEnumParams):
|
|
576
|
-
declare function _enum<const T extends util.EnumLike, K extends KrustyInternals>(entries: T, params?: string | core.$ZodEnumParams):
|
|
553
|
+
declare const KrustyEnum: core.$constructor<KrustyEnum>;
|
|
554
|
+
declare function _enum<const T extends readonly string[], K extends KrustyInternals>(values: T, params?: string | core.$ZodEnumParams): KrustyEnum<util.ToEnum<T[number]>, K>;
|
|
555
|
+
declare function _enum<const T extends util.EnumLike, K extends KrustyInternals>(entries: T, params?: string | core.$ZodEnumParams): KrustyEnum<T, K>;
|
|
577
556
|
|
|
578
557
|
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
|
579
558
|
*
|
|
@@ -582,184 +561,182 @@ declare function _enum<const T extends util.EnumLike, K extends KrustyInternals>
|
|
|
582
561
|
* z.enum(Colors);
|
|
583
562
|
* ```
|
|
584
563
|
*/
|
|
585
|
-
declare function nativeEnum<T extends util.EnumLike, K extends KrustyInternals>(entries: T, params?: string | core.$ZodEnumParams):
|
|
586
|
-
interface
|
|
564
|
+
declare function nativeEnum<T extends util.EnumLike, K extends KrustyInternals>(entries: T, params?: string | core.$ZodEnumParams): KrustyEnum<T, K>;
|
|
565
|
+
interface KrustyLiteral<T extends util.Literal = util.Literal, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodLiteralInternals<T>, K>, core.$ZodLiteral<T> {
|
|
587
566
|
values: Set<T>;
|
|
588
567
|
/** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
|
|
589
568
|
value: T;
|
|
590
569
|
}
|
|
591
|
-
declare const
|
|
592
|
-
declare function literal<const T extends ReadonlyArray<util.Literal>, K extends KrustyInternals>(value: T, params?: string | core.$ZodLiteralParams):
|
|
593
|
-
declare function literal<const T extends util.Literal, K extends KrustyInternals>(value: T, params?: string | core.$ZodLiteralParams):
|
|
594
|
-
interface
|
|
570
|
+
declare const KrustyLiteral: core.$constructor<KrustyLiteral>;
|
|
571
|
+
declare function literal<const T extends ReadonlyArray<util.Literal>, K extends KrustyInternals>(value: T, params?: string | core.$ZodLiteralParams): KrustyLiteral<T[number], K>;
|
|
572
|
+
declare function literal<const T extends util.Literal, K extends KrustyInternals>(value: T, params?: string | core.$ZodLiteralParams): KrustyLiteral<T, K>;
|
|
573
|
+
interface KrustyFile<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodFileInternals, K>, core.$ZodFile {
|
|
595
574
|
min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
|
|
596
575
|
max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
|
|
597
576
|
mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
|
|
598
577
|
}
|
|
599
|
-
declare const
|
|
600
|
-
declare function file(params?: string | core.$ZodFileParams):
|
|
601
|
-
interface
|
|
578
|
+
declare const KrustyFile: core.$constructor<KrustyFile>;
|
|
579
|
+
declare function file(params?: string | core.$ZodFileParams): KrustyFile;
|
|
580
|
+
interface KrustyTransform<O = unknown, I = unknown, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodTransformInternals<O, I>, K>, core.$ZodTransform<O, I> {
|
|
602
581
|
}
|
|
603
|
-
declare const
|
|
604
|
-
declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O):
|
|
605
|
-
interface
|
|
582
|
+
declare const KrustyTransform: core.$constructor<KrustyTransform>;
|
|
583
|
+
declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): KrustyTransform<Awaited<O>, I>;
|
|
584
|
+
interface KrustyOptional<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodOptionalInternals<T>, K>, core.$ZodOptional<T> {
|
|
606
585
|
unwrap(): T;
|
|
607
586
|
}
|
|
608
|
-
declare const
|
|
609
|
-
declare function optional<T extends core.SomeType, K extends KrustyInternals>(innerType: T):
|
|
610
|
-
interface
|
|
587
|
+
declare const KrustyOptional: core.$constructor<KrustyOptional>;
|
|
588
|
+
declare function optional<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyOptional<T, K>;
|
|
589
|
+
interface KrustyNullable<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNullableInternals<T>, K>, core.$ZodNullable<T> {
|
|
611
590
|
unwrap(): T;
|
|
612
591
|
}
|
|
613
|
-
declare const
|
|
614
|
-
declare function nullable<T extends core.SomeType, K extends KrustyInternals>(innerType: T):
|
|
615
|
-
declare function nullish<T extends core.SomeType, K extends KrustyInternals>(innerType: T):
|
|
616
|
-
interface
|
|
592
|
+
declare const KrustyNullable: core.$constructor<KrustyNullable>;
|
|
593
|
+
declare function nullable<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyNullable<T, K>;
|
|
594
|
+
declare function nullish<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyOptional<KrustyNullable<T, K>, K>;
|
|
595
|
+
interface KrustyDefault<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodDefaultInternals<T>, K>, core.$ZodDefault<T> {
|
|
617
596
|
unwrap(): T;
|
|
618
597
|
/** @deprecated Use `.unwrap()` instead. */
|
|
619
598
|
removeDefault(): T;
|
|
620
599
|
}
|
|
621
|
-
declare const
|
|
622
|
-
declare function _default<T extends core.SomeType, K extends KrustyInternals>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)):
|
|
623
|
-
interface
|
|
600
|
+
declare const KrustyDefault: core.$constructor<KrustyDefault>;
|
|
601
|
+
declare function _default<T extends core.SomeType, K extends KrustyInternals>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): KrustyDefault<T, K>;
|
|
602
|
+
interface KrustyPrefault<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodPrefaultInternals<T>, K>, core.$ZodPrefault<T> {
|
|
624
603
|
unwrap(): T;
|
|
625
604
|
}
|
|
626
|
-
declare const
|
|
627
|
-
declare function prefault<T extends core.SomeType, K extends KrustyInternals>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)):
|
|
628
|
-
interface
|
|
605
|
+
declare const KrustyPrefault: core.$constructor<KrustyPrefault>;
|
|
606
|
+
declare function prefault<T extends core.SomeType, K extends KrustyInternals>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)): KrustyPrefault<T, K>;
|
|
607
|
+
interface KrustyNonOptional<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNonOptionalInternals<T>, K>, core.$ZodNonOptional<T> {
|
|
629
608
|
unwrap(): T;
|
|
630
609
|
}
|
|
631
|
-
declare const
|
|
632
|
-
declare function nonoptional<T extends core.SomeType, K extends KrustyInternals>(innerType: T, params?: string | core.$ZodNonOptionalParams):
|
|
633
|
-
interface
|
|
610
|
+
declare const KrustyNonOptional: core.$constructor<KrustyNonOptional>;
|
|
611
|
+
declare function nonoptional<T extends core.SomeType, K extends KrustyInternals>(innerType: T, params?: string | core.$ZodNonOptionalParams): KrustyNonOptional<T, K>;
|
|
612
|
+
interface KrustySuccess<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodSuccessInternals<T>, K>, core.$ZodSuccess<T> {
|
|
634
613
|
unwrap(): T;
|
|
635
614
|
}
|
|
636
|
-
declare const
|
|
637
|
-
declare function success<T extends core.SomeType, K extends KrustyInternals>(innerType: T):
|
|
638
|
-
interface
|
|
615
|
+
declare const KrustySuccess: core.$constructor<KrustySuccess>;
|
|
616
|
+
declare function success<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustySuccess<T, K>;
|
|
617
|
+
interface KrustyCatch<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodCatchInternals<T>, K>, core.$ZodCatch<T> {
|
|
639
618
|
unwrap(): T;
|
|
640
619
|
/** @deprecated Use `.unwrap()` instead. */
|
|
641
620
|
removeCatch(): T;
|
|
642
621
|
}
|
|
643
|
-
declare const
|
|
644
|
-
declare function _catch<T extends core.SomeType, K extends KrustyInternals>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)):
|
|
622
|
+
declare const KrustyCatch: core.$constructor<KrustyCatch>;
|
|
623
|
+
declare function _catch<T extends core.SomeType, K extends KrustyInternals>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): KrustyCatch<T, K>;
|
|
645
624
|
|
|
646
|
-
interface
|
|
625
|
+
interface KrustyNaN<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNaNInternals, K>, core.$ZodNaN {
|
|
647
626
|
}
|
|
648
|
-
declare const
|
|
649
|
-
declare function nan(params?: string | core.$ZodNaNParams):
|
|
650
|
-
interface
|
|
627
|
+
declare const KrustyNaN: core.$constructor<KrustyNaN>;
|
|
628
|
+
declare function nan(params?: string | core.$ZodNaNParams): KrustyNaN;
|
|
629
|
+
interface KrustyPipe<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodPipeInternals<A, B>, K>, core.$ZodPipe<A, B> {
|
|
651
630
|
in: A;
|
|
652
631
|
out: B;
|
|
653
632
|
}
|
|
654
|
-
declare const
|
|
655
|
-
declare function pipe<const A extends core.SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>, K extends KrustyInternals = KrustyInternals>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>):
|
|
656
|
-
interface
|
|
633
|
+
declare const KrustyPipe: core.$constructor<KrustyPipe>;
|
|
634
|
+
declare function pipe<const A extends core.SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>, K extends KrustyInternals = KrustyInternals>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): KrustyPipe<A, B, K>;
|
|
635
|
+
interface KrustyCodec<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends KrustyPipe<A, B, K>, core.$ZodCodec<A, B> {
|
|
657
636
|
_zod: core.$ZodCodecInternals<A, B>;
|
|
658
637
|
def: core.$ZodCodecDef<A, B>;
|
|
659
638
|
}
|
|
660
|
-
declare const
|
|
639
|
+
declare const KrustyCodec: core.$constructor<KrustyCodec>;
|
|
661
640
|
declare function codec<const A extends core.SomeType, B extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals>(in_: A, out: B, params: {
|
|
662
641
|
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
|
|
663
642
|
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
|
|
664
|
-
}):
|
|
665
|
-
interface
|
|
643
|
+
}): KrustyCodec<A, B, K>;
|
|
644
|
+
interface KrustyReadonly<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodReadonlyInternals<T>, K>, core.$ZodReadonly<T> {
|
|
666
645
|
unwrap(): T;
|
|
667
646
|
}
|
|
668
|
-
declare const
|
|
669
|
-
declare function readonly<T extends core.SomeType, K extends KrustyInternals>(innerType: T):
|
|
670
|
-
interface
|
|
647
|
+
declare const KrustyReadonly: core.$constructor<KrustyReadonly>;
|
|
648
|
+
declare function readonly<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyReadonly<T, K>;
|
|
649
|
+
interface KrustyTemplateLiteral<Template extends string = string, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodTemplateLiteralInternals<Template>, K>, core.$ZodTemplateLiteral<Template> {
|
|
671
650
|
}
|
|
672
|
-
declare const
|
|
673
|
-
declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[], K extends KrustyInternals>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams):
|
|
674
|
-
interface
|
|
651
|
+
declare const KrustyTemplateLiteral: core.$constructor<KrustyTemplateLiteral>;
|
|
652
|
+
declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[], K extends KrustyInternals>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): KrustyTemplateLiteral<core.$PartsToTemplateLiteral<Parts>, K>;
|
|
653
|
+
interface KrustyLazy<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodLazyInternals<T>, K>, core.$ZodLazy<T> {
|
|
675
654
|
unwrap(): T;
|
|
676
655
|
}
|
|
677
|
-
declare const
|
|
678
|
-
declare function lazy<T extends core.SomeType, K extends KrustyInternals>(getter: () => T):
|
|
679
|
-
interface
|
|
656
|
+
declare const KrustyLazy: core.$constructor<KrustyLazy>;
|
|
657
|
+
declare function lazy<T extends core.SomeType, K extends KrustyInternals>(getter: () => T): KrustyLazy<T, K>;
|
|
658
|
+
interface KrustyPromise<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodPromiseInternals<T>, K>, core.$ZodPromise<T> {
|
|
680
659
|
unwrap(): T;
|
|
681
660
|
}
|
|
682
|
-
declare const
|
|
683
|
-
declare function promise<T extends core.SomeType, K extends KrustyInternals>(innerType: T):
|
|
684
|
-
interface
|
|
661
|
+
declare const KrustyPromise: core.$constructor<KrustyPromise>;
|
|
662
|
+
declare function promise<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyPromise<T, K>;
|
|
663
|
+
interface KrustyFunction<Args extends core.$ZodFunctionIn = core.$ZodFunctionIn, Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodFunctionInternals<Args, Returns>, K>, core.$ZodFunction<Args, Returns> {
|
|
685
664
|
_def: core.$ZodFunctionDef<Args, Returns>;
|
|
686
665
|
_input: core.$InferInnerFunctionType<Args, Returns>;
|
|
687
666
|
_output: core.$InferOuterFunctionType<Args, Returns>;
|
|
688
|
-
input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(args: Items, rest?: Rest):
|
|
689
|
-
input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs):
|
|
690
|
-
input(...args: any[]):
|
|
691
|
-
output<NewReturns extends core.$ZodType>(output: NewReturns):
|
|
667
|
+
input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(args: Items, rest?: Rest): KrustyFunction<core.$ZodTuple<Items, Rest>, Returns, K>;
|
|
668
|
+
input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): KrustyFunction<NewArgs, Returns, K>;
|
|
669
|
+
input(...args: any[]): KrustyFunction<any, Returns, K>;
|
|
670
|
+
output<NewReturns extends core.$ZodType>(output: NewReturns): KrustyFunction<Args, NewReturns, K>;
|
|
692
671
|
}
|
|
693
|
-
declare const
|
|
694
|
-
declare function _function():
|
|
672
|
+
declare const KrustyFunction: core.$constructor<KrustyFunction>;
|
|
673
|
+
declare function _function(): KrustyFunction;
|
|
695
674
|
declare function _function<const In extends ReadonlyArray<core.$ZodType>, K extends KrustyInternals>(params: {
|
|
696
675
|
input: In;
|
|
697
|
-
}):
|
|
676
|
+
}): KrustyFunction<KrustyTuple<In, null, K>, core.$ZodFunctionOut, K>;
|
|
698
677
|
declare function _function<const In extends ReadonlyArray<core.$ZodType>, const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut, K extends KrustyInternals = KrustyInternals>(params: {
|
|
699
678
|
input: In;
|
|
700
679
|
output: Out;
|
|
701
|
-
}):
|
|
680
|
+
}): KrustyFunction<KrustyTuple<In, null, K>, Out, K>;
|
|
702
681
|
declare function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn, K extends KrustyInternals = KrustyInternals>(params: {
|
|
703
682
|
input: In;
|
|
704
|
-
}):
|
|
683
|
+
}): KrustyFunction<In, core.$ZodFunctionOut, K>;
|
|
705
684
|
declare function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut, K extends KrustyInternals = KrustyInternals>(params: {
|
|
706
685
|
output: Out;
|
|
707
|
-
}):
|
|
686
|
+
}): KrustyFunction<core.$ZodFunctionIn, Out, K>;
|
|
708
687
|
declare function _function<In extends core.$ZodFunctionIn = core.$ZodFunctionIn, Out extends core.$ZodType = core.$ZodType, K extends KrustyInternals = KrustyInternals>(params?: {
|
|
709
688
|
input: In;
|
|
710
689
|
output: Out;
|
|
711
|
-
}):
|
|
690
|
+
}): KrustyFunction<In, Out, K>;
|
|
712
691
|
|
|
713
|
-
interface
|
|
692
|
+
interface KrustyCustom<O = unknown, I = unknown, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodCustomInternals<O, I>, K>, core.$ZodCustom<O, I> {
|
|
714
693
|
}
|
|
715
|
-
declare const
|
|
694
|
+
declare const KrustyCustom: core.$constructor<KrustyCustom>;
|
|
716
695
|
declare function check<O = unknown>(fn: core.CheckFn<O>): core.$ZodCheck<O>;
|
|
717
|
-
declare function custom<O, K extends KrustyInternals>(fn?: (data: unknown) => unknown, _params?: string | core.$ZodCustomParams | undefined):
|
|
696
|
+
declare function custom<O, K extends KrustyInternals>(fn?: (data: unknown) => unknown, _params?: string | core.$ZodCustomParams | undefined): KrustyCustom<O, O, K>;
|
|
718
697
|
declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
|
719
698
|
declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
|
|
720
|
-
type
|
|
721
|
-
declare function _instanceof<T extends typeof util.Class, K extends KrustyInternals>(cls: T, params?:
|
|
699
|
+
type KrustyInstanceOfParams = core.Params<KrustyCustom, core.$ZodIssueCustom, 'type' | 'check' | 'checks' | 'fn' | 'abort' | 'error' | 'params' | 'path'>;
|
|
700
|
+
declare function _instanceof<T extends typeof util.Class, K extends KrustyInternals>(cls: T, params?: KrustyInstanceOfParams): KrustyCustom<InstanceType<T>, InstanceType<T>, K>;
|
|
722
701
|
|
|
723
|
-
declare const stringbool: <K extends KrustyInternals = KrustyInternals>(_params?: string | core.$ZodStringBoolParams) =>
|
|
724
|
-
type
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
702
|
+
declare const stringbool: <K extends KrustyInternals = KrustyInternals>(_params?: string | core.$ZodStringBoolParams) => KrustyCodec<KrustyString, KrustyBoolean, K>;
|
|
703
|
+
type _KrustyJSONSchema<K extends KrustyInternals = KrustyInternals> = KrustyUnion<[
|
|
704
|
+
KrustyString,
|
|
705
|
+
KrustyNumber,
|
|
706
|
+
KrustyBoolean,
|
|
707
|
+
KrustyNull,
|
|
708
|
+
KrustyArray<KrustyJSONSchema, K>,
|
|
709
|
+
KrustyRecord<KrustyString, KrustyJSONSchema, K>
|
|
731
710
|
], K>;
|
|
732
|
-
type
|
|
733
|
-
interface
|
|
711
|
+
type _KrustyJSONSchemaInternals = _KrustyJSONSchema['_zod'];
|
|
712
|
+
interface KrustyJSONSchemaInternals extends _KrustyJSONSchemaInternals {
|
|
734
713
|
output: util.JSONType;
|
|
735
714
|
input: util.JSONType;
|
|
736
715
|
}
|
|
737
|
-
interface
|
|
738
|
-
_zod:
|
|
716
|
+
interface KrustyJSONSchema<K extends KrustyInternals = KrustyInternals> extends _KrustyJSONSchema<K> {
|
|
717
|
+
_zod: KrustyJSONSchemaInternals;
|
|
739
718
|
}
|
|
740
|
-
declare function json<K extends KrustyInternals = KrustyInternals>(params?: string | core.$ZodCustomParams):
|
|
741
|
-
declare function preprocess<A, U extends core.SomeType, B = unknown, K extends KrustyInternals = KrustyInternals>(fn: (arg: B, ctx: core.$RefinementCtx) => A, schema: U): ZodPipe<ZodTransform<A, B>, U, K>;
|
|
719
|
+
declare function json<K extends KrustyInternals = KrustyInternals>(params?: string | core.$ZodCustomParams): KrustyJSONSchema<K>;
|
|
742
720
|
|
|
743
|
-
declare class SchemaClass<GateNames extends string =
|
|
744
|
-
string(params?: string | core.$ZodStringParams):
|
|
745
|
-
number(params?: string | core.$ZodNumberParams):
|
|
746
|
-
int(params?: string | core.$ZodCheckNumberFormatParams):
|
|
747
|
-
boolean(params?: string | core.$ZodBooleanParams):
|
|
748
|
-
null(params?: string | core.$ZodNullParams):
|
|
749
|
-
array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams):
|
|
750
|
-
record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams):
|
|
751
|
-
union<const T extends readonly core.SomeType[]>(options: T, params?: string | core.$ZodUnionParams):
|
|
752
|
-
discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams):
|
|
753
|
-
object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(shape?: T, params?: string | core.$ZodObjectParams):
|
|
754
|
-
date(params?: string | core.$ZodDateParams):
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
721
|
+
declare class SchemaClass<GateNames extends string = never, K extends KrustyInternals = KrustyInternals<GateNames>> {
|
|
722
|
+
string(params?: string | core.$ZodStringParams): KrustyString<K>;
|
|
723
|
+
number(params?: string | core.$ZodNumberParams): KrustyNumber<K>;
|
|
724
|
+
int(params?: string | core.$ZodCheckNumberFormatParams): KrustyNumber<K>;
|
|
725
|
+
boolean(params?: string | core.$ZodBooleanParams): KrustyBoolean<K>;
|
|
726
|
+
null(params?: string | core.$ZodNullParams): KrustyNull<K>;
|
|
727
|
+
array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): KrustyArray<T, K>;
|
|
728
|
+
record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): KrustyRecord<Key, Value, K>;
|
|
729
|
+
union<const T extends readonly core.SomeType[]>(options: T, params?: string | core.$ZodUnionParams): KrustyUnion<T, K>;
|
|
730
|
+
discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): KrustyDiscriminatedUnion<Types, Disc, K>;
|
|
731
|
+
object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(shape?: T, params?: string | core.$ZodObjectParams): KrustyObject<core.util.Writeable<T>, core.$strip, K>;
|
|
732
|
+
date(params?: string | (core.$ZodDateParams & core.$ZodISODateParams)): KrustyDateCodec<K>;
|
|
733
|
+
datetime(params?: string | (core.$ZodDateParams & core.$ZodISODateParams)): KrustyDateTimeCodec<K>;
|
|
734
|
+
any(): KrustyAny<K>;
|
|
735
|
+
unknown(): KrustyUnknown<K>;
|
|
736
|
+
never(params?: string | core.$ZodNeverParams): KrustyNever<K>;
|
|
737
|
+
lazy<T extends core.SomeType>(getter: () => T): KrustyLazy<T, K>;
|
|
738
|
+
json(params?: string | core.$ZodCustomParams): KrustyJSONSchema<K>;
|
|
760
739
|
}
|
|
761
740
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
export { $ZodGate, KrustyType, SchemaClass, ZodAny, ZodArray, ZodBase64, ZodBase64URL, ZodBigInt, ZodBigIntFormat, ZodBoolean, ZodCIDRv4, ZodCIDRv6, ZodCUID, ZodCUID2, ZodCatch, ZodCodec, ZodCustom, ZodCustomStringFormat, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodE164, ZodEmail, ZodEmoji, ZodEnum, ZodError, ZodFile, ZodFunction, ZodGUID, ZodGate, ZodIPv4, ZodIPv6, ZodIntersection, ZodJWT, ZodKSUID, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNanoID, ZodNever, ZodNonOptional, ZodNull, ZodNullable, ZodNumber, ZodNumberFormat, ZodObject, ZodOptional, ZodPipe, ZodPrefault, ZodPromise, ZodReadonly, ZodRealError, ZodRecord, ZodSet, ZodString, ZodStringFormat, ZodSuccess, ZodSymbol, ZodTemplateLiteral, ZodTransform, ZodTuple, ZodULID, ZodURL, ZodUUID, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, ZodXID, _ZodString, _default, _function, any, array, base64, base64url, bigint, blob, boolean, _catch as catch, check, cidrv4, cidrv6, codec, cuid, cuid2, custom, date, decode, decodeAsync, discriminatedUnion, e164, email, emoji, encode, encodeAsync, _enum as enum, file, float32, float64, _function as function, gate, gatingContext, guid, hash, hex, hostname, httpUrl, _instanceof as instanceof, int, int32, int64, intersection, ipv4, ipv6, isGateIssue, isGateIssueRaw, json, jwt, keyof, ksuid, lazy, literal, looseObject, map, nan, nanoid, nativeEnum, never, nonoptional, _null as null, nullable, nullish, number, object, optional, parse, parseAsync, partialRecord, pipe, prefault, preprocess, promise, readonly, record, refine, regexp, safeDecode, safeDecodeAsync, safeEncode, safeEncodeAsync, safeParse, safeParseAsync, set, strictObject, string, stringFormat, stringbool, success, superRefine, symbol, templateLiteral, transform, tuple, uint32, uint64, ulid, _undefined as undefined, union, unknown, url, uuid, uuidv4, uuidv6, uuidv7, _void as void, xid };
|
|
765
|
-
export type { $ZodGateDef, $ZodGateInternals, AnySchema, IsGateEnabled, IssueData, KrustyInternals, SafeExtendShape, ZodFloat32, ZodFloat64, ZodInt, ZodInt32, ZodIssue, ZodJSONSchema, ZodJSONSchemaInternals, ZodSafeParseError, ZodSafeParseResult, ZodSafeParseSuccess, ZodUInt32, _KrustyType, _ZodBigInt, _ZodBoolean, _ZodDate, _ZodNumber };
|
|
741
|
+
export { $ZodGate, KrustyAny, KrustyArray, KrustyBase64, KrustyBase64URL, KrustyBigInt, KrustyBigIntFormat, KrustyBoolean, KrustyCIDRv4, KrustyCIDRv6, KrustyCUID, KrustyCUID2, KrustyCatch, KrustyCodec, KrustyCustom, KrustyCustomStringFormat, KrustyDate, KrustyDefault, KrustyDiscriminatedUnion, KrustyE164, KrustyEmail, KrustyEmoji, KrustyEnum, KrustyFile, KrustyFunction, KrustyGUID, KrustyGate, KrustyIPv4, KrustyIPv6, KrustyIntersection, KrustyJWT, KrustyKSUID, KrustyLazy, KrustyLiteral, KrustyMap, KrustyNaN, KrustyNanoID, KrustyNever, KrustyNonOptional, KrustyNull, KrustyNullable, KrustyNumber, KrustyNumberFormat, KrustyObject, KrustyOptional, KrustyPipe, KrustyPrefault, KrustyPromise, KrustyReadonly, KrustyRecord, KrustySet, KrustyString, KrustyStringFormat, KrustySuccess, KrustySymbol, KrustyTemplateLiteral, KrustyTransform, KrustyTuple, KrustyType, KrustyULID, KrustyURL, KrustyUUID, KrustyUndefined, KrustyUnion, KrustyUnknown, KrustyVoid, KrustyXID, SchemaClass, ZodError, ZodRealError, _KrustyString, _default, _function, any, array, base64, base64url, bigint, boolean, _catch as catch, check, cidrv4, cidrv6, codec, cuid, cuid2, custom, date, datetime, decode, decodeAsync, discriminatedUnion, e164, email, emoji, encode, encodeAsync, _enum as enum, file, float32, float64, _function as function, gate, gatingContext, guid, hash, hex, hostname, httpUrl, _instanceof as instanceof, int, int32, int64, intersection, ipv4, ipv6, isGateIssue, isGateIssueRaw, json, jwt, keyof, ksuid, lazy, literal, looseObject, map, nan, nanoid, nativeEnum, never, nonoptional, _null as null, nullable, nullish, number, object, optional, parse, parseAsync, partialRecord, pipe, prefault, promise, readonly, record, refine, safeDecode, safeDecodeAsync, safeEncode, safeEncodeAsync, safeParse, safeParseAsync, set, strictObject, string, stringFormat, stringbool, success, superRefine, symbol, templateLiteral, transform, tuple, uint32, uint64, ulid, _undefined as undefined, union, unknown, url, uuid, uuidv4, uuidv6, uuidv7, _void as void, xid };
|
|
742
|
+
export type { $ZodGateDef, $ZodGateInternals, IsGateEnabled, IssueData, KrustyDateCodec, KrustyDateTimeCodec, KrustyFloat32, KrustyFloat64, KrustyInt, KrustyInt32, KrustyInternals, KrustyJSONSchema, KrustyJSONSchemaInternals, KrustyUInt32, ParseContext, SafeExtendShape, ZodIssue, ZodSafeParseError, ZodSafeParseResult, ZodSafeParseSuccess, _KrustyBigInt, _KrustyBoolean, _KrustyDate, _KrustyNumber, _KrustyType };
|