diff --git a/packages/jdm-editor/package.json b/packages/jdm-editor/package.json index e0e552a4..0816cb1d 100644 --- a/packages/jdm-editor/package.json +++ b/packages/jdm-editor/package.json @@ -46,7 +46,7 @@ "fast-deep-equal": "^3.1.3", "immer": "10.1.1", "json5": "^2.2.3", - "monaco-editor": "^0.48.0", + "monaco-editor": "^0.50.0", "react-ace": "^11.0.1", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "16.0.1", diff --git a/packages/jdm-editor/src/components/decision-graph/context/dg-store.context.tsx b/packages/jdm-editor/src/components/decision-graph/context/dg-store.context.tsx index 87bc6ecb..606d2b32 100644 --- a/packages/jdm-editor/src/components/decision-graph/context/dg-store.context.tsx +++ b/packages/jdm-editor/src/components/decision-graph/context/dg-store.context.tsx @@ -1,3 +1,4 @@ +import type { Monaco } from '@monaco-editor/react'; import equal from 'fast-deep-equal/es6/react'; import { produce } from 'immer'; import type { WritableDraft } from 'immer/src/types/types-external'; @@ -109,6 +110,7 @@ export type DecisionGraphStoreType = { onPanelsChange?: (val?: string) => void; onReactFlowInit?: (instance: ReactFlowInstance) => void; onCodeExtension?: CodeEditorProps['extension']; + onFunctionReady?: (monaco: Monaco) => void; }; }; diff --git a/packages/jdm-editor/src/components/decision-graph/dg-empty.tsx b/packages/jdm-editor/src/components/decision-graph/dg-empty.tsx index 2cb8e381..884c5eb7 100644 --- a/packages/jdm-editor/src/components/decision-graph/dg-empty.tsx +++ b/packages/jdm-editor/src/components/decision-graph/dg-empty.tsx @@ -32,6 +32,7 @@ export type DecisionGraphEmptyType = { onReactFlowInit?: DecisionGraphStoreType['listeners']['onReactFlowInit']; onCodeExtension?: DecisionGraphStoreType['listeners']['onCodeExtension']; + onFunctionReady?: DecisionGraphStoreType['listeners']['onFunctionReady']; }; export const DecisionGraphEmpty: React.FC = ({ @@ -49,6 +50,7 @@ export const DecisionGraphEmpty: React.FC = ({ onPanelsChange, onReactFlowInit, onCodeExtension, + onFunctionReady, }) => { const mountedRef = useRef(false); const graphActions = useDecisionGraphActions(); @@ -83,8 +85,9 @@ export const DecisionGraphEmpty: React.FC = ({ onReactFlowInit, onPanelsChange, onCodeExtension, + onFunctionReady, }); - }, [onReactFlowInit, onPanelsChange, onCodeExtension]); + }, [onReactFlowInit, onPanelsChange, onCodeExtension, onFunctionReady]); useEffect(() => { listenerStore.setState({ onChange: innerChange }); diff --git a/packages/jdm-editor/src/components/decision-graph/graph/tab-function.tsx b/packages/jdm-editor/src/components/decision-graph/graph/tab-function.tsx index aa920c7c..9963f36a 100644 --- a/packages/jdm-editor/src/components/decision-graph/graph/tab-function.tsx +++ b/packages/jdm-editor/src/components/decision-graph/graph/tab-function.tsx @@ -1,8 +1,9 @@ +import type { Monaco } from '@monaco-editor/react'; import { Spin } from 'antd'; -import React, { Suspense } from 'react'; +import React, { Suspense, useEffect, useState } from 'react'; import { P, match } from 'ts-pattern'; -import { useDecisionGraphActions, useDecisionGraphState } from '../context/dg-store.context'; +import { useDecisionGraphActions, useDecisionGraphListeners, useDecisionGraphState } from '../context/dg-store.context'; import type { SimulationTrace, SimulationTraceDataFunction } from '../types/simulation.types'; const Function = React.lazy(async () => { @@ -16,7 +17,9 @@ export type TabFunctionProps = { export const TabFunction: React.FC = ({ id }) => { const graphActions = useDecisionGraphActions(); - const { nodeTrace, disabled, content } = useDecisionGraphState( + const onFunctionReady = useDecisionGraphListeners((s) => s.onFunctionReady); + const [monaco, setMonaco] = useState(); + const { nodeTrace, disabled, content, additionalModules } = useDecisionGraphState( ({ simulate, disabled, configurable, decisionGraph }) => ({ nodeTrace: match(simulate) .with({ result: P._ }, ({ result }) => result?.trace?.[id]) @@ -24,12 +27,44 @@ export const TabFunction: React.FC = ({ id }) => { disabled, configurable, content: (decisionGraph?.nodes ?? []).find((node) => node.id === id)?.content, + additionalModules: (decisionGraph?.nodes ?? []) + .filter((node) => node.type === 'functionNode') + .map((node) => ({ + id: node.id, + name: node.name, + content: node.content, + })), }), ); + useEffect(() => { + if (!monaco) { + return; + } + + const extraLibs = monaco.languages.typescript.javascriptDefaults.getExtraLibs(); + const newExtraLibs = Object.entries(extraLibs) + .map(([key, value]) => ({ + filePath: key, + content: value.content, + })) + .filter((i) => !i.filePath.startsWith('node:')); + + additionalModules.forEach((module) => { + newExtraLibs.push({ + filePath: `node:${module.name}`, + content: `declare module 'node:${module.name}' { ${module.content} }`, + }); + }); + + monaco.languages.typescript.javascriptDefaults.setExtraLibs(newExtraLibs); + onFunctionReady?.(monaco); + }, [JSON.stringify(additionalModules), monaco, onFunctionReady]); + return ( }> setMonaco(monaco)} value={typeof content === 'string' ? content : ''} onChange={(val) => { graphActions.updateNode(id, (draft) => { diff --git a/packages/jdm-editor/src/components/function/function.tsx b/packages/jdm-editor/src/components/function/function.tsx index b6d1ff94..7e9887d7 100644 --- a/packages/jdm-editor/src/components/function/function.tsx +++ b/packages/jdm-editor/src/components/function/function.tsx @@ -1,5 +1,5 @@ import { FormatPainterOutlined } from '@ant-design/icons'; -import { Editor, useMonaco } from '@monaco-editor/react'; +import { Editor, type Monaco, useMonaco } from '@monaco-editor/react'; import { Button, Spin, theme } from 'antd'; import type { editor } from 'monaco-editor'; import React, { useEffect, useRef, useState } from 'react'; @@ -20,6 +20,7 @@ export type FunctionProps = { value?: string; onChange?: (value: string) => void; trace?: SimulationTrace; + onMonacoReady?: (monaco: Monaco) => void; }; export const Function: React.FC = ({ @@ -30,6 +31,7 @@ export const Function: React.FC = ({ value, onChange, trace, + onMonacoReady, }) => { const monaco = useMonaco(); const mountedRef = useRef(false); @@ -51,14 +53,32 @@ export const Function: React.FC = ({ useEffect(() => { if (!monaco) return; - const extraLibs = Object.keys(functionDefinitions).map( - (pkg: keyof typeof functionDefinitions) => ({ - content: `declare module '${pkg}' { ${functionDefinitions[pkg]} }`, - }), - {}, - ); + monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ + target: monaco.languages.typescript.ScriptTarget.ES2020, + module: monaco.languages.typescript.ModuleKind.ESNext, + moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs, + allowSyntheticDefaultImports: true, + allowNonTsExtensions: true, + allowJs: true, + checkJs: true, + }); - monaco.languages.typescript.javascriptDefaults.setExtraLibs(extraLibs); + monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({ + noSyntaxValidation: false, + noSemanticValidation: false, + noSuggestionDiagnostics: false, + onlyVisible: false, + }); + + Object.entries(functionDefinitions.libs).forEach(([pkg, types]) => { + monaco.languages.typescript.javascriptDefaults.addExtraLib(`declare module '${pkg}' { ${types} }`, pkg); + }); + + Object.entries(functionDefinitions.globals).forEach(([pkg, types]) => { + monaco.languages.typescript.javascriptDefaults.addExtraLib(types, `ts:${pkg}`); + }); + + onMonacoReady?.(monaco); }, [monaco]); useEffect(() => { diff --git a/packages/jdm-editor/src/components/function/helpers/default-function.js b/packages/jdm-editor/src/components/function/helpers/default-function.js index cad7d9f1..4eea9882 100644 --- a/packages/jdm-editor/src/components/function/helpers/default-function.js +++ b/packages/jdm-editor/src/components/function/helpers/default-function.js @@ -1,10 +1,7 @@ -/** - * @param input - * @param {{ - * dayjs: import('dayjs') - * Big: import('big.js').BigConstructor - * }} helpers - */ -const handler = (input, { dayjs, Big }) => { +import http from 'http'; +import zen from 'zen'; + +export const handler = async (input) => { + const a = zen.evaluate(); return input; }; diff --git a/packages/jdm-editor/src/components/function/helpers/global.d.ts b/packages/jdm-editor/src/components/function/helpers/global.d.ts new file mode 100644 index 00000000..8205af24 --- /dev/null +++ b/packages/jdm-editor/src/components/function/helpers/global.d.ts @@ -0,0 +1,11 @@ +declare namespace console { + function log(...args: any[]): void; +} + +interface Config { + readonly maxDepth: number; + readonly iteration: number; + readonly trace: boolean; +} + +declare const config: Config; diff --git a/packages/jdm-editor/src/components/function/helpers/http.d.ts b/packages/jdm-editor/src/components/function/helpers/http.d.ts new file mode 100644 index 00000000..b93bda81 --- /dev/null +++ b/packages/jdm-editor/src/components/function/helpers/http.d.ts @@ -0,0 +1,28 @@ +declare class HttpResponse { + readonly data: any; + readonly headers: Record; + readonly status: number; +} + +interface HttpConfig { + headers: Record; + params: Record; + data: any; +} + +export class Http { + head(url: string, config?: HttpConfig): Promise; + + get(url: string, config?: HttpConfig): Promise; + + delete(url: string, config?: HttpConfig): Promise; + + post(url: string, data: any, config?: HttpConfig): Promise; + + patch(url: string, data: any, config?: HttpConfig): Promise; + + put(url: string, data: any, config?: HttpConfig): Promise; +} + +declare const http: Http; +export default http; diff --git a/packages/jdm-editor/src/components/function/helpers/libs.ts b/packages/jdm-editor/src/components/function/helpers/libs.ts index 8a752c39..56e8086e 100644 --- a/packages/jdm-editor/src/components/function/helpers/libs.ts +++ b/packages/jdm-editor/src/components/function/helpers/libs.ts @@ -6,10 +6,26 @@ import dayjs from 'dayjs/index.d.ts?raw'; // @ts-ignore import defaultFn from './default-function.js?raw'; +// @ts-ignore +import globalDts from './global.d.ts?raw'; +// @ts-ignore +import http from './http.d.ts?raw'; +// @ts-ignore +import zen from './zen.d.ts?raw'; +// @ts-ignore +import zod from './zod.d.ts?raw'; export const functionDefinitions = { - dayjs, - 'big.js': bigJs, + libs: { + dayjs, + 'big.js': bigJs, + zod, + http, + zen, + }, + globals: { + 'global.d.ts': globalDts, + }, }; export const defaultFunctionValue = defaultFn; diff --git a/packages/jdm-editor/src/components/function/helpers/zen.d.ts b/packages/jdm-editor/src/components/function/helpers/zen.d.ts new file mode 100644 index 00000000..bd22ecb5 --- /dev/null +++ b/packages/jdm-editor/src/components/function/helpers/zen.d.ts @@ -0,0 +1,48 @@ +interface EvaluateOptions { + trace?: boolean; +} + +interface EvaluateResponse { + performance: string; + result: any; + trace?: any; +} + +interface ZenModule { + /** + * Evaluates ZEN expression + * @param expression + * @param context Must contain '$' key + */ + evaluateExpression(expression: string, context: any): any; + + /** + * Evaluates ZEN unary expression + * @param expression + * @param context Must contain '$' key + */ + evaluateUnaryExpression(expression: string, context: any): boolean; + + /** + * Evaluates ZEN unary expression + * @param file File to be evaluated via DecisionLoader + * @param context + * @param opts + */ + evaluate(file: string, context: any, opts?: EvaluateOptions): Promise; + + /** + * Get Content from the DecisionLoader + * @param file + */ + get(file: string): Promise; +} + +export const evaluateExpression: ZenModule['evaluateExpression']; +export const evaluateUnaryExpression: ZenModule['evaluateUnaryExpression']; +export const evaluate: ZenModule['evaluate']; +export const get: ZenModule['get']; + +declare const zenModule: ZenModule; + +export default zenModule; diff --git a/packages/jdm-editor/src/components/function/helpers/zod.d.ts b/packages/jdm-editor/src/components/function/helpers/zod.d.ts new file mode 100644 index 00000000..02616fdb --- /dev/null +++ b/packages/jdm-editor/src/components/function/helpers/zod.d.ts @@ -0,0 +1,2895 @@ +declare type Primitive = string | number | symbol | bigint | boolean | null | undefined; +declare type Scalars = Primitive | Primitive[]; + +declare namespace util { + type AssertEqual = (() => V extends T ? 1 : 2) extends () => V extends U ? 1 : 2 ? true : false; + export type isAny = 0 extends 1 & T ? true : false; + export const assertEqual: (val: AssertEqual) => AssertEqual; + export function assertIs(_arg: T): void; + export function assertNever(_x: never): never; + export type Omit = Pick>; + export type OmitKeys = Pick>; + export type MakePartial = Omit & Partial>; + export type Exactly = T & Record, never>; + export const arrayToEnum: (items: U) => { [k in U[number]]: k }; + export const getValidEnumValues: (obj: any) => any[]; + export const objectValues: (obj: any) => any[]; + export const objectKeys: ObjectConstructor['keys']; + export const find: (arr: T[], checker: (arg: T) => any) => T | undefined; + export type identity = objectUtil.identity; + export type flatten = objectUtil.flatten; + export type noUndefined = T extends undefined ? never : T; + export const isInteger: NumberConstructor['isInteger']; + export function joinValues(array: T, separator?: string): string; + export const jsonStringifyReplacer: (_: string, value: any) => any; + export {}; +} +declare namespace objectUtil { + export type MergeShapes = { + [k in Exclude]: U[k]; + } & V; + type optionalKeys = { + [k in keyof T]: undefined extends T[k] ? k : never; + }[keyof T]; + type requiredKeys = { + [k in keyof T]: undefined extends T[k] ? never : k; + }[keyof T]; + export type addQuestionMarks = { + [K in requiredKeys]: T[K]; + } & { + [K in optionalKeys]?: T[K]; + } & { + [k in keyof T]?: unknown; + }; + export type identity = T; + export type flatten = identity<{ + [k in keyof T]: T[k]; + }>; + export type noNeverKeys = { + [k in keyof T]: [T[k]] extends [never] ? never : k; + }[keyof T]; + export type noNever = identity<{ + [k in noNeverKeys]: k extends keyof T ? T[k] : never; + }>; + export const mergeShapes: (first: U, second: T) => T & U; + export type extendShape = { + [K in keyof A as K extends keyof B ? never : K]: A[K]; + } & { + [K in keyof B]: B[K]; + }; + export {}; +} +declare const ZodParsedType: { + function: 'function'; + number: 'number'; + string: 'string'; + nan: 'nan'; + integer: 'integer'; + float: 'float'; + boolean: 'boolean'; + date: 'date'; + bigint: 'bigint'; + symbol: 'symbol'; + undefined: 'undefined'; + null: 'null'; + array: 'array'; + object: 'object'; + unknown: 'unknown'; + promise: 'promise'; + void: 'void'; + never: 'never'; + map: 'map'; + set: 'set'; +}; +declare type ZodParsedType = keyof typeof ZodParsedType; +declare const getParsedType: (data: any) => ZodParsedType; + +declare type allKeys = T extends any ? keyof T : never; +declare type inferFlattenedErrors, U = string> = typeToFlattenedError, U>; +declare type typeToFlattenedError = { + formErrors: U[]; + fieldErrors: { + [P in allKeys]?: U[]; + }; +}; +declare const ZodIssueCode: { + invalid_type: 'invalid_type'; + invalid_literal: 'invalid_literal'; + custom: 'custom'; + invalid_union: 'invalid_union'; + invalid_union_discriminator: 'invalid_union_discriminator'; + invalid_enum_value: 'invalid_enum_value'; + unrecognized_keys: 'unrecognized_keys'; + invalid_arguments: 'invalid_arguments'; + invalid_return_type: 'invalid_return_type'; + invalid_date: 'invalid_date'; + invalid_string: 'invalid_string'; + too_small: 'too_small'; + too_big: 'too_big'; + invalid_intersection_types: 'invalid_intersection_types'; + not_multiple_of: 'not_multiple_of'; + not_finite: 'not_finite'; +}; +declare type ZodIssueCode = keyof typeof ZodIssueCode; +declare type ZodIssueBase = { + path: (string | number)[]; + message?: string; +}; +interface ZodInvalidTypeIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_type; + expected: ZodParsedType; + received: ZodParsedType; +} +interface ZodInvalidLiteralIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_literal; + expected: unknown; + received: unknown; +} +interface ZodUnrecognizedKeysIssue extends ZodIssueBase { + code: typeof ZodIssueCode.unrecognized_keys; + keys: string[]; +} +interface ZodInvalidUnionIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_union; + unionErrors: ZodError[]; +} +interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_union_discriminator; + options: Primitive[]; +} +interface ZodInvalidEnumValueIssue extends ZodIssueBase { + received: string | number; + code: typeof ZodIssueCode.invalid_enum_value; + options: (string | number)[]; +} +interface ZodInvalidArgumentsIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_arguments; + argumentsError: ZodError; +} +interface ZodInvalidReturnTypeIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_return_type; + returnTypeError: ZodError; +} +interface ZodInvalidDateIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_date; +} +declare type StringValidation = + | 'email' + | 'url' + | 'emoji' + | 'uuid' + | 'nanoid' + | 'regex' + | 'cuid' + | 'cuid2' + | 'ulid' + | 'datetime' + | 'date' + | 'time' + | 'duration' + | 'ip' + | 'base64' + | { + includes: string; + position?: number; + } + | { + startsWith: string; + } + | { + endsWith: string; + }; +interface ZodInvalidStringIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_string; + validation: StringValidation; +} +interface ZodTooSmallIssue extends ZodIssueBase { + code: typeof ZodIssueCode.too_small; + minimum: number | bigint; + inclusive: boolean; + exact?: boolean; + type: 'array' | 'string' | 'number' | 'set' | 'date' | 'bigint'; +} +interface ZodTooBigIssue extends ZodIssueBase { + code: typeof ZodIssueCode.too_big; + maximum: number | bigint; + inclusive: boolean; + exact?: boolean; + type: 'array' | 'string' | 'number' | 'set' | 'date' | 'bigint'; +} +interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_intersection_types; +} +interface ZodNotMultipleOfIssue extends ZodIssueBase { + code: typeof ZodIssueCode.not_multiple_of; + multipleOf: number | bigint; +} +interface ZodNotFiniteIssue extends ZodIssueBase { + code: typeof ZodIssueCode.not_finite; +} +interface ZodCustomIssue extends ZodIssueBase { + code: typeof ZodIssueCode.custom; + params?: { + [k: string]: any; + }; +} +declare type DenormalizedError = { + [k: string]: DenormalizedError | string[]; +}; +declare type ZodIssueOptionalMessage = + | ZodInvalidTypeIssue + | ZodInvalidLiteralIssue + | ZodUnrecognizedKeysIssue + | ZodInvalidUnionIssue + | ZodInvalidUnionDiscriminatorIssue + | ZodInvalidEnumValueIssue + | ZodInvalidArgumentsIssue + | ZodInvalidReturnTypeIssue + | ZodInvalidDateIssue + | ZodInvalidStringIssue + | ZodTooSmallIssue + | ZodTooBigIssue + | ZodInvalidIntersectionTypesIssue + | ZodNotMultipleOfIssue + | ZodNotFiniteIssue + | ZodCustomIssue; +declare type ZodIssue = ZodIssueOptionalMessage & { + fatal?: boolean; + message: string; +}; +declare const quotelessJson: (obj: any) => string; +declare type recursiveZodFormattedError = T extends [any, ...any[]] + ? { + [K in keyof T]?: ZodFormattedError; + } + : T extends any[] + ? { + [k: number]: ZodFormattedError; + } + : T extends object + ? { + [K in keyof T]?: ZodFormattedError; + } + : unknown; +declare type ZodFormattedError = { + _errors: U[]; +} & recursiveZodFormattedError>; +declare type inferFormattedError, U = string> = ZodFormattedError, U>; +declare class ZodError extends Error { + issues: ZodIssue[]; + get errors(): ZodIssue[]; + constructor(issues: ZodIssue[]); + format(): ZodFormattedError; + format(mapper: (issue: ZodIssue) => U): ZodFormattedError; + static create: (issues: ZodIssue[]) => ZodError; + static assert(value: unknown): asserts value is ZodError; + toString(): string; + get message(): string; + get isEmpty(): boolean; + addIssue: (sub: ZodIssue) => void; + addIssues: (subs?: ZodIssue[]) => void; + flatten(): typeToFlattenedError; + flatten(mapper?: (issue: ZodIssue) => U): typeToFlattenedError; + get formErrors(): typeToFlattenedError; +} +declare type stripPath = T extends any ? util.OmitKeys : never; +declare type IssueData = stripPath & { + path?: (string | number)[]; + fatal?: boolean; +}; +declare type ErrorMapCtx = { + defaultError: string; + data: any; +}; +declare type ZodErrorMap = ( + issue: ZodIssueOptionalMessage, + _ctx: ErrorMapCtx, +) => { + message: string; +}; + +declare const errorMap: ZodErrorMap; +//# sourceMappingURL=en.d.ts.map + +declare function setErrorMap(map: ZodErrorMap): void; +declare function getErrorMap(): ZodErrorMap; + +declare const makeIssue: (params: { + data: any; + path: (string | number)[]; + errorMaps: ZodErrorMap[]; + issueData: IssueData; +}) => ZodIssue; +declare type ParseParams = { + path: (string | number)[]; + errorMap: ZodErrorMap; + async: boolean; +}; +declare type ParsePathComponent = string | number; +declare type ParsePath = ParsePathComponent[]; +declare const EMPTY_PATH: ParsePath; +interface ParseContext { + readonly common: { + readonly issues: ZodIssue[]; + readonly contextualErrorMap?: ZodErrorMap; + readonly async: boolean; + }; + readonly path: ParsePath; + readonly schemaErrorMap?: ZodErrorMap; + readonly parent: ParseContext | null; + readonly data: any; + readonly parsedType: ZodParsedType; +} +declare type ParseInput = { + data: any; + path: (string | number)[]; + parent: ParseContext; +}; +declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void; +declare type ObjectPair = { + key: SyncParseReturnType; + value: SyncParseReturnType; +}; +declare class ParseStatus { + value: 'aborted' | 'dirty' | 'valid'; + dirty(): void; + abort(): void; + static mergeArray(status: ParseStatus, results: SyncParseReturnType[]): SyncParseReturnType; + static mergeObjectAsync( + status: ParseStatus, + pairs: { + key: ParseReturnType; + value: ParseReturnType; + }[], + ): Promise>; + static mergeObjectSync( + status: ParseStatus, + pairs: { + key: SyncParseReturnType; + value: SyncParseReturnType; + alwaysSet?: boolean; + }[], + ): SyncParseReturnType; +} +interface ParseResult { + status: 'aborted' | 'dirty' | 'valid'; + data: any; +} +declare type INVALID = { + status: 'aborted'; +}; +declare const INVALID: INVALID; +declare type DIRTY = { + status: 'dirty'; + value: T; +}; +declare const DIRTY: (value: T) => DIRTY; +declare type OK = { + status: 'valid'; + value: T; +}; +declare const OK: (value: T) => OK; +declare type SyncParseReturnType = OK | DIRTY | INVALID; +declare type AsyncParseReturnType = Promise>; +declare type ParseReturnType = SyncParseReturnType | AsyncParseReturnType; +declare const isAborted: (x: ParseReturnType) => x is INVALID; +declare const isDirty: (x: ParseReturnType) => x is OK | DIRTY; +declare const isValid: (x: ParseReturnType) => x is OK; +declare const isAsync: (x: ParseReturnType) => x is AsyncParseReturnType; + +declare namespace enumUtil { + type UnionToIntersectionFn = (T extends unknown ? (k: () => T) => void : never) extends ( + k: infer Intersection, + ) => void + ? Intersection + : never; + type GetUnionLast = UnionToIntersectionFn extends () => infer Last ? Last : never; + type UnionToTuple = [T] extends [never] + ? Tuple + : UnionToTuple>, [GetUnionLast, ...Tuple]>; + type CastToStringTuple = T extends [string, ...string[]] ? T : never; + export type UnionToTupleString = CastToStringTuple>; + export {}; +} + +declare namespace errorUtil { + type ErrMessage = + | string + | { + message?: string; + }; + const errToObj: (message?: ErrMessage | undefined) => { + message?: string | undefined; + }; + const toString: (message?: ErrMessage | undefined) => string | undefined; +} + +declare namespace partialUtil { + type DeepPartial = + T extends ZodObject + ? ZodObject< + { + [k in keyof T['shape']]: ZodOptional>; + }, + T['_def']['unknownKeys'], + T['_def']['catchall'] + > + : T extends ZodArray + ? ZodArray, Card> + : T extends ZodOptional + ? ZodOptional> + : T extends ZodNullable + ? ZodNullable> + : T extends ZodTuple + ? { + [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial : never; + } extends infer PI + ? PI extends ZodTupleItems + ? ZodTuple + : never + : never + : T; +} + +interface RefinementCtx { + addIssue: (arg: IssueData) => void; + path: (string | number)[]; +} +declare type ZodRawShape = { + [k: string]: ZodTypeAny; +}; +declare type ZodTypeAny = ZodType; +declare type TypeOf> = T['_output']; +declare type input> = T['_input']; +declare type output> = T['_output']; + +declare type CustomErrorParams = Partial>; +interface ZodTypeDef { + errorMap?: ZodErrorMap; + description?: string; +} +declare type RawCreateParams = + | { + errorMap?: ZodErrorMap; + invalid_type_error?: string; + required_error?: string; + message?: string; + description?: string; + } + | undefined; +declare type ProcessedCreateParams = { + errorMap?: ZodErrorMap; + description?: string; +}; +declare type SafeParseSuccess = { + success: true; + data: Output; + error?: never; +}; +declare type SafeParseError = { + success: false; + error: ZodError; + data?: never; +}; +declare type SafeParseReturnType = SafeParseSuccess | SafeParseError; +declare abstract class ZodType { + readonly _type: Output; + readonly _output: Output; + readonly _input: Input; + readonly _def: Def; + get description(): string | undefined; + abstract _parse(input: ParseInput): ParseReturnType; + _getType(input: ParseInput): string; + _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext; + _processInputParams(input: ParseInput): { + status: ParseStatus; + ctx: ParseContext; + }; + _parseSync(input: ParseInput): SyncParseReturnType; + _parseAsync(input: ParseInput): AsyncParseReturnType; + parse(data: unknown, params?: Partial): Output; + safeParse(data: unknown, params?: Partial): SafeParseReturnType; + parseAsync(data: unknown, params?: Partial): Promise; + safeParseAsync(data: unknown, params?: Partial): Promise>; + /** Alias of safeParseAsync */ + spa: (data: unknown, params?: Partial | undefined) => Promise>; + refine( + check: (arg: Output) => arg is RefinedOutput, + message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams), + ): ZodEffects; + refine( + check: (arg: Output) => unknown | Promise, + message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams), + ): ZodEffects; + refinement( + check: (arg: Output) => arg is RefinedOutput, + refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData), + ): ZodEffects; + refinement( + check: (arg: Output) => boolean, + refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData), + ): ZodEffects; + _refinement(refinement: RefinementEffect['refinement']): ZodEffects; + superRefine( + refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput, + ): ZodEffects; + superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects; + superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise): ZodEffects; + constructor(def: Def); + optional(): ZodOptional; + nullable(): ZodNullable; + nullish(): ZodOptional>; + array(): ZodArray; + promise(): ZodPromise; + or(option: T): ZodUnion<[this, T]>; + and(incoming: T): ZodIntersection; + transform(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise): ZodEffects; + default(def: util.noUndefined): ZodDefault; + default(def: () => util.noUndefined): ZodDefault; + brand(brand?: B): ZodBranded; + catch(def: Output): ZodCatch; + catch(def: (ctx: { error: ZodError; input: Input }) => Output): ZodCatch; + describe(description: string): this; + pipe(target: T): ZodPipeline; + readonly(): ZodReadonly; + isOptional(): boolean; + isNullable(): boolean; +} +declare type IpVersion = 'v4' | 'v6'; +declare type ZodStringCheck = + | { + kind: 'min'; + value: number; + message?: string; + } + | { + kind: 'max'; + value: number; + message?: string; + } + | { + kind: 'length'; + value: number; + message?: string; + } + | { + kind: 'email'; + message?: string; + } + | { + kind: 'url'; + message?: string; + } + | { + kind: 'emoji'; + message?: string; + } + | { + kind: 'uuid'; + message?: string; + } + | { + kind: 'nanoid'; + message?: string; + } + | { + kind: 'cuid'; + message?: string; + } + | { + kind: 'includes'; + value: string; + position?: number; + message?: string; + } + | { + kind: 'cuid2'; + message?: string; + } + | { + kind: 'ulid'; + message?: string; + } + | { + kind: 'startsWith'; + value: string; + message?: string; + } + | { + kind: 'endsWith'; + value: string; + message?: string; + } + | { + kind: 'regex'; + regex: RegExp; + message?: string; + } + | { + kind: 'trim'; + message?: string; + } + | { + kind: 'toLowerCase'; + message?: string; + } + | { + kind: 'toUpperCase'; + message?: string; + } + | { + kind: 'datetime'; + offset: boolean; + local: boolean; + precision: number | null; + message?: string; + } + | { + kind: 'date'; + message?: string; + } + | { + kind: 'time'; + precision: number | null; + message?: string; + } + | { + kind: 'duration'; + message?: string; + } + | { + kind: 'ip'; + version?: IpVersion; + message?: string; + } + | { + kind: 'base64'; + message?: string; + }; +interface ZodStringDef extends ZodTypeDef { + checks: ZodStringCheck[]; + typeName: ZodFirstPartyTypeKind.ZodString; + coerce: boolean; +} +declare function datetimeRegex(args: { precision?: number | null; offset?: boolean; local?: boolean }): RegExp; +declare class ZodString extends ZodType { + _parse(input: ParseInput): ParseReturnType; + protected _regex( + regex: RegExp, + validation: StringValidation, + message?: errorUtil.ErrMessage, + ): ZodEffects; + _addCheck(check: ZodStringCheck): ZodString; + email(message?: errorUtil.ErrMessage): ZodString; + url(message?: errorUtil.ErrMessage): ZodString; + emoji(message?: errorUtil.ErrMessage): ZodString; + uuid(message?: errorUtil.ErrMessage): ZodString; + nanoid(message?: errorUtil.ErrMessage): ZodString; + cuid(message?: errorUtil.ErrMessage): ZodString; + cuid2(message?: errorUtil.ErrMessage): ZodString; + ulid(message?: errorUtil.ErrMessage): ZodString; + base64(message?: errorUtil.ErrMessage): ZodString; + ip( + options?: + | string + | { + version?: 'v4' | 'v6'; + message?: string; + }, + ): ZodString; + datetime( + options?: + | string + | { + message?: string | undefined; + precision?: number | null; + offset?: boolean; + local?: boolean; + }, + ): ZodString; + date(message?: string): ZodString; + time( + options?: + | string + | { + message?: string | undefined; + precision?: number | null; + }, + ): ZodString; + duration(message?: errorUtil.ErrMessage): ZodString; + regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString; + includes( + value: string, + options?: { + message?: string; + position?: number; + }, + ): ZodString; + startsWith(value: string, message?: errorUtil.ErrMessage): ZodString; + endsWith(value: string, message?: errorUtil.ErrMessage): ZodString; + min(minLength: number, message?: errorUtil.ErrMessage): ZodString; + max(maxLength: number, message?: errorUtil.ErrMessage): ZodString; + length(len: number, message?: errorUtil.ErrMessage): ZodString; + /** + * @deprecated Use z.string().min(1) instead. + * @see {@link ZodString.min} + */ + nonempty(message?: errorUtil.ErrMessage): ZodString; + trim(): ZodString; + toLowerCase(): ZodString; + toUpperCase(): ZodString; + get isDatetime(): boolean; + get isDate(): boolean; + get isTime(): boolean; + get isDuration(): boolean; + get isEmail(): boolean; + get isURL(): boolean; + get isEmoji(): boolean; + get isUUID(): boolean; + get isNANOID(): boolean; + get isCUID(): boolean; + get isCUID2(): boolean; + get isULID(): boolean; + get isIP(): boolean; + get isBase64(): boolean; + get minLength(): number | null; + get maxLength(): number | null; + static create: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: true | undefined; + }) + | undefined, + ) => ZodString; +} +declare type ZodNumberCheck = + | { + kind: 'min'; + value: number; + inclusive: boolean; + message?: string; + } + | { + kind: 'max'; + value: number; + inclusive: boolean; + message?: string; + } + | { + kind: 'int'; + message?: string; + } + | { + kind: 'multipleOf'; + value: number; + message?: string; + } + | { + kind: 'finite'; + message?: string; + }; +interface ZodNumberDef extends ZodTypeDef { + checks: ZodNumberCheck[]; + typeName: ZodFirstPartyTypeKind.ZodNumber; + coerce: boolean; +} +declare class ZodNumber extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, + ) => ZodNumber; + gte(value: number, message?: errorUtil.ErrMessage): ZodNumber; + min: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber; + gt(value: number, message?: errorUtil.ErrMessage): ZodNumber; + lte(value: number, message?: errorUtil.ErrMessage): ZodNumber; + max: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber; + lt(value: number, message?: errorUtil.ErrMessage): ZodNumber; + protected setLimit(kind: 'min' | 'max', value: number, inclusive: boolean, message?: string): ZodNumber; + _addCheck(check: ZodNumberCheck): ZodNumber; + int(message?: errorUtil.ErrMessage): ZodNumber; + positive(message?: errorUtil.ErrMessage): ZodNumber; + negative(message?: errorUtil.ErrMessage): ZodNumber; + nonpositive(message?: errorUtil.ErrMessage): ZodNumber; + nonnegative(message?: errorUtil.ErrMessage): ZodNumber; + multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber; + step: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber; + finite(message?: errorUtil.ErrMessage): ZodNumber; + safe(message?: errorUtil.ErrMessage): ZodNumber; + get minValue(): number | null; + get maxValue(): number | null; + get isInt(): boolean; + get isFinite(): boolean; +} +declare type ZodBigIntCheck = + | { + kind: 'min'; + value: bigint; + inclusive: boolean; + message?: string; + } + | { + kind: 'max'; + value: bigint; + inclusive: boolean; + message?: string; + } + | { + kind: 'multipleOf'; + value: bigint; + message?: string; + }; +interface ZodBigIntDef extends ZodTypeDef { + checks: ZodBigIntCheck[]; + typeName: ZodFirstPartyTypeKind.ZodBigInt; + coerce: boolean; +} +declare class ZodBigInt extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, + ) => ZodBigInt; + gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + min: (value: bigint, message?: errorUtil.ErrMessage | undefined) => ZodBigInt; + gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + max: (value: bigint, message?: errorUtil.ErrMessage | undefined) => ZodBigInt; + lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + protected setLimit(kind: 'min' | 'max', value: bigint, inclusive: boolean, message?: string): ZodBigInt; + _addCheck(check: ZodBigIntCheck): ZodBigInt; + positive(message?: errorUtil.ErrMessage): ZodBigInt; + negative(message?: errorUtil.ErrMessage): ZodBigInt; + nonpositive(message?: errorUtil.ErrMessage): ZodBigInt; + nonnegative(message?: errorUtil.ErrMessage): ZodBigInt; + multipleOf(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + get minValue(): bigint | null; + get maxValue(): bigint | null; +} +interface ZodBooleanDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodBoolean; + coerce: boolean; +} +declare class ZodBoolean extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, + ) => ZodBoolean; +} +declare type ZodDateCheck = + | { + kind: 'min'; + value: number; + message?: string; + } + | { + kind: 'max'; + value: number; + message?: string; + }; +interface ZodDateDef extends ZodTypeDef { + checks: ZodDateCheck[]; + coerce: boolean; + typeName: ZodFirstPartyTypeKind.ZodDate; +} +declare class ZodDate extends ZodType { + _parse(input: ParseInput): ParseReturnType; + _addCheck(check: ZodDateCheck): ZodDate; + min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate; + max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate; + get minDate(): Date | null; + get maxDate(): Date | null; + static create: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, + ) => ZodDate; +} +interface ZodSymbolDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodSymbol; +} +declare class ZodSymbol extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodSymbol; +} +interface ZodUndefinedDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodUndefined; +} +declare class ZodUndefined extends ZodType { + _parse(input: ParseInput): ParseReturnType; + params?: RawCreateParams; + static create: (params?: RawCreateParams) => ZodUndefined; +} +interface ZodNullDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodNull; +} +declare class ZodNull extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodNull; +} +interface ZodAnyDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodAny; +} +declare class ZodAny extends ZodType { + _any: true; + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodAny; +} +interface ZodUnknownDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodUnknown; +} +declare class ZodUnknown extends ZodType { + _unknown: true; + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodUnknown; +} +interface ZodNeverDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodNever; +} +declare class ZodNever extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodNever; +} +interface ZodVoidDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodVoid; +} +declare class ZodVoid extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodVoid; +} +interface ZodArrayDef extends ZodTypeDef { + type: T; + typeName: ZodFirstPartyTypeKind.ZodArray; + exactLength: { + value: number; + message?: string; + } | null; + minLength: { + value: number; + message?: string; + } | null; + maxLength: { + value: number; + message?: string; + } | null; +} +declare type ArrayCardinality = 'many' | 'atleastone'; +declare type arrayOutputType< + T extends ZodTypeAny, + Cardinality extends ArrayCardinality = 'many', +> = Cardinality extends 'atleastone' ? [T['_output'], ...T['_output'][]] : T['_output'][]; +declare class ZodArray extends ZodType< + arrayOutputType, + ZodArrayDef, + Cardinality extends 'atleastone' ? [T['_input'], ...T['_input'][]] : T['_input'][] +> { + _parse(input: ParseInput): ParseReturnType; + get element(): T; + min(minLength: number, message?: errorUtil.ErrMessage): this; + max(maxLength: number, message?: errorUtil.ErrMessage): this; + length(len: number, message?: errorUtil.ErrMessage): this; + nonempty(message?: errorUtil.ErrMessage): ZodArray; + static create: (schema: T_1, params?: RawCreateParams) => ZodArray; +} +declare type ZodNonEmptyArray = ZodArray; +declare type UnknownKeysParam = 'passthrough' | 'strict' | 'strip'; +interface ZodObjectDef< + T extends ZodRawShape = ZodRawShape, + UnknownKeys extends UnknownKeysParam = UnknownKeysParam, + Catchall extends ZodTypeAny = ZodTypeAny, +> extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodObject; + shape: () => T; + catchall: Catchall; + unknownKeys: UnknownKeys; +} +declare type mergeTypes = { + [k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never; +}; +declare type objectOutputType< + Shape extends ZodRawShape, + Catchall extends ZodTypeAny, + UnknownKeys extends UnknownKeysParam = UnknownKeysParam, +> = objectUtil.flatten>> & + CatchallOutput & + PassthroughType; +declare type baseObjectOutputType = { + [k in keyof Shape]: Shape[k]['_output']; +}; +declare type objectInputType< + Shape extends ZodRawShape, + Catchall extends ZodTypeAny, + UnknownKeys extends UnknownKeysParam = UnknownKeysParam, +> = objectUtil.flatten> & CatchallInput & PassthroughType; +declare type baseObjectInputType = objectUtil.addQuestionMarks<{ + [k in keyof Shape]: Shape[k]['_input']; +}>; +declare type CatchallOutput = ZodType extends T + ? unknown + : { + [k: string]: T['_output']; + }; +declare type CatchallInput = ZodType extends T + ? unknown + : { + [k: string]: T['_input']; + }; +declare type PassthroughType = T extends 'passthrough' + ? { + [k: string]: unknown; + } + : unknown; +declare type deoptional = + T extends ZodOptional ? deoptional : T extends ZodNullable ? ZodNullable> : T; +declare type SomeZodObject = ZodObject; +declare type noUnrecognized = { + [k in keyof Obj]: k extends keyof Shape ? Obj[k] : never; +}; +declare class ZodObject< + T extends ZodRawShape, + UnknownKeys extends UnknownKeysParam = UnknownKeysParam, + Catchall extends ZodTypeAny = ZodTypeAny, + Output = objectOutputType, + Input = objectInputType, +> extends ZodType, Input> { + private _cached; + _getCached(): { + shape: T; + keys: string[]; + }; + _parse(input: ParseInput): ParseReturnType; + get shape(): T; + strict(message?: errorUtil.ErrMessage): ZodObject; + strip(): ZodObject; + passthrough(): ZodObject; + /** + * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. + * If you want to pass through unknown properties, use `.passthrough()` instead. + */ + nonstrict: () => ZodObject; + extend( + augmentation: Augmentation, + ): ZodObject, UnknownKeys, Catchall>; + /** + * @deprecated Use `.extend` instead + * */ + augment: ( + augmentation: Augmentation, + ) => ZodObject< + objectUtil.extendShape, + UnknownKeys, + Catchall, + objectOutputType, Catchall, UnknownKeys>, + objectInputType, Catchall, UnknownKeys> + >; + /** + * Prior to zod@1.0.12 there was a bug in the + * inferred type of merged objects. Please + * upgrade if you are experiencing issues. + */ + merge( + merging: Incoming, + ): ZodObject, Incoming['_def']['unknownKeys'], Incoming['_def']['catchall']>; + setKey( + key: Key, + schema: Schema, + ): ZodObject< + T & { + [k in Key]: Schema; + }, + UnknownKeys, + Catchall + >; + catchall(index: Index): ZodObject; + pick< + Mask extends util.Exactly< + { + [k in keyof T]?: true; + }, + Mask + >, + >(mask: Mask): ZodObject>, UnknownKeys, Catchall>; + omit< + Mask extends util.Exactly< + { + [k in keyof T]?: true; + }, + Mask + >, + >(mask: Mask): ZodObject, UnknownKeys, Catchall>; + /** + * @deprecated + */ + deepPartial(): partialUtil.DeepPartial; + partial(): ZodObject< + { + [k in keyof T]: ZodOptional; + }, + UnknownKeys, + Catchall + >; + partial< + Mask extends util.Exactly< + { + [k in keyof T]?: true; + }, + Mask + >, + >( + mask: Mask, + ): ZodObject< + objectUtil.noNever<{ + [k in keyof T]: k extends keyof Mask ? ZodOptional : T[k]; + }>, + UnknownKeys, + Catchall + >; + required(): ZodObject< + { + [k in keyof T]: deoptional; + }, + UnknownKeys, + Catchall + >; + required< + Mask extends util.Exactly< + { + [k in keyof T]?: true; + }, + Mask + >, + >( + mask: Mask, + ): ZodObject< + objectUtil.noNever<{ + [k in keyof T]: k extends keyof Mask ? deoptional : T[k]; + }>, + UnknownKeys, + Catchall + >; + keyof(): ZodEnum>; + static create: ( + shape: T_1, + params?: RawCreateParams, + ) => ZodObject< + T_1, + 'strip', + ZodTypeAny, + { + [k in keyof objectUtil.addQuestionMarks, any>]: objectUtil.addQuestionMarks< + baseObjectOutputType, + any + >[k]; + }, + { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1] } + >; + static strictCreate: ( + shape: T_1, + params?: RawCreateParams, + ) => ZodObject< + T_1, + 'strict', + ZodTypeAny, + { + [k in keyof objectUtil.addQuestionMarks, any>]: objectUtil.addQuestionMarks< + baseObjectOutputType, + any + >[k]; + }, + { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1] } + >; + static lazycreate: ( + shape: () => T_1, + params?: RawCreateParams, + ) => ZodObject< + T_1, + 'strip', + ZodTypeAny, + { + [k in keyof objectUtil.addQuestionMarks, any>]: objectUtil.addQuestionMarks< + baseObjectOutputType, + any + >[k]; + }, + { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1] } + >; +} +declare type AnyZodObject = ZodObject; +declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>; +interface ZodUnionDef> + extends ZodTypeDef { + options: T; + typeName: ZodFirstPartyTypeKind.ZodUnion; +} +declare class ZodUnion extends ZodType< + T[number]['_output'], + ZodUnionDef, + T[number]['_input'] +> { + _parse(input: ParseInput): ParseReturnType; + get options(): T; + static create: ( + types: T_1, + params?: RawCreateParams, + ) => ZodUnion; +} +declare type ZodDiscriminatedUnionOption = ZodObject< + { + [key in Discriminator]: ZodTypeAny; + } & ZodRawShape, + UnknownKeysParam, + ZodTypeAny +>; +interface ZodDiscriminatedUnionDef< + Discriminator extends string, + Options extends ZodDiscriminatedUnionOption[] = ZodDiscriminatedUnionOption[], +> extends ZodTypeDef { + discriminator: Discriminator; + options: Options; + optionsMap: Map>; + typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion; +} +declare class ZodDiscriminatedUnion< + Discriminator extends string, + Options extends ZodDiscriminatedUnionOption[], +> extends ZodType, ZodDiscriminatedUnionDef, input> { + _parse(input: ParseInput): ParseReturnType; + get discriminator(): Discriminator; + get options(): Options; + get optionsMap(): Map>; + /** + * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. + * However, it only allows a union of objects, all of which need to share a discriminator property. This property must + * have a different value for each object in the union. + * @param discriminator the name of the discriminator property + * @param types an array of object schemas + * @param params + */ + static create< + Discriminator extends string, + Types extends [ZodDiscriminatedUnionOption, ...ZodDiscriminatedUnionOption[]], + >( + discriminator: Discriminator, + options: Types, + params?: RawCreateParams, + ): ZodDiscriminatedUnion; +} +interface ZodIntersectionDef extends ZodTypeDef { + left: T; + right: U; + typeName: ZodFirstPartyTypeKind.ZodIntersection; +} +declare class ZodIntersection extends ZodType< + T['_output'] & U['_output'], + ZodIntersectionDef, + T['_input'] & U['_input'] +> { + _parse(input: ParseInput): ParseReturnType; + static create: ( + left: T_1, + right: U_1, + params?: RawCreateParams, + ) => ZodIntersection; +} +declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]]; +declare type AssertArray = T extends any[] ? T : never; +declare type OutputTypeOfTuple = AssertArray<{ + [k in keyof T]: T[k] extends ZodType ? T[k]['_output'] : never; +}>; +declare type OutputTypeOfTupleWithRest< + T extends ZodTupleItems | [], + Rest extends ZodTypeAny | null = null, +> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple, ...Rest['_output'][]] : OutputTypeOfTuple; +declare type InputTypeOfTuple = AssertArray<{ + [k in keyof T]: T[k] extends ZodType ? T[k]['_input'] : never; +}>; +declare type InputTypeOfTupleWithRest< + T extends ZodTupleItems | [], + Rest extends ZodTypeAny | null = null, +> = Rest extends ZodTypeAny ? [...InputTypeOfTuple, ...Rest['_input'][]] : InputTypeOfTuple; +interface ZodTupleDef + extends ZodTypeDef { + items: T; + rest: Rest; + typeName: ZodFirstPartyTypeKind.ZodTuple; +} +declare type AnyZodTuple = ZodTuple<[ZodTypeAny, ...ZodTypeAny[]] | [], ZodTypeAny | null>; +declare class ZodTuple< + T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], + Rest extends ZodTypeAny | null = null, +> extends ZodType, ZodTupleDef, InputTypeOfTupleWithRest> { + _parse(input: ParseInput): ParseReturnType; + get items(): T; + rest(rest: Rest): ZodTuple; + static create: ( + schemas: T_1, + params?: RawCreateParams, + ) => ZodTuple; +} +interface ZodRecordDef extends ZodTypeDef { + valueType: Value; + keyType: Key; + typeName: ZodFirstPartyTypeKind.ZodRecord; +} +declare type KeySchema = ZodType; +declare type RecordType = [string] extends [K] + ? Record + : [number] extends [K] + ? Record + : [symbol] extends [K] + ? Record + : [BRAND] extends [K] + ? Record + : Partial>; +declare class ZodRecord extends ZodType< + RecordType, + ZodRecordDef, + RecordType +> { + get keySchema(): Key; + get valueSchema(): Value; + _parse(input: ParseInput): ParseReturnType; + get element(): Value; + static create(valueType: Value, params?: RawCreateParams): ZodRecord; + static create( + keySchema: Keys, + valueType: Value, + params?: RawCreateParams, + ): ZodRecord; +} +interface ZodMapDef extends ZodTypeDef { + valueType: Value; + keyType: Key; + typeName: ZodFirstPartyTypeKind.ZodMap; +} +declare class ZodMap extends ZodType< + Map, + ZodMapDef, + Map +> { + get keySchema(): Key; + get valueSchema(): Value; + _parse(input: ParseInput): ParseReturnType; + static create: ( + keyType: Key_1, + valueType: Value_1, + params?: RawCreateParams, + ) => ZodMap; +} +interface ZodSetDef extends ZodTypeDef { + valueType: Value; + typeName: ZodFirstPartyTypeKind.ZodSet; + minSize: { + value: number; + message?: string; + } | null; + maxSize: { + value: number; + message?: string; + } | null; +} +declare class ZodSet extends ZodType< + Set, + ZodSetDef, + Set +> { + _parse(input: ParseInput): ParseReturnType; + min(minSize: number, message?: errorUtil.ErrMessage): this; + max(maxSize: number, message?: errorUtil.ErrMessage): this; + size(size: number, message?: errorUtil.ErrMessage): this; + nonempty(message?: errorUtil.ErrMessage): ZodSet; + static create: ( + valueType: Value_1, + params?: RawCreateParams, + ) => ZodSet; +} +interface ZodFunctionDef = ZodTuple, Returns extends ZodTypeAny = ZodTypeAny> + extends ZodTypeDef { + args: Args; + returns: Returns; + typeName: ZodFirstPartyTypeKind.ZodFunction; +} +declare type OuterTypeOfFunction, Returns extends ZodTypeAny> = + Args['_input'] extends Array ? (...args: Args['_input']) => Returns['_output'] : never; +declare type InnerTypeOfFunction, Returns extends ZodTypeAny> = + Args['_output'] extends Array ? (...args: Args['_output']) => Returns['_input'] : never; +declare class ZodFunction, Returns extends ZodTypeAny> extends ZodType< + OuterTypeOfFunction, + ZodFunctionDef, + InnerTypeOfFunction +> { + _parse(input: ParseInput): ParseReturnType; + parameters(): Args; + returnType(): Returns; + args[0]>( + ...items: Items + ): ZodFunction, Returns>; + returns>(returnType: NewReturnType): ZodFunction; + implement>( + func: F, + ): ReturnType extends Returns['_output'] + ? (...args: Args['_input']) => ReturnType + : OuterTypeOfFunction; + strictImplement(func: InnerTypeOfFunction): InnerTypeOfFunction; + validate: >( + func: F, + ) => ReturnType extends Returns['_output'] + ? (...args: Args['_input']) => ReturnType + : OuterTypeOfFunction; + static create(): ZodFunction, ZodUnknown>; + static create>(args: T): ZodFunction; + static create(args: T, returns: U): ZodFunction; + static create, U extends ZodTypeAny = ZodUnknown>( + args: T, + returns: U, + params?: RawCreateParams, + ): ZodFunction; +} +interface ZodLazyDef extends ZodTypeDef { + getter: () => T; + typeName: ZodFirstPartyTypeKind.ZodLazy; +} +declare class ZodLazy extends ZodType, ZodLazyDef, input> { + get schema(): T; + _parse(input: ParseInput): ParseReturnType; + static create: (getter: () => T_1, params?: RawCreateParams) => ZodLazy; +} +interface ZodLiteralDef extends ZodTypeDef { + value: T; + typeName: ZodFirstPartyTypeKind.ZodLiteral; +} +declare class ZodLiteral extends ZodType, T> { + _parse(input: ParseInput): ParseReturnType; + get value(): T; + static create: (value: T_1, params?: RawCreateParams) => ZodLiteral; +} +declare type ArrayKeys = keyof any[]; +declare type Indices = Exclude; +declare type EnumValues = readonly [T, ...T[]]; +declare type Values = { + [k in T[number]]: k; +}; +interface ZodEnumDef extends ZodTypeDef { + values: T; + typeName: ZodFirstPartyTypeKind.ZodEnum; +} +declare type Writeable = { + -readonly [P in keyof T]: T[P]; +}; +declare type FilterEnum = Values extends [] + ? [] + : Values extends [infer Head, ...infer Rest] + ? Head extends ToExclude + ? FilterEnum + : [Head, ...FilterEnum] + : never; +declare type typecast = A extends T ? A : never; +declare function createZodEnum>( + values: T, + params?: RawCreateParams, +): ZodEnum>; +declare function createZodEnum( + values: T, + params?: RawCreateParams, +): ZodEnum; +declare class ZodEnum extends ZodType, T[number]> { + #private; + _parse(input: ParseInput): ParseReturnType; + get options(): T; + get enum(): Values; + get Values(): Values; + get Enum(): Values; + extract( + values: ToExtract, + newDef?: RawCreateParams, + ): ZodEnum>; + exclude( + values: ToExclude, + newDef?: RawCreateParams, + ): ZodEnum>, [string, ...string[]]>>; + static create: typeof createZodEnum; +} +interface ZodNativeEnumDef extends ZodTypeDef { + values: T; + typeName: ZodFirstPartyTypeKind.ZodNativeEnum; +} +declare type EnumLike = { + [k: string]: string | number; + [nu: number]: string; +}; +declare class ZodNativeEnum extends ZodType, T[keyof T]> { + #private; + _parse(input: ParseInput): ParseReturnType; + get enum(): T; + static create: (values: T_1, params?: RawCreateParams) => ZodNativeEnum; +} +interface ZodPromiseDef extends ZodTypeDef { + type: T; + typeName: ZodFirstPartyTypeKind.ZodPromise; +} +declare class ZodPromise extends ZodType< + Promise, + ZodPromiseDef, + Promise +> { + unwrap(): T; + _parse(input: ParseInput): ParseReturnType; + static create: (schema: T_1, params?: RawCreateParams) => ZodPromise; +} +declare type Refinement = (arg: T, ctx: RefinementCtx) => any; +declare type SuperRefinement = (arg: T, ctx: RefinementCtx) => void | Promise; +declare type RefinementEffect = { + type: 'refinement'; + refinement: (arg: T, ctx: RefinementCtx) => any; +}; +declare type TransformEffect = { + type: 'transform'; + transform: (arg: T, ctx: RefinementCtx) => any; +}; +declare type PreprocessEffect = { + type: 'preprocess'; + transform: (arg: T, ctx: RefinementCtx) => any; +}; +declare type Effect = RefinementEffect | TransformEffect | PreprocessEffect; +interface ZodEffectsDef extends ZodTypeDef { + schema: T; + typeName: ZodFirstPartyTypeKind.ZodEffects; + effect: Effect; +} +declare class ZodEffects, Input = input> extends ZodType< + Output, + ZodEffectsDef, + Input +> { + innerType(): T; + sourceType(): T; + _parse(input: ParseInput): ParseReturnType; + static create: ( + schema: I, + effect: Effect, + params?: RawCreateParams, + ) => ZodEffects>; + static createWithPreprocess: ( + preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, + schema: I, + params?: RawCreateParams, + ) => ZodEffects; +} + +interface ZodOptionalDef extends ZodTypeDef { + innerType: T; + typeName: ZodFirstPartyTypeKind.ZodOptional; +} +declare type ZodOptionalType = ZodOptional; +declare class ZodOptional extends ZodType< + T['_output'] | undefined, + ZodOptionalDef, + T['_input'] | undefined +> { + _parse(input: ParseInput): ParseReturnType; + unwrap(): T; + static create: (type: T_1, params?: RawCreateParams) => ZodOptional; +} +interface ZodNullableDef extends ZodTypeDef { + innerType: T; + typeName: ZodFirstPartyTypeKind.ZodNullable; +} +declare type ZodNullableType = ZodNullable; +declare class ZodNullable extends ZodType< + T['_output'] | null, + ZodNullableDef, + T['_input'] | null +> { + _parse(input: ParseInput): ParseReturnType; + unwrap(): T; + static create: (type: T_1, params?: RawCreateParams) => ZodNullable; +} +interface ZodDefaultDef extends ZodTypeDef { + innerType: T; + defaultValue: () => util.noUndefined; + typeName: ZodFirstPartyTypeKind.ZodDefault; +} +declare class ZodDefault extends ZodType< + util.noUndefined, + ZodDefaultDef, + T['_input'] | undefined +> { + _parse(input: ParseInput): ParseReturnType; + removeDefault(): T; + static create: ( + type: T_1, + params: { + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + default: T_1['_input'] | (() => util.noUndefined); + }, + ) => ZodDefault; +} +interface ZodCatchDef extends ZodTypeDef { + innerType: T; + catchValue: (ctx: { error: ZodError; input: unknown }) => T['_input']; + typeName: ZodFirstPartyTypeKind.ZodCatch; +} +declare class ZodCatch extends ZodType, unknown> { + _parse(input: ParseInput): ParseReturnType; + removeCatch(): T; + static create: ( + type: T_1, + params: { + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + catch: T_1['_output'] | (() => T_1['_output']); + }, + ) => ZodCatch; +} +interface ZodNaNDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodNaN; +} +declare class ZodNaN extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodNaN; +} +interface ZodBrandedDef extends ZodTypeDef { + type: T; + typeName: ZodFirstPartyTypeKind.ZodBranded; +} +declare const BRAND: unique symbol; +declare type BRAND = { + [BRAND]: { + [k in T]: true; + }; +}; +declare class ZodBranded extends ZodType< + T['_output'] & BRAND, + ZodBrandedDef, + T['_input'] +> { + _parse(input: ParseInput): ParseReturnType; + unwrap(): T; +} +interface ZodPipelineDef extends ZodTypeDef { + in: A; + out: B; + typeName: ZodFirstPartyTypeKind.ZodPipeline; +} +declare class ZodPipeline extends ZodType< + B['_output'], + ZodPipelineDef, + A['_input'] +> { + _parse(input: ParseInput): ParseReturnType; + static create(a: A, b: B): ZodPipeline; +} +declare type BuiltIn = + | (((...args: any[]) => any) | (new (...args: any[]) => any)) + | { + readonly [Symbol.toStringTag]: string; + } + | Date + | Error + | Generator + | Promise + | RegExp; +declare 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; +interface ZodReadonlyDef extends ZodTypeDef { + innerType: T; + typeName: ZodFirstPartyTypeKind.ZodReadonly; +} +declare class ZodReadonly extends ZodType< + MakeReadonly, + ZodReadonlyDef, + MakeReadonly +> { + _parse(input: ParseInput): ParseReturnType; + static create: (type: T_1, params?: RawCreateParams) => ZodReadonly; + unwrap(): T; +} +declare type CustomParams = CustomErrorParams & { + fatal?: boolean; +}; +declare function custom( + check?: (data: any) => any, + params?: string | CustomParams | ((input: any) => CustomParams), + /** + * @deprecated + * + * Pass `fatal` into the params object instead: + * + * ```ts + * z.string().custom((val) => val.length > 5, { fatal: false }) + * ``` + * + */ + fatal?: boolean, +): ZodType; + +declare const late: { + object: ( + shape: () => T, + params?: RawCreateParams, + ) => ZodObject< + T, + 'strip', + ZodTypeAny, + { + [k in keyof objectUtil.addQuestionMarks, any>]: objectUtil.addQuestionMarks< + baseObjectOutputType, + any + >[k]; + }, + { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1] } + >; +}; +declare enum ZodFirstPartyTypeKind { + ZodString = 'ZodString', + ZodNumber = 'ZodNumber', + ZodNaN = 'ZodNaN', + ZodBigInt = 'ZodBigInt', + ZodBoolean = 'ZodBoolean', + ZodDate = 'ZodDate', + ZodSymbol = 'ZodSymbol', + ZodUndefined = 'ZodUndefined', + ZodNull = 'ZodNull', + ZodAny = 'ZodAny', + ZodUnknown = 'ZodUnknown', + ZodNever = 'ZodNever', + ZodVoid = 'ZodVoid', + ZodArray = 'ZodArray', + ZodObject = 'ZodObject', + ZodUnion = 'ZodUnion', + ZodDiscriminatedUnion = 'ZodDiscriminatedUnion', + ZodIntersection = 'ZodIntersection', + ZodTuple = 'ZodTuple', + ZodRecord = 'ZodRecord', + ZodMap = 'ZodMap', + ZodSet = 'ZodSet', + ZodFunction = 'ZodFunction', + ZodLazy = 'ZodLazy', + ZodLiteral = 'ZodLiteral', + ZodEnum = 'ZodEnum', + ZodEffects = 'ZodEffects', + ZodNativeEnum = 'ZodNativeEnum', + ZodOptional = 'ZodOptional', + ZodNullable = 'ZodNullable', + ZodDefault = 'ZodDefault', + ZodCatch = 'ZodCatch', + ZodPromise = 'ZodPromise', + ZodBranded = 'ZodBranded', + ZodPipeline = 'ZodPipeline', + ZodReadonly = 'ZodReadonly', +} +declare type ZodFirstPartySchemaTypes = + | ZodString + | ZodNumber + | ZodNaN + | ZodBigInt + | ZodBoolean + | ZodDate + | ZodUndefined + | ZodNull + | ZodAny + | ZodUnknown + | ZodNever + | ZodVoid + | ZodArray + | ZodObject + | ZodUnion + | ZodDiscriminatedUnion + | ZodIntersection + | ZodTuple + | ZodRecord + | ZodMap + | ZodSet + | ZodFunction + | ZodLazy + | ZodLiteral + | ZodEnum + | ZodEffects + | ZodNativeEnum + | ZodOptional + | ZodNullable + | ZodDefault + | ZodCatch + | ZodPromise + | ZodBranded + | ZodPipeline + | ZodReadonly + | ZodSymbol; +declare abstract class Class { + constructor(..._: any[]); +} +declare const instanceOfType: ( + cls: T, + params?: CustomParams, +) => ZodType, ZodTypeDef, InstanceType>; +declare const stringType: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: true | undefined; + }) + | undefined, +) => ZodString; +declare const numberType: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, +) => ZodNumber; +declare const nanType: (params?: RawCreateParams) => ZodNaN; +declare const bigIntType: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, +) => ZodBigInt; +declare const booleanType: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, +) => ZodBoolean; +declare const dateType: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, +) => ZodDate; +declare const symbolType: (params?: RawCreateParams) => ZodSymbol; +declare const undefinedType: (params?: RawCreateParams) => ZodUndefined; +declare const nullType: (params?: RawCreateParams) => ZodNull; +declare const anyType: (params?: RawCreateParams) => ZodAny; +declare const unknownType: (params?: RawCreateParams) => ZodUnknown; +declare const neverType: (params?: RawCreateParams) => ZodNever; +declare const voidType: (params?: RawCreateParams) => ZodVoid; +declare const arrayType: (schema: T, params?: RawCreateParams) => ZodArray; +declare const objectType: ( + shape: T, + params?: RawCreateParams, +) => ZodObject< + T, + 'strip', + ZodTypeAny, + { + [k in keyof objectUtil.addQuestionMarks, any>]: objectUtil.addQuestionMarks< + baseObjectOutputType, + any + >[k]; + }, + { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1] } +>; +declare const strictObjectType: ( + shape: T, + params?: RawCreateParams, +) => ZodObject< + T, + 'strict', + ZodTypeAny, + { + [k in keyof objectUtil.addQuestionMarks, any>]: objectUtil.addQuestionMarks< + baseObjectOutputType, + any + >[k]; + }, + { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1] } +>; +declare const unionType: ( + types: T, + params?: RawCreateParams, +) => ZodUnion; +declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create; +declare const intersectionType: ( + left: T, + right: U, + params?: RawCreateParams, +) => ZodIntersection; +declare const tupleType: ( + schemas: T, + params?: RawCreateParams, +) => ZodTuple; +declare const recordType: typeof ZodRecord.create; +declare const mapType: ( + keyType: Key, + valueType: Value, + params?: RawCreateParams, +) => ZodMap; +declare const setType: ( + valueType: Value, + params?: RawCreateParams, +) => ZodSet; +declare const functionType: typeof ZodFunction.create; +declare const lazyType: (getter: () => T, params?: RawCreateParams) => ZodLazy; +declare const literalType: (value: T, params?: RawCreateParams) => ZodLiteral; +declare const enumType: typeof createZodEnum; +declare const nativeEnumType: (values: T, params?: RawCreateParams) => ZodNativeEnum; +declare const promiseType: (schema: T, params?: RawCreateParams) => ZodPromise; +declare const effectsType: ( + schema: I, + effect: Effect, + params?: RawCreateParams, +) => ZodEffects>; +declare const optionalType: (type: T, params?: RawCreateParams) => ZodOptional; +declare const nullableType: (type: T, params?: RawCreateParams) => ZodNullable; +declare const preprocessType: ( + preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, + schema: I, + params?: RawCreateParams, +) => ZodEffects; +declare const pipelineType: typeof ZodPipeline.create; +declare const ostring: () => ZodOptional; +declare const onumber: () => ZodOptional; +declare const oboolean: () => ZodOptional; +declare const coerce: { + string: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: true | undefined; + }) + | undefined, + ) => ZodString; + number: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, + ) => ZodNumber; + boolean: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, + ) => ZodBoolean; + bigint: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, + ) => ZodBigInt; + date: ( + params?: + | ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) + | undefined, + ) => ZodDate; +}; + +declare const NEVER: never; + +//# sourceMappingURL=external.d.ts.map + +declare const z_setErrorMap: typeof setErrorMap; +declare const z_getErrorMap: typeof getErrorMap; +declare const z_makeIssue: typeof makeIssue; +type z_ParseParams = ParseParams; +type z_ParsePathComponent = ParsePathComponent; +type z_ParsePath = ParsePath; +declare const z_EMPTY_PATH: typeof EMPTY_PATH; +type z_ParseContext = ParseContext; +type z_ParseInput = ParseInput; +declare const z_addIssueToContext: typeof addIssueToContext; +type z_ObjectPair = ObjectPair; +type z_ParseStatus = ParseStatus; +declare const z_ParseStatus: typeof ParseStatus; +type z_ParseResult = ParseResult; +declare const z_INVALID: typeof INVALID; +declare const z_DIRTY: typeof DIRTY; +declare const z_OK: typeof OK; +type z_SyncParseReturnType = SyncParseReturnType; +type z_AsyncParseReturnType = AsyncParseReturnType; +type z_ParseReturnType = ParseReturnType; +declare const z_isAborted: typeof isAborted; +declare const z_isDirty: typeof isDirty; +declare const z_isValid: typeof isValid; +declare const z_isAsync: typeof isAsync; +type z_Primitive = Primitive; +type z_Scalars = Scalars; +declare const z_util: typeof util; +declare const z_objectUtil: typeof objectUtil; +type z_ZodParsedType = ZodParsedType; +declare const z_getParsedType: typeof getParsedType; +declare const z_oboolean: typeof oboolean; +declare const z_onumber: typeof onumber; +declare const z_ostring: typeof ostring; +type z_RefinementCtx = RefinementCtx; +type z_ZodRawShape = ZodRawShape; +type z_ZodTypeAny = ZodTypeAny; +type z_TypeOf> = TypeOf; +type z_input> = input; +type z_output> = output; +type z_CustomErrorParams = CustomErrorParams; +type z_ZodTypeDef = ZodTypeDef; +type z_RawCreateParams = RawCreateParams; +type z_ProcessedCreateParams = ProcessedCreateParams; +type z_SafeParseSuccess = SafeParseSuccess; +type z_SafeParseError = SafeParseError; +type z_SafeParseReturnType = SafeParseReturnType; +type z_ZodType = ZodType; +declare const z_ZodType: typeof ZodType; +type z_IpVersion = IpVersion; +type z_ZodStringCheck = ZodStringCheck; +type z_ZodStringDef = ZodStringDef; +declare const z_datetimeRegex: typeof datetimeRegex; +type z_ZodString = ZodString; +declare const z_ZodString: typeof ZodString; +type z_ZodNumberCheck = ZodNumberCheck; +type z_ZodNumberDef = ZodNumberDef; +type z_ZodNumber = ZodNumber; +declare const z_ZodNumber: typeof ZodNumber; +type z_ZodBigIntCheck = ZodBigIntCheck; +type z_ZodBigIntDef = ZodBigIntDef; +type z_ZodBigInt = ZodBigInt; +declare const z_ZodBigInt: typeof ZodBigInt; +type z_ZodBooleanDef = ZodBooleanDef; +type z_ZodBoolean = ZodBoolean; +declare const z_ZodBoolean: typeof ZodBoolean; +type z_ZodDateCheck = ZodDateCheck; +type z_ZodDateDef = ZodDateDef; +type z_ZodDate = ZodDate; +declare const z_ZodDate: typeof ZodDate; +type z_ZodSymbolDef = ZodSymbolDef; +type z_ZodSymbol = ZodSymbol; +declare const z_ZodSymbol: typeof ZodSymbol; +type z_ZodUndefinedDef = ZodUndefinedDef; +type z_ZodUndefined = ZodUndefined; +declare const z_ZodUndefined: typeof ZodUndefined; +type z_ZodNullDef = ZodNullDef; +type z_ZodNull = ZodNull; +declare const z_ZodNull: typeof ZodNull; +type z_ZodAnyDef = ZodAnyDef; +type z_ZodAny = ZodAny; +declare const z_ZodAny: typeof ZodAny; +type z_ZodUnknownDef = ZodUnknownDef; +type z_ZodUnknown = ZodUnknown; +declare const z_ZodUnknown: typeof ZodUnknown; +type z_ZodNeverDef = ZodNeverDef; +type z_ZodNever = ZodNever; +declare const z_ZodNever: typeof ZodNever; +type z_ZodVoidDef = ZodVoidDef; +type z_ZodVoid = ZodVoid; +declare const z_ZodVoid: typeof ZodVoid; +type z_ZodArrayDef = ZodArrayDef; +type z_ArrayCardinality = ArrayCardinality; +type z_arrayOutputType = arrayOutputType< + T, + Cardinality +>; +type z_ZodArray = ZodArray; +declare const z_ZodArray: typeof ZodArray; +type z_ZodNonEmptyArray = ZodNonEmptyArray; +type z_UnknownKeysParam = UnknownKeysParam; +type z_ZodObjectDef< + T extends ZodRawShape = ZodRawShape, + UnknownKeys extends UnknownKeysParam = UnknownKeysParam, + Catchall extends ZodTypeAny = ZodTypeAny, +> = ZodObjectDef; +type z_mergeTypes = mergeTypes; +type z_objectOutputType< + Shape extends ZodRawShape, + Catchall extends ZodTypeAny, + UnknownKeys extends UnknownKeysParam = UnknownKeysParam, +> = objectOutputType; +type z_baseObjectOutputType = baseObjectOutputType; +type z_objectInputType< + Shape extends ZodRawShape, + Catchall extends ZodTypeAny, + UnknownKeys extends UnknownKeysParam = UnknownKeysParam, +> = objectInputType; +type z_baseObjectInputType = baseObjectInputType; +type z_CatchallOutput = CatchallOutput; +type z_CatchallInput = CatchallInput; +type z_PassthroughType = PassthroughType; +type z_deoptional = deoptional; +type z_SomeZodObject = SomeZodObject; +type z_noUnrecognized = noUnrecognized; +type z_ZodObject< + T extends ZodRawShape, + UnknownKeys extends UnknownKeysParam = UnknownKeysParam, + Catchall extends ZodTypeAny = ZodTypeAny, + Output = objectOutputType, + Input = objectInputType, +> = ZodObject; +declare const z_ZodObject: typeof ZodObject; +type z_AnyZodObject = AnyZodObject; +type z_ZodUnionOptions = ZodUnionOptions; +type z_ZodUnionDef> = ZodUnionDef; +type z_ZodUnion = ZodUnion; +declare const z_ZodUnion: typeof ZodUnion; +type z_ZodDiscriminatedUnionOption = ZodDiscriminatedUnionOption; +type z_ZodDiscriminatedUnionDef< + Discriminator extends string, + Options extends ZodDiscriminatedUnionOption[] = ZodDiscriminatedUnionOption[], +> = ZodDiscriminatedUnionDef; +type z_ZodDiscriminatedUnion< + Discriminator extends string, + Options extends ZodDiscriminatedUnionOption[], +> = ZodDiscriminatedUnion; +declare const z_ZodDiscriminatedUnion: typeof ZodDiscriminatedUnion; +type z_ZodIntersectionDef = ZodIntersectionDef< + T, + U +>; +type z_ZodIntersection = ZodIntersection; +declare const z_ZodIntersection: typeof ZodIntersection; +type z_ZodTupleItems = ZodTupleItems; +type z_AssertArray = AssertArray; +type z_OutputTypeOfTuple = OutputTypeOfTuple; +type z_OutputTypeOfTupleWithRest< + T extends ZodTupleItems | [], + Rest extends ZodTypeAny | null = null, +> = OutputTypeOfTupleWithRest; +type z_InputTypeOfTuple = InputTypeOfTuple; +type z_InputTypeOfTupleWithRest< + T extends ZodTupleItems | [], + Rest extends ZodTypeAny | null = null, +> = InputTypeOfTupleWithRest; +type z_ZodTupleDef = ZodTupleDef< + T, + Rest +>; +type z_AnyZodTuple = AnyZodTuple; +type z_ZodTuple< + T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], + Rest extends ZodTypeAny | null = null, +> = ZodTuple; +declare const z_ZodTuple: typeof ZodTuple; +type z_ZodRecordDef = ZodRecordDef< + Key, + Value +>; +type z_KeySchema = KeySchema; +type z_RecordType = RecordType; +type z_ZodRecord = ZodRecord; +declare const z_ZodRecord: typeof ZodRecord; +type z_ZodMapDef = ZodMapDef; +type z_ZodMap = ZodMap; +declare const z_ZodMap: typeof ZodMap; +type z_ZodSetDef = ZodSetDef; +type z_ZodSet = ZodSet; +declare const z_ZodSet: typeof ZodSet; +type z_ZodFunctionDef< + Args extends ZodTuple = ZodTuple, + Returns extends ZodTypeAny = ZodTypeAny, +> = ZodFunctionDef; +type z_OuterTypeOfFunction, Returns extends ZodTypeAny> = OuterTypeOfFunction< + Args, + Returns +>; +type z_InnerTypeOfFunction, Returns extends ZodTypeAny> = InnerTypeOfFunction< + Args, + Returns +>; +type z_ZodFunction, Returns extends ZodTypeAny> = ZodFunction; +declare const z_ZodFunction: typeof ZodFunction; +type z_ZodLazyDef = ZodLazyDef; +type z_ZodLazy = ZodLazy; +declare const z_ZodLazy: typeof ZodLazy; +type z_ZodLiteralDef = ZodLiteralDef; +type z_ZodLiteral = ZodLiteral; +declare const z_ZodLiteral: typeof ZodLiteral; +type z_ArrayKeys = ArrayKeys; +type z_Indices = Indices; +type z_EnumValues = EnumValues; +type z_Values = Values; +type z_ZodEnumDef = ZodEnumDef; +type z_Writeable = Writeable; +type z_FilterEnum = FilterEnum; +type z_typecast = typecast; +type z_ZodEnum = ZodEnum; +declare const z_ZodEnum: typeof ZodEnum; +type z_ZodNativeEnumDef = ZodNativeEnumDef; +type z_EnumLike = EnumLike; +type z_ZodNativeEnum = ZodNativeEnum; +declare const z_ZodNativeEnum: typeof ZodNativeEnum; +type z_ZodPromiseDef = ZodPromiseDef; +type z_ZodPromise = ZodPromise; +declare const z_ZodPromise: typeof ZodPromise; +type z_Refinement = Refinement; +type z_SuperRefinement = SuperRefinement; +type z_RefinementEffect = RefinementEffect; +type z_TransformEffect = TransformEffect; +type z_PreprocessEffect = PreprocessEffect; +type z_Effect = Effect; +type z_ZodEffectsDef = ZodEffectsDef; +type z_ZodEffects, Input = input> = ZodEffects; +declare const z_ZodEffects: typeof ZodEffects; +type z_ZodOptionalDef = ZodOptionalDef; +type z_ZodOptionalType = ZodOptionalType; +type z_ZodOptional = ZodOptional; +declare const z_ZodOptional: typeof ZodOptional; +type z_ZodNullableDef = ZodNullableDef; +type z_ZodNullableType = ZodNullableType; +type z_ZodNullable = ZodNullable; +declare const z_ZodNullable: typeof ZodNullable; +type z_ZodDefaultDef = ZodDefaultDef; +type z_ZodDefault = ZodDefault; +declare const z_ZodDefault: typeof ZodDefault; +type z_ZodCatchDef = ZodCatchDef; +type z_ZodCatch = ZodCatch; +declare const z_ZodCatch: typeof ZodCatch; +type z_ZodNaNDef = ZodNaNDef; +type z_ZodNaN = ZodNaN; +declare const z_ZodNaN: typeof ZodNaN; +type z_ZodBrandedDef = ZodBrandedDef; +type z_BRAND = BRAND; +type z_ZodBranded = ZodBranded; +declare const z_ZodBranded: typeof ZodBranded; +type z_ZodPipelineDef = ZodPipelineDef; +type z_ZodPipeline = ZodPipeline; +declare const z_ZodPipeline: typeof ZodPipeline; +type z_ZodReadonlyDef = ZodReadonlyDef; +type z_ZodReadonly = ZodReadonly; +declare const z_ZodReadonly: typeof ZodReadonly; +declare const z_custom: typeof custom; +declare const z_late: typeof late; +type z_ZodFirstPartyTypeKind = ZodFirstPartyTypeKind; +declare const z_ZodFirstPartyTypeKind: typeof ZodFirstPartyTypeKind; +type z_ZodFirstPartySchemaTypes = ZodFirstPartySchemaTypes; +declare const z_coerce: typeof coerce; +declare const z_NEVER: typeof NEVER; +type z_inferFlattenedErrors, U = string> = inferFlattenedErrors; +type z_typeToFlattenedError = typeToFlattenedError; +type z_ZodIssueCode = ZodIssueCode; +type z_ZodIssueBase = ZodIssueBase; +type z_ZodInvalidTypeIssue = ZodInvalidTypeIssue; +type z_ZodInvalidLiteralIssue = ZodInvalidLiteralIssue; +type z_ZodUnrecognizedKeysIssue = ZodUnrecognizedKeysIssue; +type z_ZodInvalidUnionIssue = ZodInvalidUnionIssue; +type z_ZodInvalidUnionDiscriminatorIssue = ZodInvalidUnionDiscriminatorIssue; +type z_ZodInvalidEnumValueIssue = ZodInvalidEnumValueIssue; +type z_ZodInvalidArgumentsIssue = ZodInvalidArgumentsIssue; +type z_ZodInvalidReturnTypeIssue = ZodInvalidReturnTypeIssue; +type z_ZodInvalidDateIssue = ZodInvalidDateIssue; +type z_StringValidation = StringValidation; +type z_ZodInvalidStringIssue = ZodInvalidStringIssue; +type z_ZodTooSmallIssue = ZodTooSmallIssue; +type z_ZodTooBigIssue = ZodTooBigIssue; +type z_ZodInvalidIntersectionTypesIssue = ZodInvalidIntersectionTypesIssue; +type z_ZodNotMultipleOfIssue = ZodNotMultipleOfIssue; +type z_ZodNotFiniteIssue = ZodNotFiniteIssue; +type z_ZodCustomIssue = ZodCustomIssue; +type z_DenormalizedError = DenormalizedError; +type z_ZodIssueOptionalMessage = ZodIssueOptionalMessage; +type z_ZodIssue = ZodIssue; +declare const z_quotelessJson: typeof quotelessJson; +type z_ZodFormattedError = ZodFormattedError; +type z_inferFormattedError, U = string> = inferFormattedError; +type z_ZodError = ZodError; +declare const z_ZodError: typeof ZodError; +type z_IssueData = IssueData; +type z_ErrorMapCtx = ErrorMapCtx; +type z_ZodErrorMap = ZodErrorMap; +declare namespace z { + export { + errorMap as defaultErrorMap, + z_setErrorMap as setErrorMap, + z_getErrorMap as getErrorMap, + z_makeIssue as makeIssue, + type z_ParseParams as ParseParams, + type z_ParsePathComponent as ParsePathComponent, + type z_ParsePath as ParsePath, + z_EMPTY_PATH as EMPTY_PATH, + type z_ParseContext as ParseContext, + type z_ParseInput as ParseInput, + z_addIssueToContext as addIssueToContext, + type z_ObjectPair as ObjectPair, + z_ParseStatus as ParseStatus, + type z_ParseResult as ParseResult, + z_INVALID as INVALID, + z_DIRTY as DIRTY, + z_OK as OK, + type z_SyncParseReturnType as SyncParseReturnType, + type z_AsyncParseReturnType as AsyncParseReturnType, + type z_ParseReturnType as ParseReturnType, + z_isAborted as isAborted, + z_isDirty as isDirty, + z_isValid as isValid, + z_isAsync as isAsync, + type z_Primitive as Primitive, + type z_Scalars as Scalars, + z_util as util, + z_objectUtil as objectUtil, + type z_ZodParsedType as ZodParsedType, + z_getParsedType as getParsedType, + type TypeOf as infer, + ZodEffects as ZodTransformer, + ZodType as Schema, + ZodType as ZodSchema, + anyType as any, + arrayType as array, + bigIntType as bigint, + booleanType as boolean, + dateType as date, + discriminatedUnionType as discriminatedUnion, + effectsType as effect, + enumType as enum, + functionType as function, + instanceOfType as instanceof, + intersectionType as intersection, + lazyType as lazy, + literalType as literal, + mapType as map, + nanType as nan, + nativeEnumType as nativeEnum, + neverType as never, + nullType as null, + nullableType as nullable, + numberType as number, + objectType as object, + z_oboolean as oboolean, + z_onumber as onumber, + optionalType as optional, + z_ostring as ostring, + pipelineType as pipeline, + preprocessType as preprocess, + promiseType as promise, + recordType as record, + setType as set, + strictObjectType as strictObject, + stringType as string, + symbolType as symbol, + effectsType as transformer, + tupleType as tuple, + undefinedType as undefined, + unionType as union, + unknownType as unknown, + voidType as void, + type z_RefinementCtx as RefinementCtx, + type z_ZodRawShape as ZodRawShape, + type z_ZodTypeAny as ZodTypeAny, + type z_TypeOf as TypeOf, + type z_input as input, + type z_output as output, + type z_CustomErrorParams as CustomErrorParams, + type z_ZodTypeDef as ZodTypeDef, + type z_RawCreateParams as RawCreateParams, + type z_ProcessedCreateParams as ProcessedCreateParams, + type z_SafeParseSuccess as SafeParseSuccess, + type z_SafeParseError as SafeParseError, + type z_SafeParseReturnType as SafeParseReturnType, + z_ZodType as ZodType, + type z_IpVersion as IpVersion, + type z_ZodStringCheck as ZodStringCheck, + type z_ZodStringDef as ZodStringDef, + z_datetimeRegex as datetimeRegex, + z_ZodString as ZodString, + type z_ZodNumberCheck as ZodNumberCheck, + type z_ZodNumberDef as ZodNumberDef, + z_ZodNumber as ZodNumber, + type z_ZodBigIntCheck as ZodBigIntCheck, + type z_ZodBigIntDef as ZodBigIntDef, + z_ZodBigInt as ZodBigInt, + type z_ZodBooleanDef as ZodBooleanDef, + z_ZodBoolean as ZodBoolean, + type z_ZodDateCheck as ZodDateCheck, + type z_ZodDateDef as ZodDateDef, + z_ZodDate as ZodDate, + type z_ZodSymbolDef as ZodSymbolDef, + z_ZodSymbol as ZodSymbol, + type z_ZodUndefinedDef as ZodUndefinedDef, + z_ZodUndefined as ZodUndefined, + type z_ZodNullDef as ZodNullDef, + z_ZodNull as ZodNull, + type z_ZodAnyDef as ZodAnyDef, + z_ZodAny as ZodAny, + type z_ZodUnknownDef as ZodUnknownDef, + z_ZodUnknown as ZodUnknown, + type z_ZodNeverDef as ZodNeverDef, + z_ZodNever as ZodNever, + type z_ZodVoidDef as ZodVoidDef, + z_ZodVoid as ZodVoid, + type z_ZodArrayDef as ZodArrayDef, + type z_ArrayCardinality as ArrayCardinality, + type z_arrayOutputType as arrayOutputType, + z_ZodArray as ZodArray, + type z_ZodNonEmptyArray as ZodNonEmptyArray, + type z_UnknownKeysParam as UnknownKeysParam, + type z_ZodObjectDef as ZodObjectDef, + type z_mergeTypes as mergeTypes, + type z_objectOutputType as objectOutputType, + type z_baseObjectOutputType as baseObjectOutputType, + type z_objectInputType as objectInputType, + type z_baseObjectInputType as baseObjectInputType, + type z_CatchallOutput as CatchallOutput, + type z_CatchallInput as CatchallInput, + type z_PassthroughType as PassthroughType, + type z_deoptional as deoptional, + type z_SomeZodObject as SomeZodObject, + type z_noUnrecognized as noUnrecognized, + z_ZodObject as ZodObject, + type z_AnyZodObject as AnyZodObject, + type z_ZodUnionOptions as ZodUnionOptions, + type z_ZodUnionDef as ZodUnionDef, + z_ZodUnion as ZodUnion, + type z_ZodDiscriminatedUnionOption as ZodDiscriminatedUnionOption, + type z_ZodDiscriminatedUnionDef as ZodDiscriminatedUnionDef, + z_ZodDiscriminatedUnion as ZodDiscriminatedUnion, + type z_ZodIntersectionDef as ZodIntersectionDef, + z_ZodIntersection as ZodIntersection, + type z_ZodTupleItems as ZodTupleItems, + type z_AssertArray as AssertArray, + type z_OutputTypeOfTuple as OutputTypeOfTuple, + type z_OutputTypeOfTupleWithRest as OutputTypeOfTupleWithRest, + type z_InputTypeOfTuple as InputTypeOfTuple, + type z_InputTypeOfTupleWithRest as InputTypeOfTupleWithRest, + type z_ZodTupleDef as ZodTupleDef, + type z_AnyZodTuple as AnyZodTuple, + z_ZodTuple as ZodTuple, + type z_ZodRecordDef as ZodRecordDef, + type z_KeySchema as KeySchema, + type z_RecordType as RecordType, + z_ZodRecord as ZodRecord, + type z_ZodMapDef as ZodMapDef, + z_ZodMap as ZodMap, + type z_ZodSetDef as ZodSetDef, + z_ZodSet as ZodSet, + type z_ZodFunctionDef as ZodFunctionDef, + type z_OuterTypeOfFunction as OuterTypeOfFunction, + type z_InnerTypeOfFunction as InnerTypeOfFunction, + z_ZodFunction as ZodFunction, + type z_ZodLazyDef as ZodLazyDef, + z_ZodLazy as ZodLazy, + type z_ZodLiteralDef as ZodLiteralDef, + z_ZodLiteral as ZodLiteral, + type z_ArrayKeys as ArrayKeys, + type z_Indices as Indices, + type z_EnumValues as EnumValues, + type z_Values as Values, + type z_ZodEnumDef as ZodEnumDef, + type z_Writeable as Writeable, + type z_FilterEnum as FilterEnum, + type z_typecast as typecast, + z_ZodEnum as ZodEnum, + type z_ZodNativeEnumDef as ZodNativeEnumDef, + type z_EnumLike as EnumLike, + z_ZodNativeEnum as ZodNativeEnum, + type z_ZodPromiseDef as ZodPromiseDef, + z_ZodPromise as ZodPromise, + type z_Refinement as Refinement, + type z_SuperRefinement as SuperRefinement, + type z_RefinementEffect as RefinementEffect, + type z_TransformEffect as TransformEffect, + type z_PreprocessEffect as PreprocessEffect, + type z_Effect as Effect, + type z_ZodEffectsDef as ZodEffectsDef, + z_ZodEffects as ZodEffects, + type z_ZodOptionalDef as ZodOptionalDef, + type z_ZodOptionalType as ZodOptionalType, + z_ZodOptional as ZodOptional, + type z_ZodNullableDef as ZodNullableDef, + type z_ZodNullableType as ZodNullableType, + z_ZodNullable as ZodNullable, + type z_ZodDefaultDef as ZodDefaultDef, + z_ZodDefault as ZodDefault, + type z_ZodCatchDef as ZodCatchDef, + z_ZodCatch as ZodCatch, + type z_ZodNaNDef as ZodNaNDef, + z_ZodNaN as ZodNaN, + type z_ZodBrandedDef as ZodBrandedDef, + type z_BRAND as BRAND, + z_ZodBranded as ZodBranded, + type z_ZodPipelineDef as ZodPipelineDef, + z_ZodPipeline as ZodPipeline, + type z_ZodReadonlyDef as ZodReadonlyDef, + z_ZodReadonly as ZodReadonly, + z_custom as custom, + z_late as late, + z_ZodFirstPartyTypeKind as ZodFirstPartyTypeKind, + type z_ZodFirstPartySchemaTypes as ZodFirstPartySchemaTypes, + z_coerce as coerce, + z_NEVER as NEVER, + type z_inferFlattenedErrors as inferFlattenedErrors, + type z_typeToFlattenedError as typeToFlattenedError, + type z_ZodIssueCode as ZodIssueCode, + type z_ZodIssueBase as ZodIssueBase, + type z_ZodInvalidTypeIssue as ZodInvalidTypeIssue, + type z_ZodInvalidLiteralIssue as ZodInvalidLiteralIssue, + type z_ZodUnrecognizedKeysIssue as ZodUnrecognizedKeysIssue, + type z_ZodInvalidUnionIssue as ZodInvalidUnionIssue, + type z_ZodInvalidUnionDiscriminatorIssue as ZodInvalidUnionDiscriminatorIssue, + type z_ZodInvalidEnumValueIssue as ZodInvalidEnumValueIssue, + type z_ZodInvalidArgumentsIssue as ZodInvalidArgumentsIssue, + type z_ZodInvalidReturnTypeIssue as ZodInvalidReturnTypeIssue, + type z_ZodInvalidDateIssue as ZodInvalidDateIssue, + type z_StringValidation as StringValidation, + type z_ZodInvalidStringIssue as ZodInvalidStringIssue, + type z_ZodTooSmallIssue as ZodTooSmallIssue, + type z_ZodTooBigIssue as ZodTooBigIssue, + type z_ZodInvalidIntersectionTypesIssue as ZodInvalidIntersectionTypesIssue, + type z_ZodNotMultipleOfIssue as ZodNotMultipleOfIssue, + type z_ZodNotFiniteIssue as ZodNotFiniteIssue, + type z_ZodCustomIssue as ZodCustomIssue, + type z_DenormalizedError as DenormalizedError, + type z_ZodIssueOptionalMessage as ZodIssueOptionalMessage, + type z_ZodIssue as ZodIssue, + z_quotelessJson as quotelessJson, + type z_ZodFormattedError as ZodFormattedError, + type z_inferFormattedError as inferFormattedError, + z_ZodError as ZodError, + type z_IssueData as IssueData, + type z_ErrorMapCtx as ErrorMapCtx, + type z_ZodErrorMap as ZodErrorMap, + }; +} + +//# sourceMappingURL=index.d.ts.map + +export { + type AnyZodObject, + type AnyZodTuple, + type ArrayCardinality, + type ArrayKeys, + type AssertArray, + type AsyncParseReturnType, + BRAND, + type CatchallInput, + type CatchallOutput, + type CustomErrorParams, + DIRTY, + type DenormalizedError, + EMPTY_PATH, + type Effect, + type EnumLike, + type EnumValues, + type ErrorMapCtx, + type FilterEnum, + INVALID, + type Indices, + type InnerTypeOfFunction, + type InputTypeOfTuple, + type InputTypeOfTupleWithRest, + type IpVersion, + type IssueData, + type KeySchema, + NEVER, + OK, + type ObjectPair, + type OuterTypeOfFunction, + type OutputTypeOfTuple, + type OutputTypeOfTupleWithRest, + type ParseContext, + type ParseInput, + type ParseParams, + type ParsePath, + type ParsePathComponent, + type ParseResult, + type ParseReturnType, + ParseStatus, + type PassthroughType, + type PreprocessEffect, + type Primitive, + type ProcessedCreateParams, + type RawCreateParams, + type RecordType, + type Refinement, + type RefinementCtx, + type RefinementEffect, + type SafeParseError, + type SafeParseReturnType, + type SafeParseSuccess, + type Scalars, + ZodType as Schema, + type SomeZodObject, + type StringValidation, + type SuperRefinement, + type SyncParseReturnType, + type TransformEffect, + type TypeOf, + type UnknownKeysParam, + type Values, + type Writeable, + ZodAny, + type ZodAnyDef, + ZodArray, + type ZodArrayDef, + ZodBigInt, + type ZodBigIntCheck, + type ZodBigIntDef, + ZodBoolean, + type ZodBooleanDef, + ZodBranded, + type ZodBrandedDef, + ZodCatch, + type ZodCatchDef, + type ZodCustomIssue, + ZodDate, + type ZodDateCheck, + type ZodDateDef, + ZodDefault, + type ZodDefaultDef, + ZodDiscriminatedUnion, + type ZodDiscriminatedUnionDef, + type ZodDiscriminatedUnionOption, + ZodEffects, + type ZodEffectsDef, + ZodEnum, + type ZodEnumDef, + ZodError, + type ZodErrorMap, + type ZodFirstPartySchemaTypes, + ZodFirstPartyTypeKind, + type ZodFormattedError, + ZodFunction, + type ZodFunctionDef, + ZodIntersection, + type ZodIntersectionDef, + type ZodInvalidArgumentsIssue, + type ZodInvalidDateIssue, + type ZodInvalidEnumValueIssue, + type ZodInvalidIntersectionTypesIssue, + type ZodInvalidLiteralIssue, + type ZodInvalidReturnTypeIssue, + type ZodInvalidStringIssue, + type ZodInvalidTypeIssue, + type ZodInvalidUnionDiscriminatorIssue, + type ZodInvalidUnionIssue, + type ZodIssue, + type ZodIssueBase, + ZodIssueCode, + type ZodIssueOptionalMessage, + ZodLazy, + type ZodLazyDef, + ZodLiteral, + type ZodLiteralDef, + ZodMap, + type ZodMapDef, + ZodNaN, + type ZodNaNDef, + ZodNativeEnum, + type ZodNativeEnumDef, + ZodNever, + type ZodNeverDef, + type ZodNonEmptyArray, + type ZodNotFiniteIssue, + type ZodNotMultipleOfIssue, + ZodNull, + type ZodNullDef, + ZodNullable, + type ZodNullableDef, + type ZodNullableType, + ZodNumber, + type ZodNumberCheck, + type ZodNumberDef, + ZodObject, + type ZodObjectDef, + ZodOptional, + type ZodOptionalDef, + type ZodOptionalType, + ZodParsedType, + ZodPipeline, + type ZodPipelineDef, + ZodPromise, + type ZodPromiseDef, + type ZodRawShape, + ZodReadonly, + type ZodReadonlyDef, + ZodRecord, + type ZodRecordDef, + ZodType as ZodSchema, + ZodSet, + type ZodSetDef, + ZodString, + type ZodStringCheck, + type ZodStringDef, + ZodSymbol, + type ZodSymbolDef, + type ZodTooBigIssue, + type ZodTooSmallIssue, + ZodEffects as ZodTransformer, + ZodTuple, + type ZodTupleDef, + type ZodTupleItems, + ZodType, + type ZodTypeAny, + type ZodTypeDef, + ZodUndefined, + type ZodUndefinedDef, + ZodUnion, + type ZodUnionDef, + type ZodUnionOptions, + ZodUnknown, + type ZodUnknownDef, + type ZodUnrecognizedKeysIssue, + ZodVoid, + type ZodVoidDef, + addIssueToContext, + anyType as any, + arrayType as array, + type arrayOutputType, + type baseObjectInputType, + type baseObjectOutputType, + bigIntType as bigint, + booleanType as boolean, + coerce, + custom, + dateType as date, + datetimeRegex, + z as default, + errorMap as defaultErrorMap, + type deoptional, + discriminatedUnionType as discriminatedUnion, + effectsType as effect, + enumType as enum, + functionType as function, + getErrorMap, + getParsedType, + type TypeOf as infer, + type inferFlattenedErrors, + type inferFormattedError, + type input, + instanceOfType as instanceof, + intersectionType as intersection, + isAborted, + isAsync, + isDirty, + isValid, + late, + lazyType as lazy, + literalType as literal, + makeIssue, + mapType as map, + type mergeTypes, + nanType as nan, + nativeEnumType as nativeEnum, + neverType as never, + type noUnrecognized, + nullType as null, + nullableType as nullable, + numberType as number, + objectType as object, + type objectInputType, + type objectOutputType, + objectUtil, + oboolean, + onumber, + optionalType as optional, + ostring, + type output, + pipelineType as pipeline, + preprocessType as preprocess, + promiseType as promise, + quotelessJson, + recordType as record, + setType as set, + setErrorMap, + strictObjectType as strictObject, + stringType as string, + symbolType as symbol, + effectsType as transformer, + tupleType as tuple, + type typeToFlattenedError, + type typecast, + undefinedType as undefined, + unionType as union, + unknownType as unknown, + util, + voidType as void, + z, +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 38c3b130..7eb9fc34 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -91,7 +91,7 @@ importers: version: 1.4.0 '@monaco-editor/react': specifier: ^4.6.0 - version: 4.6.0(monaco-editor@0.48.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 4.6.0(monaco-editor@0.50.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tanstack/react-table': specifier: 8.17.3 version: 8.17.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -123,8 +123,8 @@ importers: specifier: ^2.2.3 version: 2.2.3 monaco-editor: - specifier: ^0.48.0 - version: 0.48.0 + specifier: ^0.50.0 + version: 0.50.0 react-ace: specifier: ^11.0.1 version: 11.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -4992,8 +4992,8 @@ packages: resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==} engines: {node: '>=0.10.0'} - monaco-editor@0.48.0: - resolution: {integrity: sha512-goSDElNqFfw7iDHMg8WDATkfcyeLTNpBHQpO8incK6p5qZt5G/1j41X0xdGzpIkGojGXM+QiRQyLjnfDVvrpwA==} + monaco-editor@0.50.0: + resolution: {integrity: sha512-8CclLCmrRRh+sul7C08BmPBP3P8wVWfBHomsTcndxg5NRCEPfu/mc2AGU8k37ajjDVXcXFc12ORAMUkmk+lkFA==} ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} @@ -7092,7 +7092,7 @@ snapshots: '@babel/traverse': 7.24.1 '@babel/types': 7.24.0 convert-source-map: 2.0.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -7153,7 +7153,7 @@ snapshots: '@babel/core': 7.24.4 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-plugin-utils': 7.24.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -7834,7 +7834,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.24.4 '@babel/types': 7.24.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -7849,7 +7849,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.24.4 '@babel/types': 7.24.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -8210,15 +8210,15 @@ snapshots: '@microsoft/tsdoc@0.14.2': {} - '@monaco-editor/loader@1.4.0(monaco-editor@0.48.0)': + '@monaco-editor/loader@1.4.0(monaco-editor@0.50.0)': dependencies: - monaco-editor: 0.48.0 + monaco-editor: 0.50.0 state-local: 1.0.7 - '@monaco-editor/react@4.6.0(monaco-editor@0.48.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@monaco-editor/react@4.6.0(monaco-editor@0.50.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@monaco-editor/loader': 1.4.0(monaco-editor@0.48.0) - monaco-editor: 0.48.0 + '@monaco-editor/loader': 1.4.0(monaco-editor@0.50.0) + monaco-editor: 0.50.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -11067,6 +11067,10 @@ snapshots: dependencies: ms: 2.0.0 + debug@4.3.4: + dependencies: + ms: 2.1.2 + debug@4.3.4(supports-color@8.1.1): dependencies: ms: 2.1.2 @@ -11174,7 +11178,7 @@ snapshots: detect-port@1.5.1: dependencies: address: 1.2.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -11384,7 +11388,7 @@ snapshots: esbuild-register@3.5.0(esbuild@0.20.2): dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 esbuild: 0.20.2 transitivePeerDependencies: - supports-color @@ -12993,7 +12997,7 @@ snapshots: modify-values@1.0.1: {} - monaco-editor@0.48.0: {} + monaco-editor@0.50.0: {} ms@2.0.0: {} @@ -15090,7 +15094,7 @@ snapshots: '@microsoft/api-extractor': 7.43.0(@types/node@20.12.12) '@rollup/pluginutils': 5.1.0(rollup@4.15.0) '@vue/language-core': 1.8.27(typescript@5.4.5) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 kolorist: 1.8.0 magic-string: 0.30.10 typescript: 5.4.5