import { type BaseParseContext, type BaseRoot, type StandardSchemaV1 } from "@ark/schema"; import { type anyOrNever, type array, type ErrorMessage, type Fn, type ifEmptyObjectLiteral, type objectKindOrDomainOf, type Primitive } from "@ark/util"; import type { Out } from "../attributes.ts"; import type { type } from "../keywords/keywords.ts"; import type { InnerParseResult } from "../scope.ts"; import type { shallowDefaultableMessage, shallowOptionalMessage, validateString } from "./ast/validate.ts"; import { type inferObjectLiteral, type validateObjectLiteral } from "./objectLiteral.ts"; import type { isDefaultable, OptionalPropertyDefinition } from "./property.ts"; import { type BaseCompletions, type inferString } from "./string.ts"; import { type inferTupleExpression, type maybeValidateTupleExpression, type TupleExpression } from "./tupleExpressions.ts"; import { type inferTupleLiteral, type validateTupleLiteral } from "./tupleLiteral.ts"; export declare const parseInnerDefinition: (def: unknown, ctx: BaseParseContext) => InnerParseResult; export declare const parseObject: (def: object, ctx: BaseParseContext) => BaseRoot; export type inferDefinition = [ def ] extends [anyOrNever] ? def : def extends type.cast ? ifEmptyObjectLiteral : def extends ThunkCast ? t : def extends string ? inferString : def extends array ? inferTuple : def extends RegExp ? string : def extends StandardSchemaV1 ? inferStandardSchema : def extends object ? inferObjectLiteral : never; type inferStandardSchema, o = StandardSchemaV1.InferOutput> = [i, o] extends [o, i] ? i : (In: i) => Out; export type validateDefinition = null extends undefined ? ErrorMessage<`'strict' or 'strictNullChecks' must be set to true in your tsconfig's 'compilerOptions'`> : [def] extends [anyOrNever] ? def : def extends OptionalPropertyDefinition ? ErrorMessage : isDefaultable extends true ? ErrorMessage : validateInnerDefinition; export type validateInnerDefinition = [ def ] extends [TerminalObjectDefinition] ? def : def extends string ? validateString : unknown extends def ? BaseCompletions<$, args> | {} : def extends readonly unknown[] ? validateTuple : def extends BadDefinitionType ? ErrorMessage>> : validateObjectLiteral; export declare const parseTuple: (def: array, ctx: BaseParseContext) => BaseRoot; export type validateTuple = maybeValidateTupleExpression extends infer result ? result extends null ? validateTupleLiteral : result : never; export type inferTuple = def extends TupleExpression ? inferTupleExpression : inferTupleLiteral; export type TerminalObjectDefinition = type.cast | Fn | RegExp | StandardSchemaV1; export type ThunkCast = () => type.cast; type BadDefinitionType = Exclude; export declare const writeBadDefinitionTypeMessage: (actual: actual) => writeBadDefinitionTypeMessage; type writeBadDefinitionTypeMessage = `Type definitions must be strings or objects (was ${actual})`; export {};