@temporary-name/zod 1.9.3-alpha.65222302f1b71807a849530b3fe0fa0326d3c1a2 → 1.9.3-alpha.6a70825f6d8c3dc99b87e4e5b778aea0fa007417
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 +714 -76
- package/dist/index.d.ts +714 -76
- package/dist/index.mjs +1507 -897
- package/package.json +6 -17
- package/dist/zod4/index.d.mts +0 -314
- package/dist/zod4/index.d.ts +0 -314
- package/dist/zod4/index.mjs +0 -743
package/dist/index.d.mts
CHANGED
|
@@ -1,91 +1,729 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
1
|
+
import * as core from 'zod/v4/core';
|
|
2
|
+
import { $ZodError, util } from 'zod/v4/core';
|
|
3
|
+
export { core };
|
|
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
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
/** @deprecated Use `z.core.$ZodIssue` from `@zod/core` instead, especially if you are building a library on top of Zod. */
|
|
8
|
+
type ZodIssue = core.$ZodIssue;
|
|
9
|
+
/** An Error-like class used to store Zod validation issues. */
|
|
10
|
+
interface ZodError<T = unknown> extends $ZodError<T> {
|
|
11
|
+
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
12
|
+
format(): core.$ZodFormattedError<T>;
|
|
13
|
+
format<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFormattedError<T, U>;
|
|
14
|
+
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
15
|
+
flatten(): core.$ZodFlattenedError<T>;
|
|
16
|
+
flatten<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFlattenedError<T, U>;
|
|
17
|
+
/** @deprecated Push directly to `.issues` instead. */
|
|
18
|
+
addIssue(issue: core.$ZodIssue): void;
|
|
19
|
+
/** @deprecated Push directly to `.issues` instead. */
|
|
20
|
+
addIssues(issues: core.$ZodIssue[]): void;
|
|
21
|
+
/** @deprecated Check `err.issues.length === 0` instead. */
|
|
22
|
+
isEmpty: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const ZodError: core.$constructor<ZodError>;
|
|
25
|
+
declare const ZodRealError: core.$constructor<ZodError>;
|
|
26
|
+
/** @deprecated Use `z.core.$ZodRawIssue` instead. */
|
|
27
|
+
type IssueData = core.$ZodRawIssue;
|
|
13
28
|
|
|
14
|
-
type
|
|
15
|
-
|
|
29
|
+
type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
|
|
30
|
+
type ZodSafeParseSuccess<T> = {
|
|
31
|
+
success: true;
|
|
32
|
+
data: T;
|
|
33
|
+
error?: never;
|
|
16
34
|
};
|
|
17
|
-
type
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
mimeType?: string;
|
|
35
|
+
type ZodSafeParseError<T> = {
|
|
36
|
+
success: false;
|
|
37
|
+
data?: never;
|
|
38
|
+
error: ZodError<T>;
|
|
22
39
|
};
|
|
23
|
-
declare
|
|
24
|
-
|
|
25
|
-
|
|
40
|
+
declare const parse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {
|
|
41
|
+
callee?: core.util.AnyFunc;
|
|
42
|
+
Err?: core.$ZodErrorClass;
|
|
43
|
+
}) => core.output<T>;
|
|
44
|
+
declare const parseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {
|
|
45
|
+
callee?: core.util.AnyFunc;
|
|
46
|
+
Err?: core.$ZodErrorClass;
|
|
47
|
+
}) => Promise<core.output<T>>;
|
|
48
|
+
declare const safeParse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.output<T>>;
|
|
49
|
+
declare const safeParseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.output<T>>>;
|
|
50
|
+
declare const encode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => core.input<T>;
|
|
51
|
+
declare const decode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => core.output<T>;
|
|
52
|
+
declare const encodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<core.input<T>>;
|
|
53
|
+
declare const decodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<core.output<T>>;
|
|
54
|
+
declare const safeEncode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.input<T>>;
|
|
55
|
+
declare const safeDecode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.output<T>>;
|
|
56
|
+
declare const safeEncodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.input<T>>>;
|
|
57
|
+
declare const safeDecodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.output<T>>>;
|
|
26
58
|
|
|
27
|
-
|
|
59
|
+
type IsGateEnabled = (gate: string) => boolean;
|
|
60
|
+
declare const gatingContext: AsyncLocalStorage<IsGateEnabled>;
|
|
61
|
+
declare function isGateIssueRaw(issue: core.$ZodRawIssue): boolean;
|
|
62
|
+
declare function isGateIssue(issue: core.$ZodIssue): boolean;
|
|
63
|
+
interface $ZodGateDef<T extends core.SomeType = core.$ZodType> extends core.$ZodOptionalDef<T> {
|
|
64
|
+
gateName: string;
|
|
65
|
+
}
|
|
66
|
+
interface $ZodGateInternals<T extends core.SomeType = core.$ZodType> extends core.$ZodOptionalInternals<T> {
|
|
67
|
+
def: $ZodGateDef<T>;
|
|
68
|
+
}
|
|
69
|
+
interface $ZodGate<T extends core.SomeType = core.$ZodType> extends core.$ZodType {
|
|
70
|
+
_zod: $ZodGateInternals<T>;
|
|
71
|
+
}
|
|
72
|
+
declare const $ZodGate: core.$constructor<$ZodGate>;
|
|
73
|
+
interface KrustyGate<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<$ZodGateInternals<T>, K>, $ZodGate<T> {
|
|
74
|
+
unwrap(): T;
|
|
75
|
+
}
|
|
76
|
+
declare const KrustyGate: core.$constructor<KrustyGate>;
|
|
77
|
+
declare function gate<T extends core.SomeType, K extends KrustyInternals>(innerType: T, gateName: K['gateNames']): KrustyGate<T, K>;
|
|
28
78
|
|
|
29
|
-
|
|
30
|
-
|
|
79
|
+
type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
|
|
80
|
+
[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];
|
|
31
81
|
};
|
|
82
|
+
interface KrustyObject<
|
|
83
|
+
/** @ts-expect-error Cast variance */
|
|
84
|
+
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> {
|
|
85
|
+
shape: Shape;
|
|
86
|
+
keyof(): KrustyEnum<util.ToEnum<keyof Shape & string>, K>;
|
|
87
|
+
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
|
|
88
|
+
catchall<T extends core.SomeType>(schema: T): KrustyObject<Shape, core.$catchall<T>, K>;
|
|
89
|
+
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
|
|
90
|
+
passthrough(): KrustyObject<Shape, core.$loose, K>;
|
|
91
|
+
/** Consider `z.looseObject(A.shape)` instead */
|
|
92
|
+
loose(): KrustyObject<Shape, core.$loose, K>;
|
|
93
|
+
/** Consider `z.strictObject(A.shape)` instead */
|
|
94
|
+
strict(): KrustyObject<Shape, core.$strict, K>;
|
|
95
|
+
/** This is the default behavior. This method call is likely unnecessary. */
|
|
96
|
+
strip(): KrustyObject<Shape, core.$strip, K>;
|
|
97
|
+
extend<U extends core.$ZodLooseShape>(shape: U): KrustyObject<util.Extend<Shape, U>, Config, K>;
|
|
98
|
+
safeExtend<U extends core.$ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>): KrustyObject<util.Extend<Shape, U>, Config, K>;
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
101
|
+
*/
|
|
102
|
+
merge<U extends KrustyObject>(other: U): KrustyObject<util.Extend<Shape, U['shape']>, U['_zod']['config'], K>;
|
|
103
|
+
pick<M extends util.Mask<keyof Shape>>(mask: M): KrustyObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config, K>;
|
|
104
|
+
omit<M extends util.Mask<keyof Shape>>(mask: M): KrustyObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config, K>;
|
|
105
|
+
partial(): KrustyObject<{
|
|
106
|
+
[k in keyof Shape]: KrustyOptional<Shape[k], K>;
|
|
107
|
+
}, Config, K>;
|
|
108
|
+
partial<M extends util.Mask<keyof Shape>>(mask: M): KrustyObject<{
|
|
109
|
+
[k in keyof Shape]: k extends keyof M ? KrustyOptional<Shape[k], K> : Shape[k];
|
|
110
|
+
}, Config, K>;
|
|
111
|
+
required(): KrustyObject<{
|
|
112
|
+
[k in keyof Shape]: KrustyNonOptional<Shape[k], K>;
|
|
113
|
+
}, Config, K>;
|
|
114
|
+
required<M extends util.Mask<keyof Shape>>(mask: M): KrustyObject<{
|
|
115
|
+
[k in keyof Shape]: k extends keyof M ? KrustyNonOptional<Shape[k], K> : Shape[k];
|
|
116
|
+
}, Config, K>;
|
|
117
|
+
}
|
|
118
|
+
declare const KrustyObject: core.$constructor<KrustyObject>;
|
|
119
|
+
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>;
|
|
120
|
+
declare function strictObject<T extends core.$ZodLooseShape, K extends KrustyInternals>(shape: T, params?: string | core.$ZodObjectParams): KrustyObject<T, core.$strict, K>;
|
|
121
|
+
declare function looseObject<T extends core.$ZodLooseShape, K extends KrustyInternals>(shape: T, params?: string | core.$ZodObjectParams): KrustyObject<T, core.$loose, K>;
|
|
32
122
|
|
|
33
|
-
|
|
123
|
+
interface KrustyUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[], K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodUnionInternals<T>, K>, core.$ZodUnion<T> {
|
|
124
|
+
options: T;
|
|
125
|
+
}
|
|
126
|
+
declare const KrustyUnion: core.$constructor<KrustyUnion>;
|
|
127
|
+
declare function union<const T extends readonly core.SomeType[], K extends KrustyInternals>(options: T, params?: string | core.$ZodUnionParams): KrustyUnion<T, K>;
|
|
128
|
+
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> {
|
|
129
|
+
_zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
|
|
130
|
+
def: core.$ZodDiscriminatedUnionDef<Options, Disc>;
|
|
131
|
+
}
|
|
132
|
+
declare const KrustyDiscriminatedUnion: core.$constructor<KrustyDiscriminatedUnion>;
|
|
133
|
+
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>;
|
|
34
134
|
|
|
35
|
-
|
|
135
|
+
interface KrustyInternals<GateNames extends string = string> {
|
|
136
|
+
gateNames: GateNames;
|
|
137
|
+
}
|
|
138
|
+
interface _KrustyType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals, out KInternals extends KrustyInternals = KrustyInternals> extends KrustyType<any, any, Internals, KInternals> {
|
|
139
|
+
}
|
|
140
|
+
interface KrustyType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>, KInternals extends KrustyInternals = KrustyInternals> extends core.$ZodType<Output, Input, Internals> {
|
|
141
|
+
def: Internals['def'];
|
|
142
|
+
type: Internals['def']['type'];
|
|
143
|
+
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
|
144
|
+
clone(def?: Internals['def'], params?: {
|
|
145
|
+
parent: boolean;
|
|
146
|
+
}): this;
|
|
147
|
+
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R['_schema'] ? undefined extends R['_meta'] ? [
|
|
148
|
+
core.$replace<R['_meta'], this>?
|
|
149
|
+
] : [core.$replace<R['_meta'], this>] : ['Incompatible schema']): this;
|
|
150
|
+
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T>;
|
|
151
|
+
refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
|
|
152
|
+
superRefine(refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>): this;
|
|
153
|
+
overwrite(fn: (x: core.output<this>) => core.output<this>): this;
|
|
154
|
+
gate(gateName: KInternals['gateNames']): KrustyGate<this, KInternals>;
|
|
155
|
+
optional(): KrustyOptional<this, KInternals>;
|
|
156
|
+
nonoptional(params?: string | core.$ZodNonOptionalParams): KrustyNonOptional<this, KInternals>;
|
|
157
|
+
nullable(): KrustyNullable<this, KInternals>;
|
|
158
|
+
nullish(): KrustyOptional<KrustyNullable<this, KInternals>, KInternals>;
|
|
159
|
+
default(def: util.NoUndefined<core.output<this>>): KrustyDefault<this, KInternals>;
|
|
160
|
+
default(def: () => util.NoUndefined<core.output<this>>): KrustyDefault<this, KInternals>;
|
|
161
|
+
prefault(def: () => core.input<this>): KrustyPrefault<this, KInternals>;
|
|
162
|
+
prefault(def: core.input<this>): KrustyPrefault<this, KInternals>;
|
|
163
|
+
array(): KrustyArray<this, KInternals>;
|
|
164
|
+
or<T extends core.SomeType>(option: T): KrustyUnion<[this, T], KInternals>;
|
|
165
|
+
and<T extends core.SomeType>(incoming: T): KrustyIntersection<this, T, KInternals>;
|
|
166
|
+
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>;
|
|
167
|
+
}
|
|
168
|
+
declare const KrustyType: core.$constructor<_KrustyType>;
|
|
169
|
+
interface _KrustyString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>, K extends KrustyInternals = KrustyInternals> extends _KrustyType<T, K> {
|
|
170
|
+
format: string | null;
|
|
171
|
+
minLength: number | null;
|
|
172
|
+
maxLength: number | null;
|
|
173
|
+
regex(regex: RegExp, params?: string | core.$ZodCheckRegexParams): this;
|
|
174
|
+
includes(value: string, params?: core.$ZodCheckIncludesParams): this;
|
|
175
|
+
startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
|
|
176
|
+
endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
|
|
177
|
+
min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
|
|
178
|
+
max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
|
|
179
|
+
length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
|
|
180
|
+
nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
|
|
181
|
+
lowercase(params?: string | core.$ZodCheckLowerCaseParams): this;
|
|
182
|
+
uppercase(params?: string | core.$ZodCheckUpperCaseParams): this;
|
|
183
|
+
trim(): this;
|
|
184
|
+
normalize(form?: 'NFC' | 'NFD' | 'NFKC' | 'NFKD' | (string & {})): this;
|
|
185
|
+
toLowerCase(): this;
|
|
186
|
+
toUpperCase(): this;
|
|
187
|
+
}
|
|
188
|
+
/** @internal */
|
|
189
|
+
declare const _KrustyString: core.$constructor<_KrustyString>;
|
|
190
|
+
interface KrustyString<K extends KrustyInternals = KrustyInternals> extends _KrustyString<core.$ZodStringInternals<string>, K> {
|
|
191
|
+
/** @deprecated Use `z.email()` instead. */
|
|
192
|
+
email(params?: string | core.$ZodCheckEmailParams): this;
|
|
193
|
+
/** @deprecated Use `z.url()` instead. */
|
|
194
|
+
url(params?: string | core.$ZodCheckURLParams): this;
|
|
195
|
+
/** @deprecated Use `z.jwt()` instead. */
|
|
196
|
+
jwt(params?: string | core.$ZodCheckJWTParams): this;
|
|
197
|
+
/** @deprecated Use `z.emoji()` instead. */
|
|
198
|
+
emoji(params?: string | core.$ZodCheckEmojiParams): this;
|
|
199
|
+
/** @deprecated Use `z.guid()` instead. */
|
|
200
|
+
guid(params?: string | core.$ZodCheckGUIDParams): this;
|
|
201
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
202
|
+
uuid(params?: string | core.$ZodCheckUUIDParams): this;
|
|
203
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
204
|
+
uuidv4(params?: string | core.$ZodCheckUUIDParams): this;
|
|
205
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
206
|
+
uuidv6(params?: string | core.$ZodCheckUUIDParams): this;
|
|
207
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
208
|
+
uuidv7(params?: string | core.$ZodCheckUUIDParams): this;
|
|
209
|
+
/** @deprecated Use `z.nanoid()` instead. */
|
|
210
|
+
nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
|
|
211
|
+
/** @deprecated Use `z.guid()` instead. */
|
|
212
|
+
guid(params?: string | core.$ZodCheckGUIDParams): this;
|
|
213
|
+
/** @deprecated Use `z.cuid()` instead. */
|
|
214
|
+
cuid(params?: string | core.$ZodCheckCUIDParams): this;
|
|
215
|
+
/** @deprecated Use `z.cuid2()` instead. */
|
|
216
|
+
cuid2(params?: string | core.$ZodCheckCUID2Params): this;
|
|
217
|
+
/** @deprecated Use `z.ulid()` instead. */
|
|
218
|
+
ulid(params?: string | core.$ZodCheckULIDParams): this;
|
|
219
|
+
/** @deprecated Use `z.base64()` instead. */
|
|
220
|
+
base64(params?: string | core.$ZodCheckBase64Params): this;
|
|
221
|
+
/** @deprecated Use `z.base64url()` instead. */
|
|
222
|
+
base64url(params?: string | core.$ZodCheckBase64URLParams): this;
|
|
223
|
+
/** @deprecated Use `z.xid()` instead. */
|
|
224
|
+
xid(params?: string | core.$ZodCheckXIDParams): this;
|
|
225
|
+
/** @deprecated Use `z.ksuid()` instead. */
|
|
226
|
+
ksuid(params?: string | core.$ZodCheckKSUIDParams): this;
|
|
227
|
+
/** @deprecated Use `z.ipv4()` instead. */
|
|
228
|
+
ipv4(params?: string | core.$ZodCheckIPv4Params): this;
|
|
229
|
+
/** @deprecated Use `z.ipv6()` instead. */
|
|
230
|
+
ipv6(params?: string | core.$ZodCheckIPv6Params): this;
|
|
231
|
+
/** @deprecated Use `z.cidrv4()` instead. */
|
|
232
|
+
cidrv4(params?: string | core.$ZodCheckCIDRv4Params): this;
|
|
233
|
+
/** @deprecated Use `z.cidrv6()` instead. */
|
|
234
|
+
cidrv6(params?: string | core.$ZodCheckCIDRv6Params): this;
|
|
235
|
+
/** @deprecated Use `z.e164()` instead. */
|
|
236
|
+
e164(params?: string | core.$ZodCheckE164Params): this;
|
|
237
|
+
/** @deprecated Use `z.iso.datetime()` instead. */
|
|
238
|
+
datetime(params?: string | core.$ZodCheckISODateTimeParams): this;
|
|
239
|
+
/** @deprecated Use `z.iso.date()` instead. */
|
|
240
|
+
date(params?: string | core.$ZodCheckISODateParams): this;
|
|
241
|
+
/** @deprecated Use `z.iso.time()` instead. */
|
|
242
|
+
time(params?: string | core.$ZodCheckISOTimeParams): this;
|
|
243
|
+
/** @deprecated Use `z.iso.duration()` instead. */
|
|
244
|
+
duration(params?: string | core.$ZodCheckISODurationParams): this;
|
|
245
|
+
}
|
|
246
|
+
declare const KrustyString: core.$constructor<KrustyString>;
|
|
247
|
+
declare function string<K extends KrustyInternals = KrustyInternals>(params?: string | core.$ZodStringParams): KrustyString<K>;
|
|
248
|
+
interface KrustyStringFormat<Format extends string = string, K extends KrustyInternals = KrustyInternals> extends _KrustyString<core.$ZodStringFormatInternals<Format>, K> {
|
|
249
|
+
}
|
|
250
|
+
declare const KrustyStringFormat: core.$constructor<KrustyStringFormat>;
|
|
251
|
+
interface KrustyEmail<K extends KrustyInternals = KrustyInternals> extends KrustyStringFormat<'email', K> {
|
|
252
|
+
_zod: core.$ZodEmailInternals;
|
|
253
|
+
}
|
|
254
|
+
declare const KrustyEmail: core.$constructor<KrustyEmail>;
|
|
255
|
+
declare function email(params?: string | core.$ZodEmailParams): KrustyEmail;
|
|
256
|
+
interface KrustyGUID<K extends KrustyInternals = KrustyInternals> extends KrustyStringFormat<'guid', K> {
|
|
257
|
+
_zod: core.$ZodGUIDInternals;
|
|
258
|
+
}
|
|
259
|
+
declare const KrustyGUID: core.$constructor<KrustyGUID>;
|
|
260
|
+
declare function guid(params?: string | core.$ZodGUIDParams): KrustyGUID;
|
|
261
|
+
interface KrustyUUID<K extends KrustyInternals = KrustyInternals> extends KrustyStringFormat<'uuid', K> {
|
|
262
|
+
_zod: core.$ZodUUIDInternals;
|
|
263
|
+
}
|
|
264
|
+
declare const KrustyUUID: core.$constructor<KrustyUUID>;
|
|
265
|
+
declare function uuid(params?: string | core.$ZodUUIDParams): KrustyUUID;
|
|
266
|
+
declare function uuidv4(params?: string | core.$ZodUUIDv4Params): KrustyUUID;
|
|
267
|
+
declare function uuidv6(params?: string | core.$ZodUUIDv6Params): KrustyUUID;
|
|
268
|
+
declare function uuidv7(params?: string | core.$ZodUUIDv7Params): KrustyUUID;
|
|
269
|
+
interface KrustyURL extends KrustyStringFormat<'url'> {
|
|
270
|
+
_zod: core.$ZodURLInternals;
|
|
271
|
+
}
|
|
272
|
+
declare const KrustyURL: core.$constructor<KrustyURL>;
|
|
273
|
+
declare function url(params?: string | core.$ZodURLParams): KrustyURL;
|
|
274
|
+
declare function httpUrl(params?: string | Omit<core.$ZodURLParams, 'protocol' | 'hostname'>): KrustyURL;
|
|
275
|
+
interface KrustyEmoji extends KrustyStringFormat<'emoji'> {
|
|
276
|
+
_zod: core.$ZodEmojiInternals;
|
|
277
|
+
}
|
|
278
|
+
declare const KrustyEmoji: core.$constructor<KrustyEmoji>;
|
|
279
|
+
declare function emoji(params?: string | core.$ZodEmojiParams): KrustyEmoji;
|
|
280
|
+
interface KrustyNanoID extends KrustyStringFormat<'nanoid'> {
|
|
281
|
+
_zod: core.$ZodNanoIDInternals;
|
|
282
|
+
}
|
|
283
|
+
declare const KrustyNanoID: core.$constructor<KrustyNanoID>;
|
|
284
|
+
declare function nanoid(params?: string | core.$ZodNanoIDParams): KrustyNanoID;
|
|
285
|
+
interface KrustyCUID extends KrustyStringFormat<'cuid'> {
|
|
286
|
+
_zod: core.$ZodCUIDInternals;
|
|
287
|
+
}
|
|
288
|
+
declare const KrustyCUID: core.$constructor<KrustyCUID>;
|
|
289
|
+
declare function cuid(params?: string | core.$ZodCUIDParams): KrustyCUID;
|
|
290
|
+
interface KrustyCUID2 extends KrustyStringFormat<'cuid2'> {
|
|
291
|
+
_zod: core.$ZodCUID2Internals;
|
|
292
|
+
}
|
|
293
|
+
declare const KrustyCUID2: core.$constructor<KrustyCUID2>;
|
|
294
|
+
declare function cuid2(params?: string | core.$ZodCUID2Params): KrustyCUID2;
|
|
295
|
+
interface KrustyULID extends KrustyStringFormat<'ulid'> {
|
|
296
|
+
_zod: core.$ZodULIDInternals;
|
|
297
|
+
}
|
|
298
|
+
declare const KrustyULID: core.$constructor<KrustyULID>;
|
|
299
|
+
declare function ulid(params?: string | core.$ZodULIDParams): KrustyULID;
|
|
300
|
+
interface KrustyXID extends KrustyStringFormat<'xid'> {
|
|
301
|
+
_zod: core.$ZodXIDInternals;
|
|
302
|
+
}
|
|
303
|
+
declare const KrustyXID: core.$constructor<KrustyXID>;
|
|
304
|
+
declare function xid(params?: string | core.$ZodXIDParams): KrustyXID;
|
|
305
|
+
interface KrustyKSUID extends KrustyStringFormat<'ksuid'> {
|
|
306
|
+
_zod: core.$ZodKSUIDInternals;
|
|
307
|
+
}
|
|
308
|
+
declare const KrustyKSUID: core.$constructor<KrustyKSUID>;
|
|
309
|
+
declare function ksuid(params?: string | core.$ZodKSUIDParams): KrustyKSUID;
|
|
310
|
+
interface KrustyIPv4 extends KrustyStringFormat<'ipv4'> {
|
|
311
|
+
_zod: core.$ZodIPv4Internals;
|
|
312
|
+
}
|
|
313
|
+
declare const KrustyIPv4: core.$constructor<KrustyIPv4>;
|
|
314
|
+
declare function ipv4(params?: string | core.$ZodIPv4Params): KrustyIPv4;
|
|
315
|
+
interface KrustyIPv6 extends KrustyStringFormat<'ipv6'> {
|
|
316
|
+
_zod: core.$ZodIPv6Internals;
|
|
317
|
+
}
|
|
318
|
+
declare const KrustyIPv6: core.$constructor<KrustyIPv6>;
|
|
319
|
+
declare function ipv6(params?: string | core.$ZodIPv6Params): KrustyIPv6;
|
|
320
|
+
interface KrustyCIDRv4 extends KrustyStringFormat<'cidrv4'> {
|
|
321
|
+
_zod: core.$ZodCIDRv4Internals;
|
|
322
|
+
}
|
|
323
|
+
declare const KrustyCIDRv4: core.$constructor<KrustyCIDRv4>;
|
|
324
|
+
declare function cidrv4(params?: string | core.$ZodCIDRv4Params): KrustyCIDRv4;
|
|
325
|
+
interface KrustyCIDRv6 extends KrustyStringFormat<'cidrv6'> {
|
|
326
|
+
_zod: core.$ZodCIDRv6Internals;
|
|
327
|
+
}
|
|
328
|
+
declare const KrustyCIDRv6: core.$constructor<KrustyCIDRv6>;
|
|
329
|
+
declare function cidrv6(params?: string | core.$ZodCIDRv6Params): KrustyCIDRv6;
|
|
330
|
+
interface KrustyBase64 extends KrustyStringFormat<'base64'> {
|
|
331
|
+
_zod: core.$ZodBase64Internals;
|
|
332
|
+
}
|
|
333
|
+
declare const KrustyBase64: core.$constructor<KrustyBase64>;
|
|
334
|
+
declare function base64(params?: string | core.$ZodBase64Params): KrustyBase64;
|
|
335
|
+
interface KrustyBase64URL extends KrustyStringFormat<'base64url'> {
|
|
336
|
+
_zod: core.$ZodBase64URLInternals;
|
|
337
|
+
}
|
|
338
|
+
declare const KrustyBase64URL: core.$constructor<KrustyBase64URL>;
|
|
339
|
+
declare function base64url(params?: string | core.$ZodBase64URLParams): KrustyBase64URL;
|
|
340
|
+
interface KrustyE164 extends KrustyStringFormat<'e164'> {
|
|
341
|
+
_zod: core.$ZodE164Internals;
|
|
342
|
+
}
|
|
343
|
+
declare const KrustyE164: core.$constructor<KrustyE164>;
|
|
344
|
+
declare function e164(params?: string | core.$ZodE164Params): KrustyE164;
|
|
345
|
+
interface KrustyJWT extends KrustyStringFormat<'jwt'> {
|
|
346
|
+
_zod: core.$ZodJWTInternals;
|
|
347
|
+
}
|
|
348
|
+
declare const KrustyJWT: core.$constructor<KrustyJWT>;
|
|
349
|
+
declare function jwt(params?: string | core.$ZodJWTParams): KrustyJWT;
|
|
350
|
+
interface KrustyCustomStringFormat<Format extends string = string> extends KrustyStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
|
|
351
|
+
_zod: core.$ZodCustomStringFormatInternals<Format>;
|
|
352
|
+
}
|
|
353
|
+
declare const KrustyCustomStringFormat: core.$constructor<KrustyCustomStringFormat>;
|
|
354
|
+
declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): KrustyCustomStringFormat<Format>;
|
|
355
|
+
declare function hostname(_params?: string | core.$ZodStringFormatParams): KrustyCustomStringFormat<'hostname'>;
|
|
356
|
+
declare function hex(_params?: string | core.$ZodStringFormatParams): KrustyCustomStringFormat<'hex'>;
|
|
357
|
+
declare function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = 'hex'>(alg: Alg, params?: {
|
|
358
|
+
enc?: Enc;
|
|
359
|
+
} & core.$ZodStringFormatParams): KrustyCustomStringFormat<`${Alg}_${Enc}`>;
|
|
360
|
+
interface _KrustyNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals, K extends KrustyInternals = KrustyInternals> extends _KrustyType<Internals, K> {
|
|
361
|
+
gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
362
|
+
/** Identical to .min() */
|
|
363
|
+
gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
364
|
+
min(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
365
|
+
lt(value: number, params?: string | core.$ZodCheckLessThanParams): this;
|
|
366
|
+
/** Identical to .max() */
|
|
367
|
+
lte(value: number, params?: string | core.$ZodCheckLessThanParams): this;
|
|
368
|
+
max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
|
|
369
|
+
/** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
|
|
370
|
+
int(params?: string | core.$ZodCheckNumberFormatParams): this;
|
|
371
|
+
/** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
|
|
372
|
+
safe(params?: string | core.$ZodCheckNumberFormatParams): this;
|
|
373
|
+
positive(params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
374
|
+
nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
375
|
+
negative(params?: string | core.$ZodCheckLessThanParams): this;
|
|
376
|
+
nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
|
|
377
|
+
multipleOf(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
|
|
378
|
+
/** @deprecated Use `.multipleOf()` instead. */
|
|
379
|
+
step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
|
|
380
|
+
/** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
|
|
381
|
+
finite(params?: unknown): this;
|
|
382
|
+
minValue: number | null;
|
|
383
|
+
maxValue: number | null;
|
|
384
|
+
/** @deprecated Check the `format` property instead. */
|
|
385
|
+
isInt: boolean;
|
|
386
|
+
/** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
|
|
387
|
+
isFinite: boolean;
|
|
388
|
+
format: string | null;
|
|
389
|
+
}
|
|
390
|
+
interface KrustyNumber<K extends KrustyInternals = KrustyInternals> extends _KrustyNumber<core.$ZodNumberInternals<number>, K> {
|
|
391
|
+
}
|
|
392
|
+
declare const KrustyNumber: core.$constructor<KrustyNumber>;
|
|
393
|
+
declare function number(params?: string | core.$ZodNumberParams): KrustyNumber;
|
|
394
|
+
interface KrustyNumberFormat extends KrustyNumber {
|
|
395
|
+
_zod: core.$ZodNumberFormatInternals;
|
|
396
|
+
}
|
|
397
|
+
declare const KrustyNumberFormat: core.$constructor<KrustyNumberFormat>;
|
|
398
|
+
interface KrustyInt extends KrustyNumberFormat {
|
|
399
|
+
}
|
|
400
|
+
declare function int(params?: string | core.$ZodCheckNumberFormatParams): KrustyInt;
|
|
401
|
+
interface KrustyFloat32 extends KrustyNumberFormat {
|
|
402
|
+
}
|
|
403
|
+
declare function float32(params?: string | core.$ZodCheckNumberFormatParams): KrustyFloat32;
|
|
404
|
+
interface KrustyFloat64 extends KrustyNumberFormat {
|
|
405
|
+
}
|
|
406
|
+
declare function float64(params?: string | core.$ZodCheckNumberFormatParams): KrustyFloat64;
|
|
407
|
+
interface KrustyInt32 extends KrustyNumberFormat {
|
|
408
|
+
}
|
|
409
|
+
declare function int32(params?: string | core.$ZodCheckNumberFormatParams): KrustyInt32;
|
|
410
|
+
interface KrustyUInt32 extends KrustyNumberFormat {
|
|
411
|
+
}
|
|
412
|
+
declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): KrustyUInt32;
|
|
413
|
+
interface _KrustyBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals, K extends KrustyInternals = KrustyInternals> extends _KrustyType<T, K> {
|
|
414
|
+
}
|
|
415
|
+
interface KrustyBoolean<K extends KrustyInternals = KrustyInternals> extends _KrustyBoolean<core.$ZodBooleanInternals<boolean>, K> {
|
|
416
|
+
}
|
|
417
|
+
declare const KrustyBoolean: core.$constructor<KrustyBoolean>;
|
|
418
|
+
declare function boolean(params?: string | core.$ZodBooleanParams): KrustyBoolean;
|
|
419
|
+
interface _KrustyBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals, K extends KrustyInternals = KrustyInternals> extends _KrustyType<T, K> {
|
|
420
|
+
gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
421
|
+
/** Alias of `.gte()` */
|
|
422
|
+
min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
423
|
+
gt(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
424
|
+
/** Alias of `.lte()` */
|
|
425
|
+
lte(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
|
|
426
|
+
max(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
|
|
427
|
+
lt(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
|
|
428
|
+
positive(params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
429
|
+
negative(params?: string | core.$ZodCheckLessThanParams): this;
|
|
430
|
+
nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
|
|
431
|
+
nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
432
|
+
multipleOf(value: bigint, params?: string | core.$ZodCheckMultipleOfParams): this;
|
|
433
|
+
minValue: bigint | null;
|
|
434
|
+
maxValue: bigint | null;
|
|
435
|
+
format: string | null;
|
|
436
|
+
}
|
|
437
|
+
interface KrustyBigInt<K extends KrustyInternals = KrustyInternals> extends _KrustyBigInt<core.$ZodBigIntInternals<bigint>, K> {
|
|
438
|
+
}
|
|
439
|
+
declare const KrustyBigInt: core.$constructor<KrustyBigInt>;
|
|
440
|
+
declare function bigint(params?: string | core.$ZodBigIntParams): KrustyBigInt;
|
|
441
|
+
interface KrustyBigIntFormat extends KrustyBigInt {
|
|
442
|
+
_zod: core.$ZodBigIntFormatInternals;
|
|
443
|
+
}
|
|
444
|
+
declare const KrustyBigIntFormat: core.$constructor<KrustyBigIntFormat>;
|
|
445
|
+
declare function int64(params?: string | core.$ZodBigIntFormatParams): KrustyBigIntFormat;
|
|
446
|
+
declare function uint64(params?: string | core.$ZodBigIntFormatParams): KrustyBigIntFormat;
|
|
447
|
+
interface KrustySymbol<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodSymbolInternals, K> {
|
|
448
|
+
}
|
|
449
|
+
declare const KrustySymbol: core.$constructor<KrustySymbol>;
|
|
450
|
+
declare function symbol(params?: string | core.$ZodSymbolParams): KrustySymbol;
|
|
451
|
+
interface KrustyUndefined<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodUndefinedInternals, K> {
|
|
452
|
+
}
|
|
453
|
+
declare const KrustyUndefined: core.$constructor<KrustyUndefined>;
|
|
454
|
+
declare function _undefined(params?: string | core.$ZodUndefinedParams): KrustyUndefined;
|
|
36
455
|
|
|
37
|
-
|
|
38
|
-
init(options: StandardHandlerOptions<TContext>): void;
|
|
456
|
+
interface KrustyNull<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNullInternals, K> {
|
|
39
457
|
}
|
|
458
|
+
declare const KrustyNull: core.$constructor<KrustyNull>;
|
|
459
|
+
declare function _null(params?: string | core.$ZodNullParams): KrustyNull;
|
|
40
460
|
|
|
41
|
-
interface
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
* @default 3
|
|
48
|
-
*/
|
|
49
|
-
maxLazyDepth?: number;
|
|
50
|
-
/**
|
|
51
|
-
* Max depth of nested types
|
|
52
|
-
*
|
|
53
|
-
* Used anyJsonSchema (`{}`) when exceed max depth
|
|
54
|
-
*
|
|
55
|
-
* @default 10
|
|
56
|
-
*/
|
|
57
|
-
maxStructureDepth?: number;
|
|
58
|
-
/**
|
|
59
|
-
* The schema to be used to represent the any | unknown type.
|
|
60
|
-
*
|
|
61
|
-
* @default { }
|
|
62
|
-
*/
|
|
63
|
-
anyJsonSchema?: Exclude<JSONSchema, boolean>;
|
|
64
|
-
/**
|
|
65
|
-
* The schema to be used when the Zod schema is unsupported.
|
|
66
|
-
*
|
|
67
|
-
* @default { not: {} }
|
|
68
|
-
*/
|
|
69
|
-
unsupportedJsonSchema?: Exclude<JSONSchema, boolean>;
|
|
70
|
-
}
|
|
71
|
-
declare class ZodToJsonSchemaConverter implements ConditionalSchemaConverter {
|
|
72
|
-
#private;
|
|
73
|
-
private readonly maxLazyDepth;
|
|
74
|
-
private readonly maxStructureDepth;
|
|
75
|
-
private readonly unsupportedJsonSchema;
|
|
76
|
-
private readonly anyJsonSchema;
|
|
77
|
-
constructor(options?: ZodToJsonSchemaOptions);
|
|
78
|
-
condition(schema: AnySchema | undefined): boolean;
|
|
79
|
-
convert(schema: AnySchema | undefined, options: SchemaConvertOptions, lazyDepth?: number, isHandledCustomJSONSchema?: boolean, isHandledZodDescription?: boolean, structureDepth?: number): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>];
|
|
461
|
+
interface KrustyAny<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodAnyInternals, K> {
|
|
462
|
+
}
|
|
463
|
+
declare const KrustyAny: core.$constructor<KrustyAny>;
|
|
464
|
+
declare function any(): KrustyAny;
|
|
465
|
+
interface KrustyUnknown<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodUnknownInternals, K> {
|
|
80
466
|
}
|
|
467
|
+
declare const KrustyUnknown: core.$constructor<KrustyUnknown>;
|
|
468
|
+
declare function unknown(): KrustyUnknown;
|
|
469
|
+
interface KrustyNever<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNeverInternals, K> {
|
|
470
|
+
}
|
|
471
|
+
declare const KrustyNever: core.$constructor<KrustyNever>;
|
|
472
|
+
declare function never(params?: string | core.$ZodNeverParams): KrustyNever;
|
|
473
|
+
interface KrustyVoid<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodVoidInternals, K> {
|
|
474
|
+
}
|
|
475
|
+
declare const KrustyVoid: core.$constructor<KrustyVoid>;
|
|
476
|
+
declare function _void(params?: string | core.$ZodVoidParams): KrustyVoid;
|
|
81
477
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
478
|
+
interface _KrustyDate<T extends core.$ZodDateInternals = core.$ZodDateInternals, K extends KrustyInternals = KrustyInternals> extends _KrustyType<T, K> {
|
|
479
|
+
min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
480
|
+
max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
|
|
481
|
+
/** @deprecated Not recommended. */
|
|
482
|
+
minDate: Date | null;
|
|
483
|
+
/** @deprecated Not recommended. */
|
|
484
|
+
maxDate: Date | null;
|
|
485
|
+
}
|
|
486
|
+
interface KrustyDate<K extends KrustyInternals = KrustyInternals> extends _KrustyDate<core.$ZodDateInternals<Date>, K> {
|
|
487
|
+
}
|
|
488
|
+
declare const KrustyDate: core.$constructor<KrustyDate>;
|
|
489
|
+
declare function date(params?: string | core.$ZodDateParams): KrustyDate;
|
|
490
|
+
interface KrustyArray<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodArrayInternals<T>, K>, core.$ZodArray<T> {
|
|
491
|
+
element: T;
|
|
492
|
+
min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
|
|
493
|
+
nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
|
|
494
|
+
max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
|
|
495
|
+
length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
|
|
496
|
+
unwrap(): T;
|
|
497
|
+
}
|
|
498
|
+
declare const KrustyArray: core.$constructor<KrustyArray>;
|
|
499
|
+
declare function array<T extends core.SomeType, K extends KrustyInternals>(element: T, params?: string | core.$ZodArrayParams): KrustyArray<T, K>;
|
|
500
|
+
declare function keyof<T extends KrustyObject, K extends KrustyInternals>(schema: T): KrustyEnum<util.KeysEnum<T['_zod']['output']>, K>;
|
|
501
|
+
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> {
|
|
502
|
+
}
|
|
503
|
+
declare const KrustyIntersection: core.$constructor<KrustyIntersection>;
|
|
504
|
+
declare function intersection<T extends core.SomeType, U extends core.SomeType, K extends KrustyInternals>(left: T, right: U): KrustyIntersection<T, U, K>;
|
|
505
|
+
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> {
|
|
506
|
+
rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): KrustyTuple<T, Rest, K>;
|
|
507
|
+
}
|
|
508
|
+
declare const KrustyTuple: core.$constructor<KrustyTuple>;
|
|
509
|
+
declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], K extends KrustyInternals>(items: T, params?: string | core.$ZodTupleParams): KrustyTuple<T, null, K>;
|
|
510
|
+
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>;
|
|
511
|
+
declare function tuple(items: [], params?: string | core.$ZodTupleParams): KrustyTuple<[], null, KrustyInternals>;
|
|
512
|
+
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> {
|
|
513
|
+
keyType: Key;
|
|
514
|
+
valueType: Value;
|
|
515
|
+
}
|
|
516
|
+
declare const KrustyRecord: core.$constructor<KrustyRecord>;
|
|
517
|
+
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>;
|
|
518
|
+
declare function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): KrustyRecord<Key & core.$partial, Value>;
|
|
519
|
+
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> {
|
|
520
|
+
keyType: Key;
|
|
521
|
+
valueType: Value;
|
|
522
|
+
}
|
|
523
|
+
declare const KrustyMap: core.$constructor<KrustyMap>;
|
|
524
|
+
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>;
|
|
525
|
+
interface KrustySet<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodSetInternals<T>, K>, core.$ZodSet<T> {
|
|
526
|
+
min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
|
|
527
|
+
nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
|
|
528
|
+
max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
|
|
529
|
+
size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
|
|
530
|
+
}
|
|
531
|
+
declare const KrustySet: core.$constructor<KrustySet>;
|
|
532
|
+
declare function set<Value extends core.SomeType, K extends KrustyInternals>(valueType: Value, params?: string | core.$ZodSetParams): KrustySet<Value, K>;
|
|
533
|
+
interface KrustyEnum<
|
|
534
|
+
/** @ts-expect-error Cast variance */
|
|
535
|
+
out T extends util.EnumLike = util.EnumLike, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodEnumInternals<T>, K>, core.$ZodEnum<T> {
|
|
536
|
+
enum: T;
|
|
537
|
+
options: Array<T[keyof T]>;
|
|
538
|
+
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): KrustyEnum<util.Flatten<Pick<T, U[number]>>, K>;
|
|
539
|
+
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): KrustyEnum<util.Flatten<Omit<T, U[number]>>, K>;
|
|
540
|
+
}
|
|
541
|
+
declare const KrustyEnum: core.$constructor<KrustyEnum>;
|
|
542
|
+
declare function _enum<const T extends readonly string[], K extends KrustyInternals>(values: T, params?: string | core.$ZodEnumParams): KrustyEnum<util.ToEnum<T[number]>, K>;
|
|
543
|
+
declare function _enum<const T extends util.EnumLike, K extends KrustyInternals>(entries: T, params?: string | core.$ZodEnumParams): KrustyEnum<T, K>;
|
|
544
|
+
|
|
545
|
+
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
|
546
|
+
*
|
|
547
|
+
* ```ts
|
|
548
|
+
* enum Colors { red, green, blue }
|
|
549
|
+
* z.enum(Colors);
|
|
550
|
+
* ```
|
|
551
|
+
*/
|
|
552
|
+
declare function nativeEnum<T extends util.EnumLike, K extends KrustyInternals>(entries: T, params?: string | core.$ZodEnumParams): KrustyEnum<T, K>;
|
|
553
|
+
interface KrustyLiteral<T extends util.Literal = util.Literal, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodLiteralInternals<T>, K>, core.$ZodLiteral<T> {
|
|
554
|
+
values: Set<T>;
|
|
555
|
+
/** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
|
|
556
|
+
value: T;
|
|
557
|
+
}
|
|
558
|
+
declare const KrustyLiteral: core.$constructor<KrustyLiteral>;
|
|
559
|
+
declare function literal<const T extends ReadonlyArray<util.Literal>, K extends KrustyInternals>(value: T, params?: string | core.$ZodLiteralParams): KrustyLiteral<T[number], K>;
|
|
560
|
+
declare function literal<const T extends util.Literal, K extends KrustyInternals>(value: T, params?: string | core.$ZodLiteralParams): KrustyLiteral<T, K>;
|
|
561
|
+
interface KrustyFile<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodFileInternals, K>, core.$ZodFile {
|
|
562
|
+
min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
|
|
563
|
+
max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
|
|
564
|
+
mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
|
|
565
|
+
}
|
|
566
|
+
declare const KrustyFile: core.$constructor<KrustyFile>;
|
|
567
|
+
declare function file(params?: string | core.$ZodFileParams): KrustyFile;
|
|
568
|
+
interface KrustyTransform<O = unknown, I = unknown, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodTransformInternals<O, I>, K>, core.$ZodTransform<O, I> {
|
|
569
|
+
}
|
|
570
|
+
declare const KrustyTransform: core.$constructor<KrustyTransform>;
|
|
571
|
+
declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): KrustyTransform<Awaited<O>, I>;
|
|
572
|
+
interface KrustyOptional<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodOptionalInternals<T>, K>, core.$ZodOptional<T> {
|
|
573
|
+
unwrap(): T;
|
|
574
|
+
}
|
|
575
|
+
declare const KrustyOptional: core.$constructor<KrustyOptional>;
|
|
576
|
+
declare function optional<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyOptional<T, K>;
|
|
577
|
+
interface KrustyNullable<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNullableInternals<T>, K>, core.$ZodNullable<T> {
|
|
578
|
+
unwrap(): T;
|
|
579
|
+
}
|
|
580
|
+
declare const KrustyNullable: core.$constructor<KrustyNullable>;
|
|
581
|
+
declare function nullable<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyNullable<T, K>;
|
|
582
|
+
declare function nullish<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyOptional<KrustyNullable<T, K>, K>;
|
|
583
|
+
interface KrustyDefault<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodDefaultInternals<T>, K>, core.$ZodDefault<T> {
|
|
584
|
+
unwrap(): T;
|
|
585
|
+
/** @deprecated Use `.unwrap()` instead. */
|
|
586
|
+
removeDefault(): T;
|
|
587
|
+
}
|
|
588
|
+
declare const KrustyDefault: core.$constructor<KrustyDefault>;
|
|
589
|
+
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>;
|
|
590
|
+
interface KrustyPrefault<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodPrefaultInternals<T>, K>, core.$ZodPrefault<T> {
|
|
591
|
+
unwrap(): T;
|
|
592
|
+
}
|
|
593
|
+
declare const KrustyPrefault: core.$constructor<KrustyPrefault>;
|
|
594
|
+
declare function prefault<T extends core.SomeType, K extends KrustyInternals>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)): KrustyPrefault<T, K>;
|
|
595
|
+
interface KrustyNonOptional<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNonOptionalInternals<T>, K>, core.$ZodNonOptional<T> {
|
|
596
|
+
unwrap(): T;
|
|
597
|
+
}
|
|
598
|
+
declare const KrustyNonOptional: core.$constructor<KrustyNonOptional>;
|
|
599
|
+
declare function nonoptional<T extends core.SomeType, K extends KrustyInternals>(innerType: T, params?: string | core.$ZodNonOptionalParams): KrustyNonOptional<T, K>;
|
|
600
|
+
interface KrustySuccess<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodSuccessInternals<T>, K>, core.$ZodSuccess<T> {
|
|
601
|
+
unwrap(): T;
|
|
602
|
+
}
|
|
603
|
+
declare const KrustySuccess: core.$constructor<KrustySuccess>;
|
|
604
|
+
declare function success<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustySuccess<T, K>;
|
|
605
|
+
interface KrustyCatch<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodCatchInternals<T>, K>, core.$ZodCatch<T> {
|
|
606
|
+
unwrap(): T;
|
|
607
|
+
/** @deprecated Use `.unwrap()` instead. */
|
|
608
|
+
removeCatch(): T;
|
|
609
|
+
}
|
|
610
|
+
declare const KrustyCatch: core.$constructor<KrustyCatch>;
|
|
611
|
+
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>;
|
|
612
|
+
|
|
613
|
+
interface KrustyNaN<K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodNaNInternals, K>, core.$ZodNaN {
|
|
614
|
+
}
|
|
615
|
+
declare const KrustyNaN: core.$constructor<KrustyNaN>;
|
|
616
|
+
declare function nan(params?: string | core.$ZodNaNParams): KrustyNaN;
|
|
617
|
+
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> {
|
|
618
|
+
in: A;
|
|
619
|
+
out: B;
|
|
620
|
+
}
|
|
621
|
+
declare const KrustyPipe: core.$constructor<KrustyPipe>;
|
|
622
|
+
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>;
|
|
623
|
+
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> {
|
|
624
|
+
_zod: core.$ZodCodecInternals<A, B>;
|
|
625
|
+
def: core.$ZodCodecDef<A, B>;
|
|
626
|
+
}
|
|
627
|
+
declare const KrustyCodec: core.$constructor<KrustyCodec>;
|
|
628
|
+
declare function codec<const A extends core.SomeType, B extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals>(in_: A, out: B, params: {
|
|
629
|
+
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
|
|
630
|
+
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
|
|
631
|
+
}): KrustyCodec<A, B, K>;
|
|
632
|
+
interface KrustyReadonly<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodReadonlyInternals<T>, K>, core.$ZodReadonly<T> {
|
|
633
|
+
unwrap(): T;
|
|
634
|
+
}
|
|
635
|
+
declare const KrustyReadonly: core.$constructor<KrustyReadonly>;
|
|
636
|
+
declare function readonly<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyReadonly<T, K>;
|
|
637
|
+
interface KrustyTemplateLiteral<Template extends string = string, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodTemplateLiteralInternals<Template>, K>, core.$ZodTemplateLiteral<Template> {
|
|
638
|
+
}
|
|
639
|
+
declare const KrustyTemplateLiteral: core.$constructor<KrustyTemplateLiteral>;
|
|
640
|
+
declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[], K extends KrustyInternals>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): KrustyTemplateLiteral<core.$PartsToTemplateLiteral<Parts>, K>;
|
|
641
|
+
interface KrustyLazy<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodLazyInternals<T>, K>, core.$ZodLazy<T> {
|
|
642
|
+
unwrap(): T;
|
|
643
|
+
}
|
|
644
|
+
declare const KrustyLazy: core.$constructor<KrustyLazy>;
|
|
645
|
+
declare function lazy<T extends core.SomeType, K extends KrustyInternals>(getter: () => T): KrustyLazy<T, K>;
|
|
646
|
+
interface KrustyPromise<T extends core.SomeType = core.$ZodType, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodPromiseInternals<T>, K>, core.$ZodPromise<T> {
|
|
647
|
+
unwrap(): T;
|
|
648
|
+
}
|
|
649
|
+
declare const KrustyPromise: core.$constructor<KrustyPromise>;
|
|
650
|
+
declare function promise<T extends core.SomeType, K extends KrustyInternals>(innerType: T): KrustyPromise<T, K>;
|
|
651
|
+
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> {
|
|
652
|
+
_def: core.$ZodFunctionDef<Args, Returns>;
|
|
653
|
+
_input: core.$InferInnerFunctionType<Args, Returns>;
|
|
654
|
+
_output: core.$InferOuterFunctionType<Args, Returns>;
|
|
655
|
+
input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(args: Items, rest?: Rest): KrustyFunction<core.$ZodTuple<Items, Rest>, Returns, K>;
|
|
656
|
+
input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): KrustyFunction<NewArgs, Returns, K>;
|
|
657
|
+
input(...args: any[]): KrustyFunction<any, Returns, K>;
|
|
658
|
+
output<NewReturns extends core.$ZodType>(output: NewReturns): KrustyFunction<Args, NewReturns, K>;
|
|
659
|
+
}
|
|
660
|
+
declare const KrustyFunction: core.$constructor<KrustyFunction>;
|
|
661
|
+
declare function _function(): KrustyFunction;
|
|
662
|
+
declare function _function<const In extends ReadonlyArray<core.$ZodType>, K extends KrustyInternals>(params: {
|
|
663
|
+
input: In;
|
|
664
|
+
}): KrustyFunction<KrustyTuple<In, null, K>, core.$ZodFunctionOut, K>;
|
|
665
|
+
declare function _function<const In extends ReadonlyArray<core.$ZodType>, const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut, K extends KrustyInternals = KrustyInternals>(params: {
|
|
666
|
+
input: In;
|
|
667
|
+
output: Out;
|
|
668
|
+
}): KrustyFunction<KrustyTuple<In, null, K>, Out, K>;
|
|
669
|
+
declare function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn, K extends KrustyInternals = KrustyInternals>(params: {
|
|
670
|
+
input: In;
|
|
671
|
+
}): KrustyFunction<In, core.$ZodFunctionOut, K>;
|
|
672
|
+
declare function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut, K extends KrustyInternals = KrustyInternals>(params: {
|
|
673
|
+
output: Out;
|
|
674
|
+
}): KrustyFunction<core.$ZodFunctionIn, Out, K>;
|
|
675
|
+
declare function _function<In extends core.$ZodFunctionIn = core.$ZodFunctionIn, Out extends core.$ZodType = core.$ZodType, K extends KrustyInternals = KrustyInternals>(params?: {
|
|
676
|
+
input: In;
|
|
677
|
+
output: Out;
|
|
678
|
+
}): KrustyFunction<In, Out, K>;
|
|
679
|
+
|
|
680
|
+
interface KrustyCustom<O = unknown, I = unknown, K extends KrustyInternals = KrustyInternals> extends _KrustyType<core.$ZodCustomInternals<O, I>, K>, core.$ZodCustom<O, I> {
|
|
681
|
+
}
|
|
682
|
+
declare const KrustyCustom: core.$constructor<KrustyCustom>;
|
|
683
|
+
declare function check<O = unknown>(fn: core.CheckFn<O>): core.$ZodCheck<O>;
|
|
684
|
+
declare function custom<O, K extends KrustyInternals>(fn?: (data: unknown) => unknown, _params?: string | core.$ZodCustomParams | undefined): KrustyCustom<O, O, K>;
|
|
685
|
+
declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
|
686
|
+
declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
|
|
687
|
+
type KrustyInstanceOfParams = core.Params<KrustyCustom, core.$ZodIssueCustom, 'type' | 'check' | 'checks' | 'fn' | 'abort' | 'error' | 'params' | 'path'>;
|
|
688
|
+
declare function _instanceof<T extends typeof util.Class, K extends KrustyInternals>(cls: T, params?: KrustyInstanceOfParams): KrustyCustom<InstanceType<T>, InstanceType<T>, K>;
|
|
689
|
+
|
|
690
|
+
declare const stringbool: <K extends KrustyInternals = KrustyInternals>(_params?: string | core.$ZodStringBoolParams) => KrustyCodec<KrustyString, KrustyBoolean, K>;
|
|
691
|
+
type _KrustyJSONSchema<K extends KrustyInternals = KrustyInternals> = KrustyUnion<[
|
|
692
|
+
KrustyString,
|
|
693
|
+
KrustyNumber,
|
|
694
|
+
KrustyBoolean,
|
|
695
|
+
KrustyNull,
|
|
696
|
+
KrustyArray<KrustyJSONSchema, K>,
|
|
697
|
+
KrustyRecord<KrustyString, KrustyJSONSchema, K>
|
|
698
|
+
], K>;
|
|
699
|
+
type _KrustyJSONSchemaInternals = _KrustyJSONSchema['_zod'];
|
|
700
|
+
interface KrustyJSONSchemaInternals extends _KrustyJSONSchemaInternals {
|
|
701
|
+
output: util.JSONType;
|
|
702
|
+
input: util.JSONType;
|
|
703
|
+
}
|
|
704
|
+
interface KrustyJSONSchema<K extends KrustyInternals = KrustyInternals> extends _KrustyJSONSchema<K> {
|
|
705
|
+
_zod: KrustyJSONSchemaInternals;
|
|
706
|
+
}
|
|
707
|
+
declare function json<K extends KrustyInternals = KrustyInternals>(params?: string | core.$ZodCustomParams): KrustyJSONSchema<K>;
|
|
708
|
+
|
|
709
|
+
declare class SchemaClass<GateNames extends string = never, K extends KrustyInternals = KrustyInternals<GateNames>> {
|
|
710
|
+
string(params?: string | core.$ZodStringParams): KrustyString<K>;
|
|
711
|
+
number(params?: string | core.$ZodNumberParams): KrustyNumber<K>;
|
|
712
|
+
int(params?: string | core.$ZodCheckNumberFormatParams): KrustyNumber<K>;
|
|
713
|
+
boolean(params?: string | core.$ZodBooleanParams): KrustyBoolean<K>;
|
|
714
|
+
null(params?: string | core.$ZodNullParams): KrustyNull<K>;
|
|
715
|
+
array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): KrustyArray<T, K>;
|
|
716
|
+
record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): KrustyRecord<Key, Value, K>;
|
|
717
|
+
union<const T extends readonly core.SomeType[]>(options: T, params?: string | core.$ZodUnionParams): KrustyUnion<T, K>;
|
|
718
|
+
discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): KrustyDiscriminatedUnion<Types, Disc, K>;
|
|
719
|
+
object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(shape?: T, params?: string | core.$ZodObjectParams): KrustyObject<core.util.Writeable<T>, core.$strip, K>;
|
|
720
|
+
date(params?: string | core.$ZodDateParams): KrustyDate<K>;
|
|
721
|
+
any(): KrustyAny<K>;
|
|
722
|
+
unknown(): KrustyUnknown<K>;
|
|
723
|
+
never(params?: string | core.$ZodNeverParams): KrustyNever<K>;
|
|
724
|
+
lazy<T extends core.SomeType>(getter: () => T): KrustyLazy<T, K>;
|
|
725
|
+
json(params?: string | core.$ZodCustomParams): KrustyJSONSchema<K>;
|
|
726
|
+
}
|
|
89
727
|
|
|
90
|
-
export {
|
|
91
|
-
export type {
|
|
728
|
+
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, 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 };
|
|
729
|
+
export type { $ZodGateDef, $ZodGateInternals, IsGateEnabled, IssueData, KrustyFloat32, KrustyFloat64, KrustyInt, KrustyInt32, KrustyInternals, KrustyJSONSchema, KrustyJSONSchemaInternals, KrustyUInt32, SafeExtendShape, ZodIssue, ZodSafeParseError, ZodSafeParseResult, ZodSafeParseSuccess, _KrustyBigInt, _KrustyBoolean, _KrustyDate, _KrustyNumber, _KrustyType };
|