import { z } from '@deboxsoft/module-core'; type JsonSchema7AnyType = {}; declare function parseAnyDef(): JsonSchema7AnyType; type ErrorMessages = Partial>; declare function addErrorMessage; }>(res: T, key: keyof T, errorMessage: string | undefined, refs: Refs): void; declare function setResponseValueAndErrors; }, Key extends keyof Omit>(res: Json7Type, key: Key, value: Json7Type[Key], errorMessage: string | undefined, refs: Refs): void; type JsonSchema7ArrayType = { type: "array"; items?: JsonSchema7Type; minItems?: number; maxItems?: number; errorMessages?: ErrorMessages; }; declare function parseArrayDef(def: z.ZodArrayDef, refs: Refs): JsonSchema7ArrayType; type JsonSchema7BigintType = { type: "integer"; format: "int64"; minimum?: BigInt; exclusiveMinimum?: BigInt; maximum?: BigInt; exclusiveMaximum?: BigInt; multipleOf?: BigInt; errorMessage?: ErrorMessages; }; declare function parseBigintDef(def: z.ZodBigIntDef, refs: Refs): JsonSchema7BigintType; type JsonSchema7BooleanType = { type: "boolean"; }; declare function parseBooleanDef(): JsonSchema7BooleanType; type JsonSchema7NumberType = { type: "number" | "integer"; minimum?: number; exclusiveMinimum?: number; maximum?: number; exclusiveMaximum?: number; multipleOf?: number; errorMessage?: ErrorMessages; }; declare function parseNumberDef(def: z.ZodNumberDef, refs: Refs): JsonSchema7NumberType; type JsonSchema7DateType = { type: "integer" | "string"; format: "unix-time" | "date-time" | "date"; minimum?: number; maximum?: number; errorMessage?: ErrorMessages; } | { anyOf: JsonSchema7DateType[]; }; declare function parseDateDef(def: z.ZodDateDef, refs: Refs, overrideDateStrategy?: DateStrategy): JsonSchema7DateType; type JsonSchema7EnumType = { type: "string"; enum: string[]; }; declare function parseEnumDef(def: z.ZodEnumDef): JsonSchema7EnumType; type JsonSchema7AllOfType = { allOf: JsonSchema7Type[]; unevaluatedProperties?: boolean; }; declare function parseIntersectionDef(def: z.ZodIntersectionDef, refs: Refs): JsonSchema7AllOfType | JsonSchema7Type | undefined; type JsonSchema7LiteralType = { type: "string" | "number" | "integer" | "boolean"; const: string | number | boolean; } | { type: "object" | "array"; }; declare function parseLiteralDef(def: z.ZodLiteralDef, refs: Refs): JsonSchema7LiteralType; /** * Generated from the regular expressions found here as of 2024-05-22: * https://github.com/colinhacks/zod/blob/master/src/types.ts. * * Expressions with /i flag have been changed accordingly. */ declare const zodPatterns: { /** * `c` was changed to `[cC]` to replicate /i flag */ readonly cuid: RegExp; readonly cuid2: RegExp; readonly ulid: RegExp; /** * `a-z` was added to replicate /i flag */ readonly email: RegExp; /** * Constructed a valid Unicode RegExp * * Lazily instantiate since this type of regex isn't supported * in all envs (e.g. React Native). * * See: * https://github.com/colinhacks/zod/issues/2433 * Fix in Zod: * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b */ readonly emoji: () => RegExp; /** * Unused */ readonly uuid: RegExp; /** * Unused */ readonly ipv4: RegExp; readonly ipv4Cidr: RegExp; /** * Unused */ readonly ipv6: RegExp; readonly ipv6Cidr: RegExp; readonly base64: RegExp; readonly base64url: RegExp; readonly nanoid: RegExp; readonly jwt: RegExp; }; type JsonSchema7StringType = { type: "string"; minLength?: number; maxLength?: number; format?: "email" | "idn-email" | "uri" | "uuid" | "date-time" | "ipv4" | "ipv6" | "date" | "time" | "duration"; pattern?: string; allOf?: { pattern: string; errorMessage?: ErrorMessages<{ pattern: string; }>; }[]; anyOf?: { format: string; errorMessage?: ErrorMessages<{ format: string; }>; }[]; errorMessage?: ErrorMessages; contentEncoding?: string; }; declare function parseStringDef(def: z.ZodStringDef, refs: Refs): JsonSchema7StringType; type JsonSchema7RecordPropertyNamesType = Omit | Omit; type JsonSchema7RecordType = { type: "object"; additionalProperties?: JsonSchema7Type | true; propertyNames?: JsonSchema7RecordPropertyNamesType; }; declare function parseRecordDef(def: z.ZodRecordDef | z.ZodMapDef, refs: Refs): JsonSchema7RecordType; type JsonSchema7MapType = { type: "array"; maxItems: 125; items: { type: "array"; items: [JsonSchema7Type, JsonSchema7Type]; minItems: 2; maxItems: 2; }; }; declare function parseMapDef(def: z.ZodMapDef, refs: Refs): JsonSchema7MapType | JsonSchema7RecordType; type JsonSchema7NativeEnumType = { type: "string" | "number" | ["string", "number"]; enum: (string | number)[]; }; declare function parseNativeEnumDef(def: z.ZodNativeEnumDef): JsonSchema7NativeEnumType; type JsonSchema7NeverType = { not: {}; }; declare function parseNeverDef(): JsonSchema7NeverType; type JsonSchema7NullType = { type: "null"; }; declare function parseNullDef(refs: Refs): JsonSchema7NullType; type JsonSchema7NullableType = { anyOf: [JsonSchema7Type, JsonSchema7NullType]; } | { type: [string, "null"]; }; declare function parseNullableDef(def: z.ZodNullableDef, refs: Refs): JsonSchema7NullableType | undefined; type JsonSchema7ObjectType = { type: "object"; properties: Record; additionalProperties?: boolean | JsonSchema7Type; required?: string[]; }; declare function parseObjectDef(def: z.ZodObjectDef, refs: Refs): JsonSchema7ObjectType; type JsonSchema7SetType = { type: "array"; uniqueItems: true; items?: JsonSchema7Type; minItems?: number; maxItems?: number; errorMessage?: ErrorMessages; }; declare function parseSetDef(def: z.ZodSetDef, refs: Refs): JsonSchema7SetType; type JsonSchema7TupleType = { type: "array"; minItems: number; items: JsonSchema7Type[]; } & ({ maxItems: number; } | { additionalItems?: JsonSchema7Type; }); declare function parseTupleDef(def: z.ZodTupleDef, refs: Refs): JsonSchema7TupleType; type JsonSchema7UndefinedType = { not: {}; }; declare function parseUndefinedDef(): JsonSchema7UndefinedType; declare const primitiveMappings: { readonly ZodString: "string"; readonly ZodNumber: "number"; readonly ZodBigInt: "integer"; readonly ZodBoolean: "boolean"; readonly ZodNull: "null"; }; type JsonSchema7Primitive = (typeof primitiveMappings)[keyof typeof primitiveMappings]; type JsonSchema7UnionType = JsonSchema7PrimitiveUnionType | JsonSchema7AnyOfType; type JsonSchema7PrimitiveUnionType = { type: JsonSchema7Primitive | JsonSchema7Primitive[]; } | { type: JsonSchema7Primitive | JsonSchema7Primitive[]; enum: (string | number | bigint | boolean | null)[]; }; type JsonSchema7AnyOfType = { anyOf: JsonSchema7Type[]; }; declare function parseUnionDef(def: z.ZodUnionDef | z.ZodDiscriminatedUnionDef, refs: Refs): JsonSchema7PrimitiveUnionType | JsonSchema7AnyOfType | undefined; type JsonSchema7UnknownType = {}; declare function parseUnknownDef(): JsonSchema7UnknownType; type JsonSchema7RefType = { $ref: string; }; type JsonSchema7Meta = { title?: string; default?: any; description?: string; markdownDescription?: string; }; type JsonSchema7TypeUnion = JsonSchema7StringType | JsonSchema7ArrayType | JsonSchema7NumberType | JsonSchema7BigintType | JsonSchema7BooleanType | JsonSchema7DateType | JsonSchema7EnumType | JsonSchema7LiteralType | JsonSchema7NativeEnumType | JsonSchema7NullType | JsonSchema7NumberType | JsonSchema7ObjectType | JsonSchema7RecordType | JsonSchema7TupleType | JsonSchema7UnionType | JsonSchema7UndefinedType | JsonSchema7RefType | JsonSchema7NeverType | JsonSchema7MapType | JsonSchema7AnyType | JsonSchema7NullableType | JsonSchema7AllOfType | JsonSchema7UnknownType | JsonSchema7SetType; type JsonSchema7Type = JsonSchema7TypeUnion & JsonSchema7Meta; type Refs = { seen: Map; currentPath: string[]; propertyPath: string[] | undefined; } & Options; type Seen = { def: z.ZodTypeDef; path: string[]; jsonSchema: JsonSchema7Type | undefined; }; declare const getRefs: (options?: string | Partial>) => Refs; type Targets = "jsonSchema7" | "jsonSchema2019-09" | "openApi3" | "openAi"; type DateStrategy = "format:date-time" | "format:date" | "string" | "integer"; declare const ignoreOverride: unique symbol; type OverrideCallback = (def: z.ZodTypeDef, refs: Refs, seen: Seen | undefined, forceResolution?: boolean) => JsonSchema7Type | undefined | typeof ignoreOverride; type PostProcessCallback = (jsonSchema: JsonSchema7Type | undefined, def: z.ZodTypeDef, refs: Refs) => JsonSchema7Type | undefined; declare const jsonDescription: PostProcessCallback; type Options = { name: string | undefined; $refStrategy: "root" | "relative" | "none" | "seen"; basePath: string[]; effectStrategy: "input" | "any"; pipeStrategy: "input" | "output" | "all"; dateStrategy: DateStrategy | DateStrategy[]; mapStrategy: "entries" | "record"; removeAdditionalStrategy: "passthrough" | "strict"; allowedAdditionalProperties: true | undefined; rejectedAdditionalProperties: false | undefined; target: Target; strictUnions: boolean; definitionPath: string; definitions: Record; errorMessages: boolean; markdownDescription: boolean; patternStrategy: "escape" | "preserve"; applyRegexFlags: boolean; emailStrategy: "format:email" | "format:idn-email" | "pattern:zod"; base64Strategy: "format:binary" | "contentEncoding:base64" | "pattern:zod"; nameStrategy: "ref" | "title"; override?: OverrideCallback; postProcess?: PostProcessCallback; }; declare const defaultOptions: Options; declare const getDefaultOptions: (options: Partial> | string | undefined) => Options; declare function parseDef(def: z.ZodTypeDef, refs: Refs, forceResolution?: boolean): JsonSchema7Type | undefined; declare function parseBrandedDef(_def: z.ZodBrandedDef, refs: Refs): JsonSchema7Type | undefined; declare const parseCatchDef: (def: z.ZodCatchDef, refs: Refs) => JsonSchema7Type | undefined; declare function parseDefaultDef(_def: z.ZodDefaultDef, refs: Refs): JsonSchema7Type & { default: any; }; declare function parseEffectsDef(_def: z.ZodEffectsDef, refs: Refs): JsonSchema7Type | undefined; declare const parseOptionalDef: (def: z.ZodOptionalDef, refs: Refs) => JsonSchema7Type | undefined; declare const parsePipelineDef: (def: z.ZodPipelineDef, refs: Refs) => JsonSchema7AllOfType | JsonSchema7Type | undefined; declare function parsePromiseDef(def: z.ZodPromiseDef, refs: Refs): JsonSchema7Type | undefined; declare const parseReadonlyDef: (def: z.ZodReadonlyDef, refs: Refs) => JsonSchema7Type | undefined; type InnerDefGetter = () => any; declare const selectParser: (def: any, typeName: z.ZodFirstPartyTypeKind, refs: Refs) => JsonSchema7Type | undefined | InnerDefGetter; declare const zodToJsonSchema: (schema: z.ZodSchema, options?: Partial> | string) => (Target extends "jsonSchema7" ? JsonSchema7Type : object) & { $schema?: string; definitions?: { [key: string]: Target extends "jsonSchema7" ? JsonSchema7Type : Target extends "jsonSchema2019-09" ? JsonSchema7Type : object; }; }; export { type DateStrategy, type ErrorMessages, type InnerDefGetter, type JsonSchema7AllOfType, type JsonSchema7AnyType, type JsonSchema7ArrayType, type JsonSchema7BigintType, type JsonSchema7BooleanType, type JsonSchema7DateType, type JsonSchema7EnumType, type JsonSchema7LiteralType, type JsonSchema7MapType, type JsonSchema7NativeEnumType, type JsonSchema7NeverType, type JsonSchema7NullType, type JsonSchema7NullableType, type JsonSchema7NumberType, type JsonSchema7ObjectType, type JsonSchema7RecordType, type JsonSchema7SetType, type JsonSchema7StringType, type JsonSchema7TupleType, type JsonSchema7Type, type JsonSchema7TypeUnion, type JsonSchema7UndefinedType, type JsonSchema7UnionType, type JsonSchema7UnknownType, type Options, type OverrideCallback, type PostProcessCallback, type Refs, type Seen, type Targets, addErrorMessage, zodToJsonSchema as default, defaultOptions, getDefaultOptions, getRefs, ignoreOverride, jsonDescription, parseAnyDef, parseArrayDef, parseBigintDef, parseBooleanDef, parseBrandedDef, parseCatchDef, parseDateDef, parseDef, parseDefaultDef, parseEffectsDef, parseEnumDef, parseIntersectionDef, parseLiteralDef, parseMapDef, parseNativeEnumDef, parseNeverDef, parseNullDef, parseNullableDef, parseNumberDef, parseObjectDef, parseOptionalDef, parsePipelineDef, parsePromiseDef, parseReadonlyDef, parseRecordDef, parseSetDef, parseStringDef, parseTupleDef, parseUndefinedDef, parseUnionDef, parseUnknownDef, primitiveMappings, selectParser, setResponseValueAndErrors, zodPatterns, zodToJsonSchema };