/** The Standard Schema interface. */ interface StandardSchemaV1 { /** The Standard Schema properties. */ readonly "~standard": StandardSchemaV1.Props; } declare namespace StandardSchemaV1 { /** The Standard Schema properties interface. */ interface Props { /** The version number of the standard. */ readonly version: 1; /** The vendor name of the schema library. */ readonly vendor: string; /** Validates unknown input values. */ readonly validate: (value: unknown) => Result | Promise>; /** Inferred types associated with the schema. */ readonly types?: Types | undefined; } /** The result interface of the validate function. */ type Result = SuccessResult | FailureResult; /** The result interface if validation succeeds. */ interface SuccessResult { /** The typed output value. */ readonly value: Output; /** The non-existent issues. */ readonly issues?: undefined; } /** The result interface if validation fails. */ interface FailureResult { /** The issues of failed validation. */ readonly issues: ReadonlyArray; } /** The issue interface of the failure output. */ interface Issue { /** The error message of the issue. */ readonly message: string; /** The path of the issue, if any. */ readonly path?: ReadonlyArray | undefined; } /** The path segment interface of the issue. */ interface PathSegment { /** The key representing a path segment. */ readonly key: PropertyKey; } /** The Standard Schema types interface. */ interface Types { /** The input type of the schema. */ readonly input: Input; /** The output type of the schema. */ readonly output: Output; } /** Infers the input type of a Standard Schema. */ type InferInput = NonNullable["input"]; /** Infers the output type of a Standard Schema. */ type InferOutput = NonNullable["output"]; } type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {}); type Omit$1 = Pick>; type MakePartial = Omit$1 & InexactPartial>; type NoUndefined = T extends undefined ? never : T; type LoosePartial = InexactPartial & { [k: string]: unknown; }; type InexactPartial = { [P in keyof T]?: T[P] | undefined; }; type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | { readonly [Symbol.toStringTag]: string; } | Date | Error | Generator | Promise | RegExp; type MakeReadonly = T extends Map ? ReadonlyMap : T extends Set ? ReadonlySet : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array ? ReadonlyArray : T extends BuiltIn ? T : Readonly; type Identity = T; type Flatten = Identity<{ [k in keyof T]: T[k]; }>; type AnyFunc = (...args: any[]) => any; type MaybeAsync = T | Promise; type EnumValue = string | number; type EnumLike = Readonly>; type Primitive = string | number | symbol | bigint | boolean | null | undefined; type HasLength = { length: number; }; type PropValues = Record>; type PrimitiveSet = Set; type EmptyToNever = keyof T extends never ? never : T; declare abstract class Class { constructor(..._args: any[]); } declare const version: { readonly major: 4; readonly minor: 0; readonly patch: number; }; interface ParseContext { /** Customize error messages. */ readonly error?: $ZodErrorMap; /** Include the `input` field in issue objects. Default `false`. */ readonly reportInput?: boolean; /** Skip eval-based fast path. Default `false`. */ readonly jitless?: boolean; } /** @internal */ interface ParseContextInternal extends ParseContext { readonly async?: boolean | undefined; } interface ParsePayload { value: T; issues: $ZodRawIssue[]; } type CheckFn = (input: ParsePayload) => MaybeAsync; interface $ZodTypeDef { 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"; error?: $ZodErrorMap | undefined; checks?: $ZodCheck[]; } interface _$ZodTypeInternals { /** The `@zod/core` version of this schema */ version: typeof version; /** Schema definition. */ def: $ZodTypeDef; /** @internal Randomly generated ID for this schema. */ /** @internal List of deferred initializers. */ deferred: AnyFunc[] | undefined; /** @internal Parses input and runs all checks (refinements). */ run(payload: ParsePayload, ctx: ParseContextInternal): MaybeAsync; /** @internal Parses input, doesn't run checks. */ parse(payload: ParsePayload, ctx: ParseContextInternal): MaybeAsync; /** @internal Stores identifiers for the set of traits implemented by this schema. */ traits: Set; /** @internal Indicates that a schema output type should be considered optional inside objects. * @default Required */ /** @internal */ optin?: "optional" | undefined; /** @internal */ optout?: "optional" | undefined; /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record(). * * Defined on: enum, const, literal, null, undefined * Passthrough: optional, nullable, branded, default, catch, pipe * Todo: unions? */ values?: PrimitiveSet | undefined; /** Default value bubbled up from */ /** @internal A set of literal discriminators used for the fast path in discriminated unions. */ propValues?: PropValues | undefined; /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */ pattern: RegExp | undefined; /** @internal The constructor function of this schema. */ constr: new (def: any) => $ZodType; /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */ bag: Record; /** @internal The set of issues this schema might throw during type checking. */ isst: $ZodIssueBase; /** An optional method used to override `toJSONSchema` logic. */ toJSONSchema?: () => unknown; /** @internal The parent of this schema. Only set during certain clone operations. */ parent?: $ZodType | undefined; } /** @internal */ interface $ZodTypeInternals extends _$ZodTypeInternals { /** @internal The inferred output type */ output: O; /** @internal The inferred input type */ input: I; } type $ZodStandardSchema = StandardSchemaV1.Props, output>; type SomeType = { _zod: _$ZodTypeInternals; }; interface $ZodType = $ZodTypeInternals> { _zod: Internals; "~standard": $ZodStandardSchema; } declare const $ZodType: $constructor<$ZodType>; interface $ZodStringDef extends $ZodTypeDef { type: "string"; coerce?: boolean; checks?: $ZodCheck[]; } interface $ZodStringInternals extends $ZodTypeInternals { def: $ZodStringDef; /** @deprecated Internal API, use with caution (not deprecated) */ pattern: RegExp; /** @deprecated Internal API, use with caution (not deprecated) */ isst: $ZodIssueInvalidType; bag: LoosePartial<{ minimum: number; maximum: number; patterns: Set; format: string; contentEncoding: string; }>; } interface $ZodStringFormatDef extends $ZodStringDef, $ZodCheckStringFormatDef { } interface $ZodStringFormatInternals extends $ZodStringInternals, $ZodCheckStringFormatInternals { def: $ZodStringFormatDef; } interface $ZodStringFormat extends $ZodType { _zod: $ZodStringFormatInternals; } declare const $ZodStringFormat: $constructor<$ZodStringFormat>; interface $ZodGUIDInternals extends $ZodStringFormatInternals<"guid"> { } interface $ZodGUID extends $ZodType { _zod: $ZodGUIDInternals; } declare const $ZodGUID: $constructor<$ZodGUID>; interface $ZodUUIDDef extends $ZodStringFormatDef<"uuid"> { version?: "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7" | "v8"; } interface $ZodUUIDInternals extends $ZodStringFormatInternals<"uuid"> { def: $ZodUUIDDef; } interface $ZodUUID extends $ZodType { _zod: $ZodUUIDInternals; } declare const $ZodUUID: $constructor<$ZodUUID>; interface $ZodEmailInternals extends $ZodStringFormatInternals<"email"> { } interface $ZodEmail extends $ZodType { _zod: $ZodEmailInternals; } declare const $ZodEmail: $constructor<$ZodEmail>; interface $ZodURLDef extends $ZodStringFormatDef<"url"> { hostname?: RegExp | undefined; protocol?: RegExp | undefined; normalize?: boolean | undefined; } interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> { def: $ZodURLDef; } interface $ZodURL extends $ZodType { _zod: $ZodURLInternals; } declare const $ZodURL: $constructor<$ZodURL>; interface $ZodEmojiInternals extends $ZodStringFormatInternals<"emoji"> { } interface $ZodEmoji extends $ZodType { _zod: $ZodEmojiInternals; } declare const $ZodEmoji: $constructor<$ZodEmoji>; interface $ZodNanoIDInternals extends $ZodStringFormatInternals<"nanoid"> { } interface $ZodNanoID extends $ZodType { _zod: $ZodNanoIDInternals; } declare const $ZodNanoID: $constructor<$ZodNanoID>; interface $ZodCUIDInternals extends $ZodStringFormatInternals<"cuid"> { } interface $ZodCUID extends $ZodType { _zod: $ZodCUIDInternals; } declare const $ZodCUID: $constructor<$ZodCUID>; interface $ZodCUID2Internals extends $ZodStringFormatInternals<"cuid2"> { } interface $ZodCUID2 extends $ZodType { _zod: $ZodCUID2Internals; } declare const $ZodCUID2: $constructor<$ZodCUID2>; interface $ZodULIDInternals extends $ZodStringFormatInternals<"ulid"> { } interface $ZodULID extends $ZodType { _zod: $ZodULIDInternals; } declare const $ZodULID: $constructor<$ZodULID>; interface $ZodXIDInternals extends $ZodStringFormatInternals<"xid"> { } interface $ZodXID extends $ZodType { _zod: $ZodXIDInternals; } declare const $ZodXID: $constructor<$ZodXID>; interface $ZodKSUIDInternals extends $ZodStringFormatInternals<"ksuid"> { } interface $ZodKSUID extends $ZodType { _zod: $ZodKSUIDInternals; } declare const $ZodKSUID: $constructor<$ZodKSUID>; interface $ZodISODateTimeDef extends $ZodStringFormatDef<"datetime"> { precision: number | null; offset: boolean; local: boolean; } interface $ZodISODateTimeInternals extends $ZodStringFormatInternals { def: $ZodISODateTimeDef; } interface $ZodISODateTime extends $ZodType { _zod: $ZodISODateTimeInternals; } declare const $ZodISODateTime: $constructor<$ZodISODateTime>; interface $ZodISODateInternals extends $ZodStringFormatInternals<"date"> { } interface $ZodISODate extends $ZodType { _zod: $ZodISODateInternals; } declare const $ZodISODate: $constructor<$ZodISODate>; interface $ZodISOTimeDef extends $ZodStringFormatDef<"time"> { precision?: number | null; } interface $ZodISOTimeInternals extends $ZodStringFormatInternals<"time"> { def: $ZodISOTimeDef; } interface $ZodISOTime extends $ZodType { _zod: $ZodISOTimeInternals; } declare const $ZodISOTime: $constructor<$ZodISOTime>; interface $ZodISODurationInternals extends $ZodStringFormatInternals<"duration"> { } interface $ZodISODuration extends $ZodType { _zod: $ZodISODurationInternals; } declare const $ZodISODuration: $constructor<$ZodISODuration>; interface $ZodIPv4Def extends $ZodStringFormatDef<"ipv4"> { version?: "v4"; } interface $ZodIPv4Internals extends $ZodStringFormatInternals<"ipv4"> { def: $ZodIPv4Def; } interface $ZodIPv4 extends $ZodType { _zod: $ZodIPv4Internals; } declare const $ZodIPv4: $constructor<$ZodIPv4>; interface $ZodIPv6Def extends $ZodStringFormatDef<"ipv6"> { version?: "v6"; } interface $ZodIPv6Internals extends $ZodStringFormatInternals<"ipv6"> { def: $ZodIPv6Def; } interface $ZodIPv6 extends $ZodType { _zod: $ZodIPv6Internals; } declare const $ZodIPv6: $constructor<$ZodIPv6>; interface $ZodCIDRv4Def extends $ZodStringFormatDef<"cidrv4"> { version?: "v4"; } interface $ZodCIDRv4Internals extends $ZodStringFormatInternals<"cidrv4"> { def: $ZodCIDRv4Def; } interface $ZodCIDRv4 extends $ZodType { _zod: $ZodCIDRv4Internals; } declare const $ZodCIDRv4: $constructor<$ZodCIDRv4>; interface $ZodCIDRv6Def extends $ZodStringFormatDef<"cidrv6"> { version?: "v6"; } interface $ZodCIDRv6Internals extends $ZodStringFormatInternals<"cidrv6"> { def: $ZodCIDRv6Def; } interface $ZodCIDRv6 extends $ZodType { _zod: $ZodCIDRv6Internals; } declare const $ZodCIDRv6: $constructor<$ZodCIDRv6>; interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64"> { } interface $ZodBase64 extends $ZodType { _zod: $ZodBase64Internals; } declare const $ZodBase64: $constructor<$ZodBase64>; interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> { } interface $ZodBase64URL extends $ZodType { _zod: $ZodBase64URLInternals; } declare const $ZodBase64URL: $constructor<$ZodBase64URL>; interface $ZodE164Internals extends $ZodStringFormatInternals<"e164"> { } interface $ZodE164 extends $ZodType { _zod: $ZodE164Internals; } declare const $ZodE164: $constructor<$ZodE164>; interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> { alg?: JWTAlgorithm | undefined; } interface $ZodJWTInternals extends $ZodStringFormatInternals<"jwt"> { def: $ZodJWTDef; } interface $ZodJWT extends $ZodType { _zod: $ZodJWTInternals; } declare const $ZodJWT: $constructor<$ZodJWT>; interface $ZodArrayDef extends $ZodTypeDef { type: "array"; element: T; } interface $ZodArrayInternals extends _$ZodTypeInternals { def: $ZodArrayDef; isst: $ZodIssueInvalidType; output: output[]; input: input[]; } interface $ZodArray extends $ZodType> { } declare const $ZodArray: $constructor<$ZodArray>; type OptionalOutSchema = { _zod: { optout: "optional"; }; }; type OptionalInSchema = { _zod: { optin: "optional"; }; }; type $InferUnionOutput = T extends any ? output : never; type $InferUnionInput = T extends any ? input : never; interface $ZodUnionDef extends $ZodTypeDef { type: "union"; options: Options; } type IsOptionalIn = T extends OptionalInSchema ? true : false; type IsOptionalOut = T extends OptionalOutSchema ? true : false; interface $ZodUnionInternals extends _$ZodTypeInternals { def: $ZodUnionDef; isst: $ZodIssueInvalidUnion; pattern: T[number]["_zod"]["pattern"]; values: T[number]["_zod"]["values"]; output: $InferUnionOutput; input: $InferUnionInput; optin: IsOptionalIn extends false ? "optional" | undefined : "optional"; optout: IsOptionalOut extends false ? "optional" | undefined : "optional"; } interface $ZodUnion extends $ZodType> { _zod: $ZodUnionInternals; } declare const $ZodUnion: $constructor<$ZodUnion>; interface $ZodIntersectionDef extends $ZodTypeDef { type: "intersection"; left: Left; right: Right; } interface $ZodIntersectionInternals extends _$ZodTypeInternals { def: $ZodIntersectionDef; isst: never; optin: A["_zod"]["optin"] | B["_zod"]["optin"]; optout: A["_zod"]["optout"] | B["_zod"]["optout"]; output: output & output; input: input & input; } interface $ZodIntersection extends $ZodType { _zod: $ZodIntersectionInternals; } declare const $ZodIntersection: $constructor<$ZodIntersection>; type $InferEnumOutput = T[keyof T] & {}; type $InferEnumInput = T[keyof T] & {}; interface $ZodEnumDef extends $ZodTypeDef { type: "enum"; entries: T; } interface $ZodEnumInternals< /** @ts-ignore Cast variance */ out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput, $InferEnumInput> { def: $ZodEnumDef; /** @deprecated Internal API, use with caution (not deprecated) */ values: PrimitiveSet; /** @deprecated Internal API, use with caution (not deprecated) */ pattern: RegExp; isst: $ZodIssueInvalidValue; } interface $ZodEnum extends $ZodType { _zod: $ZodEnumInternals; } declare const $ZodEnum: $constructor<$ZodEnum>; interface $ZodTransformDef extends $ZodTypeDef { type: "transform"; transform: (input: unknown, payload: ParsePayload) => MaybeAsync; } interface $ZodTransformInternals extends $ZodTypeInternals { def: $ZodTransformDef; isst: never; } interface $ZodTransform extends $ZodType { _zod: $ZodTransformInternals; } declare const $ZodTransform: $constructor<$ZodTransform>; interface $ZodOptionalDef extends $ZodTypeDef { type: "optional"; innerType: T; } interface $ZodOptionalInternals extends $ZodTypeInternals | undefined, input | undefined> { def: $ZodOptionalDef; optin: "optional"; optout: "optional"; isst: never; values: T["_zod"]["values"]; pattern: T["_zod"]["pattern"]; } interface $ZodOptional extends $ZodType { _zod: $ZodOptionalInternals; } declare const $ZodOptional: $constructor<$ZodOptional>; interface $ZodNullableDef extends $ZodTypeDef { type: "nullable"; innerType: T; } interface $ZodNullableInternals extends $ZodTypeInternals | null, input | null> { def: $ZodNullableDef; optin: T["_zod"]["optin"]; optout: T["_zod"]["optout"]; isst: never; values: T["_zod"]["values"]; pattern: T["_zod"]["pattern"]; } interface $ZodNullable extends $ZodType { _zod: $ZodNullableInternals; } declare const $ZodNullable: $constructor<$ZodNullable>; interface $ZodDefaultDef extends $ZodTypeDef { type: "default"; innerType: T; /** The default value. May be a getter. */ defaultValue: NoUndefined>; } interface $ZodDefaultInternals extends $ZodTypeInternals>, input | undefined> { def: $ZodDefaultDef; optin: "optional"; optout?: "optional" | undefined; isst: never; values: T["_zod"]["values"]; } interface $ZodDefault extends $ZodType { _zod: $ZodDefaultInternals; } declare const $ZodDefault: $constructor<$ZodDefault>; interface $ZodPrefaultDef extends $ZodTypeDef { type: "prefault"; innerType: T; /** The default value. May be a getter. */ defaultValue: input; } interface $ZodPrefaultInternals extends $ZodTypeInternals>, input | undefined> { def: $ZodPrefaultDef; optin: "optional"; optout?: "optional" | undefined; isst: never; values: T["_zod"]["values"]; } interface $ZodPrefault extends $ZodType { _zod: $ZodPrefaultInternals; } declare const $ZodPrefault: $constructor<$ZodPrefault>; interface $ZodNonOptionalDef extends $ZodTypeDef { type: "nonoptional"; innerType: T; } interface $ZodNonOptionalInternals extends $ZodTypeInternals>, NoUndefined>> { def: $ZodNonOptionalDef; isst: $ZodIssueInvalidType; values: T["_zod"]["values"]; optin: "optional" | undefined; optout: "optional" | undefined; } interface $ZodNonOptional extends $ZodType { _zod: $ZodNonOptionalInternals; } declare const $ZodNonOptional: $constructor<$ZodNonOptional>; interface $ZodCatchCtx extends ParsePayload { /** @deprecated Use `ctx.issues` */ error: { issues: $ZodIssue[]; }; /** @deprecated Use `ctx.value` */ input: unknown; } interface $ZodCatchDef extends $ZodTypeDef { type: "catch"; innerType: T; catchValue: (ctx: $ZodCatchCtx) => unknown; } interface $ZodCatchInternals extends $ZodTypeInternals, input> { def: $ZodCatchDef; optin: T["_zod"]["optin"]; optout: T["_zod"]["optout"]; isst: never; values: T["_zod"]["values"]; } interface $ZodCatch extends $ZodType { _zod: $ZodCatchInternals; } declare const $ZodCatch: $constructor<$ZodCatch>; interface $ZodPipeDef extends $ZodTypeDef { type: "pipe"; in: A; out: B; } interface $ZodPipeInternals extends $ZodTypeInternals, input> { def: $ZodPipeDef; isst: never; values: A["_zod"]["values"]; optin: A["_zod"]["optin"]; optout: B["_zod"]["optout"]; propValues: A["_zod"]["propValues"]; } interface $ZodPipe extends $ZodType { _zod: $ZodPipeInternals; } declare const $ZodPipe: $constructor<$ZodPipe>; interface $ZodReadonlyDef extends $ZodTypeDef { type: "readonly"; innerType: T; } interface $ZodReadonlyInternals extends $ZodTypeInternals>, MakeReadonly>> { def: $ZodReadonlyDef; optin: T["_zod"]["optin"]; optout: T["_zod"]["optout"]; isst: never; propValues: T["_zod"]["propValues"]; values: T["_zod"]["values"]; } interface $ZodReadonly extends $ZodType { _zod: $ZodReadonlyInternals; } declare const $ZodReadonly: $constructor<$ZodReadonly>; interface $ZodCustomDef extends $ZodTypeDef, $ZodCheckDef { type: "custom"; check: "custom"; path?: PropertyKey[] | undefined; error?: $ZodErrorMap | undefined; params?: Record | undefined; fn: (arg: O) => unknown; } interface $ZodCustomInternals extends $ZodTypeInternals, $ZodCheckInternals { def: $ZodCustomDef; issc: $ZodIssue; isst: never; bag: LoosePartial<{ Class: typeof Class; }>; } interface $ZodCustom extends $ZodType { _zod: $ZodCustomInternals; } declare const $ZodCustom: $constructor<$ZodCustom>; interface $ZodCheckDef { check: string; error?: $ZodErrorMap | undefined; /** If true, no later checks will be executed if this check fails. Default `false`. */ abort?: boolean | undefined; /** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */ when?: ((payload: ParsePayload) => boolean) | undefined; } interface $ZodCheckInternals { def: $ZodCheckDef; /** The set of issues this check might throw. */ issc?: $ZodIssueBase; check(payload: ParsePayload): MaybeAsync; onattach: ((schema: $ZodType) => void)[]; } interface $ZodCheck { _zod: $ZodCheckInternals; } declare const $ZodCheck: $constructor<$ZodCheck>; interface $ZodCheckMaxLengthDef extends $ZodCheckDef { check: "max_length"; maximum: number; } interface $ZodCheckMaxLengthInternals extends $ZodCheckInternals { def: $ZodCheckMaxLengthDef; issc: $ZodIssueTooBig; } interface $ZodCheckMaxLength extends $ZodCheck { _zod: $ZodCheckMaxLengthInternals; } declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>; interface $ZodCheckMinLengthDef extends $ZodCheckDef { check: "min_length"; minimum: number; } interface $ZodCheckMinLengthInternals extends $ZodCheckInternals { def: $ZodCheckMinLengthDef; issc: $ZodIssueTooSmall; } interface $ZodCheckMinLength extends $ZodCheck { _zod: $ZodCheckMinLengthInternals; } declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>; interface $ZodCheckLengthEqualsDef extends $ZodCheckDef { check: "length_equals"; length: number; } interface $ZodCheckLengthEqualsInternals extends $ZodCheckInternals { def: $ZodCheckLengthEqualsDef; issc: $ZodIssueTooBig | $ZodIssueTooSmall; } interface $ZodCheckLengthEquals extends $ZodCheck { _zod: $ZodCheckLengthEqualsInternals; } declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>; 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"; interface $ZodCheckStringFormatDef extends $ZodCheckDef { check: "string_format"; format: Format; pattern?: RegExp | undefined; } interface $ZodCheckStringFormatInternals extends $ZodCheckInternals { def: $ZodCheckStringFormatDef; issc: $ZodIssueInvalidStringFormat; } interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef { format: "regex"; pattern: RegExp; } interface $ZodCheckRegexInternals extends $ZodCheckInternals { def: $ZodCheckRegexDef; issc: $ZodIssueInvalidStringFormat; } interface $ZodCheckRegex extends $ZodCheck { _zod: $ZodCheckRegexInternals; } declare const $ZodCheckRegex: $constructor<$ZodCheckRegex>; interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> { } interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals { def: $ZodCheckLowerCaseDef; issc: $ZodIssueInvalidStringFormat; } interface $ZodCheckLowerCase extends $ZodCheck { _zod: $ZodCheckLowerCaseInternals; } declare const $ZodCheckLowerCase: $constructor<$ZodCheckLowerCase>; interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> { } interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals { def: $ZodCheckUpperCaseDef; issc: $ZodIssueInvalidStringFormat; } interface $ZodCheckUpperCase extends $ZodCheck { _zod: $ZodCheckUpperCaseInternals; } declare const $ZodCheckUpperCase: $constructor<$ZodCheckUpperCase>; interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> { includes: string; position?: number | undefined; } interface $ZodCheckIncludesInternals extends $ZodCheckInternals { def: $ZodCheckIncludesDef; issc: $ZodIssueInvalidStringFormat; } interface $ZodCheckIncludes extends $ZodCheck { _zod: $ZodCheckIncludesInternals; } declare const $ZodCheckIncludes: $constructor<$ZodCheckIncludes>; interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> { prefix: string; } interface $ZodCheckStartsWithInternals extends $ZodCheckInternals { def: $ZodCheckStartsWithDef; issc: $ZodIssueInvalidStringFormat; } interface $ZodCheckStartsWith extends $ZodCheck { _zod: $ZodCheckStartsWithInternals; } declare const $ZodCheckStartsWith: $constructor<$ZodCheckStartsWith>; interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> { suffix: string; } interface $ZodCheckEndsWithInternals extends $ZodCheckInternals { def: $ZodCheckEndsWithDef; issc: $ZodIssueInvalidStringFormat; } interface $ZodCheckEndsWith extends $ZodCheckInternals { _zod: $ZodCheckEndsWithInternals; } declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>; interface $ZodIssueBase { readonly code?: string; readonly input?: unknown; readonly path: PropertyKey[]; readonly message: string; } interface $ZodIssueInvalidType extends $ZodIssueBase { readonly code: "invalid_type"; readonly expected: $ZodType["_zod"]["def"]["type"]; readonly input?: Input; } interface $ZodIssueTooBig extends $ZodIssueBase { readonly code: "too_big"; readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {}); readonly maximum: number | bigint; readonly inclusive?: boolean; readonly exact?: boolean; readonly input?: Input; } interface $ZodIssueTooSmall extends $ZodIssueBase { readonly code: "too_small"; readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {}); readonly minimum: number | bigint; /** True if the allowable range includes the minimum */ readonly inclusive?: boolean; /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */ readonly exact?: boolean; readonly input?: Input; } interface $ZodIssueInvalidStringFormat extends $ZodIssueBase { readonly code: "invalid_format"; readonly format: $ZodStringFormats | (string & {}); readonly pattern?: string; readonly input?: string; } interface $ZodIssueNotMultipleOf extends $ZodIssueBase { readonly code: "not_multiple_of"; readonly divisor: number; readonly input?: Input; } interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase { readonly code: "unrecognized_keys"; readonly keys: string[]; readonly input?: Record; } interface $ZodIssueInvalidUnion extends $ZodIssueBase { readonly code: "invalid_union"; readonly errors: $ZodIssue[][]; readonly input?: unknown; readonly discriminator?: string | undefined; } interface $ZodIssueInvalidKey extends $ZodIssueBase { readonly code: "invalid_key"; readonly origin: "map" | "record"; readonly issues: $ZodIssue[]; readonly input?: Input; } interface $ZodIssueInvalidElement extends $ZodIssueBase { readonly code: "invalid_element"; readonly origin: "map" | "set"; readonly key: unknown; readonly issues: $ZodIssue[]; readonly input?: Input; } interface $ZodIssueInvalidValue extends $ZodIssueBase { readonly code: "invalid_value"; readonly values: Primitive[]; readonly input?: Input; } interface $ZodIssueCustom extends $ZodIssueBase { readonly code: "custom"; readonly params?: Record | undefined; readonly input?: unknown; } type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom; type $ZodInternalIssue = T extends any ? RawIssue$1 : never; type RawIssue$1 = T extends any ? Flatten & { /** The input data */ readonly input: unknown; /** The schema or check that originated this issue. */ readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will continue executing checks/refinements after this issue. */ readonly continue?: boolean | undefined; } & Record> : never; type $ZodRawIssue = $ZodInternalIssue; interface $ZodErrorMap { (issue: $ZodRawIssue): { message: string; } | string | undefined | null; } interface $ZodError extends Error { type: T; issues: $ZodIssue[]; _zod: { output: T; def: $ZodIssue[]; }; stack?: string; name: string; } declare const $ZodError: $constructor<$ZodError>; type $ZodFlattenedError = _FlattenedError; type _FlattenedError = { formErrors: U[]; fieldErrors: { [P in keyof T]?: U[]; }; }; type _ZodFormattedError = T extends [any, ...any[]] ? { [K in keyof T]?: $ZodFormattedError; } : T extends any[] ? { [k: number]: $ZodFormattedError; } : T extends object ? Flatten<{ [K in keyof T]?: $ZodFormattedError; }> : any; type $ZodFormattedError = { _errors: U[]; } & Flatten<_ZodFormattedError>; type ZodTrait = { _zod: { def: any; [k: string]: any; }; }; interface $constructor { new (def: D): T; init(inst: T, def: D): asserts inst is T; } declare function $constructor(name: string, initializer: (inst: T, def: D) => void, params?: { Parent?: typeof Class; }): $constructor; declare const $brand: unique symbol; type $brand = { [$brand]: { [k in T]: true; }; }; type $ZodBranded = T & Record<"_zod", Record<"output", output & $brand>>; type input = T extends { _zod: { input: any; }; } ? T["_zod"]["input"] : unknown; type output = T extends { _zod: { output: any; }; } ? T["_zod"]["output"] : unknown; declare const $output: unique symbol; type $output = typeof $output; declare const $input: unique symbol; type $input = typeof $input; type $replace = Meta extends $output ? output : Meta extends $input ? input : Meta extends (infer M)[] ? $replace[] : Meta extends (...args: infer P) => infer R ? (...args: { [K in keyof P]: $replace; }) => $replace : Meta extends object ? { [K in keyof Meta]: $replace; } : Meta; type MetadataType = object | undefined; declare class $ZodRegistry { _meta: Meta; _schema: Schema; _map: Map>; _idmap: Map; add(schema: S, ..._meta: undefined extends Meta ? [$replace?] : [$replace]): this; clear(): this; remove(schema: Schema): this; get(schema: S): $replace | undefined; has(schema: Schema): boolean; } interface JSONSchemaMeta { id?: string | undefined; title?: string | undefined; description?: string | undefined; deprecated?: boolean | undefined; [k: string]: unknown; } interface GlobalMeta extends JSONSchemaMeta { } type Params = Flatten & ([IssueTypes] extends [never] ? {} : { error?: string | $ZodErrorMap | undefined; /** @deprecated This parameter is deprecated. Use `error` instead. */ message?: string | undefined; })>>>; type TypeParams = never> = Params, "type" | "checks" | "error" | AlsoOmit>; type CheckParams = never> = Params, "check" | "error" | AlsoOmit>; type CheckStringFormatParams = never> = Params, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>; type CheckTypeParams = never> = Params, "type" | "checks" | "error" | "check" | AlsoOmit>; type $ZodCheckEmailParams = CheckStringFormatParams<$ZodEmail, "when">; type $ZodCheckGUIDParams = CheckStringFormatParams<$ZodGUID, "pattern" | "when">; type $ZodCheckUUIDParams = CheckStringFormatParams<$ZodUUID, "pattern" | "when">; type $ZodCheckURLParams = CheckStringFormatParams<$ZodURL, "when">; type $ZodCheckEmojiParams = CheckStringFormatParams<$ZodEmoji, "when">; type $ZodCheckNanoIDParams = CheckStringFormatParams<$ZodNanoID, "when">; type $ZodCheckCUIDParams = CheckStringFormatParams<$ZodCUID, "when">; type $ZodCheckCUID2Params = CheckStringFormatParams<$ZodCUID2, "when">; type $ZodCheckULIDParams = CheckStringFormatParams<$ZodULID, "when">; type $ZodCheckXIDParams = CheckStringFormatParams<$ZodXID, "when">; type $ZodCheckKSUIDParams = CheckStringFormatParams<$ZodKSUID, "when">; type $ZodCheckIPv4Params = CheckStringFormatParams<$ZodIPv4, "pattern" | "when" | "version">; type $ZodCheckIPv6Params = CheckStringFormatParams<$ZodIPv6, "pattern" | "when" | "version">; type $ZodCheckCIDRv4Params = CheckStringFormatParams<$ZodCIDRv4, "pattern" | "when">; type $ZodCheckCIDRv6Params = CheckStringFormatParams<$ZodCIDRv6, "pattern" | "when">; type $ZodCheckBase64Params = CheckStringFormatParams<$ZodBase64, "pattern" | "when">; type $ZodCheckBase64URLParams = CheckStringFormatParams<$ZodBase64URL, "pattern" | "when">; type $ZodCheckE164Params = CheckStringFormatParams<$ZodE164, "when">; type $ZodCheckJWTParams = CheckStringFormatParams<$ZodJWT, "pattern" | "when">; type $ZodCheckISODateTimeParams = CheckStringFormatParams<$ZodISODateTime, "pattern" | "when">; type $ZodCheckISODateParams = CheckStringFormatParams<$ZodISODate, "pattern" | "when">; type $ZodCheckISOTimeParams = CheckStringFormatParams<$ZodISOTime, "pattern" | "when">; type $ZodCheckISODurationParams = CheckStringFormatParams<$ZodISODuration, "when">; type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">; type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">; type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">; type $ZodCheckRegexParams = CheckParams<$ZodCheckRegex, "format" | "pattern" | "when">; type $ZodCheckLowerCaseParams = CheckParams<$ZodCheckLowerCase, "format" | "when">; type $ZodCheckUpperCaseParams = CheckParams<$ZodCheckUpperCase, "format" | "when">; type $ZodCheckIncludesParams = CheckParams<$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">; type $ZodCheckStartsWithParams = CheckParams<$ZodCheckStartsWith, "prefix" | "format" | "when" | "pattern">; type $ZodCheckEndsWithParams = CheckParams<$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">; type $ZodEnumParams = TypeParams<$ZodEnum, "entries">; type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">; type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">; type $ZodSuperRefineIssue = T extends any ? RawIssue : never; type RawIssue = T extends any ? Flatten & { /** The schema or check that originated this issue. */ readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will continue executing checks/refinements after this issue. */ readonly continue?: boolean | undefined; } & Record> : never; interface $RefinementCtx extends ParsePayload { addIssue(arg: string | $ZodSuperRefineIssue): void; } /** An Error-like class used to store Zod validation issues. */ interface ZodError extends $ZodError { /** @deprecated Use the `z.treeifyError(err)` function instead. */ format(): $ZodFormattedError; format(mapper: (issue: $ZodIssue) => U): $ZodFormattedError; /** @deprecated Use the `z.treeifyError(err)` function instead. */ flatten(): $ZodFlattenedError; flatten(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError; /** @deprecated Push directly to `.issues` instead. */ addIssue(issue: $ZodIssue): void; /** @deprecated Push directly to `.issues` instead. */ addIssues(issues: $ZodIssue[]): void; /** @deprecated Check `err.issues.length === 0` instead. */ isEmpty: boolean; } declare const ZodError: $constructor; type ZodSafeParseResult = ZodSafeParseSuccess | ZodSafeParseError; type ZodSafeParseSuccess = { success: true; data: T; error?: never; }; type ZodSafeParseError = { success: false; data?: never; error: ZodError; }; interface _ZodType extends ZodType { } interface ZodType = $ZodTypeInternals> extends $ZodType { def: Internals["def"]; type: Internals["def"]["type"]; /** @deprecated Use `.def` instead. */ _def: Internals["def"]; /** @deprecated Use `z.output` instead. */ _output: Internals["output"]; /** @deprecated Use `z.input` instead. */ _input: Internals["input"]; check(...checks: (CheckFn> | $ZodCheck>)[]): this; clone(def?: Internals["def"], params?: { parent: boolean; }): this; register(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace?] : [$replace] : ["Incompatible schema"]): this; brand(value?: T): PropertyKey extends T ? this : $ZodBranded; parse(data: unknown, params?: ParseContext<$ZodIssue>): output; safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult>; parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise>; safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise>>; spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise>>; refine(check: (arg: output) => unknown | Promise, params?: string | $ZodCustomParams): this; superRefine(refinement: (arg: output, ctx: $RefinementCtx>) => void | Promise): this; overwrite(fn: (x: output) => output): this; optional(): ZodOptional; nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional; nullable(): ZodNullable; nullish(): ZodOptional>; default(def: output): ZodDefault; default(def: () => NoUndefined>): ZodDefault; prefault(def: () => input): ZodPrefault; prefault(def: input): ZodPrefault; array(): ZodArray; or(option: T): ZodUnion<[this, T]>; and(incoming: T): ZodIntersection; transform(transform: (arg: output, ctx: $RefinementCtx>) => NewOut | Promise): ZodPipe, output>>; catch(def: output): ZodCatch; catch(def: (ctx: $ZodCatchCtx) => output): ZodCatch; pipe>>(target: T | $ZodType>): ZodPipe; readonly(): ZodReadonly; /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */ describe(description: string): this; description?: string; /** Returns the metadata associated with this instance in `z.globalRegistry` */ meta(): $replace | undefined; /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */ meta(data: $replace): this; /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally): * * ```ts * const schema = z.string().optional(); * const isOptional = schema.safeParse(undefined).success; // true * ``` */ isOptional(): boolean; /** * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally): * * ```ts * const schema = z.string().nullable(); * const isNullable = schema.safeParse(null).success; // true * ``` */ isNullable(): boolean; } declare const ZodType: $constructor; interface _ZodString = $ZodStringInternals> extends _ZodType { format: string | null; minLength: number | null; maxLength: number | null; regex(regex: RegExp, params?: string | $ZodCheckRegexParams): this; includes(value: string, params?: $ZodCheckIncludesParams): this; startsWith(value: string, params?: string | $ZodCheckStartsWithParams): this; endsWith(value: string, params?: string | $ZodCheckEndsWithParams): this; min(minLength: number, params?: string | $ZodCheckMinLengthParams): this; max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this; length(len: number, params?: string | $ZodCheckLengthEqualsParams): this; nonempty(params?: string | $ZodCheckMinLengthParams): this; lowercase(params?: string | $ZodCheckLowerCaseParams): this; uppercase(params?: string | $ZodCheckUpperCaseParams): this; trim(): this; normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this; toLowerCase(): this; toUpperCase(): this; } /** @internal */ declare const _ZodString: $constructor<_ZodString>; interface ZodString extends _ZodString<$ZodStringInternals> { /** @deprecated Use `z.email()` instead. */ email(params?: string | $ZodCheckEmailParams): this; /** @deprecated Use `z.url()` instead. */ url(params?: string | $ZodCheckURLParams): this; /** @deprecated Use `z.jwt()` instead. */ jwt(params?: string | $ZodCheckJWTParams): this; /** @deprecated Use `z.emoji()` instead. */ emoji(params?: string | $ZodCheckEmojiParams): this; /** @deprecated Use `z.guid()` instead. */ guid(params?: string | $ZodCheckGUIDParams): this; /** @deprecated Use `z.uuid()` instead. */ uuid(params?: string | $ZodCheckUUIDParams): this; /** @deprecated Use `z.uuid()` instead. */ uuidv4(params?: string | $ZodCheckUUIDParams): this; /** @deprecated Use `z.uuid()` instead. */ uuidv6(params?: string | $ZodCheckUUIDParams): this; /** @deprecated Use `z.uuid()` instead. */ uuidv7(params?: string | $ZodCheckUUIDParams): this; /** @deprecated Use `z.nanoid()` instead. */ nanoid(params?: string | $ZodCheckNanoIDParams): this; /** @deprecated Use `z.guid()` instead. */ guid(params?: string | $ZodCheckGUIDParams): this; /** @deprecated Use `z.cuid()` instead. */ cuid(params?: string | $ZodCheckCUIDParams): this; /** @deprecated Use `z.cuid2()` instead. */ cuid2(params?: string | $ZodCheckCUID2Params): this; /** @deprecated Use `z.ulid()` instead. */ ulid(params?: string | $ZodCheckULIDParams): this; /** @deprecated Use `z.base64()` instead. */ base64(params?: string | $ZodCheckBase64Params): this; /** @deprecated Use `z.base64url()` instead. */ base64url(params?: string | $ZodCheckBase64URLParams): this; /** @deprecated Use `z.xid()` instead. */ xid(params?: string | $ZodCheckXIDParams): this; /** @deprecated Use `z.ksuid()` instead. */ ksuid(params?: string | $ZodCheckKSUIDParams): this; /** @deprecated Use `z.ipv4()` instead. */ ipv4(params?: string | $ZodCheckIPv4Params): this; /** @deprecated Use `z.ipv6()` instead. */ ipv6(params?: string | $ZodCheckIPv6Params): this; /** @deprecated Use `z.cidrv4()` instead. */ cidrv4(params?: string | $ZodCheckCIDRv4Params): this; /** @deprecated Use `z.cidrv6()` instead. */ cidrv6(params?: string | $ZodCheckCIDRv6Params): this; /** @deprecated Use `z.e164()` instead. */ e164(params?: string | $ZodCheckE164Params): this; /** @deprecated Use `z.iso.datetime()` instead. */ datetime(params?: string | $ZodCheckISODateTimeParams): this; /** @deprecated Use `z.iso.date()` instead. */ date(params?: string | $ZodCheckISODateParams): this; /** @deprecated Use `z.iso.time()` instead. */ time(params?: string | $ZodCheckISOTimeParams): this; /** @deprecated Use `z.iso.duration()` instead. */ duration(params?: string | $ZodCheckISODurationParams): this; } declare const ZodString: $constructor; interface ZodArray extends _ZodType<$ZodArrayInternals>, $ZodArray { element: T; min(minLength: number, params?: string | $ZodCheckMinLengthParams): this; nonempty(params?: string | $ZodCheckMinLengthParams): this; max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this; length(len: number, params?: string | $ZodCheckLengthEqualsParams): this; unwrap(): T; } declare const ZodArray: $constructor; interface ZodUnion extends _ZodType<$ZodUnionInternals>, $ZodUnion { options: T; } declare const ZodUnion: $constructor; interface ZodIntersection extends _ZodType<$ZodIntersectionInternals>, $ZodIntersection { } declare const ZodIntersection: $constructor; interface ZodEnum< /** @ts-ignore Cast variance */ out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals>, $ZodEnum { enum: T; options: Array; extract(values: U, params?: string | $ZodEnumParams): ZodEnum>>; exclude(values: U, params?: string | $ZodEnumParams): ZodEnum>>; } declare const ZodEnum: $constructor; interface ZodTransform extends _ZodType<$ZodTransformInternals>, $ZodTransform { } declare const ZodTransform: $constructor; interface ZodOptional extends _ZodType<$ZodOptionalInternals>, $ZodOptional { unwrap(): T; } declare const ZodOptional: $constructor; interface ZodNullable extends _ZodType<$ZodNullableInternals>, $ZodNullable { unwrap(): T; } declare const ZodNullable: $constructor; interface ZodDefault extends _ZodType<$ZodDefaultInternals>, $ZodDefault { unwrap(): T; /** @deprecated Use `.unwrap()` instead. */ removeDefault(): T; } declare const ZodDefault: $constructor; interface ZodPrefault extends _ZodType<$ZodPrefaultInternals>, $ZodPrefault { unwrap(): T; } declare const ZodPrefault: $constructor; interface ZodNonOptional extends _ZodType<$ZodNonOptionalInternals>, $ZodNonOptional { unwrap(): T; } declare const ZodNonOptional: $constructor; interface ZodCatch extends _ZodType<$ZodCatchInternals>, $ZodCatch { unwrap(): T; /** @deprecated Use `.unwrap()` instead. */ removeCatch(): T; } declare const ZodCatch: $constructor; interface ZodPipe extends _ZodType<$ZodPipeInternals>, $ZodPipe { in: A; out: B; } declare const ZodPipe: $constructor; interface ZodReadonly extends _ZodType<$ZodReadonlyInternals>, $ZodReadonly { unwrap(): T; } declare const ZodReadonly: $constructor; /** * Returns the environment variable schema for the specified preset. * * @param preset - The name of the preset to retrieve. Available presets are: * - 'vercel': For Vercel deployment environment variables. * - 'netlify': For Netlify deployment environment variables. * - 'fly': For Fly.io deployment environment variables. * - 'railway': For Railway deployment environment variables. * - 'render': For Render deployment environment variables. * * @returns An object containing the environment variable schemas defined for the specified preset. */ declare function preset(preset: 'vercel'): ReturnType; declare function preset(preset: 'netlify'): ReturnType; declare function preset(preset: 'fly'): ReturnType; declare function preset(preset: 'railway'): ReturnType; declare function preset(preset: 'render'): ReturnType; /** * Vercel System Environment Variables * @see https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables */ declare const vercel: () => { readonly VERCEL: ZodOptional; readonly CI: ZodOptional; readonly VERCEL_ENV: ZodOptional>; readonly VERCEL_URL: ZodOptional; readonly VERCEL_PROJECT_PRODUCTION_URL: ZodOptional; readonly VERCEL_BRANCH_URL: ZodOptional; readonly VERCEL_REGION: ZodOptional; readonly VERCEL_DEPLOYMENT_ID: ZodOptional; readonly VERCEL_SKEW_PROTECTION_ENABLED: ZodOptional; readonly VERCEL_AUTOMATION_BYPASS_SECRET: ZodOptional; readonly VERCEL_GIT_PROVIDER: ZodOptional; readonly VERCEL_GIT_REPO_SLUG: ZodOptional; readonly VERCEL_GIT_REPO_OWNER: ZodOptional; readonly VERCEL_GIT_REPO_ID: ZodOptional; readonly VERCEL_GIT_COMMIT_REF: ZodOptional; readonly VERCEL_GIT_COMMIT_SHA: ZodOptional; readonly VERCEL_GIT_COMMIT_MESSAGE: ZodOptional; readonly VERCEL_GIT_COMMIT_AUTHOR_LOGIN: ZodOptional; readonly VERCEL_GIT_COMMIT_AUTHOR_NAME: ZodOptional; readonly VERCEL_GIT_PREVIOUS_SHA: ZodOptional; readonly VERCEL_GIT_PULL_REQUEST_ID: ZodOptional; }; /** * Render System Environment Variables * @see https://docs.render.com/environment-variables#all-runtimes */ declare const render: () => { readonly IS_PULL_REQUEST: ZodOptional; readonly RENDER_DISCOVERY_SERVICE: ZodOptional; readonly RENDER_EXTERNAL_HOSTNAME: ZodOptional; readonly RENDER_EXTERNAL_URL: ZodOptional; readonly RENDER_GIT_BRANCH: ZodOptional; readonly RENDER_GIT_COMMIT: ZodOptional; readonly RENDER_GIT_REPO_SLUG: ZodOptional; readonly RENDER_INSTANCE_ID: ZodOptional; readonly RENDER_SERVICE_ID: ZodOptional; readonly RENDER_SERVICE_NAME: ZodOptional; readonly RENDER_SERVICE_TYPE: ZodOptional>; readonly RENDER: ZodOptional; }; /** * Railway Environment Variables * @see https://docs.railway.app/reference/variables#railway-provided-variables */ declare const railway: () => { readonly RAILWAY_PUBLIC_DOMAIN: ZodOptional; readonly RAILWAY_PRIVATE_DOMAIN: ZodOptional; readonly RAILWAY_TCP_PROXY_DOMAIN: ZodOptional; readonly RAILWAY_TCP_PROXY_PORT: ZodOptional; readonly RAILWAY_TCP_APPLICATION_PORT: ZodOptional; readonly RAILWAY_PROJECT_NAME: ZodOptional; readonly RAILWAY_PROJECT_ID: ZodOptional; readonly RAILWAY_ENVIRONMENT_NAME: ZodOptional; readonly RAILWAY_ENVIRONMENT_ID: ZodOptional; readonly RAILWAY_SERVICE_NAME: ZodOptional; readonly RAILWAY_SERVICE_ID: ZodOptional; readonly RAILWAY_REPLICA_ID: ZodOptional; readonly RAILWAY_DEPLOYMENT_ID: ZodOptional; readonly RAILWAY_SNAPSHOT_ID: ZodOptional; readonly RAILWAY_VOLUME_NAME: ZodOptional; readonly RAILWAY_VOLUME_MOUNT_PATH: ZodOptional; readonly RAILWAY_RUN_UID: ZodOptional; readonly RAILWAY_GIT_COMMIT_SHA: ZodOptional; readonly RAILWAY_GIT_AUTHOR_EMAIL: ZodOptional; readonly RAILWAY_GIT_BRANCH: ZodOptional; readonly RAILWAY_GIT_REPO_NAME: ZodOptional; readonly RAILWAY_GIT_REPO_OWNER: ZodOptional; readonly RAILWAY_GIT_COMMIT_MESSAGE: ZodOptional; }; /** * Fly.io Environment Variables * @see https://fly.io/docs/machines/runtime-environment/#environment-variables */ declare const fly: () => { readonly FLY_APP_NAME: ZodOptional; readonly FLY_MACHINE_ID: ZodOptional; readonly FLY_ALLOC_ID: ZodOptional; readonly FLY_REGION: ZodOptional; readonly FLY_PUBLIC_IP: ZodOptional; readonly FLY_IMAGE_REF: ZodOptional; readonly FLY_MACHINE_VERSION: ZodOptional; readonly FLY_PRIVATE_IP: ZodOptional; readonly FLY_PROCESS_GROUP: ZodOptional; readonly FLY_VM_MEMORY_MB: ZodOptional; readonly PRIMARY_REGION: ZodOptional; }; /** * Netlify Environment Variables * @see https://docs.netlify.com/configure-builds/environment-variables */ declare const netlify: () => { readonly NETLIFY: ZodOptional; readonly BUILD_ID: ZodOptional; readonly CONTEXT: ZodOptional>; readonly REPOSITORY_URL: ZodOptional; readonly BRANCH: ZodOptional; readonly URL: ZodOptional; readonly DEPLOY_URL: ZodOptional; readonly DEPLOY_PRIME_URL: ZodOptional; readonly DEPLOY_ID: ZodOptional; readonly SITE_NAME: ZodOptional; readonly SITE_ID: ZodOptional; }; /** * * Represents a type that can either be ``null`` or ``undefined``. * @export type {Nullable} */ type Nullable = null | undefined; /** Represnets a type that might be nullable, as in it might be `null` or `undefined`. */ type Maybe = T | Nullable; /** * Represents a unique array type that filters out duplicate elements. * If a duplicate is encountered, it returns a tuple with an error message and the duplicate element. * * @template T The type of the elements in the array, which must be a readonly array. * @returns A readonly array of unique elements or a tuple indicating a duplicate. * * @example * ``` * type Result1 = UniqueArray<[1, 2, 3, 1]>; // Result: ['Encountered duplicate element', 1] * type Result2 = UniqueArray<[1, 2, 3]>; // Result: [1, 2, 3] * type Result3 = UniqueArray<[]>; // Result: [] * ``` */ type UniqueArray = T extends readonly [infer Head, ...infer Tail] ? Head extends Seen ? ['Encountered duplicate element', Head] : readonly [Head, ...UniqueArray] : T; /** * Represents a record of environment variable definitions * where each key maps to a Zod schema. */ type EnvVar = Record; /** * Produces a runtime environment type that optionally applies a prefix * to each key, except for those listed in `DisabledKeys`. */ type PrefixedRuntimeEnv, DisabledKeys extends readonly (keyof S & string)[]> = { [K in keyof S as K extends DisabledKeys[number] ? K : P extends string ? `${P}_${string & K}` : K]: Maybe; }; /** * Configuration object for creating a typed, prefixed environment. */ interface EnvSchema, DisabledKeys extends readonly (keyof S & string)[] = []> { /** Zod schemas for each environment variable */ vars: S; /** Optional prefix to prepend to environment variable keys */ prefix?: P; /** Skip validation altogether */ skipValidation?: boolean; /** Keys that should not be prefixed */ disablePrefix?: UniqueArray; /** A manually provided environment object, merged with process.env */ runtimeEnv?: PrefixedRuntimeEnv; } /** Infers the validated TypeScript type for each variable in the EnvVar record. */ type InferEnvVars = { [K in keyof S]: output; }; /** * Renames (prefixes) the keys of the inferred environment variables, * skipping those that appear in `D`. */ type RenameKeys, D extends string> = { [K in keyof E as K extends D ? K : P extends string ? K extends string ? `${P}_${K}` : K : K]: E[K]; }; /** Final shape of the environment object after key prefixing and schema inference. */ type PrefixedEnvVars, D extends keyof S & string = never> = RenameKeys, P, D>; /** * Creates a typed environment object with optional key prefixing and schema validation. * * @throws if validation fails and `skipValidation` is false */ declare function createEnv = undefined, D extends readonly (keyof S & string)[] = []>(options: EnvSchema): PrefixedEnvVars; export { createEnv, preset };