@vertz/schema 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +782 -0
- package/dist/index.js +2438 -0
- package/package.json +30 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,782 @@
|
|
|
1
|
+
declare enum ErrorCode {
|
|
2
|
+
InvalidType = "invalid_type",
|
|
3
|
+
TooSmall = "too_small",
|
|
4
|
+
TooBig = "too_big",
|
|
5
|
+
InvalidString = "invalid_string",
|
|
6
|
+
InvalidEnumValue = "invalid_enum_value",
|
|
7
|
+
InvalidLiteral = "invalid_literal",
|
|
8
|
+
InvalidUnion = "invalid_union",
|
|
9
|
+
InvalidDate = "invalid_date",
|
|
10
|
+
MissingProperty = "missing_property",
|
|
11
|
+
UnrecognizedKeys = "unrecognized_keys",
|
|
12
|
+
Custom = "custom",
|
|
13
|
+
InvalidIntersection = "invalid_intersection",
|
|
14
|
+
NotMultipleOf = "not_multiple_of",
|
|
15
|
+
NotFinite = "not_finite"
|
|
16
|
+
}
|
|
17
|
+
interface ValidationIssue {
|
|
18
|
+
code: ErrorCode;
|
|
19
|
+
message: string;
|
|
20
|
+
path: (string | number)[];
|
|
21
|
+
expected?: string;
|
|
22
|
+
received?: string;
|
|
23
|
+
}
|
|
24
|
+
declare class ParseError extends Error {
|
|
25
|
+
readonly issues: ValidationIssue[];
|
|
26
|
+
constructor(issues: ValidationIssue[]);
|
|
27
|
+
static formatMessage(issues: ValidationIssue[]): string;
|
|
28
|
+
}
|
|
29
|
+
declare class ParseContext {
|
|
30
|
+
readonly issues: ValidationIssue[];
|
|
31
|
+
private _path;
|
|
32
|
+
addIssue(issue: Omit<ValidationIssue, "path"> & {
|
|
33
|
+
path?: (string | number)[];
|
|
34
|
+
}): void;
|
|
35
|
+
hasIssues(): boolean;
|
|
36
|
+
pushPath(segment: string | number): void;
|
|
37
|
+
popPath(): void;
|
|
38
|
+
get path(): (string | number)[];
|
|
39
|
+
}
|
|
40
|
+
/** Public-facing refinement context — subset of ParseContext exposed to .refine()/.superRefine()/.check() */
|
|
41
|
+
interface RefinementContext {
|
|
42
|
+
addIssue(issue: Omit<ValidationIssue, "path"> & {
|
|
43
|
+
path?: (string | number)[];
|
|
44
|
+
}): void;
|
|
45
|
+
readonly path: (string | number)[];
|
|
46
|
+
}
|
|
47
|
+
interface JSONSchemaObject {
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
declare class RefTracker {
|
|
51
|
+
private _seen;
|
|
52
|
+
private _defs;
|
|
53
|
+
hasSeen(id: string): boolean;
|
|
54
|
+
markSeen(id: string): void;
|
|
55
|
+
addDef(id: string, schema: JSONSchemaObject): void;
|
|
56
|
+
getDefs(): Record<string, JSONSchemaObject>;
|
|
57
|
+
}
|
|
58
|
+
declare function toJSONSchema2(schema: SchemaAny): JSONSchemaObject;
|
|
59
|
+
declare enum SchemaType {
|
|
60
|
+
String = "string",
|
|
61
|
+
Number = "number",
|
|
62
|
+
BigInt = "bigint",
|
|
63
|
+
Boolean = "boolean",
|
|
64
|
+
Date = "date",
|
|
65
|
+
Symbol = "symbol",
|
|
66
|
+
Undefined = "undefined",
|
|
67
|
+
Null = "null",
|
|
68
|
+
Void = "void",
|
|
69
|
+
Any = "any",
|
|
70
|
+
Unknown = "unknown",
|
|
71
|
+
Never = "never",
|
|
72
|
+
NaN = "nan",
|
|
73
|
+
Object = "object",
|
|
74
|
+
Array = "array",
|
|
75
|
+
Tuple = "tuple",
|
|
76
|
+
Enum = "enum",
|
|
77
|
+
Union = "union",
|
|
78
|
+
DiscriminatedUnion = "discriminatedUnion",
|
|
79
|
+
Intersection = "intersection",
|
|
80
|
+
Record = "record",
|
|
81
|
+
Map = "map",
|
|
82
|
+
Set = "set",
|
|
83
|
+
Literal = "literal",
|
|
84
|
+
Lazy = "lazy",
|
|
85
|
+
Custom = "custom",
|
|
86
|
+
InstanceOf = "instanceof",
|
|
87
|
+
File = "file"
|
|
88
|
+
}
|
|
89
|
+
interface SchemaMetadata {
|
|
90
|
+
type: SchemaType;
|
|
91
|
+
id: string | undefined;
|
|
92
|
+
description: string | undefined;
|
|
93
|
+
meta: Record<string, unknown> | undefined;
|
|
94
|
+
examples: unknown[];
|
|
95
|
+
}
|
|
96
|
+
type SafeParseResult<T> = {
|
|
97
|
+
success: true;
|
|
98
|
+
data: T;
|
|
99
|
+
} | {
|
|
100
|
+
success: false;
|
|
101
|
+
error: ParseError;
|
|
102
|
+
};
|
|
103
|
+
type SchemaAny = Schema<any, any>;
|
|
104
|
+
/** Apply Readonly only to object types; leave primitives and `any` unchanged. */
|
|
105
|
+
type ReadonlyOutput<O> = 0 extends 1 & O ? O : O extends object ? Readonly<O> : O;
|
|
106
|
+
type InnerSchema<I = unknown> = Schema<any, I>;
|
|
107
|
+
type InnerTransformFn<O> = (value: any) => O;
|
|
108
|
+
declare abstract class Schema<
|
|
109
|
+
O,
|
|
110
|
+
I = O
|
|
111
|
+
> {
|
|
112
|
+
/** @internal */ readonly _output: O;
|
|
113
|
+
/** @internal */ readonly _input: I;
|
|
114
|
+
/** @internal */ _id: string | undefined;
|
|
115
|
+
/** @internal */ _description: string | undefined;
|
|
116
|
+
/** @internal */ _meta: Record<string, unknown> | undefined;
|
|
117
|
+
/** @internal */ _examples: unknown[];
|
|
118
|
+
constructor();
|
|
119
|
+
abstract _schemaType(): SchemaType;
|
|
120
|
+
abstract _toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
121
|
+
abstract _clone(): Schema<O, I>;
|
|
122
|
+
parse(value: unknown): O;
|
|
123
|
+
safeParse(value: unknown): SafeParseResult<O>;
|
|
124
|
+
id(name: string): this;
|
|
125
|
+
describe(description: string): this;
|
|
126
|
+
meta(data: Record<string, unknown>): this;
|
|
127
|
+
example(value: I): this;
|
|
128
|
+
get metadata(): SchemaMetadata;
|
|
129
|
+
toJSONSchema(): JSONSchemaObject;
|
|
130
|
+
_toJSONSchemaWithRefs(tracker: RefTracker): JSONSchemaObject;
|
|
131
|
+
private _applyMetadata;
|
|
132
|
+
protected _cloneBase<T extends {
|
|
133
|
+
_id: string | undefined;
|
|
134
|
+
_description: string | undefined;
|
|
135
|
+
_meta: Record<string, unknown> | undefined;
|
|
136
|
+
_examples: unknown[];
|
|
137
|
+
}>(target: T): T;
|
|
138
|
+
optional(): OptionalSchema<O, I>;
|
|
139
|
+
nullable(): NullableSchema<O, I>;
|
|
140
|
+
default(defaultValue: I | (() => I)): DefaultSchema<O, I>;
|
|
141
|
+
refine(predicate: (value: O) => boolean, params?: string | {
|
|
142
|
+
message?: string;
|
|
143
|
+
path?: (string | number)[];
|
|
144
|
+
}): RefinedSchema<O, I>;
|
|
145
|
+
superRefine(refinement: (value: O, ctx: RefinementContext) => void): SuperRefinedSchema<O, I>;
|
|
146
|
+
check(refinement: (value: O, ctx: RefinementContext) => void): SuperRefinedSchema<O, I>;
|
|
147
|
+
transform<NewO>(fn: (value: O) => NewO): TransformSchema<NewO, I>;
|
|
148
|
+
pipe<NewO>(schema: Schema<NewO>): PipeSchema<NewO, I>;
|
|
149
|
+
catch(fallback: O | (() => O)): CatchSchema<O, I>;
|
|
150
|
+
brand<B extends string | symbol>(): BrandedSchema<O & {
|
|
151
|
+
readonly __brand: B;
|
|
152
|
+
}, I>;
|
|
153
|
+
readonly(): ReadonlySchema<ReadonlyOutput<O>, I>;
|
|
154
|
+
_runPipeline(value: unknown, ctx: ParseContext): O;
|
|
155
|
+
}
|
|
156
|
+
declare class OptionalSchema<
|
|
157
|
+
O,
|
|
158
|
+
I
|
|
159
|
+
> extends Schema<O | undefined, I | undefined> {
|
|
160
|
+
private readonly _inner;
|
|
161
|
+
constructor(_inner: Schema<O, I>);
|
|
162
|
+
_schemaType(): SchemaType;
|
|
163
|
+
_parse(value: unknown, ctx: ParseContext): O | undefined;
|
|
164
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
165
|
+
_clone(): OptionalSchema<O, I>;
|
|
166
|
+
unwrap(): Schema<O, I>;
|
|
167
|
+
}
|
|
168
|
+
declare class NullableSchema<
|
|
169
|
+
O,
|
|
170
|
+
I
|
|
171
|
+
> extends Schema<O | null, I | null> {
|
|
172
|
+
private readonly _inner;
|
|
173
|
+
constructor(_inner: Schema<O, I>);
|
|
174
|
+
_schemaType(): SchemaType;
|
|
175
|
+
_parse(value: unknown, ctx: ParseContext): O | null;
|
|
176
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
177
|
+
_clone(): NullableSchema<O, I>;
|
|
178
|
+
unwrap(): Schema<O, I>;
|
|
179
|
+
}
|
|
180
|
+
declare class DefaultSchema<
|
|
181
|
+
O,
|
|
182
|
+
I
|
|
183
|
+
> extends Schema<O, I | undefined> {
|
|
184
|
+
private readonly _inner;
|
|
185
|
+
private readonly _default;
|
|
186
|
+
constructor(_inner: Schema<O, I>, _default: I | (() => I));
|
|
187
|
+
_schemaType(): SchemaType;
|
|
188
|
+
_parse(value: unknown, ctx: ParseContext): O;
|
|
189
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
190
|
+
private _resolveDefault;
|
|
191
|
+
_clone(): DefaultSchema<O, I>;
|
|
192
|
+
unwrap(): Schema<O, I>;
|
|
193
|
+
}
|
|
194
|
+
declare class RefinedSchema<
|
|
195
|
+
O,
|
|
196
|
+
I = O
|
|
197
|
+
> extends Schema<O, I> {
|
|
198
|
+
private readonly _inner;
|
|
199
|
+
private readonly _predicate;
|
|
200
|
+
private readonly _message;
|
|
201
|
+
private readonly _path;
|
|
202
|
+
constructor(inner: Schema<O, I>, predicate: (value: O) => boolean, params?: string | {
|
|
203
|
+
message?: string;
|
|
204
|
+
path?: (string | number)[];
|
|
205
|
+
});
|
|
206
|
+
_parse(value: unknown, ctx: ParseContext): O;
|
|
207
|
+
_schemaType(): SchemaType;
|
|
208
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
209
|
+
_clone(): RefinedSchema<O, I>;
|
|
210
|
+
}
|
|
211
|
+
declare class SuperRefinedSchema<
|
|
212
|
+
O,
|
|
213
|
+
I = O
|
|
214
|
+
> extends Schema<O, I> {
|
|
215
|
+
private readonly _inner;
|
|
216
|
+
private readonly _refinement;
|
|
217
|
+
constructor(inner: Schema<O, I>, refinement: (value: O, ctx: RefinementContext) => void);
|
|
218
|
+
_parse(value: unknown, ctx: ParseContext): O;
|
|
219
|
+
_schemaType(): SchemaType;
|
|
220
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
221
|
+
_clone(): SuperRefinedSchema<O, I>;
|
|
222
|
+
}
|
|
223
|
+
declare class TransformSchema<
|
|
224
|
+
O,
|
|
225
|
+
I = unknown
|
|
226
|
+
> extends Schema<O, I> {
|
|
227
|
+
private readonly _inner;
|
|
228
|
+
private readonly _transform;
|
|
229
|
+
constructor(inner: InnerSchema<I>, transform: InnerTransformFn<O>);
|
|
230
|
+
_parse(value: unknown, ctx: ParseContext): O;
|
|
231
|
+
_schemaType(): SchemaType;
|
|
232
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
233
|
+
_clone(): TransformSchema<O, I>;
|
|
234
|
+
}
|
|
235
|
+
declare class PipeSchema<
|
|
236
|
+
O,
|
|
237
|
+
I = unknown
|
|
238
|
+
> extends Schema<O, I> {
|
|
239
|
+
private readonly _first;
|
|
240
|
+
private readonly _second;
|
|
241
|
+
constructor(first: InnerSchema<I>, second: Schema<O>);
|
|
242
|
+
_parse(value: unknown, ctx: ParseContext): O;
|
|
243
|
+
_schemaType(): SchemaType;
|
|
244
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
245
|
+
_clone(): PipeSchema<O, I>;
|
|
246
|
+
}
|
|
247
|
+
declare class CatchSchema<
|
|
248
|
+
O,
|
|
249
|
+
I = O
|
|
250
|
+
> extends Schema<O, I> {
|
|
251
|
+
private readonly _inner;
|
|
252
|
+
private readonly _fallback;
|
|
253
|
+
constructor(inner: Schema<O, I>, fallback: O | (() => O));
|
|
254
|
+
_parse(value: unknown, _ctx: ParseContext): O;
|
|
255
|
+
_schemaType(): SchemaType;
|
|
256
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
257
|
+
private _resolveFallback;
|
|
258
|
+
_clone(): CatchSchema<O, I>;
|
|
259
|
+
}
|
|
260
|
+
declare class BrandedSchema<
|
|
261
|
+
O,
|
|
262
|
+
I = unknown
|
|
263
|
+
> extends Schema<O, I> {
|
|
264
|
+
private readonly _inner;
|
|
265
|
+
constructor(inner: InnerSchema<I>);
|
|
266
|
+
_parse(value: unknown, ctx: ParseContext): O;
|
|
267
|
+
_schemaType(): SchemaType;
|
|
268
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
269
|
+
_clone(): BrandedSchema<O, I>;
|
|
270
|
+
}
|
|
271
|
+
declare class ReadonlySchema<
|
|
272
|
+
O,
|
|
273
|
+
I = unknown
|
|
274
|
+
> extends Schema<O, I> {
|
|
275
|
+
private readonly _inner;
|
|
276
|
+
constructor(inner: InnerSchema<I>);
|
|
277
|
+
_parse(value: unknown, ctx: ParseContext): O;
|
|
278
|
+
_schemaType(): SchemaType;
|
|
279
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
280
|
+
_clone(): ReadonlySchema<O, I>;
|
|
281
|
+
}
|
|
282
|
+
declare class SchemaRegistry {
|
|
283
|
+
private static _schemas;
|
|
284
|
+
static register(name: string, schema: SchemaAny): void;
|
|
285
|
+
static get(name: string): SchemaAny | undefined;
|
|
286
|
+
static getOrThrow(name: string): SchemaAny;
|
|
287
|
+
static has(name: string): boolean;
|
|
288
|
+
/** Returns a read-only view of the internal map. Do not cast to Map to mutate. */
|
|
289
|
+
static getAll(): ReadonlyMap<string, SchemaAny>;
|
|
290
|
+
static clear(): void;
|
|
291
|
+
}
|
|
292
|
+
declare class ArraySchema<T> extends Schema<T[]> {
|
|
293
|
+
private readonly _element;
|
|
294
|
+
private _min;
|
|
295
|
+
private _max;
|
|
296
|
+
private _length;
|
|
297
|
+
constructor(element: Schema<T>);
|
|
298
|
+
_parse(value: unknown, ctx: ParseContext): T[];
|
|
299
|
+
min(n: number): ArraySchema<T>;
|
|
300
|
+
max(n: number): ArraySchema<T>;
|
|
301
|
+
length(n: number): ArraySchema<T>;
|
|
302
|
+
_schemaType(): SchemaType;
|
|
303
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
304
|
+
_clone(): ArraySchema<T>;
|
|
305
|
+
}
|
|
306
|
+
declare class BigIntSchema extends Schema<bigint> {
|
|
307
|
+
_parse(value: unknown, ctx: ParseContext): bigint;
|
|
308
|
+
_schemaType(): SchemaType;
|
|
309
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
310
|
+
_clone(): BigIntSchema;
|
|
311
|
+
}
|
|
312
|
+
declare class BooleanSchema extends Schema<boolean> {
|
|
313
|
+
_parse(value: unknown, ctx: ParseContext): boolean;
|
|
314
|
+
_schemaType(): SchemaType;
|
|
315
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
316
|
+
_clone(): BooleanSchema;
|
|
317
|
+
}
|
|
318
|
+
declare class DateSchema extends Schema<Date> {
|
|
319
|
+
private _min;
|
|
320
|
+
private _minMessage;
|
|
321
|
+
private _max;
|
|
322
|
+
private _maxMessage;
|
|
323
|
+
_parse(value: unknown, ctx: ParseContext): Date;
|
|
324
|
+
min(date: Date, message?: string): DateSchema;
|
|
325
|
+
max(date: Date, message?: string): DateSchema;
|
|
326
|
+
_schemaType(): SchemaType;
|
|
327
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
328
|
+
_clone(): DateSchema;
|
|
329
|
+
}
|
|
330
|
+
declare class NumberSchema extends Schema<number> {
|
|
331
|
+
private _gte;
|
|
332
|
+
private _gteMessage;
|
|
333
|
+
private _gt;
|
|
334
|
+
private _gtMessage;
|
|
335
|
+
private _lte;
|
|
336
|
+
private _lteMessage;
|
|
337
|
+
private _lt;
|
|
338
|
+
private _ltMessage;
|
|
339
|
+
private _int;
|
|
340
|
+
private _positive;
|
|
341
|
+
private _negative;
|
|
342
|
+
private _nonnegative;
|
|
343
|
+
private _nonpositive;
|
|
344
|
+
private _multipleOf;
|
|
345
|
+
private _finite;
|
|
346
|
+
_parse(value: unknown, ctx: ParseContext): number;
|
|
347
|
+
gte(n: number, message?: string): NumberSchema;
|
|
348
|
+
min(n: number, message?: string): NumberSchema;
|
|
349
|
+
gt(n: number, message?: string): NumberSchema;
|
|
350
|
+
lte(n: number, message?: string): NumberSchema;
|
|
351
|
+
max(n: number, message?: string): NumberSchema;
|
|
352
|
+
lt(n: number, message?: string): NumberSchema;
|
|
353
|
+
int(): NumberSchema;
|
|
354
|
+
positive(): NumberSchema;
|
|
355
|
+
negative(): NumberSchema;
|
|
356
|
+
nonnegative(): NumberSchema;
|
|
357
|
+
nonpositive(): NumberSchema;
|
|
358
|
+
multipleOf(n: number): NumberSchema;
|
|
359
|
+
step(n: number): NumberSchema;
|
|
360
|
+
finite(): NumberSchema;
|
|
361
|
+
_schemaType(): SchemaType;
|
|
362
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
363
|
+
_clone(): NumberSchema;
|
|
364
|
+
}
|
|
365
|
+
declare class StringSchema extends Schema<string> {
|
|
366
|
+
private _min;
|
|
367
|
+
private _minMessage;
|
|
368
|
+
private _max;
|
|
369
|
+
private _maxMessage;
|
|
370
|
+
private _length;
|
|
371
|
+
private _lengthMessage;
|
|
372
|
+
private _regex;
|
|
373
|
+
private _startsWith;
|
|
374
|
+
private _endsWith;
|
|
375
|
+
private _includes;
|
|
376
|
+
private _uppercase;
|
|
377
|
+
private _lowercase;
|
|
378
|
+
private _trim;
|
|
379
|
+
private _toLowerCase;
|
|
380
|
+
private _toUpperCase;
|
|
381
|
+
private _normalize;
|
|
382
|
+
_parse(value: unknown, ctx: ParseContext): string;
|
|
383
|
+
min(n: number, message?: string): StringSchema;
|
|
384
|
+
max(n: number, message?: string): StringSchema;
|
|
385
|
+
length(n: number, message?: string): StringSchema;
|
|
386
|
+
regex(pattern: RegExp): StringSchema;
|
|
387
|
+
startsWith(prefix: string): StringSchema;
|
|
388
|
+
endsWith(suffix: string): StringSchema;
|
|
389
|
+
includes(substring: string): StringSchema;
|
|
390
|
+
uppercase(): StringSchema;
|
|
391
|
+
lowercase(): StringSchema;
|
|
392
|
+
trim(): StringSchema;
|
|
393
|
+
toLowerCase(): StringSchema;
|
|
394
|
+
toUpperCase(): StringSchema;
|
|
395
|
+
normalize(): StringSchema;
|
|
396
|
+
_schemaType(): SchemaType;
|
|
397
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
398
|
+
_clone(): StringSchema;
|
|
399
|
+
}
|
|
400
|
+
declare class CoercedStringSchema extends StringSchema {
|
|
401
|
+
_parse(value: unknown, ctx: ParseContext): string;
|
|
402
|
+
_clone(): CoercedStringSchema;
|
|
403
|
+
}
|
|
404
|
+
declare class CoercedNumberSchema extends NumberSchema {
|
|
405
|
+
_parse(value: unknown, ctx: ParseContext): number;
|
|
406
|
+
_clone(): CoercedNumberSchema;
|
|
407
|
+
}
|
|
408
|
+
declare class CoercedBooleanSchema extends BooleanSchema {
|
|
409
|
+
_parse(value: unknown, ctx: ParseContext): boolean;
|
|
410
|
+
_clone(): CoercedBooleanSchema;
|
|
411
|
+
}
|
|
412
|
+
declare class CoercedBigIntSchema extends BigIntSchema {
|
|
413
|
+
_parse(value: unknown, ctx: ParseContext): bigint;
|
|
414
|
+
_clone(): CoercedBigIntSchema;
|
|
415
|
+
}
|
|
416
|
+
declare class CoercedDateSchema extends DateSchema {
|
|
417
|
+
_parse(value: unknown, ctx: ParseContext): Date;
|
|
418
|
+
_clone(): CoercedDateSchema;
|
|
419
|
+
}
|
|
420
|
+
declare class CustomSchema<T> extends Schema<T> {
|
|
421
|
+
private readonly _check;
|
|
422
|
+
private readonly _message;
|
|
423
|
+
constructor(check: (value: unknown) => boolean, message?: string);
|
|
424
|
+
_parse(value: unknown, ctx: ParseContext): T;
|
|
425
|
+
_schemaType(): SchemaType;
|
|
426
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
427
|
+
_clone(): CustomSchema<T>;
|
|
428
|
+
}
|
|
429
|
+
type Shape = Record<string, SchemaAny>;
|
|
430
|
+
type InferShape<S extends Shape> = { [K in keyof S] : S[K]["_output"] };
|
|
431
|
+
declare class ObjectSchema<S extends Shape = Shape> extends Schema<InferShape<S>> {
|
|
432
|
+
private readonly _shape;
|
|
433
|
+
private _unknownKeys;
|
|
434
|
+
private _catchall;
|
|
435
|
+
constructor(shape: S);
|
|
436
|
+
get shape(): S;
|
|
437
|
+
private _isOptionalKey;
|
|
438
|
+
_parse(value: unknown, ctx: ParseContext): InferShape<S>;
|
|
439
|
+
strict(): ObjectSchema<S>;
|
|
440
|
+
passthrough(): ObjectSchema<S>;
|
|
441
|
+
extend<E extends Shape>(extension: E): ObjectSchema<S & E>;
|
|
442
|
+
merge<O extends Shape>(other: ObjectSchema<O>): ObjectSchema<Omit<S, keyof O> & O>;
|
|
443
|
+
pick<K extends keyof S & string>(...keys: K[]): ObjectSchema<Pick<S, K>>;
|
|
444
|
+
required(): ObjectSchema<{ [K in keyof S] : S[K] extends OptionalSchema<infer O, infer I> ? Schema<O, I> : S[K] extends DefaultSchema<infer O, infer I> ? Schema<O, I> : S[K] }>;
|
|
445
|
+
partial(): ObjectSchema<{ [K in keyof S] : OptionalSchema<S[K]["_output"], S[K]["_input"]> } & Shape>;
|
|
446
|
+
omit<K extends keyof S & string>(...keys: K[]): ObjectSchema<Omit<S, K>>;
|
|
447
|
+
keyof(): string[];
|
|
448
|
+
catchall(schema: SchemaAny): ObjectSchema<S>;
|
|
449
|
+
_schemaType(): SchemaType;
|
|
450
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
451
|
+
_clone(): ObjectSchema<S>;
|
|
452
|
+
}
|
|
453
|
+
type DiscriminatedOptions = [ObjectSchema<any>, ...ObjectSchema<any>[]];
|
|
454
|
+
type InferDiscriminatedUnion<T extends DiscriminatedOptions> = T[number] extends infer U ? U extends Schema<infer O> ? O : never : never;
|
|
455
|
+
declare class DiscriminatedUnionSchema<T extends DiscriminatedOptions> extends Schema<InferDiscriminatedUnion<T>> {
|
|
456
|
+
private readonly _discriminator;
|
|
457
|
+
private readonly _options;
|
|
458
|
+
private readonly _lookup;
|
|
459
|
+
constructor(discriminator: string, options: T);
|
|
460
|
+
_parse(value: unknown, ctx: ParseContext): InferDiscriminatedUnion<T>;
|
|
461
|
+
_schemaType(): SchemaType;
|
|
462
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
463
|
+
_clone(): DiscriminatedUnionSchema<T>;
|
|
464
|
+
}
|
|
465
|
+
declare class EnumSchema<T extends readonly [string, ...string[]]> extends Schema<T[number]> {
|
|
466
|
+
private readonly _values;
|
|
467
|
+
constructor(values: T);
|
|
468
|
+
_parse(value: unknown, ctx: ParseContext): T[number];
|
|
469
|
+
_schemaType(): SchemaType;
|
|
470
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
471
|
+
exclude<E extends T[number]>(values: E[]): EnumSchema<readonly [string, ...string[]]>;
|
|
472
|
+
extract<E extends T[number]>(values: E[]): EnumSchema<readonly [string, ...string[]]>;
|
|
473
|
+
_clone(): EnumSchema<T>;
|
|
474
|
+
}
|
|
475
|
+
declare class FileSchema extends Schema<Blob> {
|
|
476
|
+
_parse(value: unknown, ctx: ParseContext): Blob;
|
|
477
|
+
_schemaType(): SchemaType;
|
|
478
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
479
|
+
_clone(): FileSchema;
|
|
480
|
+
}
|
|
481
|
+
declare abstract class FormatSchema extends StringSchema {
|
|
482
|
+
protected abstract _errorMessage: string;
|
|
483
|
+
protected abstract _validate(value: string): boolean;
|
|
484
|
+
protected _jsonSchemaExtra(): Record<string, unknown> | undefined;
|
|
485
|
+
_parse(value: unknown, ctx: ParseContext): string;
|
|
486
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
487
|
+
_clone(): this;
|
|
488
|
+
}
|
|
489
|
+
declare class Base64Schema extends FormatSchema {
|
|
490
|
+
protected _errorMessage: string;
|
|
491
|
+
protected _validate(value: string): boolean;
|
|
492
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
493
|
+
}
|
|
494
|
+
declare class CuidSchema extends FormatSchema {
|
|
495
|
+
protected _errorMessage: string;
|
|
496
|
+
protected _validate(value: string): boolean;
|
|
497
|
+
}
|
|
498
|
+
declare class EmailSchema extends FormatSchema {
|
|
499
|
+
protected _errorMessage: string;
|
|
500
|
+
protected _validate(value: string): boolean;
|
|
501
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
502
|
+
}
|
|
503
|
+
declare class HexSchema extends FormatSchema {
|
|
504
|
+
protected _errorMessage: string;
|
|
505
|
+
protected _validate(value: string): boolean;
|
|
506
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
507
|
+
}
|
|
508
|
+
declare class HostnameSchema extends FormatSchema {
|
|
509
|
+
protected _errorMessage: string;
|
|
510
|
+
protected _validate(value: string): boolean;
|
|
511
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
512
|
+
}
|
|
513
|
+
declare class Ipv4Schema extends FormatSchema {
|
|
514
|
+
protected _errorMessage: string;
|
|
515
|
+
protected _validate(value: string): boolean;
|
|
516
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
517
|
+
}
|
|
518
|
+
declare class Ipv6Schema extends FormatSchema {
|
|
519
|
+
protected _errorMessage: string;
|
|
520
|
+
protected _validate(value: string): boolean;
|
|
521
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
522
|
+
}
|
|
523
|
+
declare class IsoDateSchema extends FormatSchema {
|
|
524
|
+
protected _errorMessage: string;
|
|
525
|
+
protected _validate(value: string): boolean;
|
|
526
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
527
|
+
}
|
|
528
|
+
declare class IsoTimeSchema extends FormatSchema {
|
|
529
|
+
protected _errorMessage: string;
|
|
530
|
+
protected _validate(value: string): boolean;
|
|
531
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
532
|
+
}
|
|
533
|
+
declare class IsoDatetimeSchema extends FormatSchema {
|
|
534
|
+
protected _errorMessage: string;
|
|
535
|
+
protected _validate(value: string): boolean;
|
|
536
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
537
|
+
}
|
|
538
|
+
declare class IsoDurationSchema extends FormatSchema {
|
|
539
|
+
protected _errorMessage: string;
|
|
540
|
+
protected _validate(value: string): boolean;
|
|
541
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
542
|
+
}
|
|
543
|
+
declare class JwtSchema extends FormatSchema {
|
|
544
|
+
protected _errorMessage: string;
|
|
545
|
+
protected _validate(value: string): boolean;
|
|
546
|
+
}
|
|
547
|
+
declare class NanoidSchema extends FormatSchema {
|
|
548
|
+
protected _errorMessage: string;
|
|
549
|
+
protected _validate(value: string): boolean;
|
|
550
|
+
}
|
|
551
|
+
declare class UlidSchema extends FormatSchema {
|
|
552
|
+
protected _errorMessage: string;
|
|
553
|
+
protected _validate(value: string): boolean;
|
|
554
|
+
}
|
|
555
|
+
declare class UrlSchema extends FormatSchema {
|
|
556
|
+
protected _errorMessage: string;
|
|
557
|
+
protected _validate(value: string): boolean;
|
|
558
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
559
|
+
}
|
|
560
|
+
declare class UuidSchema extends FormatSchema {
|
|
561
|
+
protected _errorMessage: string;
|
|
562
|
+
protected _validate(value: string): boolean;
|
|
563
|
+
protected _jsonSchemaExtra(): Record<string, unknown>;
|
|
564
|
+
}
|
|
565
|
+
type Constructor<T> = new (...args: any[]) => T;
|
|
566
|
+
declare class InstanceOfSchema<T> extends Schema<T> {
|
|
567
|
+
private readonly _cls;
|
|
568
|
+
constructor(cls: Constructor<T>);
|
|
569
|
+
_parse(value: unknown, ctx: ParseContext): T;
|
|
570
|
+
_schemaType(): SchemaType;
|
|
571
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
572
|
+
_clone(): InstanceOfSchema<T>;
|
|
573
|
+
}
|
|
574
|
+
declare class IntersectionSchema<
|
|
575
|
+
L extends SchemaAny,
|
|
576
|
+
R extends SchemaAny
|
|
577
|
+
> extends Schema<L["_output"] & R["_output"]> {
|
|
578
|
+
private readonly _left;
|
|
579
|
+
private readonly _right;
|
|
580
|
+
constructor(left: L, right: R);
|
|
581
|
+
_parse(value: unknown, ctx: ParseContext): L["_output"] & R["_output"];
|
|
582
|
+
_schemaType(): SchemaType;
|
|
583
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
584
|
+
_clone(): IntersectionSchema<L, R>;
|
|
585
|
+
}
|
|
586
|
+
declare class LazySchema<T> extends Schema<T> {
|
|
587
|
+
private readonly _getter;
|
|
588
|
+
private _cached;
|
|
589
|
+
constructor(getter: () => Schema<T>);
|
|
590
|
+
private _resolve;
|
|
591
|
+
_parse(value: unknown, ctx: ParseContext): T;
|
|
592
|
+
_schemaType(): SchemaType;
|
|
593
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
594
|
+
_clone(): LazySchema<T>;
|
|
595
|
+
}
|
|
596
|
+
type LiteralValue = string | number | boolean | null;
|
|
597
|
+
declare class LiteralSchema<T extends LiteralValue> extends Schema<T> {
|
|
598
|
+
private readonly _value;
|
|
599
|
+
constructor(value: T);
|
|
600
|
+
get value(): T;
|
|
601
|
+
_parse(value: unknown, ctx: ParseContext): T;
|
|
602
|
+
_schemaType(): SchemaType;
|
|
603
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
604
|
+
_clone(): LiteralSchema<T>;
|
|
605
|
+
}
|
|
606
|
+
declare class MapSchema<
|
|
607
|
+
K,
|
|
608
|
+
V
|
|
609
|
+
> extends Schema<Map<K, V>> {
|
|
610
|
+
private readonly _keySchema;
|
|
611
|
+
private readonly _valueSchema;
|
|
612
|
+
constructor(keySchema: Schema<K>, valueSchema: Schema<V>);
|
|
613
|
+
_parse(value: unknown, ctx: ParseContext): Map<K, V>;
|
|
614
|
+
_schemaType(): SchemaType;
|
|
615
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
616
|
+
_clone(): MapSchema<K, V>;
|
|
617
|
+
}
|
|
618
|
+
declare class NanSchema extends Schema<number> {
|
|
619
|
+
_parse(value: unknown, ctx: ParseContext): number;
|
|
620
|
+
_schemaType(): SchemaType;
|
|
621
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
622
|
+
_clone(): NanSchema;
|
|
623
|
+
}
|
|
624
|
+
declare class RecordSchema<V> extends Schema<Record<string, V>> {
|
|
625
|
+
private readonly _keySchema;
|
|
626
|
+
private readonly _valueSchema;
|
|
627
|
+
constructor(valueSchema: Schema<V>);
|
|
628
|
+
constructor(keySchema: Schema<string>, valueSchema: Schema<V>);
|
|
629
|
+
_parse(value: unknown, ctx: ParseContext): Record<string, V>;
|
|
630
|
+
_schemaType(): SchemaType;
|
|
631
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
632
|
+
_clone(): RecordSchema<V>;
|
|
633
|
+
}
|
|
634
|
+
declare class SetSchema<V> extends Schema<Set<V>> {
|
|
635
|
+
private readonly _valueSchema;
|
|
636
|
+
private _min;
|
|
637
|
+
private _max;
|
|
638
|
+
private _size;
|
|
639
|
+
constructor(valueSchema: Schema<V>);
|
|
640
|
+
_parse(value: unknown, ctx: ParseContext): Set<V>;
|
|
641
|
+
min(n: number): SetSchema<V>;
|
|
642
|
+
max(n: number): SetSchema<V>;
|
|
643
|
+
size(n: number): SetSchema<V>;
|
|
644
|
+
_schemaType(): SchemaType;
|
|
645
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
646
|
+
_clone(): SetSchema<V>;
|
|
647
|
+
}
|
|
648
|
+
declare class AnySchema extends Schema<any> {
|
|
649
|
+
_parse(value: unknown, _ctx: ParseContext): any;
|
|
650
|
+
_schemaType(): SchemaType;
|
|
651
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
652
|
+
_clone(): AnySchema;
|
|
653
|
+
}
|
|
654
|
+
declare class UnknownSchema extends Schema<unknown> {
|
|
655
|
+
_parse(value: unknown, _ctx: ParseContext): unknown;
|
|
656
|
+
_schemaType(): SchemaType;
|
|
657
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
658
|
+
_clone(): UnknownSchema;
|
|
659
|
+
}
|
|
660
|
+
declare class NullSchema extends Schema<null> {
|
|
661
|
+
_parse(value: unknown, ctx: ParseContext): null;
|
|
662
|
+
_schemaType(): SchemaType;
|
|
663
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
664
|
+
_clone(): NullSchema;
|
|
665
|
+
}
|
|
666
|
+
declare class UndefinedSchema extends Schema<undefined> {
|
|
667
|
+
_parse(value: unknown, ctx: ParseContext): undefined;
|
|
668
|
+
_schemaType(): SchemaType;
|
|
669
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
670
|
+
_clone(): UndefinedSchema;
|
|
671
|
+
}
|
|
672
|
+
declare class VoidSchema extends Schema<void> {
|
|
673
|
+
_parse(value: unknown, ctx: ParseContext): void;
|
|
674
|
+
_schemaType(): SchemaType;
|
|
675
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
676
|
+
_clone(): VoidSchema;
|
|
677
|
+
}
|
|
678
|
+
declare class NeverSchema extends Schema<never> {
|
|
679
|
+
_parse(value: unknown, ctx: ParseContext): never;
|
|
680
|
+
_schemaType(): SchemaType;
|
|
681
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
682
|
+
_clone(): NeverSchema;
|
|
683
|
+
}
|
|
684
|
+
declare class SymbolSchema extends Schema<symbol> {
|
|
685
|
+
_parse(value: unknown, ctx: ParseContext): symbol;
|
|
686
|
+
_schemaType(): SchemaType;
|
|
687
|
+
_toJSONSchema(_tracker: RefTracker): JSONSchemaObject;
|
|
688
|
+
_clone(): SymbolSchema;
|
|
689
|
+
}
|
|
690
|
+
type TupleItems = [SchemaAny, ...SchemaAny[]];
|
|
691
|
+
type InferTuple<T extends TupleItems> = { [K in keyof T] : T[K] extends Schema<infer O> ? O : never };
|
|
692
|
+
declare class TupleSchema<T extends TupleItems> extends Schema<InferTuple<T>> {
|
|
693
|
+
private readonly _items;
|
|
694
|
+
private _rest;
|
|
695
|
+
constructor(items: T);
|
|
696
|
+
_parse(value: unknown, ctx: ParseContext): InferTuple<T>;
|
|
697
|
+
rest<R>(schema: Schema<R>): TupleSchema<T>;
|
|
698
|
+
_schemaType(): SchemaType;
|
|
699
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
700
|
+
_clone(): TupleSchema<T>;
|
|
701
|
+
}
|
|
702
|
+
type UnionOptions = [SchemaAny, ...SchemaAny[]];
|
|
703
|
+
type InferUnion<T extends UnionOptions> = T[number] extends infer U ? U extends Schema<infer O> ? O : never : never;
|
|
704
|
+
declare class UnionSchema<T extends UnionOptions> extends Schema<InferUnion<T>> {
|
|
705
|
+
private readonly _options;
|
|
706
|
+
constructor(options: T);
|
|
707
|
+
_parse(value: unknown, ctx: ParseContext): InferUnion<T>;
|
|
708
|
+
_schemaType(): SchemaType;
|
|
709
|
+
_toJSONSchema(tracker: RefTracker): JSONSchemaObject;
|
|
710
|
+
_clone(): UnionSchema<T>;
|
|
711
|
+
}
|
|
712
|
+
declare function preprocess<O>(fn: (value: unknown) => unknown, schema: Schema<O>): Schema<O>;
|
|
713
|
+
/** Infer the output type of a schema. Alias for Output<T>. */
|
|
714
|
+
type Infer<T extends SchemaAny> = T["_output"];
|
|
715
|
+
/** Infer the output type of a schema. */
|
|
716
|
+
type Output<T extends SchemaAny> = T["_output"];
|
|
717
|
+
/** Infer the input type of a schema. Differs from Output when transforms exist. */
|
|
718
|
+
type Input<T extends SchemaAny> = T["_input"];
|
|
719
|
+
declare const s: {
|
|
720
|
+
string: () => StringSchema;
|
|
721
|
+
number: () => NumberSchema;
|
|
722
|
+
boolean: () => BooleanSchema;
|
|
723
|
+
bigint: () => BigIntSchema;
|
|
724
|
+
date: () => DateSchema;
|
|
725
|
+
symbol: () => SymbolSchema;
|
|
726
|
+
nan: () => NanSchema;
|
|
727
|
+
int: () => NumberSchema;
|
|
728
|
+
any: () => AnySchema;
|
|
729
|
+
unknown: () => UnknownSchema;
|
|
730
|
+
null: () => NullSchema;
|
|
731
|
+
undefined: () => UndefinedSchema;
|
|
732
|
+
void: () => VoidSchema;
|
|
733
|
+
never: () => NeverSchema;
|
|
734
|
+
object: <T extends Record<string, SchemaAny>>(shape: T) => ObjectSchema<T>;
|
|
735
|
+
array: <T>(itemSchema: Schema<T>) => ArraySchema<T>;
|
|
736
|
+
tuple: <T extends [SchemaAny, ...SchemaAny[]]>(items: [...T]) => TupleSchema<T>;
|
|
737
|
+
enum: <T extends readonly [string, ...string[]]>(values: T) => EnumSchema<T>;
|
|
738
|
+
literal: <T extends string | number | boolean | null>(value: T) => LiteralSchema<T>;
|
|
739
|
+
union: <T extends [SchemaAny, ...SchemaAny[]]>(options: [...T]) => UnionSchema<T>;
|
|
740
|
+
discriminatedUnion: <T extends [ObjectSchema<any>, ...ObjectSchema<any>[]]>(discriminator: string, options: [...T]) => DiscriminatedUnionSchema<T>;
|
|
741
|
+
intersection: <
|
|
742
|
+
L extends SchemaAny,
|
|
743
|
+
R extends SchemaAny
|
|
744
|
+
>(left: L, right: R) => IntersectionSchema<L, R>;
|
|
745
|
+
record: <V>(valueSchema: Schema<V>) => RecordSchema<V>;
|
|
746
|
+
map: <
|
|
747
|
+
K,
|
|
748
|
+
V
|
|
749
|
+
>(keySchema: Schema<K>, valueSchema: Schema<V>) => MapSchema<K, V>;
|
|
750
|
+
set: <V>(valueSchema: Schema<V>) => SetSchema<V>;
|
|
751
|
+
file: () => FileSchema;
|
|
752
|
+
custom: <T>(check: (value: unknown) => boolean, message?: string) => CustomSchema<T>;
|
|
753
|
+
instanceof: <T>(cls: new (...args: any[]) => T) => InstanceOfSchema<T>;
|
|
754
|
+
lazy: <T>(getter: () => Schema<T>) => LazySchema<T>;
|
|
755
|
+
email: () => EmailSchema;
|
|
756
|
+
uuid: () => UuidSchema;
|
|
757
|
+
url: () => UrlSchema;
|
|
758
|
+
hostname: () => HostnameSchema;
|
|
759
|
+
ipv4: () => Ipv4Schema;
|
|
760
|
+
ipv6: () => Ipv6Schema;
|
|
761
|
+
base64: () => Base64Schema;
|
|
762
|
+
hex: () => HexSchema;
|
|
763
|
+
jwt: () => JwtSchema;
|
|
764
|
+
cuid: () => CuidSchema;
|
|
765
|
+
ulid: () => UlidSchema;
|
|
766
|
+
nanoid: () => NanoidSchema;
|
|
767
|
+
iso: {
|
|
768
|
+
date: () => IsoDateSchema;
|
|
769
|
+
time: () => IsoTimeSchema;
|
|
770
|
+
datetime: () => IsoDatetimeSchema;
|
|
771
|
+
duration: () => IsoDurationSchema;
|
|
772
|
+
};
|
|
773
|
+
coerce: {
|
|
774
|
+
string: () => CoercedStringSchema;
|
|
775
|
+
number: () => CoercedNumberSchema;
|
|
776
|
+
boolean: () => CoercedBooleanSchema;
|
|
777
|
+
bigint: () => CoercedBigIntSchema;
|
|
778
|
+
date: () => CoercedDateSchema;
|
|
779
|
+
};
|
|
780
|
+
};
|
|
781
|
+
declare const schema: typeof s;
|
|
782
|
+
export { toJSONSchema2 as toJSONSchema, schema, s, preprocess, VoidSchema, ValidationIssue, UuidSchema, UrlSchema, UnknownSchema, UnionSchema, UndefinedSchema, UlidSchema, TupleSchema, TransformSchema, SymbolSchema, SuperRefinedSchema, StringSchema, SetSchema, SchemaType, SchemaRegistry, SchemaMetadata, SchemaAny, Schema, SafeParseResult, RefinementContext, RefinedSchema, RefTracker, RecordSchema, ReadonlySchema, ReadonlyOutput, PipeSchema, ParseError, ParseContext, Output, OptionalSchema, ObjectSchema, NumberSchema, NullableSchema, NullSchema, NeverSchema, NanoidSchema, NanSchema, MapSchema, LiteralSchema, LazySchema, JwtSchema, JSONSchemaObject, IsoTimeSchema, IsoDurationSchema, IsoDatetimeSchema, IsoDateSchema, Ipv6Schema, Ipv4Schema, IntersectionSchema, InstanceOfSchema, Input, Infer, HostnameSchema, HexSchema, FileSchema, ErrorCode, EnumSchema, EmailSchema, DiscriminatedUnionSchema, DefaultSchema, DateSchema, CustomSchema, CuidSchema, CoercedStringSchema, CoercedNumberSchema, CoercedDateSchema, CoercedBooleanSchema, CoercedBigIntSchema, CatchSchema, BrandedSchema, BooleanSchema, BigIntSchema, Base64Schema, ArraySchema, AnySchema };
|