likec4 1.41.0 → 1.42.0
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/__app__/src/likec4.js +11659 -12120
- package/__app__/src/main.js +185 -129
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +38519 -17031
- package/__app__/src/webcomponent.js +68 -0
- package/config/package.json +2 -2
- package/config/schema.json +575 -0
- package/dist/cli/index.mjs +557 -553
- package/dist/config/index.d.mts +4 -1
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +47 -4
- package/dist/model/index.mjs +1 -1
- package/dist/shared/likec4.B5Q51Z1F.mjs +543 -0
- package/dist/shared/likec4.BCSBNe4z.d.mts +6808 -0
- package/dist/shared/likec4.CB2-Uaub.mjs +47 -0
- package/dist/shared/likec4.CJVbsoPD.mjs +256 -0
- package/dist/shared/{likec4.3AlS7pfZ.d.mts → likec4.CaOUU1HJ.d.mts} +204 -149
- package/dist/shared/likec4.DOUP9ptn.mjs +1 -0
- package/dist/shared/{likec4.C8C0fF8a.mjs → likec4.DO_7oUns.mjs} +1 -1
- package/dist/shared/likec4.DdxVkEIS.mjs +4038 -0
- package/dist/vite-plugin/index.d.mts +4 -3
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal.mjs +3 -3
- package/icons/all/package.json +4 -0
- package/model/builder/package.json +4 -0
- package/model/package.json +4 -0
- package/package.json +42 -42
- package/react/index.d.ts +6655 -0
- package/react/index.js +48628 -0
- package/react/package.json +3 -2
- package/vite-plugin/package.json +2 -2
- package/vite-plugin-modules.d.ts +5 -5
- package/__app__/src/webcomponent.tsx +0 -81
- package/dist/shared/likec4.CdNNo2L4.mjs +0 -1
- package/dist/shared/likec4.CxmGAh_J.mjs +0 -144
- package/dist/shared/likec4.DX1wM3Or.d.mts +0 -1704
- package/dist/shared/likec4.Db3cTW-C.mjs +0 -257
- package/dist/shared/likec4.bxIrQhth.mjs +0 -4174
- package/react/index.d.mts +0 -6578
- package/react/index.mjs +0 -185
|
@@ -1,1704 +0,0 @@
|
|
|
1
|
-
import { LikeC4Model, ElementModel, RelationshipModel, DeploymentRelationModel, LikeC4ViewModel, DeploymentElementModel } from '@likec4/core/model';
|
|
2
|
-
import { ProjectId, aux } from '@likec4/core/types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
|
|
6
|
-
* This class is a simple parser which creates the basic component parts
|
|
7
|
-
* (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
|
|
8
|
-
* and encoding.
|
|
9
|
-
*
|
|
10
|
-
* ```txt
|
|
11
|
-
* foo://example.com:8042/over/there?name=ferret#nose
|
|
12
|
-
* \_/ \______________/\_________/ \_________/ \__/
|
|
13
|
-
* | | | | |
|
|
14
|
-
* scheme authority path query fragment
|
|
15
|
-
* | _____________________|__
|
|
16
|
-
* / \ / \
|
|
17
|
-
* urn:example:animal:ferret:nose
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
declare class URI implements UriComponents {
|
|
21
|
-
static isUri(thing: any): thing is URI;
|
|
22
|
-
/**
|
|
23
|
-
* scheme is the 'http' part of 'http://www.example.com/some/path?query#fragment'.
|
|
24
|
-
* The part before the first colon.
|
|
25
|
-
*/
|
|
26
|
-
readonly scheme: string;
|
|
27
|
-
/**
|
|
28
|
-
* authority is the 'www.example.com' part of 'http://www.example.com/some/path?query#fragment'.
|
|
29
|
-
* The part between the first double slashes and the next slash.
|
|
30
|
-
*/
|
|
31
|
-
readonly authority: string;
|
|
32
|
-
/**
|
|
33
|
-
* path is the '/some/path' part of 'http://www.example.com/some/path?query#fragment'.
|
|
34
|
-
*/
|
|
35
|
-
readonly path: string;
|
|
36
|
-
/**
|
|
37
|
-
* query is the 'query' part of 'http://www.example.com/some/path?query#fragment'.
|
|
38
|
-
*/
|
|
39
|
-
readonly query: string;
|
|
40
|
-
/**
|
|
41
|
-
* fragment is the 'fragment' part of 'http://www.example.com/some/path?query#fragment'.
|
|
42
|
-
*/
|
|
43
|
-
readonly fragment: string;
|
|
44
|
-
/**
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
47
|
-
protected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);
|
|
48
|
-
/**
|
|
49
|
-
* @internal
|
|
50
|
-
*/
|
|
51
|
-
protected constructor(components: UriComponents);
|
|
52
|
-
/**
|
|
53
|
-
* Returns a string representing the corresponding file system path of this URI.
|
|
54
|
-
* Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
|
|
55
|
-
* platform specific path separator.
|
|
56
|
-
*
|
|
57
|
-
* * Will *not* validate the path for invalid characters and semantics.
|
|
58
|
-
* * Will *not* look at the scheme of this URI.
|
|
59
|
-
* * The result shall *not* be used for display purposes but for accessing a file on disk.
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* The *difference* to `URI#path` is the use of the platform specific separator and the handling
|
|
63
|
-
* of UNC paths. See the below sample of a file-uri with an authority (UNC path).
|
|
64
|
-
*
|
|
65
|
-
* ```ts
|
|
66
|
-
const u = URI.parse('file://server/c$/folder/file.txt')
|
|
67
|
-
u.authority === 'server'
|
|
68
|
-
u.path === '/shares/c$/file.txt'
|
|
69
|
-
u.fsPath === '\\server\c$\folder\file.txt'
|
|
70
|
-
```
|
|
71
|
-
*
|
|
72
|
-
* Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
|
|
73
|
-
* namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
|
|
74
|
-
* with URIs that represent files on disk (`file` scheme).
|
|
75
|
-
*/
|
|
76
|
-
get fsPath(): string;
|
|
77
|
-
with(change: {
|
|
78
|
-
scheme?: string;
|
|
79
|
-
authority?: string | null;
|
|
80
|
-
path?: string | null;
|
|
81
|
-
query?: string | null;
|
|
82
|
-
fragment?: string | null;
|
|
83
|
-
}): URI;
|
|
84
|
-
/**
|
|
85
|
-
* Creates a new URI from a string, e.g. `http://www.example.com/some/path`,
|
|
86
|
-
* `file:///usr/home`, or `scheme:with/path`.
|
|
87
|
-
*
|
|
88
|
-
* @param value A string which represents an URI (see `URI#toString`).
|
|
89
|
-
*/
|
|
90
|
-
static parse(value: string, _strict?: boolean): URI;
|
|
91
|
-
/**
|
|
92
|
-
* Creates a new URI from a file system path, e.g. `c:\my\files`,
|
|
93
|
-
* `/usr/home`, or `\\server\share\some\path`.
|
|
94
|
-
*
|
|
95
|
-
* The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
|
|
96
|
-
* as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
|
|
97
|
-
* `URI.parse('file://' + path)` because the path might contain characters that are
|
|
98
|
-
* interpreted (# and ?). See the following sample:
|
|
99
|
-
* ```ts
|
|
100
|
-
const good = URI.file('/coding/c#/project1');
|
|
101
|
-
good.scheme === 'file';
|
|
102
|
-
good.path === '/coding/c#/project1';
|
|
103
|
-
good.fragment === '';
|
|
104
|
-
const bad = URI.parse('file://' + '/coding/c#/project1');
|
|
105
|
-
bad.scheme === 'file';
|
|
106
|
-
bad.path === '/coding/c'; // path is now broken
|
|
107
|
-
bad.fragment === '/project1';
|
|
108
|
-
```
|
|
109
|
-
*
|
|
110
|
-
* @param path A file system path (see `URI#fsPath`)
|
|
111
|
-
*/
|
|
112
|
-
static file(path: string): URI;
|
|
113
|
-
static from(components: {
|
|
114
|
-
scheme: string;
|
|
115
|
-
authority?: string;
|
|
116
|
-
path?: string;
|
|
117
|
-
query?: string;
|
|
118
|
-
fragment?: string;
|
|
119
|
-
}): URI;
|
|
120
|
-
/**
|
|
121
|
-
* Creates a string representation for this URI. It's guaranteed that calling
|
|
122
|
-
* `URI.parse` with the result of this function creates an URI which is equal
|
|
123
|
-
* to this URI.
|
|
124
|
-
*
|
|
125
|
-
* * The result shall *not* be used for display purposes but for externalization or transport.
|
|
126
|
-
* * The result will be encoded using the percentage encoding and encoding happens mostly
|
|
127
|
-
* ignore the scheme-specific encoding rules.
|
|
128
|
-
*
|
|
129
|
-
* @param skipEncoding Do not encode the result, default is `false`
|
|
130
|
-
*/
|
|
131
|
-
toString(skipEncoding?: boolean): string;
|
|
132
|
-
toJSON(): UriComponents;
|
|
133
|
-
static revive(data: UriComponents | URI): URI;
|
|
134
|
-
static revive(data: UriComponents | URI | undefined): URI | undefined;
|
|
135
|
-
static revive(data: UriComponents | URI | null): URI | null;
|
|
136
|
-
static revive(data: UriComponents | URI | undefined | null): URI | undefined | null;
|
|
137
|
-
}
|
|
138
|
-
interface UriComponents {
|
|
139
|
-
scheme: string;
|
|
140
|
-
authority: string;
|
|
141
|
-
path: string;
|
|
142
|
-
query: string;
|
|
143
|
-
fragment: string;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/** The Standard Schema interface. */
|
|
147
|
-
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
148
|
-
/** The Standard Schema properties. */
|
|
149
|
-
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
150
|
-
}
|
|
151
|
-
declare namespace StandardSchemaV1 {
|
|
152
|
-
/** The Standard Schema properties interface. */
|
|
153
|
-
interface Props<Input = unknown, Output = Input> {
|
|
154
|
-
/** The version number of the standard. */
|
|
155
|
-
readonly version: 1;
|
|
156
|
-
/** The vendor name of the schema library. */
|
|
157
|
-
readonly vendor: string;
|
|
158
|
-
/** Validates unknown input values. */
|
|
159
|
-
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
160
|
-
/** Inferred types associated with the schema. */
|
|
161
|
-
readonly types?: Types<Input, Output> | undefined;
|
|
162
|
-
}
|
|
163
|
-
/** The result interface of the validate function. */
|
|
164
|
-
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
165
|
-
/** The result interface if validation succeeds. */
|
|
166
|
-
interface SuccessResult<Output> {
|
|
167
|
-
/** The typed output value. */
|
|
168
|
-
readonly value: Output;
|
|
169
|
-
/** The non-existent issues. */
|
|
170
|
-
readonly issues?: undefined;
|
|
171
|
-
}
|
|
172
|
-
/** The result interface if validation fails. */
|
|
173
|
-
interface FailureResult {
|
|
174
|
-
/** The issues of failed validation. */
|
|
175
|
-
readonly issues: ReadonlyArray<Issue>;
|
|
176
|
-
}
|
|
177
|
-
/** The issue interface of the failure output. */
|
|
178
|
-
interface Issue {
|
|
179
|
-
/** The error message of the issue. */
|
|
180
|
-
readonly message: string;
|
|
181
|
-
/** The path of the issue, if any. */
|
|
182
|
-
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
183
|
-
}
|
|
184
|
-
/** The path segment interface of the issue. */
|
|
185
|
-
interface PathSegment {
|
|
186
|
-
/** The key representing a path segment. */
|
|
187
|
-
readonly key: PropertyKey;
|
|
188
|
-
}
|
|
189
|
-
/** The Standard Schema types interface. */
|
|
190
|
-
interface Types<Input = unknown, Output = Input> {
|
|
191
|
-
/** The input type of the schema. */
|
|
192
|
-
readonly input: Input;
|
|
193
|
-
/** The output type of the schema. */
|
|
194
|
-
readonly output: Output;
|
|
195
|
-
}
|
|
196
|
-
/** Infers the input type of a Standard Schema. */
|
|
197
|
-
type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
198
|
-
/** Infers the output type of a Standard Schema. */
|
|
199
|
-
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
|
|
203
|
-
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
204
|
-
type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
205
|
-
type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
|
|
206
|
-
type NoUndefined<T> = T extends undefined ? never : T;
|
|
207
|
-
type LoosePartial<T extends object> = InexactPartial<T> & {
|
|
208
|
-
[k: string]: unknown;
|
|
209
|
-
};
|
|
210
|
-
type Mask<Keys extends PropertyKey> = {
|
|
211
|
-
[K in Keys]?: true;
|
|
212
|
-
};
|
|
213
|
-
type InexactPartial<T> = {
|
|
214
|
-
[P in keyof T]?: T[P] | undefined;
|
|
215
|
-
};
|
|
216
|
-
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
|
217
|
-
readonly [Symbol.toStringTag]: string;
|
|
218
|
-
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
|
219
|
-
type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
|
|
220
|
-
type SomeObject = Record<PropertyKey, any>;
|
|
221
|
-
type Identity<T> = T;
|
|
222
|
-
type Flatten<T> = Identity<{
|
|
223
|
-
[k in keyof T]: T[k];
|
|
224
|
-
}>;
|
|
225
|
-
type Prettify<T> = {
|
|
226
|
-
[K in keyof T]: T[K];
|
|
227
|
-
} & {};
|
|
228
|
-
type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : {
|
|
229
|
-
[K in keyof A as K extends keyof B ? never : K]: A[K];
|
|
230
|
-
} & {
|
|
231
|
-
[K in keyof B]: B[K];
|
|
232
|
-
}>;
|
|
233
|
-
type AnyFunc = (...args: any[]) => any;
|
|
234
|
-
type MaybeAsync<T> = T | Promise<T>;
|
|
235
|
-
type EnumValue = string | number;
|
|
236
|
-
type EnumLike = Readonly<Record<string, EnumValue>>;
|
|
237
|
-
type ToEnum<T extends EnumValue> = Flatten<{
|
|
238
|
-
[k in T]: k;
|
|
239
|
-
}>;
|
|
240
|
-
type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
241
|
-
type HasLength = {
|
|
242
|
-
length: number;
|
|
243
|
-
};
|
|
244
|
-
type PropValues = Record<string, Set<Primitive>>;
|
|
245
|
-
type PrimitiveSet = Set<Primitive>;
|
|
246
|
-
type EmptyToNever<T> = keyof T extends never ? never : T;
|
|
247
|
-
declare abstract class Class {
|
|
248
|
-
constructor(..._args: any[]);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
declare const version: {
|
|
252
|
-
readonly major: 4;
|
|
253
|
-
readonly minor: 0;
|
|
254
|
-
readonly patch: number;
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
interface ParseContext<T extends $ZodIssueBase = never> {
|
|
258
|
-
/** Customize error messages. */
|
|
259
|
-
readonly error?: $ZodErrorMap<T>;
|
|
260
|
-
/** Include the `input` field in issue objects. Default `false`. */
|
|
261
|
-
readonly reportInput?: boolean;
|
|
262
|
-
/** Skip eval-based fast path. Default `false`. */
|
|
263
|
-
readonly jitless?: boolean;
|
|
264
|
-
}
|
|
265
|
-
/** @internal */
|
|
266
|
-
interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext<T> {
|
|
267
|
-
readonly async?: boolean | undefined;
|
|
268
|
-
}
|
|
269
|
-
interface ParsePayload<T = unknown> {
|
|
270
|
-
value: T;
|
|
271
|
-
issues: $ZodRawIssue[];
|
|
272
|
-
}
|
|
273
|
-
type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
|
|
274
|
-
interface $ZodTypeDef {
|
|
275
|
-
type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "custom";
|
|
276
|
-
error?: $ZodErrorMap<never> | undefined;
|
|
277
|
-
checks?: $ZodCheck<never>[];
|
|
278
|
-
}
|
|
279
|
-
interface _$ZodTypeInternals {
|
|
280
|
-
/** The `@zod/core` version of this schema */
|
|
281
|
-
version: typeof version;
|
|
282
|
-
/** Schema definition. */
|
|
283
|
-
def: $ZodTypeDef;
|
|
284
|
-
/** @internal Randomly generated ID for this schema. */
|
|
285
|
-
/** @internal List of deferred initializers. */
|
|
286
|
-
deferred: AnyFunc[] | undefined;
|
|
287
|
-
/** @internal Parses input and runs all checks (refinements). */
|
|
288
|
-
run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
|
|
289
|
-
/** @internal Parses input, doesn't run checks. */
|
|
290
|
-
parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
|
|
291
|
-
/** @internal Stores identifiers for the set of traits implemented by this schema. */
|
|
292
|
-
traits: Set<string>;
|
|
293
|
-
/** @internal Indicates that a schema output type should be considered optional inside objects.
|
|
294
|
-
* @default Required
|
|
295
|
-
*/
|
|
296
|
-
/** @internal */
|
|
297
|
-
optin?: "optional" | undefined;
|
|
298
|
-
/** @internal */
|
|
299
|
-
optout?: "optional" | undefined;
|
|
300
|
-
/** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
|
|
301
|
-
*
|
|
302
|
-
* Defined on: enum, const, literal, null, undefined
|
|
303
|
-
* Passthrough: optional, nullable, branded, default, catch, pipe
|
|
304
|
-
* Todo: unions?
|
|
305
|
-
*/
|
|
306
|
-
values?: PrimitiveSet | undefined;
|
|
307
|
-
/** Default value bubbled up from */
|
|
308
|
-
/** @internal A set of literal discriminators used for the fast path in discriminated unions. */
|
|
309
|
-
propValues?: PropValues | undefined;
|
|
310
|
-
/** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
|
|
311
|
-
pattern: RegExp | undefined;
|
|
312
|
-
/** @internal The constructor function of this schema. */
|
|
313
|
-
constr: new (def: any) => $ZodType;
|
|
314
|
-
/** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
|
|
315
|
-
bag: Record<string, unknown>;
|
|
316
|
-
/** @internal The set of issues this schema might throw during type checking. */
|
|
317
|
-
isst: $ZodIssueBase;
|
|
318
|
-
/** An optional method used to override `toJSONSchema` logic. */
|
|
319
|
-
toJSONSchema?: () => unknown;
|
|
320
|
-
/** @internal The parent of this schema. Only set during certain clone operations. */
|
|
321
|
-
parent?: $ZodType | undefined;
|
|
322
|
-
}
|
|
323
|
-
/** @internal */
|
|
324
|
-
interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
|
|
325
|
-
/** @internal The inferred output type */
|
|
326
|
-
output: O;
|
|
327
|
-
/** @internal The inferred input type */
|
|
328
|
-
input: I;
|
|
329
|
-
}
|
|
330
|
-
type $ZodStandardSchema<T> = StandardSchemaV1.Props<input<T>, output<T>>;
|
|
331
|
-
type SomeType = {
|
|
332
|
-
_zod: _$ZodTypeInternals;
|
|
333
|
-
};
|
|
334
|
-
interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
|
|
335
|
-
_zod: Internals;
|
|
336
|
-
"~standard": $ZodStandardSchema<this>;
|
|
337
|
-
}
|
|
338
|
-
declare const $ZodType: $constructor<$ZodType>;
|
|
339
|
-
|
|
340
|
-
interface $ZodStringDef extends $ZodTypeDef {
|
|
341
|
-
type: "string";
|
|
342
|
-
coerce?: boolean;
|
|
343
|
-
checks?: $ZodCheck<string>[];
|
|
344
|
-
}
|
|
345
|
-
interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
|
|
346
|
-
def: $ZodStringDef;
|
|
347
|
-
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
348
|
-
pattern: RegExp;
|
|
349
|
-
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
350
|
-
isst: $ZodIssueInvalidType;
|
|
351
|
-
bag: LoosePartial<{
|
|
352
|
-
minimum: number;
|
|
353
|
-
maximum: number;
|
|
354
|
-
patterns: Set<RegExp>;
|
|
355
|
-
format: string;
|
|
356
|
-
contentEncoding: string;
|
|
357
|
-
}>;
|
|
358
|
-
}
|
|
359
|
-
interface $ZodStringFormatDef<Format extends string = string> extends $ZodStringDef, $ZodCheckStringFormatDef<Format> {
|
|
360
|
-
}
|
|
361
|
-
interface $ZodStringFormatInternals<Format extends string = string> extends $ZodStringInternals<string>, $ZodCheckStringFormatInternals {
|
|
362
|
-
def: $ZodStringFormatDef<Format>;
|
|
363
|
-
}
|
|
364
|
-
interface $ZodStringFormat<Format extends string = string> extends $ZodType {
|
|
365
|
-
_zod: $ZodStringFormatInternals<Format>;
|
|
366
|
-
}
|
|
367
|
-
declare const $ZodStringFormat: $constructor<$ZodStringFormat>;
|
|
368
|
-
interface $ZodGUIDInternals extends $ZodStringFormatInternals<"guid"> {
|
|
369
|
-
}
|
|
370
|
-
interface $ZodGUID extends $ZodType {
|
|
371
|
-
_zod: $ZodGUIDInternals;
|
|
372
|
-
}
|
|
373
|
-
declare const $ZodGUID: $constructor<$ZodGUID>;
|
|
374
|
-
interface $ZodUUIDDef extends $ZodStringFormatDef<"uuid"> {
|
|
375
|
-
version?: "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7" | "v8";
|
|
376
|
-
}
|
|
377
|
-
interface $ZodUUIDInternals extends $ZodStringFormatInternals<"uuid"> {
|
|
378
|
-
def: $ZodUUIDDef;
|
|
379
|
-
}
|
|
380
|
-
interface $ZodUUID extends $ZodType {
|
|
381
|
-
_zod: $ZodUUIDInternals;
|
|
382
|
-
}
|
|
383
|
-
declare const $ZodUUID: $constructor<$ZodUUID>;
|
|
384
|
-
interface $ZodEmailInternals extends $ZodStringFormatInternals<"email"> {
|
|
385
|
-
}
|
|
386
|
-
interface $ZodEmail extends $ZodType {
|
|
387
|
-
_zod: $ZodEmailInternals;
|
|
388
|
-
}
|
|
389
|
-
declare const $ZodEmail: $constructor<$ZodEmail>;
|
|
390
|
-
interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
|
|
391
|
-
hostname?: RegExp | undefined;
|
|
392
|
-
protocol?: RegExp | undefined;
|
|
393
|
-
normalize?: boolean | undefined;
|
|
394
|
-
}
|
|
395
|
-
interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
|
|
396
|
-
def: $ZodURLDef;
|
|
397
|
-
}
|
|
398
|
-
interface $ZodURL extends $ZodType {
|
|
399
|
-
_zod: $ZodURLInternals;
|
|
400
|
-
}
|
|
401
|
-
declare const $ZodURL: $constructor<$ZodURL>;
|
|
402
|
-
interface $ZodEmojiInternals extends $ZodStringFormatInternals<"emoji"> {
|
|
403
|
-
}
|
|
404
|
-
interface $ZodEmoji extends $ZodType {
|
|
405
|
-
_zod: $ZodEmojiInternals;
|
|
406
|
-
}
|
|
407
|
-
declare const $ZodEmoji: $constructor<$ZodEmoji>;
|
|
408
|
-
interface $ZodNanoIDInternals extends $ZodStringFormatInternals<"nanoid"> {
|
|
409
|
-
}
|
|
410
|
-
interface $ZodNanoID extends $ZodType {
|
|
411
|
-
_zod: $ZodNanoIDInternals;
|
|
412
|
-
}
|
|
413
|
-
declare const $ZodNanoID: $constructor<$ZodNanoID>;
|
|
414
|
-
interface $ZodCUIDInternals extends $ZodStringFormatInternals<"cuid"> {
|
|
415
|
-
}
|
|
416
|
-
interface $ZodCUID extends $ZodType {
|
|
417
|
-
_zod: $ZodCUIDInternals;
|
|
418
|
-
}
|
|
419
|
-
declare const $ZodCUID: $constructor<$ZodCUID>;
|
|
420
|
-
interface $ZodCUID2Internals extends $ZodStringFormatInternals<"cuid2"> {
|
|
421
|
-
}
|
|
422
|
-
interface $ZodCUID2 extends $ZodType {
|
|
423
|
-
_zod: $ZodCUID2Internals;
|
|
424
|
-
}
|
|
425
|
-
declare const $ZodCUID2: $constructor<$ZodCUID2>;
|
|
426
|
-
interface $ZodULIDInternals extends $ZodStringFormatInternals<"ulid"> {
|
|
427
|
-
}
|
|
428
|
-
interface $ZodULID extends $ZodType {
|
|
429
|
-
_zod: $ZodULIDInternals;
|
|
430
|
-
}
|
|
431
|
-
declare const $ZodULID: $constructor<$ZodULID>;
|
|
432
|
-
interface $ZodXIDInternals extends $ZodStringFormatInternals<"xid"> {
|
|
433
|
-
}
|
|
434
|
-
interface $ZodXID extends $ZodType {
|
|
435
|
-
_zod: $ZodXIDInternals;
|
|
436
|
-
}
|
|
437
|
-
declare const $ZodXID: $constructor<$ZodXID>;
|
|
438
|
-
interface $ZodKSUIDInternals extends $ZodStringFormatInternals<"ksuid"> {
|
|
439
|
-
}
|
|
440
|
-
interface $ZodKSUID extends $ZodType {
|
|
441
|
-
_zod: $ZodKSUIDInternals;
|
|
442
|
-
}
|
|
443
|
-
declare const $ZodKSUID: $constructor<$ZodKSUID>;
|
|
444
|
-
interface $ZodISODateTimeDef extends $ZodStringFormatDef<"datetime"> {
|
|
445
|
-
precision: number | null;
|
|
446
|
-
offset: boolean;
|
|
447
|
-
local: boolean;
|
|
448
|
-
}
|
|
449
|
-
interface $ZodISODateTimeInternals extends $ZodStringFormatInternals {
|
|
450
|
-
def: $ZodISODateTimeDef;
|
|
451
|
-
}
|
|
452
|
-
interface $ZodISODateTime extends $ZodType {
|
|
453
|
-
_zod: $ZodISODateTimeInternals;
|
|
454
|
-
}
|
|
455
|
-
declare const $ZodISODateTime: $constructor<$ZodISODateTime>;
|
|
456
|
-
interface $ZodISODateInternals extends $ZodStringFormatInternals<"date"> {
|
|
457
|
-
}
|
|
458
|
-
interface $ZodISODate extends $ZodType {
|
|
459
|
-
_zod: $ZodISODateInternals;
|
|
460
|
-
}
|
|
461
|
-
declare const $ZodISODate: $constructor<$ZodISODate>;
|
|
462
|
-
interface $ZodISOTimeDef extends $ZodStringFormatDef<"time"> {
|
|
463
|
-
precision?: number | null;
|
|
464
|
-
}
|
|
465
|
-
interface $ZodISOTimeInternals extends $ZodStringFormatInternals<"time"> {
|
|
466
|
-
def: $ZodISOTimeDef;
|
|
467
|
-
}
|
|
468
|
-
interface $ZodISOTime extends $ZodType {
|
|
469
|
-
_zod: $ZodISOTimeInternals;
|
|
470
|
-
}
|
|
471
|
-
declare const $ZodISOTime: $constructor<$ZodISOTime>;
|
|
472
|
-
interface $ZodISODurationInternals extends $ZodStringFormatInternals<"duration"> {
|
|
473
|
-
}
|
|
474
|
-
interface $ZodISODuration extends $ZodType {
|
|
475
|
-
_zod: $ZodISODurationInternals;
|
|
476
|
-
}
|
|
477
|
-
declare const $ZodISODuration: $constructor<$ZodISODuration>;
|
|
478
|
-
interface $ZodIPv4Def extends $ZodStringFormatDef<"ipv4"> {
|
|
479
|
-
version?: "v4";
|
|
480
|
-
}
|
|
481
|
-
interface $ZodIPv4Internals extends $ZodStringFormatInternals<"ipv4"> {
|
|
482
|
-
def: $ZodIPv4Def;
|
|
483
|
-
}
|
|
484
|
-
interface $ZodIPv4 extends $ZodType {
|
|
485
|
-
_zod: $ZodIPv4Internals;
|
|
486
|
-
}
|
|
487
|
-
declare const $ZodIPv4: $constructor<$ZodIPv4>;
|
|
488
|
-
interface $ZodIPv6Def extends $ZodStringFormatDef<"ipv6"> {
|
|
489
|
-
version?: "v6";
|
|
490
|
-
}
|
|
491
|
-
interface $ZodIPv6Internals extends $ZodStringFormatInternals<"ipv6"> {
|
|
492
|
-
def: $ZodIPv6Def;
|
|
493
|
-
}
|
|
494
|
-
interface $ZodIPv6 extends $ZodType {
|
|
495
|
-
_zod: $ZodIPv6Internals;
|
|
496
|
-
}
|
|
497
|
-
declare const $ZodIPv6: $constructor<$ZodIPv6>;
|
|
498
|
-
interface $ZodCIDRv4Def extends $ZodStringFormatDef<"cidrv4"> {
|
|
499
|
-
version?: "v4";
|
|
500
|
-
}
|
|
501
|
-
interface $ZodCIDRv4Internals extends $ZodStringFormatInternals<"cidrv4"> {
|
|
502
|
-
def: $ZodCIDRv4Def;
|
|
503
|
-
}
|
|
504
|
-
interface $ZodCIDRv4 extends $ZodType {
|
|
505
|
-
_zod: $ZodCIDRv4Internals;
|
|
506
|
-
}
|
|
507
|
-
declare const $ZodCIDRv4: $constructor<$ZodCIDRv4>;
|
|
508
|
-
interface $ZodCIDRv6Def extends $ZodStringFormatDef<"cidrv6"> {
|
|
509
|
-
version?: "v6";
|
|
510
|
-
}
|
|
511
|
-
interface $ZodCIDRv6Internals extends $ZodStringFormatInternals<"cidrv6"> {
|
|
512
|
-
def: $ZodCIDRv6Def;
|
|
513
|
-
}
|
|
514
|
-
interface $ZodCIDRv6 extends $ZodType {
|
|
515
|
-
_zod: $ZodCIDRv6Internals;
|
|
516
|
-
}
|
|
517
|
-
declare const $ZodCIDRv6: $constructor<$ZodCIDRv6>;
|
|
518
|
-
interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64"> {
|
|
519
|
-
}
|
|
520
|
-
interface $ZodBase64 extends $ZodType {
|
|
521
|
-
_zod: $ZodBase64Internals;
|
|
522
|
-
}
|
|
523
|
-
declare const $ZodBase64: $constructor<$ZodBase64>;
|
|
524
|
-
interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> {
|
|
525
|
-
}
|
|
526
|
-
interface $ZodBase64URL extends $ZodType {
|
|
527
|
-
_zod: $ZodBase64URLInternals;
|
|
528
|
-
}
|
|
529
|
-
declare const $ZodBase64URL: $constructor<$ZodBase64URL>;
|
|
530
|
-
interface $ZodE164Internals extends $ZodStringFormatInternals<"e164"> {
|
|
531
|
-
}
|
|
532
|
-
interface $ZodE164 extends $ZodType {
|
|
533
|
-
_zod: $ZodE164Internals;
|
|
534
|
-
}
|
|
535
|
-
declare const $ZodE164: $constructor<$ZodE164>;
|
|
536
|
-
interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
|
|
537
|
-
alg?: JWTAlgorithm | undefined;
|
|
538
|
-
}
|
|
539
|
-
interface $ZodJWTInternals extends $ZodStringFormatInternals<"jwt"> {
|
|
540
|
-
def: $ZodJWTDef;
|
|
541
|
-
}
|
|
542
|
-
interface $ZodJWT extends $ZodType {
|
|
543
|
-
_zod: $ZodJWTInternals;
|
|
544
|
-
}
|
|
545
|
-
declare const $ZodJWT: $constructor<$ZodJWT>;
|
|
546
|
-
interface $ZodArrayDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
547
|
-
type: "array";
|
|
548
|
-
element: T;
|
|
549
|
-
}
|
|
550
|
-
interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInternals {
|
|
551
|
-
def: $ZodArrayDef<T>;
|
|
552
|
-
isst: $ZodIssueInvalidType;
|
|
553
|
-
output: output<T>[];
|
|
554
|
-
input: input<T>[];
|
|
555
|
-
}
|
|
556
|
-
interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {
|
|
557
|
-
}
|
|
558
|
-
declare const $ZodArray: $constructor<$ZodArray>;
|
|
559
|
-
type OptionalOutSchema = {
|
|
560
|
-
_zod: {
|
|
561
|
-
optout: "optional";
|
|
562
|
-
};
|
|
563
|
-
};
|
|
564
|
-
type OptionalInSchema = {
|
|
565
|
-
_zod: {
|
|
566
|
-
optin: "optional";
|
|
567
|
-
};
|
|
568
|
-
};
|
|
569
|
-
type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{
|
|
570
|
-
-readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"];
|
|
571
|
-
} & {
|
|
572
|
-
-readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"];
|
|
573
|
-
} & Extra>;
|
|
574
|
-
type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{
|
|
575
|
-
-readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"];
|
|
576
|
-
} & {
|
|
577
|
-
-readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"];
|
|
578
|
-
} & Extra>;
|
|
579
|
-
type $ZodObjectConfig = {
|
|
580
|
-
out: Record<string, unknown>;
|
|
581
|
-
in: Record<string, unknown>;
|
|
582
|
-
};
|
|
583
|
-
type $loose = {
|
|
584
|
-
out: Record<string, unknown>;
|
|
585
|
-
in: Record<string, unknown>;
|
|
586
|
-
};
|
|
587
|
-
type $strict = {
|
|
588
|
-
out: {};
|
|
589
|
-
in: {};
|
|
590
|
-
};
|
|
591
|
-
type $strip = {
|
|
592
|
-
out: {};
|
|
593
|
-
in: {};
|
|
594
|
-
};
|
|
595
|
-
type $catchall<T extends SomeType> = {
|
|
596
|
-
out: {
|
|
597
|
-
[k: string]: output<T>;
|
|
598
|
-
};
|
|
599
|
-
in: {
|
|
600
|
-
[k: string]: input<T>;
|
|
601
|
-
};
|
|
602
|
-
};
|
|
603
|
-
type $ZodShape = Readonly<{
|
|
604
|
-
[k: string]: $ZodType;
|
|
605
|
-
}>;
|
|
606
|
-
interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
|
|
607
|
-
type: "object";
|
|
608
|
-
shape: Shape;
|
|
609
|
-
catchall?: $ZodType | undefined;
|
|
610
|
-
}
|
|
611
|
-
interface $ZodObjectInternals<
|
|
612
|
-
/** @ts-ignore Cast variance */
|
|
613
|
-
out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
|
|
614
|
-
def: $ZodObjectDef<Shape>;
|
|
615
|
-
config: Config;
|
|
616
|
-
isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
|
|
617
|
-
propValues: PropValues;
|
|
618
|
-
output: $InferObjectOutput<Shape, Config["out"]>;
|
|
619
|
-
input: $InferObjectInput<Shape, Config["in"]>;
|
|
620
|
-
optin?: "optional" | undefined;
|
|
621
|
-
optout?: "optional" | undefined;
|
|
622
|
-
}
|
|
623
|
-
type $ZodLooseShape = Record<string, any>;
|
|
624
|
-
interface $ZodObject<
|
|
625
|
-
/** @ts-ignore Cast variance */
|
|
626
|
-
out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {
|
|
627
|
-
"~standard": $ZodStandardSchema<this>;
|
|
628
|
-
}
|
|
629
|
-
declare const $ZodObject: $constructor<$ZodObject>;
|
|
630
|
-
type $InferUnionOutput<T extends SomeType> = T extends any ? output<T> : never;
|
|
631
|
-
type $InferUnionInput<T extends SomeType> = T extends any ? input<T> : never;
|
|
632
|
-
interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
|
|
633
|
-
type: "union";
|
|
634
|
-
options: Options;
|
|
635
|
-
}
|
|
636
|
-
type IsOptionalIn<T extends SomeType> = T extends OptionalInSchema ? true : false;
|
|
637
|
-
type IsOptionalOut<T extends SomeType> = T extends OptionalOutSchema ? true : false;
|
|
638
|
-
interface $ZodUnionInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends _$ZodTypeInternals {
|
|
639
|
-
def: $ZodUnionDef<T>;
|
|
640
|
-
isst: $ZodIssueInvalidUnion;
|
|
641
|
-
pattern: T[number]["_zod"]["pattern"];
|
|
642
|
-
values: T[number]["_zod"]["values"];
|
|
643
|
-
output: $InferUnionOutput<T[number]>;
|
|
644
|
-
input: $InferUnionInput<T[number]>;
|
|
645
|
-
optin: IsOptionalIn<T[number]> extends false ? "optional" | undefined : "optional";
|
|
646
|
-
optout: IsOptionalOut<T[number]> extends false ? "optional" | undefined : "optional";
|
|
647
|
-
}
|
|
648
|
-
interface $ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodUnionInternals<T>> {
|
|
649
|
-
_zod: $ZodUnionInternals<T>;
|
|
650
|
-
}
|
|
651
|
-
declare const $ZodUnion: $constructor<$ZodUnion>;
|
|
652
|
-
interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
653
|
-
type: "intersection";
|
|
654
|
-
left: Left;
|
|
655
|
-
right: Right;
|
|
656
|
-
}
|
|
657
|
-
interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _$ZodTypeInternals {
|
|
658
|
-
def: $ZodIntersectionDef<A, B>;
|
|
659
|
-
isst: never;
|
|
660
|
-
optin: A["_zod"]["optin"] | B["_zod"]["optin"];
|
|
661
|
-
optout: A["_zod"]["optout"] | B["_zod"]["optout"];
|
|
662
|
-
output: output<A> & output<B>;
|
|
663
|
-
input: input<A> & input<B>;
|
|
664
|
-
}
|
|
665
|
-
interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
|
|
666
|
-
_zod: $ZodIntersectionInternals<A, B>;
|
|
667
|
-
}
|
|
668
|
-
declare const $ZodIntersection: $constructor<$ZodIntersection>;
|
|
669
|
-
type $ZodRecordKey = $ZodType<string | number | symbol, string | number | symbol>;
|
|
670
|
-
interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
671
|
-
type: "record";
|
|
672
|
-
keyType: Key;
|
|
673
|
-
valueType: Value;
|
|
674
|
-
}
|
|
675
|
-
type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output<Key>, output<Value>>> : Record<output<Key>, output<Value>>;
|
|
676
|
-
type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input<Key>, input<Value>>> : Record<input<Key>, input<Value>>;
|
|
677
|
-
interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
|
|
678
|
-
def: $ZodRecordDef<Key, Value>;
|
|
679
|
-
isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
|
|
680
|
-
optin?: "optional" | undefined;
|
|
681
|
-
optout?: "optional" | undefined;
|
|
682
|
-
}
|
|
683
|
-
type $partial = {
|
|
684
|
-
"~~partial": true;
|
|
685
|
-
};
|
|
686
|
-
interface $ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodType {
|
|
687
|
-
_zod: $ZodRecordInternals<Key, Value>;
|
|
688
|
-
}
|
|
689
|
-
declare const $ZodRecord: $constructor<$ZodRecord>;
|
|
690
|
-
type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
|
|
691
|
-
type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
|
|
692
|
-
interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
|
|
693
|
-
type: "enum";
|
|
694
|
-
entries: T;
|
|
695
|
-
}
|
|
696
|
-
interface $ZodEnumInternals<
|
|
697
|
-
/** @ts-ignore Cast variance */
|
|
698
|
-
out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
|
|
699
|
-
def: $ZodEnumDef<T>;
|
|
700
|
-
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
701
|
-
values: PrimitiveSet;
|
|
702
|
-
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
703
|
-
pattern: RegExp;
|
|
704
|
-
isst: $ZodIssueInvalidValue;
|
|
705
|
-
}
|
|
706
|
-
interface $ZodEnum<T extends EnumLike = EnumLike> extends $ZodType {
|
|
707
|
-
_zod: $ZodEnumInternals<T>;
|
|
708
|
-
}
|
|
709
|
-
declare const $ZodEnum: $constructor<$ZodEnum>;
|
|
710
|
-
interface $ZodTransformDef extends $ZodTypeDef {
|
|
711
|
-
type: "transform";
|
|
712
|
-
transform: (input: unknown, payload: ParsePayload<unknown>) => MaybeAsync<unknown>;
|
|
713
|
-
}
|
|
714
|
-
interface $ZodTransformInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I> {
|
|
715
|
-
def: $ZodTransformDef;
|
|
716
|
-
isst: never;
|
|
717
|
-
}
|
|
718
|
-
interface $ZodTransform<O = unknown, I = unknown> extends $ZodType {
|
|
719
|
-
_zod: $ZodTransformInternals<O, I>;
|
|
720
|
-
}
|
|
721
|
-
declare const $ZodTransform: $constructor<$ZodTransform>;
|
|
722
|
-
interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
723
|
-
type: "optional";
|
|
724
|
-
innerType: T;
|
|
725
|
-
}
|
|
726
|
-
interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | undefined, input<T> | undefined> {
|
|
727
|
-
def: $ZodOptionalDef<T>;
|
|
728
|
-
optin: "optional";
|
|
729
|
-
optout: "optional";
|
|
730
|
-
isst: never;
|
|
731
|
-
values: T["_zod"]["values"];
|
|
732
|
-
pattern: T["_zod"]["pattern"];
|
|
733
|
-
}
|
|
734
|
-
interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
735
|
-
_zod: $ZodOptionalInternals<T>;
|
|
736
|
-
}
|
|
737
|
-
declare const $ZodOptional: $constructor<$ZodOptional>;
|
|
738
|
-
interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
739
|
-
type: "nullable";
|
|
740
|
-
innerType: T;
|
|
741
|
-
}
|
|
742
|
-
interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | null, input<T> | null> {
|
|
743
|
-
def: $ZodNullableDef<T>;
|
|
744
|
-
optin: T["_zod"]["optin"];
|
|
745
|
-
optout: T["_zod"]["optout"];
|
|
746
|
-
isst: never;
|
|
747
|
-
values: T["_zod"]["values"];
|
|
748
|
-
pattern: T["_zod"]["pattern"];
|
|
749
|
-
}
|
|
750
|
-
interface $ZodNullable<T extends SomeType = $ZodType> extends $ZodType {
|
|
751
|
-
_zod: $ZodNullableInternals<T>;
|
|
752
|
-
}
|
|
753
|
-
declare const $ZodNullable: $constructor<$ZodNullable>;
|
|
754
|
-
interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
755
|
-
type: "default";
|
|
756
|
-
innerType: T;
|
|
757
|
-
/** The default value. May be a getter. */
|
|
758
|
-
defaultValue: NoUndefined<output<T>>;
|
|
759
|
-
}
|
|
760
|
-
interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
|
|
761
|
-
def: $ZodDefaultDef<T>;
|
|
762
|
-
optin: "optional";
|
|
763
|
-
optout?: "optional" | undefined;
|
|
764
|
-
isst: never;
|
|
765
|
-
values: T["_zod"]["values"];
|
|
766
|
-
}
|
|
767
|
-
interface $ZodDefault<T extends SomeType = $ZodType> extends $ZodType {
|
|
768
|
-
_zod: $ZodDefaultInternals<T>;
|
|
769
|
-
}
|
|
770
|
-
declare const $ZodDefault: $constructor<$ZodDefault>;
|
|
771
|
-
interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
772
|
-
type: "prefault";
|
|
773
|
-
innerType: T;
|
|
774
|
-
/** The default value. May be a getter. */
|
|
775
|
-
defaultValue: input<T>;
|
|
776
|
-
}
|
|
777
|
-
interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
|
|
778
|
-
def: $ZodPrefaultDef<T>;
|
|
779
|
-
optin: "optional";
|
|
780
|
-
optout?: "optional" | undefined;
|
|
781
|
-
isst: never;
|
|
782
|
-
values: T["_zod"]["values"];
|
|
783
|
-
}
|
|
784
|
-
interface $ZodPrefault<T extends SomeType = $ZodType> extends $ZodType {
|
|
785
|
-
_zod: $ZodPrefaultInternals<T>;
|
|
786
|
-
}
|
|
787
|
-
declare const $ZodPrefault: $constructor<$ZodPrefault>;
|
|
788
|
-
interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
789
|
-
type: "nonoptional";
|
|
790
|
-
innerType: T;
|
|
791
|
-
}
|
|
792
|
-
interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, NoUndefined<input<T>>> {
|
|
793
|
-
def: $ZodNonOptionalDef<T>;
|
|
794
|
-
isst: $ZodIssueInvalidType;
|
|
795
|
-
values: T["_zod"]["values"];
|
|
796
|
-
optin: "optional" | undefined;
|
|
797
|
-
optout: "optional" | undefined;
|
|
798
|
-
}
|
|
799
|
-
interface $ZodNonOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
800
|
-
_zod: $ZodNonOptionalInternals<T>;
|
|
801
|
-
}
|
|
802
|
-
declare const $ZodNonOptional: $constructor<$ZodNonOptional>;
|
|
803
|
-
interface $ZodCatchCtx extends ParsePayload {
|
|
804
|
-
/** @deprecated Use `ctx.issues` */
|
|
805
|
-
error: {
|
|
806
|
-
issues: $ZodIssue[];
|
|
807
|
-
};
|
|
808
|
-
/** @deprecated Use `ctx.value` */
|
|
809
|
-
input: unknown;
|
|
810
|
-
}
|
|
811
|
-
interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
812
|
-
type: "catch";
|
|
813
|
-
innerType: T;
|
|
814
|
-
catchValue: (ctx: $ZodCatchCtx) => unknown;
|
|
815
|
-
}
|
|
816
|
-
interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
|
|
817
|
-
def: $ZodCatchDef<T>;
|
|
818
|
-
optin: T["_zod"]["optin"];
|
|
819
|
-
optout: T["_zod"]["optout"];
|
|
820
|
-
isst: never;
|
|
821
|
-
values: T["_zod"]["values"];
|
|
822
|
-
}
|
|
823
|
-
interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
|
|
824
|
-
_zod: $ZodCatchInternals<T>;
|
|
825
|
-
}
|
|
826
|
-
declare const $ZodCatch: $constructor<$ZodCatch>;
|
|
827
|
-
interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
828
|
-
type: "pipe";
|
|
829
|
-
in: A;
|
|
830
|
-
out: B;
|
|
831
|
-
}
|
|
832
|
-
interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output<B>, input<A>> {
|
|
833
|
-
def: $ZodPipeDef<A, B>;
|
|
834
|
-
isst: never;
|
|
835
|
-
values: A["_zod"]["values"];
|
|
836
|
-
optin: A["_zod"]["optin"];
|
|
837
|
-
optout: B["_zod"]["optout"];
|
|
838
|
-
propValues: A["_zod"]["propValues"];
|
|
839
|
-
}
|
|
840
|
-
interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
|
|
841
|
-
_zod: $ZodPipeInternals<A, B>;
|
|
842
|
-
}
|
|
843
|
-
declare const $ZodPipe: $constructor<$ZodPipe>;
|
|
844
|
-
interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
845
|
-
type: "readonly";
|
|
846
|
-
innerType: T;
|
|
847
|
-
}
|
|
848
|
-
interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output<T>>, MakeReadonly<input<T>>> {
|
|
849
|
-
def: $ZodReadonlyDef<T>;
|
|
850
|
-
optin: T["_zod"]["optin"];
|
|
851
|
-
optout: T["_zod"]["optout"];
|
|
852
|
-
isst: never;
|
|
853
|
-
propValues: T["_zod"]["propValues"];
|
|
854
|
-
values: T["_zod"]["values"];
|
|
855
|
-
}
|
|
856
|
-
interface $ZodReadonly<T extends SomeType = $ZodType> extends $ZodType {
|
|
857
|
-
_zod: $ZodReadonlyInternals<T>;
|
|
858
|
-
}
|
|
859
|
-
declare const $ZodReadonly: $constructor<$ZodReadonly>;
|
|
860
|
-
interface $ZodCustomDef<O = unknown> extends $ZodTypeDef, $ZodCheckDef {
|
|
861
|
-
type: "custom";
|
|
862
|
-
check: "custom";
|
|
863
|
-
path?: PropertyKey[] | undefined;
|
|
864
|
-
error?: $ZodErrorMap | undefined;
|
|
865
|
-
params?: Record<string, any> | undefined;
|
|
866
|
-
fn: (arg: O) => unknown;
|
|
867
|
-
}
|
|
868
|
-
interface $ZodCustomInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I>, $ZodCheckInternals<O> {
|
|
869
|
-
def: $ZodCustomDef;
|
|
870
|
-
issc: $ZodIssue;
|
|
871
|
-
isst: never;
|
|
872
|
-
bag: LoosePartial<{
|
|
873
|
-
Class: typeof Class;
|
|
874
|
-
}>;
|
|
875
|
-
}
|
|
876
|
-
interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
|
|
877
|
-
_zod: $ZodCustomInternals<O, I>;
|
|
878
|
-
}
|
|
879
|
-
declare const $ZodCustom: $constructor<$ZodCustom>;
|
|
880
|
-
|
|
881
|
-
interface $ZodCheckDef {
|
|
882
|
-
check: string;
|
|
883
|
-
error?: $ZodErrorMap<never> | undefined;
|
|
884
|
-
/** If true, no later checks will be executed if this check fails. Default `false`. */
|
|
885
|
-
abort?: boolean | undefined;
|
|
886
|
-
/** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */
|
|
887
|
-
when?: ((payload: ParsePayload) => boolean) | undefined;
|
|
888
|
-
}
|
|
889
|
-
interface $ZodCheckInternals<T> {
|
|
890
|
-
def: $ZodCheckDef;
|
|
891
|
-
/** The set of issues this check might throw. */
|
|
892
|
-
issc?: $ZodIssueBase;
|
|
893
|
-
check(payload: ParsePayload<T>): MaybeAsync<void>;
|
|
894
|
-
onattach: ((schema: $ZodType) => void)[];
|
|
895
|
-
}
|
|
896
|
-
interface $ZodCheck<in T = never> {
|
|
897
|
-
_zod: $ZodCheckInternals<T>;
|
|
898
|
-
}
|
|
899
|
-
declare const $ZodCheck: $constructor<$ZodCheck<any>>;
|
|
900
|
-
interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
|
|
901
|
-
check: "max_length";
|
|
902
|
-
maximum: number;
|
|
903
|
-
}
|
|
904
|
-
interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
905
|
-
def: $ZodCheckMaxLengthDef;
|
|
906
|
-
issc: $ZodIssueTooBig<T>;
|
|
907
|
-
}
|
|
908
|
-
interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
909
|
-
_zod: $ZodCheckMaxLengthInternals<T>;
|
|
910
|
-
}
|
|
911
|
-
declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
|
|
912
|
-
interface $ZodCheckMinLengthDef extends $ZodCheckDef {
|
|
913
|
-
check: "min_length";
|
|
914
|
-
minimum: number;
|
|
915
|
-
}
|
|
916
|
-
interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
917
|
-
def: $ZodCheckMinLengthDef;
|
|
918
|
-
issc: $ZodIssueTooSmall<T>;
|
|
919
|
-
}
|
|
920
|
-
interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
921
|
-
_zod: $ZodCheckMinLengthInternals<T>;
|
|
922
|
-
}
|
|
923
|
-
declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
|
|
924
|
-
interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
|
|
925
|
-
check: "length_equals";
|
|
926
|
-
length: number;
|
|
927
|
-
}
|
|
928
|
-
interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
929
|
-
def: $ZodCheckLengthEqualsDef;
|
|
930
|
-
issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
|
|
931
|
-
}
|
|
932
|
-
interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
933
|
-
_zod: $ZodCheckLengthEqualsInternals<T>;
|
|
934
|
-
}
|
|
935
|
-
declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
|
|
936
|
-
type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
|
|
937
|
-
interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
|
|
938
|
-
check: "string_format";
|
|
939
|
-
format: Format;
|
|
940
|
-
pattern?: RegExp | undefined;
|
|
941
|
-
}
|
|
942
|
-
interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
|
|
943
|
-
def: $ZodCheckStringFormatDef;
|
|
944
|
-
issc: $ZodIssueInvalidStringFormat;
|
|
945
|
-
}
|
|
946
|
-
interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
|
|
947
|
-
format: "regex";
|
|
948
|
-
pattern: RegExp;
|
|
949
|
-
}
|
|
950
|
-
interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
|
|
951
|
-
def: $ZodCheckRegexDef;
|
|
952
|
-
issc: $ZodIssueInvalidStringFormat;
|
|
953
|
-
}
|
|
954
|
-
interface $ZodCheckRegex extends $ZodCheck<string> {
|
|
955
|
-
_zod: $ZodCheckRegexInternals;
|
|
956
|
-
}
|
|
957
|
-
declare const $ZodCheckRegex: $constructor<$ZodCheckRegex>;
|
|
958
|
-
interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {
|
|
959
|
-
}
|
|
960
|
-
interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
|
|
961
|
-
def: $ZodCheckLowerCaseDef;
|
|
962
|
-
issc: $ZodIssueInvalidStringFormat;
|
|
963
|
-
}
|
|
964
|
-
interface $ZodCheckLowerCase extends $ZodCheck<string> {
|
|
965
|
-
_zod: $ZodCheckLowerCaseInternals;
|
|
966
|
-
}
|
|
967
|
-
declare const $ZodCheckLowerCase: $constructor<$ZodCheckLowerCase>;
|
|
968
|
-
interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {
|
|
969
|
-
}
|
|
970
|
-
interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
|
|
971
|
-
def: $ZodCheckUpperCaseDef;
|
|
972
|
-
issc: $ZodIssueInvalidStringFormat;
|
|
973
|
-
}
|
|
974
|
-
interface $ZodCheckUpperCase extends $ZodCheck<string> {
|
|
975
|
-
_zod: $ZodCheckUpperCaseInternals;
|
|
976
|
-
}
|
|
977
|
-
declare const $ZodCheckUpperCase: $constructor<$ZodCheckUpperCase>;
|
|
978
|
-
interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
|
|
979
|
-
includes: string;
|
|
980
|
-
position?: number | undefined;
|
|
981
|
-
}
|
|
982
|
-
interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
|
|
983
|
-
def: $ZodCheckIncludesDef;
|
|
984
|
-
issc: $ZodIssueInvalidStringFormat;
|
|
985
|
-
}
|
|
986
|
-
interface $ZodCheckIncludes extends $ZodCheck<string> {
|
|
987
|
-
_zod: $ZodCheckIncludesInternals;
|
|
988
|
-
}
|
|
989
|
-
declare const $ZodCheckIncludes: $constructor<$ZodCheckIncludes>;
|
|
990
|
-
interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
|
|
991
|
-
prefix: string;
|
|
992
|
-
}
|
|
993
|
-
interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
|
|
994
|
-
def: $ZodCheckStartsWithDef;
|
|
995
|
-
issc: $ZodIssueInvalidStringFormat;
|
|
996
|
-
}
|
|
997
|
-
interface $ZodCheckStartsWith extends $ZodCheck<string> {
|
|
998
|
-
_zod: $ZodCheckStartsWithInternals;
|
|
999
|
-
}
|
|
1000
|
-
declare const $ZodCheckStartsWith: $constructor<$ZodCheckStartsWith>;
|
|
1001
|
-
interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
|
|
1002
|
-
suffix: string;
|
|
1003
|
-
}
|
|
1004
|
-
interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
|
|
1005
|
-
def: $ZodCheckEndsWithDef;
|
|
1006
|
-
issc: $ZodIssueInvalidStringFormat;
|
|
1007
|
-
}
|
|
1008
|
-
interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
|
|
1009
|
-
_zod: $ZodCheckEndsWithInternals;
|
|
1010
|
-
}
|
|
1011
|
-
declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>;
|
|
1012
|
-
|
|
1013
|
-
interface $ZodIssueBase {
|
|
1014
|
-
readonly code?: string;
|
|
1015
|
-
readonly input?: unknown;
|
|
1016
|
-
readonly path: PropertyKey[];
|
|
1017
|
-
readonly message: string;
|
|
1018
|
-
}
|
|
1019
|
-
interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
|
|
1020
|
-
readonly code: "invalid_type";
|
|
1021
|
-
readonly expected: $ZodType["_zod"]["def"]["type"];
|
|
1022
|
-
readonly input?: Input;
|
|
1023
|
-
}
|
|
1024
|
-
interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
|
|
1025
|
-
readonly code: "too_big";
|
|
1026
|
-
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
|
|
1027
|
-
readonly maximum: number | bigint;
|
|
1028
|
-
readonly inclusive?: boolean;
|
|
1029
|
-
readonly exact?: boolean;
|
|
1030
|
-
readonly input?: Input;
|
|
1031
|
-
}
|
|
1032
|
-
interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
|
|
1033
|
-
readonly code: "too_small";
|
|
1034
|
-
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
|
|
1035
|
-
readonly minimum: number | bigint;
|
|
1036
|
-
/** True if the allowable range includes the minimum */
|
|
1037
|
-
readonly inclusive?: boolean;
|
|
1038
|
-
/** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
|
|
1039
|
-
readonly exact?: boolean;
|
|
1040
|
-
readonly input?: Input;
|
|
1041
|
-
}
|
|
1042
|
-
interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
|
|
1043
|
-
readonly code: "invalid_format";
|
|
1044
|
-
readonly format: $ZodStringFormats | (string & {});
|
|
1045
|
-
readonly pattern?: string;
|
|
1046
|
-
readonly input?: string;
|
|
1047
|
-
}
|
|
1048
|
-
interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
|
|
1049
|
-
readonly code: "not_multiple_of";
|
|
1050
|
-
readonly divisor: number;
|
|
1051
|
-
readonly input?: Input;
|
|
1052
|
-
}
|
|
1053
|
-
interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
|
|
1054
|
-
readonly code: "unrecognized_keys";
|
|
1055
|
-
readonly keys: string[];
|
|
1056
|
-
readonly input?: Record<string, unknown>;
|
|
1057
|
-
}
|
|
1058
|
-
interface $ZodIssueInvalidUnion extends $ZodIssueBase {
|
|
1059
|
-
readonly code: "invalid_union";
|
|
1060
|
-
readonly errors: $ZodIssue[][];
|
|
1061
|
-
readonly input?: unknown;
|
|
1062
|
-
readonly discriminator?: string | undefined;
|
|
1063
|
-
}
|
|
1064
|
-
interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
|
|
1065
|
-
readonly code: "invalid_key";
|
|
1066
|
-
readonly origin: "map" | "record";
|
|
1067
|
-
readonly issues: $ZodIssue[];
|
|
1068
|
-
readonly input?: Input;
|
|
1069
|
-
}
|
|
1070
|
-
interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
|
|
1071
|
-
readonly code: "invalid_element";
|
|
1072
|
-
readonly origin: "map" | "set";
|
|
1073
|
-
readonly key: unknown;
|
|
1074
|
-
readonly issues: $ZodIssue[];
|
|
1075
|
-
readonly input?: Input;
|
|
1076
|
-
}
|
|
1077
|
-
interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
|
|
1078
|
-
readonly code: "invalid_value";
|
|
1079
|
-
readonly values: Primitive[];
|
|
1080
|
-
readonly input?: Input;
|
|
1081
|
-
}
|
|
1082
|
-
interface $ZodIssueCustom extends $ZodIssueBase {
|
|
1083
|
-
readonly code: "custom";
|
|
1084
|
-
readonly params?: Record<string, any> | undefined;
|
|
1085
|
-
readonly input?: unknown;
|
|
1086
|
-
}
|
|
1087
|
-
type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
|
|
1088
|
-
type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue$1<T> : never;
|
|
1089
|
-
type RawIssue$1<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
|
|
1090
|
-
/** The input data */
|
|
1091
|
-
readonly input: unknown;
|
|
1092
|
-
/** The schema or check that originated this issue. */
|
|
1093
|
-
readonly inst?: $ZodType | $ZodCheck;
|
|
1094
|
-
/** If `true`, Zod will continue executing checks/refinements after this issue. */
|
|
1095
|
-
readonly continue?: boolean | undefined;
|
|
1096
|
-
} & Record<string, unknown>> : never;
|
|
1097
|
-
type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
|
|
1098
|
-
interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
|
|
1099
|
-
(issue: $ZodRawIssue<T>): {
|
|
1100
|
-
message: string;
|
|
1101
|
-
} | string | undefined | null;
|
|
1102
|
-
}
|
|
1103
|
-
interface $ZodError<T = unknown> extends Error {
|
|
1104
|
-
type: T;
|
|
1105
|
-
issues: $ZodIssue[];
|
|
1106
|
-
_zod: {
|
|
1107
|
-
output: T;
|
|
1108
|
-
def: $ZodIssue[];
|
|
1109
|
-
};
|
|
1110
|
-
stack?: string;
|
|
1111
|
-
name: string;
|
|
1112
|
-
}
|
|
1113
|
-
declare const $ZodError: $constructor<$ZodError>;
|
|
1114
|
-
type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
|
|
1115
|
-
type _FlattenedError<T, U = string> = {
|
|
1116
|
-
formErrors: U[];
|
|
1117
|
-
fieldErrors: {
|
|
1118
|
-
[P in keyof T]?: U[];
|
|
1119
|
-
};
|
|
1120
|
-
};
|
|
1121
|
-
type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? {
|
|
1122
|
-
[K in keyof T]?: $ZodFormattedError<T[K], U>;
|
|
1123
|
-
} : T extends any[] ? {
|
|
1124
|
-
[k: number]: $ZodFormattedError<T[number], U>;
|
|
1125
|
-
} : T extends object ? Flatten<{
|
|
1126
|
-
[K in keyof T]?: $ZodFormattedError<T[K], U>;
|
|
1127
|
-
}> : any;
|
|
1128
|
-
type $ZodFormattedError<T, U = string> = {
|
|
1129
|
-
_errors: U[];
|
|
1130
|
-
} & Flatten<_ZodFormattedError<T, U>>;
|
|
1131
|
-
|
|
1132
|
-
type ZodTrait = {
|
|
1133
|
-
_zod: {
|
|
1134
|
-
def: any;
|
|
1135
|
-
[k: string]: any;
|
|
1136
|
-
};
|
|
1137
|
-
};
|
|
1138
|
-
interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
|
|
1139
|
-
new (def: D): T;
|
|
1140
|
-
init(inst: T, def: D): asserts inst is T;
|
|
1141
|
-
}
|
|
1142
|
-
declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void, params?: {
|
|
1143
|
-
Parent?: typeof Class;
|
|
1144
|
-
}): $constructor<T, D>;
|
|
1145
|
-
declare const $brand: unique symbol;
|
|
1146
|
-
type $brand<T extends string | number | symbol = string | number | symbol> = {
|
|
1147
|
-
[$brand]: {
|
|
1148
|
-
[k in T]: true;
|
|
1149
|
-
};
|
|
1150
|
-
};
|
|
1151
|
-
type $ZodBranded<T extends SomeType, Brand extends string | number | symbol> = T & Record<"_zod", Record<"output", output<T> & $brand<Brand>>>;
|
|
1152
|
-
type input<T> = T extends {
|
|
1153
|
-
_zod: {
|
|
1154
|
-
input: any;
|
|
1155
|
-
};
|
|
1156
|
-
} ? T["_zod"]["input"] : unknown;
|
|
1157
|
-
type output<T> = T extends {
|
|
1158
|
-
_zod: {
|
|
1159
|
-
output: any;
|
|
1160
|
-
};
|
|
1161
|
-
} ? T["_zod"]["output"] : unknown;
|
|
1162
|
-
|
|
1163
|
-
declare const $output: unique symbol;
|
|
1164
|
-
type $output = typeof $output;
|
|
1165
|
-
declare const $input: unique symbol;
|
|
1166
|
-
type $input = typeof $input;
|
|
1167
|
-
type $replace<Meta, S extends $ZodType> = Meta extends $output ? output<S> : Meta extends $input ? input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends (...args: infer P) => infer R ? (...args: {
|
|
1168
|
-
[K in keyof P]: $replace<P[K], S>;
|
|
1169
|
-
}) => $replace<R, S> : Meta extends object ? {
|
|
1170
|
-
[K in keyof Meta]: $replace<Meta[K], S>;
|
|
1171
|
-
} : Meta;
|
|
1172
|
-
type MetadataType = object | undefined;
|
|
1173
|
-
declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
|
|
1174
|
-
_meta: Meta;
|
|
1175
|
-
_schema: Schema;
|
|
1176
|
-
_map: Map<Schema, $replace<Meta, Schema>>;
|
|
1177
|
-
_idmap: Map<string, Schema>;
|
|
1178
|
-
add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
|
|
1179
|
-
clear(): this;
|
|
1180
|
-
remove(schema: Schema): this;
|
|
1181
|
-
get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
|
|
1182
|
-
has(schema: Schema): boolean;
|
|
1183
|
-
}
|
|
1184
|
-
interface JSONSchemaMeta {
|
|
1185
|
-
id?: string | undefined;
|
|
1186
|
-
title?: string | undefined;
|
|
1187
|
-
description?: string | undefined;
|
|
1188
|
-
deprecated?: boolean | undefined;
|
|
1189
|
-
[k: string]: unknown;
|
|
1190
|
-
}
|
|
1191
|
-
interface GlobalMeta extends JSONSchemaMeta {
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
type Params<T extends $ZodType | $ZodCheck, IssueTypes extends $ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never> = Flatten<Partial<EmptyToNever<Omit<T["_zod"]["def"], OmitKeys> & ([IssueTypes] extends [never] ? {} : {
|
|
1195
|
-
error?: string | $ZodErrorMap<IssueTypes> | undefined;
|
|
1196
|
-
/** @deprecated This parameter is deprecated. Use `error` instead. */
|
|
1197
|
-
message?: string | undefined;
|
|
1198
|
-
})>>>;
|
|
1199
|
-
type TypeParams<T extends $ZodType = $ZodType & {
|
|
1200
|
-
_isst: never;
|
|
1201
|
-
}, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
|
|
1202
|
-
type CheckParams<T extends $ZodCheck = $ZodCheck, // & { _issc: never },
|
|
1203
|
-
AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
|
|
1204
|
-
type CheckStringFormatParams<T extends $ZodStringFormat = $ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
|
|
1205
|
-
type CheckTypeParams<T extends $ZodType & $ZodCheck = $ZodType & $ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
|
|
1206
|
-
type $ZodCheckEmailParams = CheckStringFormatParams<$ZodEmail, "when">;
|
|
1207
|
-
type $ZodCheckGUIDParams = CheckStringFormatParams<$ZodGUID, "pattern" | "when">;
|
|
1208
|
-
type $ZodCheckUUIDParams = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
|
|
1209
|
-
type $ZodCheckURLParams = CheckStringFormatParams<$ZodURL, "when">;
|
|
1210
|
-
type $ZodCheckEmojiParams = CheckStringFormatParams<$ZodEmoji, "when">;
|
|
1211
|
-
type $ZodCheckNanoIDParams = CheckStringFormatParams<$ZodNanoID, "when">;
|
|
1212
|
-
type $ZodCheckCUIDParams = CheckStringFormatParams<$ZodCUID, "when">;
|
|
1213
|
-
type $ZodCheckCUID2Params = CheckStringFormatParams<$ZodCUID2, "when">;
|
|
1214
|
-
type $ZodCheckULIDParams = CheckStringFormatParams<$ZodULID, "when">;
|
|
1215
|
-
type $ZodCheckXIDParams = CheckStringFormatParams<$ZodXID, "when">;
|
|
1216
|
-
type $ZodCheckKSUIDParams = CheckStringFormatParams<$ZodKSUID, "when">;
|
|
1217
|
-
type $ZodCheckIPv4Params = CheckStringFormatParams<$ZodIPv4, "pattern" | "when" | "version">;
|
|
1218
|
-
type $ZodCheckIPv6Params = CheckStringFormatParams<$ZodIPv6, "pattern" | "when" | "version">;
|
|
1219
|
-
type $ZodCheckCIDRv4Params = CheckStringFormatParams<$ZodCIDRv4, "pattern" | "when">;
|
|
1220
|
-
type $ZodCheckCIDRv6Params = CheckStringFormatParams<$ZodCIDRv6, "pattern" | "when">;
|
|
1221
|
-
type $ZodCheckBase64Params = CheckStringFormatParams<$ZodBase64, "pattern" | "when">;
|
|
1222
|
-
type $ZodCheckBase64URLParams = CheckStringFormatParams<$ZodBase64URL, "pattern" | "when">;
|
|
1223
|
-
type $ZodCheckE164Params = CheckStringFormatParams<$ZodE164, "when">;
|
|
1224
|
-
type $ZodCheckJWTParams = CheckStringFormatParams<$ZodJWT, "pattern" | "when">;
|
|
1225
|
-
type $ZodCheckISODateTimeParams = CheckStringFormatParams<$ZodISODateTime, "pattern" | "when">;
|
|
1226
|
-
type $ZodCheckISODateParams = CheckStringFormatParams<$ZodISODate, "pattern" | "when">;
|
|
1227
|
-
type $ZodCheckISOTimeParams = CheckStringFormatParams<$ZodISOTime, "pattern" | "when">;
|
|
1228
|
-
type $ZodCheckISODurationParams = CheckStringFormatParams<$ZodISODuration, "when">;
|
|
1229
|
-
type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
|
|
1230
|
-
type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
|
|
1231
|
-
type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
|
|
1232
|
-
type $ZodCheckRegexParams = CheckParams<$ZodCheckRegex, "format" | "pattern" | "when">;
|
|
1233
|
-
type $ZodCheckLowerCaseParams = CheckParams<$ZodCheckLowerCase, "format" | "when">;
|
|
1234
|
-
type $ZodCheckUpperCaseParams = CheckParams<$ZodCheckUpperCase, "format" | "when">;
|
|
1235
|
-
type $ZodCheckIncludesParams = CheckParams<$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">;
|
|
1236
|
-
type $ZodCheckStartsWithParams = CheckParams<$ZodCheckStartsWith, "prefix" | "format" | "when" | "pattern">;
|
|
1237
|
-
type $ZodCheckEndsWithParams = CheckParams<$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">;
|
|
1238
|
-
type $ZodEnumParams = TypeParams<$ZodEnum, "entries">;
|
|
1239
|
-
type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
|
|
1240
|
-
type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
|
|
1241
|
-
type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
|
|
1242
|
-
type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
|
|
1243
|
-
/** The schema or check that originated this issue. */
|
|
1244
|
-
readonly inst?: $ZodType | $ZodCheck;
|
|
1245
|
-
/** If `true`, Zod will continue executing checks/refinements after this issue. */
|
|
1246
|
-
readonly continue?: boolean | undefined;
|
|
1247
|
-
} & Record<string, unknown>> : never;
|
|
1248
|
-
interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
|
|
1249
|
-
addIssue(arg: string | $ZodSuperRefineIssue): void;
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
/** An Error-like class used to store Zod validation issues. */
|
|
1253
|
-
interface ZodError<T = unknown> extends $ZodError<T> {
|
|
1254
|
-
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
1255
|
-
format(): $ZodFormattedError<T>;
|
|
1256
|
-
format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
|
|
1257
|
-
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
1258
|
-
flatten(): $ZodFlattenedError<T>;
|
|
1259
|
-
flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
|
|
1260
|
-
/** @deprecated Push directly to `.issues` instead. */
|
|
1261
|
-
addIssue(issue: $ZodIssue): void;
|
|
1262
|
-
/** @deprecated Push directly to `.issues` instead. */
|
|
1263
|
-
addIssues(issues: $ZodIssue[]): void;
|
|
1264
|
-
/** @deprecated Check `err.issues.length === 0` instead. */
|
|
1265
|
-
isEmpty: boolean;
|
|
1266
|
-
}
|
|
1267
|
-
declare const ZodError: $constructor<ZodError>;
|
|
1268
|
-
|
|
1269
|
-
type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
|
|
1270
|
-
type ZodSafeParseSuccess<T> = {
|
|
1271
|
-
success: true;
|
|
1272
|
-
data: T;
|
|
1273
|
-
error?: never;
|
|
1274
|
-
};
|
|
1275
|
-
type ZodSafeParseError<T> = {
|
|
1276
|
-
success: false;
|
|
1277
|
-
data?: never;
|
|
1278
|
-
error: ZodError<T>;
|
|
1279
|
-
};
|
|
1280
|
-
|
|
1281
|
-
interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType<any, any, Internals> {
|
|
1282
|
-
}
|
|
1283
|
-
interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
|
|
1284
|
-
def: Internals["def"];
|
|
1285
|
-
type: Internals["def"]["type"];
|
|
1286
|
-
/** @deprecated Use `.def` instead. */
|
|
1287
|
-
_def: Internals["def"];
|
|
1288
|
-
/** @deprecated Use `z.output<typeof schema>` instead. */
|
|
1289
|
-
_output: Internals["output"];
|
|
1290
|
-
/** @deprecated Use `z.input<typeof schema>` instead. */
|
|
1291
|
-
_input: Internals["input"];
|
|
1292
|
-
check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
|
|
1293
|
-
clone(def?: Internals["def"], params?: {
|
|
1294
|
-
parent: boolean;
|
|
1295
|
-
}): this;
|
|
1296
|
-
register<R extends $ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], this>?] : [$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
|
|
1297
|
-
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T>;
|
|
1298
|
-
parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
|
|
1299
|
-
safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
|
|
1300
|
-
parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
|
|
1301
|
-
safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
|
|
1302
|
-
spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output<this>>>;
|
|
1303
|
-
refine(check: (arg: output<this>) => unknown | Promise<unknown>, params?: string | $ZodCustomParams): this;
|
|
1304
|
-
superRefine(refinement: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => void | Promise<void>): this;
|
|
1305
|
-
overwrite(fn: (x: output<this>) => output<this>): this;
|
|
1306
|
-
optional(): ZodOptional<this>;
|
|
1307
|
-
nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
|
|
1308
|
-
nullable(): ZodNullable<this>;
|
|
1309
|
-
nullish(): ZodOptional<ZodNullable<this>>;
|
|
1310
|
-
default(def: output<this>): ZodDefault<this>;
|
|
1311
|
-
default(def: () => NoUndefined<output<this>>): ZodDefault<this>;
|
|
1312
|
-
prefault(def: () => input<this>): ZodPrefault<this>;
|
|
1313
|
-
prefault(def: input<this>): ZodPrefault<this>;
|
|
1314
|
-
array(): ZodArray<this>;
|
|
1315
|
-
or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
|
|
1316
|
-
and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
|
|
1317
|
-
transform<NewOut>(transform: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output<this>>>;
|
|
1318
|
-
catch(def: output<this>): ZodCatch<this>;
|
|
1319
|
-
catch(def: (ctx: $ZodCatchCtx) => output<this>): ZodCatch<this>;
|
|
1320
|
-
pipe<T extends $ZodType<any, output<this>>>(target: T | $ZodType<any, output<this>>): ZodPipe<this, T>;
|
|
1321
|
-
readonly(): ZodReadonly<this>;
|
|
1322
|
-
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
|
|
1323
|
-
describe(description: string): this;
|
|
1324
|
-
description?: string;
|
|
1325
|
-
/** Returns the metadata associated with this instance in `z.globalRegistry` */
|
|
1326
|
-
meta(): $replace<GlobalMeta, this> | undefined;
|
|
1327
|
-
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
|
|
1328
|
-
meta(data: $replace<GlobalMeta, this>): this;
|
|
1329
|
-
/** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
|
|
1330
|
-
*
|
|
1331
|
-
* ```ts
|
|
1332
|
-
* const schema = z.string().optional();
|
|
1333
|
-
* const isOptional = schema.safeParse(undefined).success; // true
|
|
1334
|
-
* ```
|
|
1335
|
-
*/
|
|
1336
|
-
isOptional(): boolean;
|
|
1337
|
-
/**
|
|
1338
|
-
* @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
|
|
1339
|
-
*
|
|
1340
|
-
* ```ts
|
|
1341
|
-
* const schema = z.string().nullable();
|
|
1342
|
-
* const isNullable = schema.safeParse(null).success; // true
|
|
1343
|
-
* ```
|
|
1344
|
-
*/
|
|
1345
|
-
isNullable(): boolean;
|
|
1346
|
-
}
|
|
1347
|
-
declare const ZodType: $constructor<ZodType>;
|
|
1348
|
-
interface _ZodString<T extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodType<T> {
|
|
1349
|
-
format: string | null;
|
|
1350
|
-
minLength: number | null;
|
|
1351
|
-
maxLength: number | null;
|
|
1352
|
-
regex(regex: RegExp, params?: string | $ZodCheckRegexParams): this;
|
|
1353
|
-
includes(value: string, params?: $ZodCheckIncludesParams): this;
|
|
1354
|
-
startsWith(value: string, params?: string | $ZodCheckStartsWithParams): this;
|
|
1355
|
-
endsWith(value: string, params?: string | $ZodCheckEndsWithParams): this;
|
|
1356
|
-
min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
|
|
1357
|
-
max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
|
|
1358
|
-
length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
|
|
1359
|
-
nonempty(params?: string | $ZodCheckMinLengthParams): this;
|
|
1360
|
-
lowercase(params?: string | $ZodCheckLowerCaseParams): this;
|
|
1361
|
-
uppercase(params?: string | $ZodCheckUpperCaseParams): this;
|
|
1362
|
-
trim(): this;
|
|
1363
|
-
normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
|
|
1364
|
-
toLowerCase(): this;
|
|
1365
|
-
toUpperCase(): this;
|
|
1366
|
-
}
|
|
1367
|
-
/** @internal */
|
|
1368
|
-
declare const _ZodString: $constructor<_ZodString>;
|
|
1369
|
-
interface ZodString extends _ZodString<$ZodStringInternals<string>> {
|
|
1370
|
-
/** @deprecated Use `z.email()` instead. */
|
|
1371
|
-
email(params?: string | $ZodCheckEmailParams): this;
|
|
1372
|
-
/** @deprecated Use `z.url()` instead. */
|
|
1373
|
-
url(params?: string | $ZodCheckURLParams): this;
|
|
1374
|
-
/** @deprecated Use `z.jwt()` instead. */
|
|
1375
|
-
jwt(params?: string | $ZodCheckJWTParams): this;
|
|
1376
|
-
/** @deprecated Use `z.emoji()` instead. */
|
|
1377
|
-
emoji(params?: string | $ZodCheckEmojiParams): this;
|
|
1378
|
-
/** @deprecated Use `z.guid()` instead. */
|
|
1379
|
-
guid(params?: string | $ZodCheckGUIDParams): this;
|
|
1380
|
-
/** @deprecated Use `z.uuid()` instead. */
|
|
1381
|
-
uuid(params?: string | $ZodCheckUUIDParams): this;
|
|
1382
|
-
/** @deprecated Use `z.uuid()` instead. */
|
|
1383
|
-
uuidv4(params?: string | $ZodCheckUUIDParams): this;
|
|
1384
|
-
/** @deprecated Use `z.uuid()` instead. */
|
|
1385
|
-
uuidv6(params?: string | $ZodCheckUUIDParams): this;
|
|
1386
|
-
/** @deprecated Use `z.uuid()` instead. */
|
|
1387
|
-
uuidv7(params?: string | $ZodCheckUUIDParams): this;
|
|
1388
|
-
/** @deprecated Use `z.nanoid()` instead. */
|
|
1389
|
-
nanoid(params?: string | $ZodCheckNanoIDParams): this;
|
|
1390
|
-
/** @deprecated Use `z.guid()` instead. */
|
|
1391
|
-
guid(params?: string | $ZodCheckGUIDParams): this;
|
|
1392
|
-
/** @deprecated Use `z.cuid()` instead. */
|
|
1393
|
-
cuid(params?: string | $ZodCheckCUIDParams): this;
|
|
1394
|
-
/** @deprecated Use `z.cuid2()` instead. */
|
|
1395
|
-
cuid2(params?: string | $ZodCheckCUID2Params): this;
|
|
1396
|
-
/** @deprecated Use `z.ulid()` instead. */
|
|
1397
|
-
ulid(params?: string | $ZodCheckULIDParams): this;
|
|
1398
|
-
/** @deprecated Use `z.base64()` instead. */
|
|
1399
|
-
base64(params?: string | $ZodCheckBase64Params): this;
|
|
1400
|
-
/** @deprecated Use `z.base64url()` instead. */
|
|
1401
|
-
base64url(params?: string | $ZodCheckBase64URLParams): this;
|
|
1402
|
-
/** @deprecated Use `z.xid()` instead. */
|
|
1403
|
-
xid(params?: string | $ZodCheckXIDParams): this;
|
|
1404
|
-
/** @deprecated Use `z.ksuid()` instead. */
|
|
1405
|
-
ksuid(params?: string | $ZodCheckKSUIDParams): this;
|
|
1406
|
-
/** @deprecated Use `z.ipv4()` instead. */
|
|
1407
|
-
ipv4(params?: string | $ZodCheckIPv4Params): this;
|
|
1408
|
-
/** @deprecated Use `z.ipv6()` instead. */
|
|
1409
|
-
ipv6(params?: string | $ZodCheckIPv6Params): this;
|
|
1410
|
-
/** @deprecated Use `z.cidrv4()` instead. */
|
|
1411
|
-
cidrv4(params?: string | $ZodCheckCIDRv4Params): this;
|
|
1412
|
-
/** @deprecated Use `z.cidrv6()` instead. */
|
|
1413
|
-
cidrv6(params?: string | $ZodCheckCIDRv6Params): this;
|
|
1414
|
-
/** @deprecated Use `z.e164()` instead. */
|
|
1415
|
-
e164(params?: string | $ZodCheckE164Params): this;
|
|
1416
|
-
/** @deprecated Use `z.iso.datetime()` instead. */
|
|
1417
|
-
datetime(params?: string | $ZodCheckISODateTimeParams): this;
|
|
1418
|
-
/** @deprecated Use `z.iso.date()` instead. */
|
|
1419
|
-
date(params?: string | $ZodCheckISODateParams): this;
|
|
1420
|
-
/** @deprecated Use `z.iso.time()` instead. */
|
|
1421
|
-
time(params?: string | $ZodCheckISOTimeParams): this;
|
|
1422
|
-
/** @deprecated Use `z.iso.duration()` instead. */
|
|
1423
|
-
duration(params?: string | $ZodCheckISODurationParams): this;
|
|
1424
|
-
}
|
|
1425
|
-
declare const ZodString: $constructor<ZodString>;
|
|
1426
|
-
interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
|
|
1427
|
-
element: T;
|
|
1428
|
-
min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
|
|
1429
|
-
nonempty(params?: string | $ZodCheckMinLengthParams): this;
|
|
1430
|
-
max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
|
|
1431
|
-
length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
|
|
1432
|
-
unwrap(): T;
|
|
1433
|
-
}
|
|
1434
|
-
declare const ZodArray: $constructor<ZodArray>;
|
|
1435
|
-
interface ZodObject<
|
|
1436
|
-
/** @ts-ignore Cast variance */
|
|
1437
|
-
out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
|
|
1438
|
-
shape: Shape;
|
|
1439
|
-
keyof(): ZodEnum<ToEnum<keyof Shape & string>>;
|
|
1440
|
-
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
|
|
1441
|
-
catchall<T extends SomeType>(schema: T): ZodObject<Shape, $catchall<T>>;
|
|
1442
|
-
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
|
|
1443
|
-
passthrough(): ZodObject<Shape, $loose>;
|
|
1444
|
-
/** Consider `z.looseObject(A.shape)` instead */
|
|
1445
|
-
loose(): ZodObject<Shape, $loose>;
|
|
1446
|
-
/** Consider `z.strictObject(A.shape)` instead */
|
|
1447
|
-
strict(): ZodObject<Shape, $strict>;
|
|
1448
|
-
/** This is the default behavior. This method call is likely unnecessary. */
|
|
1449
|
-
strip(): ZodObject<Shape, $strip>;
|
|
1450
|
-
extend<U extends $ZodLooseShape>(shape: U): ZodObject<Extend<Shape, U>, Config>;
|
|
1451
|
-
/**
|
|
1452
|
-
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
1453
|
-
*/
|
|
1454
|
-
merge<U extends ZodObject>(other: U): ZodObject<Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
|
|
1455
|
-
pick<M extends Mask<keyof Shape>>(mask: M): ZodObject<Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
|
1456
|
-
omit<M extends Mask<keyof Shape>>(mask: M): ZodObject<Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
|
1457
|
-
partial(): ZodObject<{
|
|
1458
|
-
[k in keyof Shape]: ZodOptional<Shape[k]>;
|
|
1459
|
-
}, Config>;
|
|
1460
|
-
partial<M extends Mask<keyof Shape>>(mask: M): ZodObject<{
|
|
1461
|
-
[k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k];
|
|
1462
|
-
}, Config>;
|
|
1463
|
-
required(): ZodObject<{
|
|
1464
|
-
[k in keyof Shape]: ZodNonOptional<Shape[k]>;
|
|
1465
|
-
}, Config>;
|
|
1466
|
-
required<M extends Mask<keyof Shape>>(mask: M): ZodObject<{
|
|
1467
|
-
[k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
|
|
1468
|
-
}, Config>;
|
|
1469
|
-
}
|
|
1470
|
-
declare const ZodObject: $constructor<ZodObject>;
|
|
1471
|
-
interface ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
|
|
1472
|
-
options: T;
|
|
1473
|
-
}
|
|
1474
|
-
declare const ZodUnion: $constructor<ZodUnion>;
|
|
1475
|
-
interface ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
|
|
1476
|
-
}
|
|
1477
|
-
declare const ZodIntersection: $constructor<ZodIntersection>;
|
|
1478
|
-
interface ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends _ZodType<$ZodRecordInternals<Key, Value>>, $ZodRecord<Key, Value> {
|
|
1479
|
-
keyType: Key;
|
|
1480
|
-
valueType: Value;
|
|
1481
|
-
}
|
|
1482
|
-
declare const ZodRecord: $constructor<ZodRecord>;
|
|
1483
|
-
interface ZodEnum<
|
|
1484
|
-
/** @ts-ignore Cast variance */
|
|
1485
|
-
out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals<T>>, $ZodEnum<T> {
|
|
1486
|
-
enum: T;
|
|
1487
|
-
options: Array<T[keyof T]>;
|
|
1488
|
-
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Pick<T, U[number]>>>;
|
|
1489
|
-
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Omit<T, U[number]>>>;
|
|
1490
|
-
}
|
|
1491
|
-
declare const ZodEnum: $constructor<ZodEnum>;
|
|
1492
|
-
interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
|
|
1493
|
-
}
|
|
1494
|
-
declare const ZodTransform: $constructor<ZodTransform>;
|
|
1495
|
-
interface ZodOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
|
|
1496
|
-
unwrap(): T;
|
|
1497
|
-
}
|
|
1498
|
-
declare const ZodOptional: $constructor<ZodOptional>;
|
|
1499
|
-
interface ZodNullable<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
|
|
1500
|
-
unwrap(): T;
|
|
1501
|
-
}
|
|
1502
|
-
declare const ZodNullable: $constructor<ZodNullable>;
|
|
1503
|
-
interface ZodDefault<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
|
|
1504
|
-
unwrap(): T;
|
|
1505
|
-
/** @deprecated Use `.unwrap()` instead. */
|
|
1506
|
-
removeDefault(): T;
|
|
1507
|
-
}
|
|
1508
|
-
declare const ZodDefault: $constructor<ZodDefault>;
|
|
1509
|
-
interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
|
|
1510
|
-
unwrap(): T;
|
|
1511
|
-
}
|
|
1512
|
-
declare const ZodPrefault: $constructor<ZodPrefault>;
|
|
1513
|
-
interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
|
|
1514
|
-
unwrap(): T;
|
|
1515
|
-
}
|
|
1516
|
-
declare const ZodNonOptional: $constructor<ZodNonOptional>;
|
|
1517
|
-
interface ZodCatch<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
|
|
1518
|
-
unwrap(): T;
|
|
1519
|
-
/** @deprecated Use `.unwrap()` instead. */
|
|
1520
|
-
removeCatch(): T;
|
|
1521
|
-
}
|
|
1522
|
-
declare const ZodCatch: $constructor<ZodCatch>;
|
|
1523
|
-
interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
|
|
1524
|
-
in: A;
|
|
1525
|
-
out: B;
|
|
1526
|
-
}
|
|
1527
|
-
declare const ZodPipe: $constructor<ZodPipe>;
|
|
1528
|
-
interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
|
|
1529
|
-
unwrap(): T;
|
|
1530
|
-
}
|
|
1531
|
-
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
1532
|
-
|
|
1533
|
-
declare const LikeC4ProjectJsonConfigSchema: ZodObject<{
|
|
1534
|
-
name: ZodPipe<ZodString, ZodTransform<ProjectId, string>>;
|
|
1535
|
-
title: ZodOptional<ZodString>;
|
|
1536
|
-
contactPerson: ZodOptional<ZodString>;
|
|
1537
|
-
imageAliases: ZodOptional<ZodRecord<ZodString, ZodString>>;
|
|
1538
|
-
exclude: ZodOptional<ZodArray<ZodString>>;
|
|
1539
|
-
}, $strip>;
|
|
1540
|
-
interface GeneratorFnContext {
|
|
1541
|
-
/**
|
|
1542
|
-
* Workspace root directory
|
|
1543
|
-
*/
|
|
1544
|
-
readonly workspace: URI;
|
|
1545
|
-
/**
|
|
1546
|
-
* Current project
|
|
1547
|
-
*/
|
|
1548
|
-
readonly project: {
|
|
1549
|
-
/**
|
|
1550
|
-
* Project name
|
|
1551
|
-
*/
|
|
1552
|
-
readonly id: ProjectId;
|
|
1553
|
-
readonly title?: string;
|
|
1554
|
-
/**
|
|
1555
|
-
* Project folder
|
|
1556
|
-
*/
|
|
1557
|
-
readonly folder: URI;
|
|
1558
|
-
};
|
|
1559
|
-
/**
|
|
1560
|
-
* Returns the location of the specified element, relation, view or deployment element
|
|
1561
|
-
*/
|
|
1562
|
-
locate(target: ElementModel | RelationshipModel | DeploymentRelationModel | LikeC4ViewModel | DeploymentElementModel): {
|
|
1563
|
-
/**
|
|
1564
|
-
* Range inside the source file
|
|
1565
|
-
*/
|
|
1566
|
-
range: {
|
|
1567
|
-
start: {
|
|
1568
|
-
line: number;
|
|
1569
|
-
character: number;
|
|
1570
|
-
};
|
|
1571
|
-
end: {
|
|
1572
|
-
line: number;
|
|
1573
|
-
character: number;
|
|
1574
|
-
};
|
|
1575
|
-
};
|
|
1576
|
-
/**
|
|
1577
|
-
* Full path to the source file
|
|
1578
|
-
*/
|
|
1579
|
-
document: URI;
|
|
1580
|
-
/**
|
|
1581
|
-
* Document path relative to the project folder
|
|
1582
|
-
*/
|
|
1583
|
-
relativePath: string;
|
|
1584
|
-
/**
|
|
1585
|
-
* Folder, containing the source file ("dirname" of document)
|
|
1586
|
-
*/
|
|
1587
|
-
folder: string;
|
|
1588
|
-
/**
|
|
1589
|
-
* Source file name ("basename" of document)
|
|
1590
|
-
*/
|
|
1591
|
-
filename: string;
|
|
1592
|
-
};
|
|
1593
|
-
/**
|
|
1594
|
-
* Write a file
|
|
1595
|
-
* @param path - Path to the file, either absolute or relative to the project folder
|
|
1596
|
-
* All folders will be created automatically
|
|
1597
|
-
* @param content - Content of the file
|
|
1598
|
-
*/
|
|
1599
|
-
write(file: {
|
|
1600
|
-
path: string | string[] | URI;
|
|
1601
|
-
content: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | NodeJS.ReadableStream;
|
|
1602
|
-
}): Promise<void>;
|
|
1603
|
-
/**
|
|
1604
|
-
* Abort the process
|
|
1605
|
-
*/
|
|
1606
|
-
abort(reason?: string): never;
|
|
1607
|
-
}
|
|
1608
|
-
type GeneratorFnParams = {
|
|
1609
|
-
/**
|
|
1610
|
-
* LikeC4 model
|
|
1611
|
-
*/
|
|
1612
|
-
likec4model: LikeC4Model<aux.UnknownLayouted>;
|
|
1613
|
-
/**
|
|
1614
|
-
* Generator context
|
|
1615
|
-
*/
|
|
1616
|
-
ctx: GeneratorFnContext;
|
|
1617
|
-
};
|
|
1618
|
-
interface GeneratorFn {
|
|
1619
|
-
(params: GeneratorFnParams): Promise<void> | void;
|
|
1620
|
-
}
|
|
1621
|
-
/**
|
|
1622
|
-
* LikeC4 project configuration
|
|
1623
|
-
*
|
|
1624
|
-
* @example
|
|
1625
|
-
* ```ts
|
|
1626
|
-
* export default defineConfig({
|
|
1627
|
-
* name: 'my-project',
|
|
1628
|
-
* generators: {
|
|
1629
|
-
* 'my-generator': async ({ likec4model, ctx }) => {
|
|
1630
|
-
* await ctx.write('my-generator.txt', likec4model.project.id)
|
|
1631
|
-
* }
|
|
1632
|
-
* }
|
|
1633
|
-
* })
|
|
1634
|
-
* ```
|
|
1635
|
-
*/
|
|
1636
|
-
type LikeC4ProjectConfig = input<typeof LikeC4ProjectJsonConfigSchema> & {
|
|
1637
|
-
/**
|
|
1638
|
-
* Add custom generators to the project
|
|
1639
|
-
* @example
|
|
1640
|
-
* ```ts
|
|
1641
|
-
* export default defineConfig({
|
|
1642
|
-
* name: 'my-project',
|
|
1643
|
-
* generators: {
|
|
1644
|
-
* 'my-generator': async ({ likec4model, ctx }) => {
|
|
1645
|
-
* await ctx.write('my-generator.txt', likec4model.project.id)
|
|
1646
|
-
* }
|
|
1647
|
-
* }
|
|
1648
|
-
* })
|
|
1649
|
-
* ```
|
|
1650
|
-
*
|
|
1651
|
-
* Execute generator:
|
|
1652
|
-
* ```bash
|
|
1653
|
-
* likec4 gen my-generator
|
|
1654
|
-
* ```
|
|
1655
|
-
*/
|
|
1656
|
-
generators?: Record<string, GeneratorFn> | undefined;
|
|
1657
|
-
};
|
|
1658
|
-
|
|
1659
|
-
/**
|
|
1660
|
-
* Defines LikeC4 Project, allows custom generators that can be executed using CLI:
|
|
1661
|
-
*
|
|
1662
|
-
* `$ likec4 gen <generator-name>`
|
|
1663
|
-
*
|
|
1664
|
-
* or VSCode command `LikeC4: Run code generator`
|
|
1665
|
-
*
|
|
1666
|
-
* @example
|
|
1667
|
-
* ```ts
|
|
1668
|
-
* export default defineConfig({
|
|
1669
|
-
* name: 'my-project',
|
|
1670
|
-
* title: 'My Project',
|
|
1671
|
-
* exclude: ['picomatch pattern'],
|
|
1672
|
-
* generators: {
|
|
1673
|
-
* 'my-generator': async ({ likec4model, ctx }) => {
|
|
1674
|
-
* await ctx.write('my-generator.txt', likec4model.project.id)
|
|
1675
|
-
* }
|
|
1676
|
-
* }
|
|
1677
|
-
* })
|
|
1678
|
-
* ```
|
|
1679
|
-
*/
|
|
1680
|
-
declare function defineConfig<const C extends LikeC4ProjectConfig>(config: C): C;
|
|
1681
|
-
/**
|
|
1682
|
-
* Define reusable custom generators
|
|
1683
|
-
*
|
|
1684
|
-
* @example
|
|
1685
|
-
* ```ts
|
|
1686
|
-
* // generators.ts
|
|
1687
|
-
* export default defineGenerators({
|
|
1688
|
-
* 'my-generator': async ({ likec4model, ctx }) => {
|
|
1689
|
-
* await ctx.write('my-generator.txt', likec4model.project.id)
|
|
1690
|
-
* }
|
|
1691
|
-
* })
|
|
1692
|
-
*
|
|
1693
|
-
* // likec4.config.ts
|
|
1694
|
-
* import generators from './generators'
|
|
1695
|
-
*
|
|
1696
|
-
* export default defineConfig({
|
|
1697
|
-
* name: 'my-project',
|
|
1698
|
-
* generators,
|
|
1699
|
-
* })
|
|
1700
|
-
* ```
|
|
1701
|
-
*/
|
|
1702
|
-
declare function defineGenerators<const G extends Record<string, GeneratorFn>>(generators: G): G;
|
|
1703
|
-
|
|
1704
|
-
export { type GeneratorFn as G, type LikeC4ProjectConfig as L, URI as U, defineGenerators as a, type GeneratorFnContext as b, type GeneratorFnParams as c, defineConfig as d };
|