diff --git a/ark/docs/components/dts/type.ts b/ark/docs/components/dts/type.ts index a5b149c5c6..018906f0ac 100644 --- a/ark/docs/components/dts/type.ts +++ b/ark/docs/components/dts/type.ts @@ -1,3 +1,3 @@ /** THIS FILE IS AUTOGENERATED FROM ark/repo/dtsGen.ts **/ // prettier-ignore -export const typeDts = "declare module \"arktype\" {\n import * as _ark_schema from '@ark/schema';\nimport { BaseRoot, BaseParseContext, TypeMeta, arkKind, GenericAst, GenericParamAst, writeUnsatisfiedParameterConstraintMessage, GenericRoot, genericParamNames, resolvableReferenceIn, writeUnresolvableMessage, writeNonSubmoduleDotMessage, emptyBrandNameMessage, writeUnboundableMessage, writeUnassignableDefaultValueMessage, writeIndivisibleMessage, writeNonStructuralOperandMessage, PrivateDeclaration, writeMissingSubmoduleAccessMessage, writeInvalidPropertyKeyMessage, UndeclaredKeyBehavior, Sequence, postfixAfterOptionalOrDefaultableMessage, BaseMappedPropInner, OptionalMappedPropInner, Prop, InclusiveNumericRangeSchema, ExclusiveNumericRangeSchema, ExactLength, InclusiveDateRangeSchema, ExclusiveDateRangeSchema, Divisor, Pattern, Morph, ToJsonSchema, JsonSchema, NodeSelector, Predicate, BaseNode, Disjoint, StandardSchemaV1, ArkErrors, unwrapDefault, RootSchema, BaseParseOptions, ArkSchemaScopeConfig, exportedNameOf, toInternalScope, NodeKind, RootKind, NodeSchema, nodeOfKind, reducibleKindOf, PreparsedNodeResolution, writeDuplicateAliasError, BaseScope, AliasDefEntry, GenericParamDef, BaseParseContextInput, flatResolutionsOf, LazyGenericBody, RootModule, ArkError } from '@ark/schema';\nexport { ArkError, ArkErrors, ArkSchemaConfig, ArkSchemaScopeConfig, JsonSchema, Traversal, TraversalError } from '@ark/schema';\nimport * as util from '@ark/util';\nimport { Scanner, requireKeys, ErrorMessage, Completion, writeUnmatchedGroupCloseMessage, writeUnclosedGroupMessage, defined, anyOrNever, Stringifiable, Hkt, array, typeToString, arkKeyOf, NumberLiteral, join, lastOf, BigintLiteral, WhitespaceChar, trim as trim$1, writeMalformedNumericLiteralMessage, show, merge, Key, Backslash, ErrorType, satisfy, conform, arkIndexableOf, arkGet, toArkKey, listable, intersectUnion, inferred, optionalKeyOf, JsonStructure, Callable, unset, numericStringKeyOf, isDisjoint, unionToTuple, propValueOf, Constructor, get, Fn, applyElementLabels, flattenListable, Brand, noSuggest, ifEmptyObjectLiteral, Primitive, objectKindOrDomainOf, requiredKeyOf, equals, Json, omit, pick, Digit, liftArray, EcmascriptObjects, PlatformObjects, isSafelyMappable, intersectArrays, unionKeyOf } from '@ark/util';\nexport { Hkt, ParseError, inferred } from '@ark/util';\nimport { regex, Regex } from 'arkregex';\nexport { regex } from 'arkregex';\nimport { ArkSchemaConfig } from '@ark/schema/config';\n\ntype StringifiablePrefixOperator = \"keyof\";\ndeclare const minComparators: {\n readonly \">\": true;\n readonly \">=\": true;\n};\ntype MinComparator = keyof typeof minComparators;\ndeclare const maxComparators: {\n readonly \"<\": true;\n readonly \"<=\": true;\n};\ntype MaxComparator = keyof typeof maxComparators;\ndeclare const comparators: {\n \">\": boolean;\n \">=\": boolean;\n \"<\": boolean;\n \"<=\": boolean;\n \"==\": boolean;\n};\ntype Comparator = keyof typeof comparators;\ntype InvertedComparators = {\n \"<\": \">\";\n \">\": \"<\";\n \"<=\": \">=\";\n \">=\": \"<=\";\n \"==\": \"==\";\n};\ntype BranchOperator = \"&\" | \"|\" | \"|>\";\ntype OpenLeftBound = {\n limit: LimitLiteral;\n comparator: MinComparator;\n};\ndeclare const writeOpenRangeMessage: (min: min, comparator: comparator) => writeOpenRangeMessage;\ntype writeOpenRangeMessage = `Left bounds are only valid when paired with right bounds (try ...${comparator}${min})`;\ntype writeUnpairableComparatorMessage = `Left-bounded expressions must specify their limits using < or <= (was ${comparator})`;\ndeclare const writeUnpairableComparatorMessage: (comparator: comparator) => writeUnpairableComparatorMessage;\ndeclare const writeMultipleLeftBoundsMessage: (openLimit: openLimit, openComparator: openComparator, limit: limit, comparator: comparator) => writeMultipleLeftBoundsMessage;\ntype writeMultipleLeftBoundsMessage = `An expression may have at most one left bound (parsed ${openLimit}${InvertedComparators[openComparator]}, ${limit}${InvertedComparators[comparator]})`;\n\ndeclare const terminatingChars: {\n readonly \" \": 1;\n readonly \"\\n\": 1;\n readonly \"\\t\": 1;\n readonly \"<\": 1;\n readonly \">\": 1;\n readonly \"=\": 1;\n readonly \"|\": 1;\n readonly \"&\": 1;\n readonly \")\": 1;\n readonly \"[\": 1;\n readonly \"%\": 1;\n readonly \",\": 1;\n readonly \":\": 1;\n readonly \"?\": 1;\n readonly \"#\": 1;\n};\ntype TerminatingChar = keyof typeof terminatingChars;\ndeclare const finalizingLookaheads: {\n readonly \">\": 1;\n readonly \",\": 1;\n readonly \"\": 1;\n readonly \"=\": 1;\n readonly \"?\": 1;\n};\ntype FinalizingLookahead = keyof typeof finalizingLookaheads;\ndeclare const lookaheadIsFinalizing: (lookahead: string, unscanned: string) => lookahead is \">\" | \",\" | \"=\" | \"?\";\ntype lookaheadIsFinalizing = lookahead extends \">\" ? unscanned extends `=${infer nextUnscanned}` ? nextUnscanned extends `=${string}` ? true : false : Scanner.skipWhitespace extends (\"\" | `${TerminatingChar}${string}`) ? true : false : lookahead extends \"=\" ? unscanned extends `=${string}` ? false : true : lookahead extends \",\" | \"?\" ? true : false;\ntype InfixToken = Comparator | \"|\" | \"&\" | \"%\" | \":\" | \"=>\" | \"|>\" | \"#\" | \"@\" | \"=\";\ntype PostfixToken = \"[]\" | \"?\";\n\ntype BranchState$1 = {\n prefixes: StringifiablePrefixOperator[];\n leftBound: OpenLeftBound | null;\n intersection: BaseRoot | null;\n union: BaseRoot | null;\n pipe: BaseRoot | null;\n};\ntype RootedRuntimeState = requireKeys;\ndeclare class RuntimeState {\n root: BaseRoot | undefined;\n branches: BranchState$1;\n finalizer: FinalizingLookahead | undefined;\n groups: BranchState$1[];\n scanner: Scanner;\n ctx: BaseParseContext;\n constructor(scanner: Scanner, ctx: BaseParseContext);\n error(message: string): never;\n hasRoot(): this is RootedRuntimeState;\n setRoot(root: BaseRoot): void;\n unsetRoot(): this[\"root\"];\n constrainRoot(...args: Parameters[\"constrain\"]>): void;\n finalize(finalizer: FinalizingLookahead): void;\n reduceLeftBound(limit: LimitLiteral, comparator: Comparator): void;\n finalizeBranches(): void;\n finalizeGroup(): void;\n addPrefix(prefix: StringifiablePrefixOperator): void;\n applyPrefixes(): void;\n pushRootToBranch(token: BranchOperator): void;\n parseUntilFinalizer(): RootedRuntimeState;\n parseOperator(this: RootedRuntimeState): void;\n parseOperand(): void;\n private assertRangeUnset;\n reduceGroupOpen(): void;\n previousOperator(): MinComparator | StringifiablePrefixOperator | InfixToken | undefined;\n shiftedBy(count: number): this;\n}\n\ntype StaticState = {\n root: unknown;\n branches: BranchState;\n groups: BranchState[];\n finalizer: FinalizingLookahead | ErrorMessage | undefined;\n scanned: string;\n unscanned: string;\n};\ntype BranchState = {\n prefixes: StringifiablePrefixOperator[];\n leftBound: OpenLeftBound | undefined;\n intersection: unknown;\n pipe: unknown;\n union: unknown;\n};\ndeclare namespace s {\n type initialize = from<{\n root: undefined;\n branches: initialBranches;\n groups: [];\n finalizer: undefined;\n scanned: \"\";\n unscanned: def;\n }>;\n type error = from<{\n root: ErrorMessage;\n branches: initialBranches;\n groups: [];\n finalizer: ErrorMessage;\n scanned: \"\";\n unscanned: \"\";\n }>;\n type completion = from<{\n root: Completion;\n branches: initialBranches;\n groups: [];\n finalizer: Completion;\n scanned: \"\";\n unscanned: \"\";\n }>;\n type initialBranches = branchesFrom<{\n prefixes: [];\n leftBound: undefined;\n intersection: undefined;\n pipe: undefined;\n union: undefined;\n }>;\n type updateScanned = previousUnscanned extends `${infer justScanned}${updatedUnscanned}` ? `${previousScanned}${justScanned}` : previousScanned;\n type setRoot = from<{\n root: root;\n branches: s[\"branches\"];\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type addPrefix = from<{\n root: s[\"root\"];\n branches: {\n prefixes: [...s[\"branches\"][\"prefixes\"], prefix];\n leftBound: s[\"branches\"][\"leftBound\"];\n intersection: s[\"branches\"][\"intersection\"];\n pipe: s[\"branches\"][\"pipe\"];\n union: s[\"branches\"][\"union\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type reduceBranch = s[\"branches\"][\"leftBound\"] extends {} ? openRangeError : from<{\n root: undefined;\n branches: {\n prefixes: [];\n leftBound: undefined;\n intersection: token extends \"&\" ? mergeToIntersection : undefined;\n union: token extends \"|\" ? mergeToUnion : token extends \"|>\" ? undefined : s[\"branches\"][\"union\"];\n pipe: token extends \"|>\" ? mergeToPipe : s[\"branches\"][\"pipe\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type reduceLeftBound = comparator extends \"<\" | \"<=\" ? s[\"branches\"][\"leftBound\"] extends {} ? s.error> : from<{\n root: undefined;\n branches: {\n prefixes: s[\"branches\"][\"prefixes\"];\n leftBound: {\n limit: limit;\n comparator: InvertedComparators[comparator];\n };\n intersection: s[\"branches\"][\"intersection\"];\n pipe: s[\"branches\"][\"pipe\"];\n union: s[\"branches\"][\"union\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }> : s.error>;\n type reduceRange = s.from<{\n root: [minLimit, minComparator, [s[\"root\"], maxComparator, maxLimit]];\n branches: {\n prefixes: s[\"branches\"][\"prefixes\"];\n leftBound: undefined;\n intersection: s[\"branches\"][\"intersection\"];\n pipe: s[\"branches\"][\"pipe\"];\n union: s[\"branches\"][\"union\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type reduceSingleBound = s.from<{\n root: [s[\"root\"], comparator, limit];\n branches: {\n prefixes: s[\"branches\"][\"prefixes\"];\n leftBound: undefined;\n intersection: s[\"branches\"][\"intersection\"];\n pipe: s[\"branches\"][\"pipe\"];\n union: s[\"branches\"][\"union\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type mergeToIntersection = s[\"branches\"][\"intersection\"] extends undefined ? mergePrefixes : [s[\"branches\"][\"intersection\"], \"&\", mergePrefixes];\n type mergeToUnion = s[\"branches\"][\"union\"] extends undefined ? mergeToIntersection : [s[\"branches\"][\"union\"], \"|\", mergeToIntersection];\n type mergeToPipe = s[\"branches\"][\"pipe\"] extends undefined ? mergeToUnion : [s[\"branches\"][\"pipe\"], \"|>\", mergeToUnion];\n type mergePrefixes = remaining extends [infer head, ...infer tail] ? [\n head,\n mergePrefixes\n ] : s[\"root\"];\n type popGroup = [\n ...stack,\n top\n ];\n type finalizeGroup = s[\"branches\"][\"leftBound\"] extends {} ? openRangeError : s[\"groups\"] extends popGroup ? from<{\n groups: stack;\n branches: top;\n root: mergeToPipe;\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }> : s.error>;\n type reduceGroupOpen = from<{\n groups: [...s[\"groups\"], s[\"branches\"]];\n branches: initialBranches;\n root: undefined;\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type finalize = s[\"groups\"] extends [] ? s[\"branches\"][\"leftBound\"] extends {} ? openRangeError : from<{\n root: mergeToPipe;\n groups: s[\"groups\"];\n branches: initialBranches;\n finalizer: finalizer;\n scanned: s[\"scanned\"];\n unscanned: s[\"unscanned\"];\n }> : s.error>;\n type openRangeError> = s.error>;\n type previousOperator = s[\"branches\"][\"leftBound\"] extends {} ? s[\"branches\"][\"leftBound\"][\"comparator\"] : s[\"branches\"][\"prefixes\"] extends ([\n ...unknown[],\n infer tail extends string\n ]) ? tail : s[\"branches\"][\"intersection\"] extends {} ? \"&\" : s[\"branches\"][\"union\"] extends {} ? \"|\" : undefined;\n type scanTo = from<{\n root: s[\"root\"];\n branches: s[\"branches\"];\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type from = s;\n type branchesFrom = b;\n}\n\ntype KeywordConfig = {\n [k in keyof Ark.flat as parseConfigurableFlatAlias]?: TypeMeta.Collapsible;\n};\ntype parseConfigurableFlatAlias = [\n v\n] extends [anyOrNever] ? k : v extends {\n [arkKind]: \"generic\" | \"module\";\n} ? never : k extends `${infer prefix}.root` ? prefix : k;\ninterface ArkConfig extends ArkSchemaConfig {\n keywords?: KeywordConfig;\n}\ndeclare const configure: (config: config) => config;\ndeclare global {\n export interface ArkEnv {\n $(): Ark;\n }\n}\n/**\n * This mirrors the global ArkEnv namespace as a local export. We use it instead\n * of the global internally due to a bug in twoslash that prevents `ark/docs`\n * from building if we refer to the global directly.\n *\n * If, in the future, docs can build while arktype refers to `ArkEnv.$` directly,\n * this can be removed.\n */\ndeclare namespace ArkAmbient {\n type $ = ReturnType;\n type meta = ArkEnv.meta;\n type prototypes = ArkEnv.prototypes;\n}\n\ntype astToString = ast extends InferredAst | DefAst ? ast[2] : ast extends PostfixExpression ? operator extends \"[]\" ? `${astToString}[]` : never : ast extends InfixExpression ? operator extends \"&\" | \"|\" | \"%\" | Comparator ? `${astToString} ${operator} ${astToString}` : never : ast extends Stringifiable ? `${ast extends bigint ? `${ast}n` : ast}` : \"...\";\ntype writeConstrainedMorphMessage = `To constrain the output of ${astToString}, pipe like myMorph.to('number > 0').\nTo constrain the input, intersect like myMorph.and('number > 0').`;\n\ntype GenericInstantiationAst = [generic, \"<>\", argAsts];\ntype inferGenericInstantiation = g[\"bodyDef\"] extends Hkt ? Hkt.apply;\n}> : inferDefinition, {\n [i in keyof g[\"names\"] & `${number}` as g[\"names\"][i]]: inferExpression, args>;\n}>;\ntype validateGenericInstantiation = validateGenericArgs;\ntype validateGenericArgs, argAsts extends array, $, args, indices extends 1[]> = argAsts extends readonly [infer arg, ...infer argsTail] ? validateAst extends infer e extends ErrorMessage ? e : inferAstRoot extends params[indices[\"length\"]][1] ? validateGenericArgs : ErrorMessage, astToString>> : undefined;\ntype resolveScope = g$ extends UnparsedScope ? $ : g$;\n\ntype inferAstRoot = ast extends array ? inferExpression : never;\ntype inferAstIn = distill.In>;\ntype DefAst = [\n def,\n \"def\",\n alias\n];\ntype InferredAst = [\n t,\n \"inferred\",\n def\n];\ntype inferExpression = ast extends array ? ast extends InferredAst ? resolution : ast extends DefAst ? inferDefinition : ast extends GenericInstantiationAst ? inferGenericInstantiation : ast[1] extends \"[]\" ? inferExpression[] : ast[1] extends \"|\" ? inferExpression | inferExpression : ast[1] extends \"&\" ? inferIntersection, inferExpression> : ast[1] extends \"|>\" ? inferPipe, inferExpression> : ast[1] extends \"=\" ? type.infer extends infer defaultValue ? withDefault, defaultValue> : never : ast[1] extends \"#\" ? type.brand, ast[2]> : ast[1] extends Comparator ? ast[0] extends LimitLiteral ? inferExpression : inferExpression : ast[1] extends \"%\" ? inferExpression : ast[1] extends \"?\" ? inferExpression : ast[0] extends \"keyof\" ? arkKeyOf> : never : never;\ntype PostfixExpression = readonly [operand, operator];\ntype InfixExpression = [l, operator, r];\n\ntype StringLiteral = DoubleQuotedStringLiteral | SingleQuotedStringLiteral;\ntype DoubleQuotedStringLiteral = `\"${contents}\"`;\ntype SingleQuotedStringLiteral = `'${contents}'`;\ndeclare const parseEnclosed: (s: RuntimeState, enclosing: EnclosingStartToken) => void;\ntype parseEnclosed = Scanner.shiftUntilEscapable extends Scanner.shiftResult ? _parseEnclosed : never;\ntype _parseEnclosed = nextUnscanned extends \"\" ? s.error> : enclosingStart extends EnclosingQuote ? s.setRoot, nextUnscanned extends Scanner.shift ? unscanned : \"\"> : enclosingStart extends EnclosingRegexToken ? regex.parse extends infer r ? r extends Regex ? s.setRoot Out, def>, nextUnscanned extends Scanner.shift ? unscanned : \"\"> : r extends ErrorMessage ? s.error : never : never : s.setRoot, nextUnscanned extends Scanner.shift ? unscanned : \"\">;\ndeclare const enclosingQuote: {\n readonly \"'\": 1;\n readonly '\"': 1;\n};\ntype EnclosingQuote = keyof typeof enclosingQuote;\ndeclare const enclosingLiteralTokens: {\n readonly \"d'\": \"'\";\n readonly 'd\"': \"\\\"\";\n readonly \"'\": \"'\";\n readonly '\"': \"\\\"\";\n};\ntype EnclosingLiteralTokens = typeof enclosingLiteralTokens;\ntype EnclosingLiteralStartToken = keyof EnclosingLiteralTokens;\ndeclare const enclosingRegexTokens: {\n readonly \"/\": \"/\";\n readonly \"x/\": \"/\";\n};\ntype EnclosingRegexTokens = typeof enclosingRegexTokens;\ntype EnclosingRegexToken = keyof EnclosingRegexTokens;\ndeclare const enclosingTokens: {\n readonly \"/\": \"/\";\n readonly \"x/\": \"/\";\n readonly \"d'\": \"'\";\n readonly 'd\"': \"\\\"\";\n readonly \"'\": \"'\";\n readonly '\"': \"\\\"\";\n};\ntype EnclosingTokens = typeof enclosingTokens;\ntype EnclosingStartToken = keyof EnclosingTokens;\ndeclare const enclosingCharDescriptions: {\n readonly '\"': \"double-quote\";\n readonly \"'\": \"single-quote\";\n readonly \"/\": \"forward slash\";\n};\ntype enclosingCharDescriptions = typeof enclosingCharDescriptions;\ndeclare const writeUnterminatedEnclosedMessage: (fragment: fragment, enclosingStart: enclosingStart) => writeUnterminatedEnclosedMessage;\ntype writeUnterminatedEnclosedMessage = `${enclosingStart}${fragment} requires a closing ${enclosingCharDescriptions[EnclosingTokens[enclosingStart]]}`;\n\ndeclare const parseUnenclosed: (s: RuntimeState) => void;\ntype parseUnenclosed = Scanner.shiftUntil extends (Scanner.shiftResult) ? tryResolve extends s.from ? s : never : never;\ntype parseResolution = resolutionToAst extends infer ast ? ast extends GenericAst ? parseGenericInstantiation, $, args> : s.setRoot : never;\ndeclare const parseGenericInstantiation: (name: string, g: GenericRoot, s: RuntimeState) => BaseRoot;\ntype parseGenericInstantiation = Scanner.skipWhitespace extends `<${infer unscanned}` ? parseGenericArgs extends infer result ? result extends ParsedArgs ? s.setRoot, nextUnscanned> : result : never : s.error, [\n]>>;\ntype tryResolve = token extends keyof args ? parseResolution : token extends keyof $ ? parseResolution : token extends keyof ArkAmbient.$ ? parseResolution : `#${token}` extends keyof $ ? parseResolution : token extends NumberLiteral ? s.setRoot, unscanned> : token extends (`${infer submodule extends keyof $ & string}.${infer reference}`) ? tryResolveSubmodule : token extends (`${infer submodule extends keyof ArkAmbient.$ & string}.${infer reference}`) ? tryResolveSubmodule : token extends BigintLiteral ? s.setRoot, unscanned> : token extends \"keyof\" ? s.addPrefix : unresolvableState;\ntype tryResolveSubmodule = resolution extends {\n [arkKind]: \"module\";\n} ? reference extends keyof resolution ? parseResolution : reference extends (`${infer nestedSubmodule extends keyof resolution & string}.${infer nestedReference}`) ? tryResolveSubmodule : unresolvableState : s.error>>;\n/** Provide valid completions for the current token, or fallback to an\n * unresolvable error if there are none */\ntype unresolvableState = [\n token,\n s[\"unscanned\"]\n] extends [\"\", Scanner.shift<\"#\", infer unscanned>] ? Scanner.shiftUntil extends (Scanner.shiftResult) ? s.error> : never : validReferenceFromToken extends (never) ? s.error>> : s.completion<`${s[\"scanned\"]}${qualifiedReference, submodulePath>}`>;\ntype qualifiedReference = join<[...submodulePath, reference], \".\">;\ntype validReferenceFromToken = Extract : resolvableReferenceIn<$>, `${token}${string}`>;\ntype writeMissingRightOperandMessage = `Token '${token}' requires a right operand${unscanned extends \"\" ? \"\" : ` before '${unscanned}'`}`;\ndeclare const writeMissingRightOperandMessage: (token: token, unscanned?: unscanned) => writeMissingRightOperandMessage;\n\ndeclare const parseOperand: (s: RuntimeState) => void;\ntype parseOperand = s[\"unscanned\"] extends Scanner.shift ? lookahead extends \"(\" ? s.reduceGroupOpen : lookahead extends EnclosingStartToken ? parseEnclosed : lookahead extends WhitespaceChar ? parseOperand, $, args> : lookahead extends \"d\" ? unscanned extends (Scanner.shift) ? parseEnclosed : parseUnenclosed : lookahead extends \"x\" ? unscanned extends Scanner.shift<\"/\", infer nextUnscanned> ? parseEnclosed : parseUnenclosed : parseUnenclosed : s.completion<`${s[\"scanned\"]}${BaseCompletions<$, args>}`>;\n\ntype UnitLiteralKeyword = \"null\" | \"undefined\" | \"true\" | \"false\";\ntype UnitLiteral = UnenclosedUnitLiteral | EnclosedUnitLiteral;\ntype UnenclosedUnitLiteral = BigintLiteral | NumberLiteral | UnitLiteralKeyword;\ntype EnclosedUnitLiteral = StringLiteral | DateLiteral;\ntype ParsedDefaultableProperty = readonly [BaseRoot, \"=\", unknown];\ndeclare const parseDefault: (s: RootedRuntimeState) => ParsedDefaultableProperty;\ntype parseDefault = trim$1 extends infer defaultExpression extends string ? defaultExpression extends UnenclosedUnitLiteral ? [\n root,\n \"=\",\n defaultExpression\n] : defaultExpression extends (`${infer start extends EnclosingLiteralStartToken}${string}`) ? defaultExpression extends `${start}${infer nextUnscanned}` ? isValidEnclosedLiteral extends true ? [\n root,\n \"=\",\n defaultExpression\n] : ErrorMessage> : never : ErrorMessage> : never;\ntype isValidEnclosedLiteral = Scanner.shiftUntilEscapable extends Scanner.shiftResult ? nextUnscanned extends EnclosingLiteralTokens[start] ? true : false : false;\ndeclare const writeNonLiteralDefaultMessage: (defaultDef: defaultDef) => writeNonLiteralDefaultMessage;\ntype writeNonLiteralDefaultMessage = `Default value '${defaultDef}' must be a literal value`;\n\ndeclare const parseBound: (s: RootedRuntimeState, start: ComparatorStartChar) => void;\ntype parseBound = shiftComparator extends infer shiftResultOrError ? shiftResultOrError extends (Scanner.shiftResult) ? s[\"root\"] extends (InferredAst) ? s.reduceLeftBound : parseRightBound, comparator, $, args> : shiftResultOrError : never;\ntype OneCharComparator = \">\" | \"<\";\ntype ComparatorStartChar = Comparator extends `${infer char}${string}` ? char : never;\ndeclare const shiftComparator: (s: RuntimeState, start: ComparatorStartChar) => Comparator;\ntype shiftComparator = unscanned extends `=${infer nextUnscanned}` ? [`${start}=`, nextUnscanned] : [start & OneCharComparator, unscanned];\ndeclare const parseRightBound: (s: RootedRuntimeState, comparator: Comparator) => void;\ntype parseRightBound = parseOperand extends infer nextState extends StaticState ? nextState[\"root\"] extends (InferredAst) ? s[\"branches\"][\"leftBound\"] extends {} ? comparator extends MaxComparator ? s.reduceRange : s.error> : s.reduceSingleBound : s.error, \"right\">> : never;\ndeclare const writeInvalidLimitMessage: (comparator: comparator, limit: limit, boundKind: boundKind) => writeInvalidLimitMessage;\ntype writeInvalidLimitMessage = `Comparator ${boundKind extends \"left\" ? InvertedComparators[comparator] : comparator} must be ${boundKind extends \"left\" ? \"preceded\" : \"followed\"} by a corresponding literal (was ${limit})`;\ntype BoundExpressionKind = \"left\" | \"right\";\n\ndeclare const parseBrand: (s: RootedRuntimeState) => void;\ntype parseBrand = Scanner.shiftUntil, TerminatingChar> extends Scanner.shiftResult<`${infer brandName}`, infer nextUnscanned> ? brandName extends \"\" ? s.error : s.setRoot : never;\n\ndeclare const parseDivisor: (s: RootedRuntimeState) => void;\ntype parseDivisor = Scanner.shiftUntil, TerminatingChar> extends Scanner.shiftResult ? scanned extends `${infer divisor extends number}` ? divisor extends 0 ? s.error> : s.setRoot : s.error> : never;\ndeclare const writeInvalidDivisorMessage: (divisor: divisor) => writeInvalidDivisorMessage;\ntype writeInvalidDivisorMessage = `% operator must be followed by a non-zero integer literal (was ${divisor})`;\n\ndeclare const parseOperator: (s: RootedRuntimeState) => void;\ntype parseOperator = s[\"unscanned\"] extends Scanner.shift ? lookahead extends \"[\" ? unscanned extends Scanner.shift<\"]\", infer nextUnscanned> ? s.setRoot : s.error : lookahead extends \"|\" ? unscanned extends Scanner.shift<\">\", infer nextUnscanned> ? s.reduceBranch\", nextUnscanned> : s.reduceBranch : lookahead extends \"&\" ? s.reduceBranch : lookahead extends \")\" ? s.finalizeGroup : lookaheadIsFinalizing extends true ? s.finalize, lookahead & FinalizingLookahead> : lookahead extends ComparatorStartChar ? parseBound : lookahead extends \"%\" ? parseDivisor : lookahead extends \"#\" ? parseBrand : lookahead extends WhitespaceChar ? parseOperator, $, args> : s.error> : s.finalize;\ndeclare const writeUnexpectedCharacterMessage: (char: char, shouldBe?: shouldBe) => writeUnexpectedCharacterMessage;\ntype writeUnexpectedCharacterMessage = `'${char}' is not allowed here${shouldBe extends \"\" ? \"\" : ` (should be ${shouldBe})`}`;\ndeclare const incompleteArrayTokenMessage = \"Missing expected ']'\";\ntype incompleteArrayTokenMessage = typeof incompleteArrayTokenMessage;\n\ndeclare const parseString: (def: string, ctx: BaseParseContext) => InnerParseResult;\n/**\n * Try to parse the definition from right to left using the most common syntax.\n * This can be much more efficient for simple definitions.\n */\ntype parseString = def extends keyof $ ? resolutionToAst : def extends `${infer child}[]` ? child extends keyof $ ? [\n resolutionToAst,\n \"[]\"\n] : fullStringParse, $, args> : fullStringParse, $, args>;\ntype inferString = inferAstRoot, $, args>;\ntype BaseCompletions<$, args, otherSuggestions extends string = never> = resolvableReferenceIn<$> | resolvableReferenceIn | (keyof args & string) | StringifiablePrefixOperator | otherSuggestions;\ndeclare const fullStringParse: (s: RuntimeState) => InnerParseResult;\ntype fullStringParse = extractFinalizedResult>;\ndeclare const parseUntilFinalizer: (s: RuntimeState) => RootedRuntimeState;\ntype parseUntilFinalizer = s[\"finalizer\"] extends undefined ? parseUntilFinalizer, $, args> : s;\ndeclare const next: (s: RuntimeState) => void;\ntype next = s[\"root\"] extends undefined ? parseOperand : parseOperator;\ntype extractFinalizedResult = s[\"finalizer\"] extends \"\" ? s[\"root\"] : s[\"finalizer\"] extends ErrorMessage ? s[\"finalizer\"] : s[\"finalizer\"] extends \"?\" ? [s[\"root\"], \"?\"] : s[\"finalizer\"] extends \"=\" ? parseDefault : ErrorMessage>;\n\ndeclare const parseGenericArgs: (name: string, g: GenericRoot, s: RuntimeState) => BaseRoot[];\ntype parseGenericArgs = _parseGenericArgs;\ntype ParsedArgs = {\n result: result;\n unscanned: unscanned;\n};\ndeclare const _parseGenericArgs: (name: string, g: GenericRoot, s: RuntimeState, argNodes: BaseRoot[]) => BaseRoot[];\ntype _parseGenericArgs = parseUntilFinalizer, $, args> extends (infer finalArgState extends StaticState) ? {\n defs: [\n ...argDefs,\n finalArgState[\"scanned\"] extends `${infer def}${\",\" | \">\"}` ? def : finalArgState[\"scanned\"]\n ];\n asts: [...argAsts, finalArgState[\"root\"]];\n unscanned: finalArgState[\"unscanned\"];\n} extends ({\n defs: infer nextDefs extends string[];\n asts: infer nextAsts extends unknown[];\n unscanned: infer nextUnscanned extends string;\n}) ? finalArgState[\"finalizer\"] extends \">\" ? nextAsts[\"length\"] extends g[\"paramsAst\"][\"length\"] ? ParsedArgs : s.error, nextDefs>> : finalArgState[\"finalizer\"] extends \",\" ? _parseGenericArgs : finalArgState[\"finalizer\"] extends ErrorMessage ? finalArgState : s.error\">> : never : never;\ndeclare const writeInvalidGenericArgCountMessage: , argDefs extends array>(name: name, params: params, argDefs: argDefs) => writeInvalidGenericArgCountMessage;\ntype writeInvalidGenericArgCountMessage, argDefs extends array> = `${name}<${join}> requires exactly ${params[\"length\"]} args (got ${argDefs[\"length\"]}${argDefs[\"length\"] extends (0) ? \"\" : `: ${join}`})`;\n\ntype validateRange = [\n l\n] extends [LimitLiteral] ? validateBound : [l] extends [[infer leftAst, Comparator, unknown]] ? ErrorMessage>> : validateBound;\ntype validateBound = inferAstRoot extends infer bounded ? isNumericallyBoundable extends true ? limit extends number ? validateAst : ErrorMessage> : [bounded] extends [Date] ? validateAst : [bounded] extends [InferredMorph] ? ErrorMessage> : ErrorMessage>> : never;\ntype isNumericallyBoundable = [\n bounded\n] extends [number] ? true : [bounded] extends [string] ? true : [bounded] extends [array] ? true : false;\ndeclare const writeDoubleRightBoundMessage: (root: root) => writeDoubleRightBoundMessage;\ntype writeDoubleRightBoundMessage = `Expression ${root} must have at most one right bound`;\n\ntype validateDefault = validateAst extends infer e extends ErrorMessage ? e : type.infer extends inferAstIn ? undefined : ErrorMessage, unitLiteral>>;\n\ntype validateDivisor = inferAstRoot extends infer data ? [\n data\n] extends [number] ? validateAst : [data] extends [InferredMorph] ? ErrorMessage> : ErrorMessage> : never;\n\ntype validateKeyof = inferAstRoot extends infer data ? [\n data\n] extends [object] ? validateAst : ErrorMessage>> : never;\n\ntype validateAst = ast extends ErrorMessage ? ast : ast extends InferredAst ? validateInferredAst : ast extends DefAst ? ast[2] extends PrivateDeclaration ? ErrorMessage> : undefined : ast extends PostfixExpression<\"[]\" | \"?\", infer operand> ? validateAst : ast extends InfixExpression ? operator extends BranchOperator ? validateInfix : operator extends Comparator ? validateRange : operator extends \"%\" ? validateDivisor : operator extends \"=\" ? validateDefault : operator extends \"#\" ? validateAst : ErrorMessage>> : ast extends [\"keyof\", infer operand] ? validateKeyof : ast extends GenericInstantiationAst ? validateGenericInstantiation : ErrorMessage>> & {\n ast: ast;\n};\ntype writeUnexpectedExpressionMessage = `Failed to parse the expression resulting from ${expression}`;\ndeclare const writePrefixedPrivateReferenceMessage: (name: name) => writePrefixedPrivateReferenceMessage;\ntype writePrefixedPrivateReferenceMessage = `Private type references should not include '#'. Use '${name}' instead.`;\ntype validateInferredAst = def extends NumberLiteral ? number extends inferred ? ErrorMessage> : undefined : def extends BigintLiteral ? bigint extends inferred ? ErrorMessage> : undefined : [inferred] extends [anyOrNever] ? undefined : def extends PrivateDeclaration ? ErrorMessage> : inferred extends Generic ? ErrorMessage> : inferred extends {\n [arkKind]: \"module\";\n} ? \"root\" extends keyof inferred ? undefined : ErrorMessage> : def extends ErrorMessage ? def : undefined;\ntype validateString = parseString extends infer ast ? validateAst extends infer result extends ErrorMessage ? result extends Completion ? text : result : def : never;\ntype validateInfix = validateAst extends infer e extends ErrorMessage ? e : validateAst extends infer e extends ErrorMessage ? e : undefined;\ndeclare const shallowOptionalMessage = \"Optional definitions like 'string?' are only valid as properties in an object or tuple\";\ntype shallowOptionalMessage = typeof shallowOptionalMessage;\ndeclare const shallowDefaultableMessage = \"Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple\";\ntype shallowDefaultableMessage = typeof shallowDefaultableMessage;\n\ntype inferObjectLiteral = show<\"...\" extends keyof def ? merge, _inferObjectLiteral> : _inferObjectLiteral>;\n/**\n * Infers the contents of an object literal, ignoring a spread definition\n */\ntype _inferObjectLiteral = {\n -readonly [k in keyof def as nonOptionalKeyFromEntry]: inferDefinition;\n} & {\n -readonly [k in keyof def as optionalKeyFromEntry]?: def[k] extends OptionalPropertyDefinition ? inferDefinition : inferDefinition;\n};\ntype validateObjectLiteral = {\n [k in keyof def]: preparseKey extends (infer parsedKey extends PreparsedKey) ? parsedKey extends PreparsedEntryKey<\"index\"> ? validateString extends (ErrorMessage) ? ErrorType : inferDefinition extends Key ? validateProperty : ErrorMessage> : validateProperty : never;\n};\ntype nonOptionalKeyFromEntry = preparseKey extends infer parsedKey ? parsedKey extends PreparsedEntryKey<\"required\"> ? [\n v\n] extends [OptionalPropertyDefinition] ? [\n v\n] extends [anyOrNever] ? parsedKey[\"normalized\"] : never : parsedKey[\"normalized\"] : parsedKey extends PreparsedEntryKey<\"index\"> ? inferDefinition & Key : never : never;\ntype optionalKeyFromEntry = preparseKey extends infer parsedKey ? parsedKey extends PreparsedEntryKey<\"optional\"> ? parsedKey[\"normalized\"] : v extends OptionalPropertyDefinition ? k : never : never;\ntype normalizedKeyKind = kind extends \"index\" ? string : Key;\ntype PreparsedEntryKey = normalizedKeyKind> = {\n kind: kind;\n normalized: normalized;\n};\ntype PreparsedSpecialKey = {\n kind: kind;\n};\ntype PreparsedKey = PreparsedEntryKey | PreparsedSpecialKey;\ndeclare namespace PreparsedKey {\n type from = t;\n}\ntype ParsedKeyKind = EntryKeyKind | SpecialKeyKind;\ntype EntryKeyKind = \"required\" | \"optional\" | \"index\";\ntype SpecialKeyKind = \"spread\" | \"undeclared\";\ntype MetaKey = \"...\" | \"+\";\ntype IndexKey = `[${def}]`;\ndeclare const preparseKey: (key: Key) => PreparsedKey;\ntype preparseKey = k extends symbol ? PreparsedKey.from<{\n kind: \"required\";\n normalized: k;\n}> : k extends `${infer inner}?` ? inner extends `${infer baseName}${Backslash}` ? PreparsedKey.from<{\n kind: \"required\";\n normalized: `${baseName}?`;\n}> : PreparsedKey.from<{\n kind: \"optional\";\n normalized: inner;\n}> : k extends \"+\" ? {\n kind: \"undeclared\";\n} : k extends \"...\" ? {\n kind: \"spread\";\n} : k extends `${Backslash}${infer escapedMeta extends MetaKey}` ? PreparsedKey.from<{\n kind: \"required\";\n normalized: escapedMeta;\n}> : k extends IndexKey ? PreparsedKey.from<{\n kind: \"index\";\n normalized: def;\n}> : PreparsedKey.from<{\n kind: \"required\";\n normalized: k extends (`${Backslash}${infer escapedIndexKey extends IndexKey}`) ? escapedIndexKey : k extends Key ? k : `${k & number}`;\n}>;\ndeclare const writeInvalidSpreadTypeMessage: (def: def) => writeInvalidSpreadTypeMessage;\ntype writeInvalidSpreadTypeMessage = `Spread operand must resolve to an object literal type (was ${def})`;\n\ntype ParsedOptionalProperty = readonly [BaseRoot, \"?\"];\ntype validateProperty = [\n def\n] extends [anyOrNever] ? \n/** this extra [anyOrNever] check is required to ensure that nested `type` invocations\n * like the following are not prematurely validated by the outer call:\n *\n * ```ts\n * type({\n * \t\"test?\": type(\"string\").pipe(x => x === \"true\")\n * })\n * ```\n */\ndef : keyKind extends \"spread\" ? def extends validateInnerDefinition ? inferDefinition extends object ? def : ErrorType>>> : validateInnerDefinition : keyKind extends \"undeclared\" ? UndeclaredKeyBehavior : keyKind extends \"required\" ? validateInnerDefinition : def extends OptionalPropertyDefinition ? ErrorMessage : isDefaultable extends true ? ErrorMessage : validateInnerDefinition;\ntype isDefaultable = def extends DefaultablePropertyTuple ? true : def extends PossibleDefaultableStringDefinition ? parseString extends DefaultablePropertyTuple ? true : false : false;\ntype OptionalPropertyDefinition = OptionalPropertyTuple | OptionalPropertyString;\ntype OptionalPropertyString = `${baseDef}?`;\ntype OptionalPropertyTuple = readonly [baseDef, \"?\"];\ntype PossibleDefaultableStringDefinition = `${string}=${string}`;\ntype DefaultablePropertyTuple = readonly [baseDef, \"=\", thunkableProperty];\ndeclare const invalidOptionalKeyKindMessage = \"Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }\";\ntype invalidOptionalKeyKindMessage = typeof invalidOptionalKeyKindMessage;\ndeclare const invalidDefaultableKeyKindMessage = \"Only required keys may specify default values, e.g. { value: 'number = 0' }\";\ntype invalidDefaultableKeyKindMessage = typeof invalidDefaultableKeyKindMessage;\n\ntype validateTupleLiteral = parseSequence extends infer s extends SequenceParseState ? Readonly : never;\ntype inferTupleLiteral = parseSequence extends infer s extends SequenceParseState ? s[\"inferred\"] : never;\ntype SequencePhase = satisfy;\ndeclare namespace SequencePhase {\n type prefix = \"prefix\";\n type optionals = \"optionals\";\n type defaultables = \"defaultables\";\n type postfix = \"postfix\";\n}\ntype SequenceParseState = {\n unscanned: array;\n inferred: array;\n validated: array;\n phase: SequencePhase;\n};\ntype parseSequence = parseNextElement<{\n unscanned: def;\n inferred: [];\n validated: [];\n phase: SequencePhase.prefix;\n}, $, args>;\ntype PreparsedElementKind = \"required\" | SequencePhase.optionals | SequencePhase.defaultables;\ntype PreparsedElement = {\n head: unknown;\n tail: array;\n inferred: unknown;\n validated: unknown;\n kind: PreparsedElementKind;\n spread: boolean;\n};\ndeclare namespace PreparsedElement {\n type from = result;\n type required = \"required\";\n type optionals = \"optionals\";\n type defaultables = \"defaultables\";\n}\ntype preparseNextState = s[\"unscanned\"] extends readonly [\"...\", infer head, ...infer tail] ? preparseNextElement : s[\"unscanned\"] extends readonly [infer head, ...infer tail] ? preparseNextElement : null;\ntype preparseNextElement = PreparsedElement.from<{\n head: head;\n tail: tail;\n inferred: inferDefinition;\n validated: validateInnerDefinition;\n kind: head extends OptionalPropertyDefinition ? PreparsedElement.optionals : head extends DefaultablePropertyTuple ? PreparsedElement.defaultables : isDefaultable extends true ? PreparsedElement.defaultables : PreparsedElement.required;\n spread: spread;\n}>;\ntype parseNextElement = preparseNextState extends infer next extends PreparsedElement ? parseNextElement<{\n unscanned: next[\"tail\"];\n inferred: nextInferred;\n validated: nextValidated;\n phase: next[\"kind\"] extends (SequencePhase.optionals | SequencePhase.defaultables) ? next[\"kind\"] : number extends nextInferred[\"length\"] ? s[\"phase\"] : SequencePhase.prefix;\n}, $, args> : s;\ntype nextInferred = next[\"spread\"] extends true ? [\n ...s[\"inferred\"],\n ...conform\n] : next[\"kind\"] extends SequencePhase.optionals ? [\n ...s[\"inferred\"],\n next[\"inferred\"]?\n] : [...s[\"inferred\"], next[\"inferred\"]];\ntype nextValidated = [\n ...s[\"validated\"],\n ...nextValidatedSpreadOperatorIfPresent,\n nextValidatedElement\n];\ntype nextValidatedSpreadOperatorIfPresent = next[\"spread\"] extends true ? [\n next[\"inferred\"] extends infer spreadOperand extends array ? [\n number,\n number\n ] extends ([\n s[\"inferred\"][\"length\"],\n spreadOperand[\"length\"]\n ]) ? ErrorMessage : \"...\" : ErrorMessage>\n] : [];\ntype nextValidatedElement = next[\"kind\"] extends SequencePhase.optionals ? next[\"spread\"] extends true ? ErrorMessage : s[\"phase\"] extends SequencePhase.postfix ? ErrorMessage : next[\"validated\"] : next[\"kind\"] extends SequencePhase.defaultables ? next[\"spread\"] extends true ? ErrorMessage : s[\"phase\"] extends SequencePhase.optionals ? ErrorMessage : s[\"phase\"] extends SequencePhase.postfix ? ErrorMessage : next[\"validated\"] : [s[\"phase\"], next[\"spread\"]] extends ([\n SequencePhase.optionals | SequencePhase.defaultables,\n false\n]) ? ErrorMessage : next[\"validated\"];\ndeclare const writeNonArraySpreadMessage: (operand: operand) => writeNonArraySpreadMessage;\ntype writeNonArraySpreadMessage = `Spread element must be an array${operand extends string ? ` (was ${operand})` : \"\"}`;\ndeclare const multipleVariadicMesage = \"A tuple may have at most one variadic element\";\ntype multipleVariadicMessage = typeof multipleVariadicMesage;\ndeclare const optionalOrDefaultableAfterVariadicMessage = \"An optional element may not follow a variadic element\";\ntype optionalOrDefaultableAfterVariadicMessage = typeof optionalOrDefaultableAfterVariadicMessage;\ndeclare const spreadOptionalMessage = \"A spread element cannot be optional\";\ntype spreadOptionalMessage = typeof spreadOptionalMessage;\ndeclare const spreadDefaultableMessage = \"A spread element cannot have a default\";\ntype spreadDefaultableMessage = typeof spreadDefaultableMessage;\ndeclare const defaultablePostOptionalMessage = \"A defaultable element may not follow an optional element without a default\";\ntype defaultablePostOptionalMessage = typeof defaultablePostOptionalMessage;\n\n/** @ts-ignore cast variance */\ninterface Type$6 extends Type$1 {\n readonly(): t extends array ? Type$5<{\n readonly [i in keyof t]: t[i];\n }, $> : Type$6<{\n readonly [k in keyof t]: t[k];\n }, $>;\n keyof(): instantiateType, $>;\n /**\n * Get the `Type` of a property of this `Type`.\n * @example type({ foo: \"string\" }).get(\"foo\") // Type\n */\n get, r = instantiateType, $>>(k1: k1 | type.cast): r extends infer _ ? _ : never;\n get, const k2 extends arkIndexableOf>, r = instantiateType, k2>, $>>(k1: k1 | type.cast, k2: k2 | type.cast): r extends infer _ ? _ : never;\n get, const k2 extends arkIndexableOf>, const k3 extends arkIndexableOf, k2>>, r = instantiateType, k2>, k3>, $>>(k1: k1 | type.cast, k2: k2 | type.cast, k3: k3 | type.cast): r extends infer _ ? _ : never;\n /**\n * Create a copy of this `Type` with only the specified properties.\n * @example type({ foo: \"string\", bar: \"number\" }).pick(\"foo\") // Type<{ foo: string }>\n */\n pick = never>(...keys: (key | type.cast)[]): Type$6<{\n [k in keyof t as Extract, key>]: t[k];\n }, $>;\n /**\n * Create a copy of this `Type` with all properties except the specified ones.\n * @example type({ foo: \"string\", bar: \"number\" }).omit(\"foo\") // Type<{ bar: number }>\n */\n omit = never>(...keys: (key | type.cast)[]): Type$6<{\n [k in keyof t as Exclude, key>]: t[k];\n }, $>;\n /**\n * Merge another `Type` definition, overriding properties of this `Type` with the duplicate keys.\n * @example type({ a: \"1\", b: \"2\" }).merge({ b: \"3\", c: \"4\" }) // Type<{ a: 1, b: 3, c: 4 }>\n */\n merge, r = Type$6, $>>(def: type.validate & (inferredDef extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredDef]>)): r extends infer _ ? _ : never;\n /**\n * Create a copy of this `Type` with all properties required.\n * @example const T = type({ \"foo?\"\": \"string\" }).required() // Type<{ foo: string }>\n */\n required(): Type$6<{\n [k in keyof t]-?: t[k];\n }, $>;\n /**\n * Create a copy of this `Type` with all properties optional.\n * @example: const T = type({ foo: \"string\" }).optional() // Type<{ foo?: string }>\n */\n partial(): Type$6<{\n [k in keyof t]?: t[k];\n }, $>;\n map, r = Type$6, $>>(flatMapEntry: (entry: typePropOf) => transformed): r extends infer _ ? _ : never;\n /**\n * List of property info of this `Type`.\n * @example type({ foo: \"string = \"\" }).props // [{ kind: \"required\", key: \"foo\", value: Type, default: \"\" }]\n */\n props: array>;\n}\ntype typePropOf = keyof o extends infer k ? k extends keyof o ? typeProp : never : never;\ntype typeProp = t extends Default ? DefaultedTypeProp : BaseTypeProp ? \"optional\" : \"required\", k & Key, t, $>;\ninterface BaseTypeProp {\n kind: kind;\n key: k;\n value: instantiateType;\n meta: ArkEnv.meta;\n toJSON: () => JsonStructure;\n}\ninterface DefaultedTypeProp extends BaseTypeProp<\"optional\", k, v, $> {\n default: defaultValue;\n}\ntype MappedTypeProp = BaseMappedTypeProp | OptionalMappedTypeProp;\ntype BaseMappedTypeProp = merge;\n}>;\ntype OptionalMappedTypeProp = merge;\n default?: v;\n}>;\ntype constructMapped> = show>>;\ntype fromTypeProps> = show<{\n [prop in props[number] as Extract, {\n kind: \"required\";\n }>[\"key\"]]: prop[\"value\"][inferred];\n} & {\n [prop in props[number] as Extract, {\n kind: \"optional\";\n default?: never;\n }>[\"key\"]]?: prop[\"value\"][inferred];\n} & {\n [prop in props[number] as Extract, {\n kind: \"optional\";\n default: unknown;\n }>[\"key\"]]: withDefault;\n}>;\ntype NonObjectMergeErrorMessage = \"Merged type must be an object\";\ntype applyHomomorphicOptionality = prop[\"kind\"] extends string ? prop : prop & {\n kind: prop[\"key\"] extends optionalKeyOf ? \"optional\" : \"required\";\n};\n\ninterface Type$5<\n/** @ts-ignore cast variance */\nout t extends readonly unknown[] = readonly unknown[], $ = {}> extends Type$6 {\n atLeastLength(schema: InclusiveNumericRangeSchema): this;\n atMostLength(schema: InclusiveNumericRangeSchema): this;\n moreThanLength(schema: ExclusiveNumericRangeSchema): this;\n lessThanLength(schema: ExclusiveNumericRangeSchema): this;\n exactlyLength(schema: ExactLength.Schema): this;\n}\n\n/** @ts-ignore cast variance */\ninterface Type$4 extends Type$6 {\n atOrAfter(schema: InclusiveDateRangeSchema): this;\n atOrBefore(schema: InclusiveDateRangeSchema): this;\n laterThan(schema: ExclusiveDateRangeSchema): this;\n earlierThan(schema: ExclusiveDateRangeSchema): this;\n}\n\n/** @ts-ignore cast variance */\ninterface Type$3 extends Type$1 {\n divisibleBy(schema: Divisor.Schema): this;\n atLeast(schema: InclusiveNumericRangeSchema): this;\n atMost(schema: InclusiveNumericRangeSchema): this;\n moreThan(schema: ExclusiveNumericRangeSchema): this;\n lessThan(schema: ExclusiveNumericRangeSchema): this;\n}\n\n/** @ts-ignore cast variance */\ninterface Type$2 extends Type$1 {\n matching(schema: schema): schema extends string ? Type$2, $> : schema extends {\n rule: infer pattern extends string;\n } ? Type$2, $> : this;\n atLeastLength(schema: InclusiveNumericRangeSchema): this;\n atMostLength(schema: InclusiveNumericRangeSchema): this;\n moreThanLength(schema: ExclusiveNumericRangeSchema): this;\n lessThanLength(schema: ExclusiveNumericRangeSchema): this;\n exactlyLength(schema: ExactLength.Schema): this;\n}\n\ntype instantiateType = [\n t\n] extends [anyOrNever] ? Type$1 : [t] extends [object] ? [\n t\n] extends [array] ? Type$5 : [t] extends [Date] ? Type$4 : Type$6 : [t] extends [string] ? Type$2 : [t] extends [number] ? Type$3 : Type$1;\n\ntype NaryUnionParser<$> = {\n (): Type;\n , $>>(a: type.validate): r extends infer _ ? _ : never;\n | type.infer, $>>(a: type.validate, b: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate, p: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate, p: type.validate, q: type.validate): r extends infer _ ? _ : never;\n , $>>(...defs: {\n [i in keyof defs]: type.validate;\n }): r extends infer _ ? _ : never;\n};\ntype NaryIntersectionParser<$> = {\n (): Type;\n , $>>(a: type.validate): r extends infer _ ? _ : never;\n , type.infer>, $>>(a: type.validate, b: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate, p: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate, p: type.validate, q: type.validate): r extends infer _ ? _ : never;\n ;\n }>, $>>(...defs: {\n [i in keyof defs]: type.validate;\n }): r extends infer _ ? _ : never;\n};\ntype NaryMergeParser<$> = {\n (): Type;\n , r = Type>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, inferredN = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>), n: type.validate & (inferredN extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredN]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, inferredN = type.infer, inferredO = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>), n: type.validate & (inferredN extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredN]>), o: type.validate & (inferredO extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredO]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, inferredN = type.infer, inferredO = type.infer, inferredP = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>), n: type.validate & (inferredN extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredN]>), o: type.validate & (inferredO extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredO]>), p: type.validate & (inferredP extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredP]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, inferredN = type.infer, inferredO = type.infer, inferredP = type.infer, inferredQ = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>), n: type.validate & (inferredN extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredN]>), o: type.validate & (inferredO extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredO]>), p: type.validate & (inferredP extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredP]>), q: type.validate & (inferredQ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredQ]>)): r extends infer _ ? _ : never;\n ;\n }>, $>>(...defs: {\n [i in keyof defs]: type.validate & (type.infer extends object ? unknown : ErrorType<[\n NonObjectMergeErrorMessage,\n actual: type.infer\n ]>);\n }): r extends infer _ ? _ : never;\n};\ntype NaryPipeParser<$, initial = unknown> = {\n (): Type;\n >, r = instantiateType, $>>(a: a): r extends infer _ ? _ : never;\n >, b extends Morph>, r = instantiateType, a, b]>, $>>(a: a, b: b): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, r = instantiateType, a, b, c]>, $>>(a: a, b: b, c: c): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, r = instantiateType, a, b, c, d]>, $>>(a: a, b: b, c: c, d: d): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, r = instantiateType, a, b, c, d, e]>, $>>(a: a, b: b, c: c, d: d, e: e): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, r = instantiateType, a, b, c, d, e, f]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, r = instantiateType, a, b, c, d, e, f, g]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j, k]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j, k, l]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j, k, l, m]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, n extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j, k, l, m, n]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, n extends Morph>, o extends Morph>, r = instantiateType,\n a,\n b,\n c,\n d,\n e,\n f,\n g,\n h,\n i,\n j,\n k,\n l,\n m,\n n,\n o\n ]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, n extends Morph>, o extends Morph>, p extends Morph>, r = instantiateType,\n a,\n b,\n c,\n d,\n e,\n f,\n g,\n h,\n i,\n j,\n k,\n l,\n m,\n n,\n o,\n p\n ]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o, p: p): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, n extends Morph>, o extends Morph>, p extends Morph>, q extends Morph>, r = instantiateType,\n a,\n b,\n c,\n d,\n e,\n f,\n g,\n h,\n i,\n j,\n k,\n l,\n m,\n n,\n o,\n p,\n q\n ]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o, p: p, q: q): r extends infer _ ? _ : never;\n , $>>(...defs: morphs): r extends infer _ ? _ : never;\n};\n\n/** @ts-ignore cast variance */\ninterface Inferred {\n internal: BaseRoot;\n [inferred]: t;\n /**\n * precompiled JS used to optimize validation\n *\n * ⚠️ will be `undefined` in [jitless](https://arktype.io/docs/configuration#jitless) mode\n */\n precompilation: string | undefined;\n /**\n * generic parameter representing this Type\n *\n * @typeonly\n *\n * ⚠️ May contain types representing morphs or default values that would\n * be inaccurate if used directly for runtime values. In those cases,\n * you should use {@link infer} or {@link inferIn} on this object instead.\n */\n t: t;\n /**\n * #### {@link Scope} in which chained methods are parsed\n */\n $: Scope<$>;\n /**\n * #### type of output this returns\n *\n * @typeonly\n *\n * @example\n * const parseNumber = type(\"string\").pipe(s => Number.parseInt(s))\n * type ParsedNumber = typeof parseNumber.infer // number\n */\n infer: this[\"inferOut\"];\n /**\n * type of output this returns\n *\n * 🔗 alias of {@link infer}\n * @typeonly\n *\n *\n * @example\n * const parseNumber = type(\"string\").pipe(s => Number.parseInt(s))\n * type ParsedNumber = typeof parseNumber.infer // number\n */\n inferOut: distill.Out;\n /**\n * type of output that can be introspected at runtime (e.g. via {@link out})\n *\n * ⚠️ If your Type contains morphs, they will be inferred as `unknown` unless\n * they are an ArkType keyword or have an explicitly defined output validator.\n *\n * @typeonly\n *\n * @example\n * const Unmorphed = type(\"string\")\n * // with no morphs, we can introspect the input and output as a single Type\n * type UnmorphedOut = typeof Unmorphed.inferIntrospectableOut // string\n *\n * const Morphed = type(\"string\").pipe(s => s.length)\n * // with a standard user-defined morph, TypeScript can infer a\n * // return type from your function, but we have no way to\n * // know the shape at runtime\n * type MorphOut = typeof Morphed.inferIntrospectableOut // unknown\n *\n * const Validated = type(\"string\").pipe(s => s.length).to(\"number\")\n * // morphs with validated output, including all morph keywords, are introspectable\n * type ValidatedMorphOut = typeof Validated.inferIntrospectableOut\n */\n inferIntrospectableOut: distill.introspectable.Out;\n /**\n * #### type of input this allows\n *\n * @typeonly\n *\n * @example\n * const parseNumber = type(\"string\").pipe(s => Number.parseInt(s))\n * type UnparsedNumber = typeof parseNumber.inferIn // string\n */\n inferIn: distill.In;\n /**\n * #### internal JSON representation\n */\n json: JsonStructure;\n /**\n * alias of {@link json} for `JSON.stringify` compatibility\n */\n toJSON(): JsonStructure;\n /**\n * #### generate a JSON Schema\n *\n * @throws {ToJsonSchema.Error} if this cannot be converted to JSON Schema\n */\n toJsonSchema(options?: ToJsonSchema.Options): JsonSchema;\n /**\n * #### metadata like custom descriptions and error messages\n *\n * ✅ type {@link https://arktype.io/docs/configuration#custom | can be customized} for your project\n */\n meta: ArkAmbient.meta;\n /**\n * #### human-readable English description\n *\n * ✅ works best for primitive values\n *\n * @example\n * const N = type(\"0 < number <= 100\")\n * console.log(N.description) // positive and at most 100\n */\n description: string;\n /**\n * #### syntax string similar to native TypeScript\n *\n * ✅ works well for both primitives and structures\n *\n * @example\n * const Loc = type({ coords: [\"number\", \"number\"] })\n * console.log(Loc.expression) // { coords: [number, number] }\n */\n expression: string;\n /**\n * #### validate and return transformed data or throw\n *\n * ✅ sugar to avoid checking for {@link type.errors} if they are unrecoverable\n *\n * @example\n * const CriticalPayload = type({\n * superImportantValue: \"string\"\n * })\n * // throws TraversalError: superImportantValue must be a string (was missing)\n * const data = CriticalPayload.assert({ irrelevantValue: \"whoops\" })\n * console.log(data.superImportantValue) // valid output can be accessed directly\n *\n * @throws {TraversalError}\n */\n assert: (data: unknown) => this[\"infer\"];\n /**\n * #### check input without applying morphs\n *\n * ✅ good for stuff like filtering that doesn't benefit from detailed errors\n *\n * @example\n * const Numeric = type(\"number | bigint\")\n * // [0, 2n]\n * const numerics = [0, \"one\", 2n].filter(Numeric.allows)\n */\n allows: (data: unknown) => data is this[\"inferIn\"];\n /**\n * #### add metadata to shallow references\n *\n * ⚠️ does not affect error messages within properties of an object\n *\n * @example\n * const NotOdd = type(\"number % 2\").configure({ description: \"not odd\" })\n * // all constraints at the root are affected\n * const odd = NotOdd(3) // must be not odd (was 3)\n * const nonNumber = NotOdd(\"two\") // must be not odd (was \"two\")\n *\n * const NotOddBox = type({\n * // we should have referenced notOdd or added meta here\n * notOdd: \"number % 2\",\n * // but instead chained from the root object\n * }).configure({ description: \"not odd\" })\n * // error message at path notOdd is not affected\n * const oddProp = NotOddBox({ notOdd: 3 }) // notOdd must be even (was 3)\n * // error message at root is affected, leading to a misleading description\n * const nonObject = NotOddBox(null) // must be not odd (was null)\n */\n configure: NodeSelector.SelectableFn;\n /**\n * #### add description to shallow references\n *\n * 🔗 equivalent to `.configure({ description })` (see {@link configure})\n * ⚠️ does not affect error messages within properties of an object\n *\n * @example\n * const AToZ = type(/^a.*z$/).describe(\"a string like 'a...z'\")\n * const good = AToZ(\"alcatraz\") // \"alcatraz\"\n * // ArkErrors: must be a string like 'a...z' (was \"albatross\")\n * const badPattern = AToZ(\"albatross\")\n */\n describe: NodeSelector.SelectableFn;\n /**\n * #### apply undeclared key behavior\n *\n * {@inheritDoc UndeclaredKeyBehavior}\n */\n onUndeclaredKey(behavior: UndeclaredKeyBehavior): this;\n /**\n * #### deeply apply undeclared key behavior\n *\n * {@inheritDoc UndeclaredKeyBehavior}\n **/\n onDeepUndeclaredKey(behavior: UndeclaredKeyBehavior): this;\n /**\n * #### alias for {@link assert} with typed input\n *\n * @example\n * const T = type({ foo: \"string\" });\n * // TypeScript: foo must be a string (was 5)\n * const data = T.from({ foo: 5 });\n */\n from(literal: this[\"inferIn\"]): this[\"infer\"];\n /**\n * #### deeply extract inputs\n *\n * ✅ will never include morphs\n * ✅ good for generating JSON Schema or other non-transforming formats\n *\n * @example\n * const User = type({\n * age: \"string.numeric.parse\"\n * })\n * // { age: 25 } (age parsed to a number)\n * const out = User({ age: \"25\" })\n * // { age: \"25\" } (age is still a string)\n * const inOut = User.in({ age: \"25\" })\n */\n get in(): instantiateType;\n /**\n * #### deeply extract outputs\n *\n * ✅ will never include morphs\n * ⚠️ if your type includes morphs, their output will likely be unknown unless they\n * were defined with an explicit output validator via `.to(outputDef)` or `.pipe(morph, outputType)`\n *\n * @example\n * const join = type(\"string[]\").pipe(a => a.join(\",\"))\n *\n * const T = type({\n * // all keywords have introspectable output\n * keyword: \"string.numeric.parse\",\n * // TypeScript knows this returns a string, but we can't introspect that at runtime\n * unvalidated: join,\n * // if needed, it can be made introspectable with an output validator\n * validated: join.to(\"string\")\n * })\n *\n * // Type<{ keyword: number; unvalidated: unknown; validated: string }>\n * const baseOut = base.out\n */\n get out(): instantiateType;\n /**\n * #### add a compile-time brand to output\n *\n * @typenoop\n *\n * @example\n * const Palindrome = type(\"string\")\n * .narrow(s => s === [...s].reverse().join(\"\"))\n * .brand(\"palindrome\")\n * // Brand\n * const out = Palindrome.assert(\"racecar\")\n */\n brand, $>>(name: name): r extends infer _ ? _ : never;\n /**\n * #### an array of this\n *\n * @example\n * // Type<{ rebmun: number }[]>\n * const T = type({ rebmun: \"number\" }).array();\n */\n array(): Type$5;\n /**\n * #### {@link https://arktype.io/docs/objects#properties-optional | optional definition}\n *\n * @chainedDefinition\n *\n * @example\n * const Prop = type({ foo: \"number\" })\n * // Type<{ bar?: { foo: number } }>\n * const Obj = type({ bar: Prop.optional() })\n */\n optional(): [this, \"?\"];\n /**\n * #### {@link https://arktype.io/docs/objects#properties-defaultable | defaultable definition}\n *\n * ✅ object defaults can be returned from a function\n * ⚠️ throws if the default value is not allowed\n * @chainedDefinition\n *\n * @example\n * // Type<{ count: Default }>\n * const State = type({ count: type.number.default(0) })\n * const Prop = type({ nested: \"boolean\" })\n * const ForObj = type({\n * key: Prop.default(() => ({ nested: false }))\n * })\n */\n default>(value: value): [this, \"=\", value];\n /**\n * #### apply a predicate function to input\n *\n * ⚠️ the behavior of {@link narrow}, this method's output counterpart, is usually more desirable\n * ✅ most useful for morphs with input types that are re-used externally\n * @predicateCast\n *\n * @example\n * const stringifyUser = type({ name: \"string\" }).pipe(user => JSON.stringify(user))\n * const stringifySafe = stringifyUser.filter(user => user.name !== \"Bobby Tables\")\n * // Type<(In: `${string}Z`) => To>\n * const WithPredicate = type(\"string.date.parse\").filter((s): s is `${string}Z` =>\n * s.endsWith(\"Z\")\n * )\n */\n filter ? (In: narrowed) => o : narrowed, $>>(predicate: Predicate.Castable): r extends infer _ ? _ : never;\n /**\n * #### apply a predicate function to output\n *\n * ✅ go-to fallback for validation not composable via built-in types and operators\n * ✅ runs after all other validators and morphs, if present\n * @predicateCast\n *\n * @example\n * const Palindrome = type(\"string\").narrow(s => s === [...s].reverse().join(\"\"))\n *\n * const PalindromicEmail = type(\"string.date.parse\").narrow((date, ctx) =>\n *\t\tdate.getFullYear() === 2025 || ctx.mustBe(\"the current year\")\n * )\n * // Type<`${string}.tsx`>\n * const WithPredicate = type(\"string\").narrow((s): s is `${string}.tsx` => /\\.tsx?$/.test(s))\n */\n narrow ? o extends To ? (In: i) => To : (In: i) => Out : narrowed, $>>(predicate: Predicate.Castable): r extends infer _ ? _ : never;\n /**\n * #### pipe output through arbitrary transformations or other Types\n *\n * @example\n * const User = type({ name: \"string\" })\n *\n * // parse a string and validate that the result as a user\n * const parseUser = type(\"string\").pipe(s => JSON.parse(s), user)\n */\n pipe: ChainedPipeParser<$, t>;\n /**\n * #### parse a definition as an output validator\n *\n * 🔗 `to({ name: \"string\" })` is equivalent to `.pipe(type({ name: \"string\" }))`\n *\n * @example\n * // parse a string and validate that the result as a user\n * const parseUser = type(\"string\").pipe(s => JSON.parse(s)).to({ name: \"string\" })\n */\n to>, $>>(def: type.validate): r extends infer _ ? _ : never;\n /**\n * #### query internal node references\n *\n * @experimental filters and returns the Type's internal representation from `@ark/schema`\n *\n * @example\n * // [\"blue\", \"red\"]\n * const values = type(\"'red' | 'blue'\").select(\"unit\").map(u => u.unit)\n */\n select: BaseNode[\"select\"];\n}\n/** @ts-ignore cast variance */\ninterface Type$1 extends Callable<(data: unknown) => distill.Out | ArkEnv.onFail>, Inferred {\n /**\n * #### cast the way this is inferred\n *\n * @typenoop\n *\n * @example\n * // Type<`LEEEEEEEE${string}ROY`>\n * const Leeroy = type(/^LE{8,}ROY$/).as<`LEEEEEEEE${string}ROY`>()\n */\n as(...args: validateChainedAsArgs): instantiateType;\n /**\n * #### intersect the parsed Type, throwing if the result is unsatisfiable\n *\n * @example\n * // Type<{ foo: number; bar: string }>\n * const T = type({ foo: \"number\" }).and({ bar: \"string\" })\n * // ParseError: Intersection at foo of number and string results in an unsatisfiable type\n * const Bad = type({ foo: \"number\" }).and({ foo: \"string\" })\n */\n and>, $>>(def: type.validate): r extends infer _ ? _ : never;\n /**\n * #### union with the parsed Type\n *\n * ⚠️ a union that could apply different morphs to the same data is a ParseError ({@link https://arktype.io/docs/expressions#union-morphs | docs})\n *\n * @example\n * // Type\n * const T = type(\"string\").or({ box: \"string\" })\n */\n or, $>>(def: type.validate): r extends infer _ ? _ : never;\n /**\n * #### intersect the parsed Type, returning an introspectable {@link Disjoint} if the result is unsatisfiable\n *\n * @example\n * // Type<{ foo: number; bar: string }>\n * const T = type({ foo: \"number\" }).intersect({ bar: \"string\" })\n * const Bad = type(\"number > 10\").intersect(\"number < 5\")\n * // logs \"Intersection of > 10 and < 5 results in an unsatisfiable type\"\n * if (Bad instanceof Disjoint) console.log(`${bad.summary}`)\n */\n intersect>, $>>(def: type.validate): r extends infer _ ? _ | Disjoint : never;\n /**\n * #### check if the parsed Type's constraints are identical\n *\n * ✅ equal types have identical input and output constraints and transforms\n * @ignoresMeta\n *\n * @example\n * const DivisibleBy6 = type.number.divisibleBy(6).moreThan(0)\n * // false (left side must also be positive)\n * DivisibleBy6.equals(\"number % 6\")\n * // false (right side has an additional <100 constraint)\n * console.log(DivisibleBy6.equals(\"0 < (number % 6) < 100\"))\n * const ThirdTry = type(\"(number % 2) > 0\").divisibleBy(3)\n * // true (types are normalized and reduced)\n * console.log(DivisibleBy6.equals(ThirdTry))\n */\n equals(def: type.validate): boolean;\n /**\n * #### narrow this based on an {@link equals} check\n *\n * @ignoresMeta\n *\n * @example\n * const N = type.raw(`${Math.random()}`)\n * // Type<0.5> | undefined\n * const Ez = N.ifEquals(\"0.5\")\n */\n ifEquals>(def: type.validate): r extends infer _ ? _ | undefined : never;\n /**\n * #### check if this is a subtype of the parsed Type\n *\n * ✅ a subtype must include all constraints from the base type\n * ✅ unlike {@link equals}, additional constraints may be present\n * @ignoresMeta\n *\n * @example\n * type.string.extends(\"unknown\") // true\n * type.string.extends(/^a.*z$/) // false\n */\n extends(other: type.validate): boolean;\n /**\n * #### narrow this based on an {@link extends} check\n *\n * @ignoresMeta\n *\n * @example\n * const N = type(Math.random() > 0.5 ? \"true\" : \"0\") // Type<0 | true>\n * const Ez = N.ifExtends(\"boolean\") // Type | undefined\n */\n ifExtends>(other: type.validate): r extends infer _ ? _ | undefined : never;\n /**\n * #### check if a value could satisfy this and the parsed Type\n *\n * ⚠️ will return true unless a {@link Disjoint} can be proven\n *\n * @example\n * type.string.overlaps(\"string | number\") // true (e.g. \"foo\")\n * type(\"string | number\").overlaps(\"1\") // true (1)\n * type(\"number > 0\").overlaps(\"number < 0\") // false (no values exist)\n *\n * const NoAt = type(\"string\").narrow(s => !s.includes(\"@\"))\n * NoAt.overlaps(\"string.email\") // true (no values exist, but not provable)\n */\n overlaps(r: type.validate): boolean;\n /**\n * #### extract branches {@link extend}ing the parsed Type\n *\n * @example\n * // Type\n * const T = type(\"boolean | 0 | 'one' | 2 | bigint\").extract(\"number | 0n | true\")\n */\n extract ? t : never, $>>(r: type.validate): r extends infer _ extends r ? _ : never;\n /**\n * #### exclude branches {@link extend}ing the parsed Type\n *\n * @example\n *\n * // Type\n * const T = type(\"boolean | 0 | 'one' | 2 | bigint\").exclude(\"number | 0n | true\")\n */\n exclude ? never : t, $>>(r: type.validate): r extends infer _ ? _ : never;\n /**\n * @experimental\n * Map and optionally reduce branches of a union. Types that are not unions\n * are treated as a single branch.\n *\n * @param mapBranch - the mapping function, accepting a branch Type\n * Returning another `Type` is common, but any value can be returned and\n * inferred as part of the output.\n *\n * @param [reduceMapped] - an operation to perform on the mapped branches\n * Can be used to e.g. merge an array of returned Types representing\n * branches back to a single union.\n */\n distribute(mapBranch: (branch: Type$1, i: number, branches: array) => mapOut, reduceMapped?: (mappedBranches: mapOut[]) => reduceOut): reduceOut;\n /** The Type's [StandardSchema](https://github.com/standard-schema/standard-schema) properties */\n \"~standard\": StandardSchemaV1.ArkTypeProps;\n /** @deprecated */\n apply: Function[\"apply\"];\n /** @deprecated */\n bind: Function[\"bind\"];\n /** @deprecated */\n call: Function[\"call\"];\n /** @deprecated */\n caller: Function;\n /** @deprecated */\n length: number;\n /** @deprecated */\n name: string;\n /** @deprecated */\n prototype: Function[\"prototype\"];\n /** @deprecated */\n arguments: Function[\"arguments\"];\n /** @deprecated */\n Symbol: never;\n}\ninterface ChainedPipeParser<$, t> extends NaryPipeParser<$, t> {\n try: NaryPipeParser<$, t>;\n}\ntype validateChainedAsArgs = [\n t\n] extends [unset] ? [\n t\n] extends [anyOrNever] ? [\n] : [\n ErrorMessage<\"as requires an explicit type parameter like myType.as()\">\n] : [];\n\ntype MatchParserContext = {\n cases: Morph[];\n $: unknown;\n input: input;\n checked: boolean;\n key: PropertyKey | null;\n};\ndeclare namespace ctx {\n type from = ctx;\n type init<$, input = unknown, checked extends boolean = false> = from<{\n cases: [];\n $: $;\n input: input;\n checked: checked;\n key: null;\n }>;\n type atKey = from<{\n cases: ctx[\"cases\"];\n $: ctx[\"$\"];\n input: ctx[\"input\"];\n checked: ctx[\"checked\"];\n key: key;\n }>;\n}\ninterface MatchParser<$> extends CaseMatchParser> {\n in(def: type.validate): ChainableMatchParser, true>>;\n in(...args: [typedInput] extends [never] ? [\n ErrorMessage<\"in requires a definition or type argument (in('string') or in())\">\n ] : []): ChainableMatchParser>;\n in(def: type.validate): ChainableMatchParser, true>>;\n case: CaseParser>;\n at: AtParser>;\n}\ntype addCasesToContext = cases extends Morph[] ? ctx.from<{\n $: ctx[\"$\"];\n input: ctx[\"input\"];\n cases: [...ctx[\"cases\"], ...cases];\n checked: ctx[\"checked\"];\n key: ctx[\"key\"];\n}> : never;\ntype addDefaultToContext> = ctx.from<{\n $: ctx[\"$\"];\n input: defaultCase extends \"never\" ? Morph.In : ctx[\"input\"];\n cases: defaultCase extends \"never\" | \"assert\" ? ctx[\"cases\"] : defaultCase extends Morph ? ctx[\"checked\"] extends true ? [\n (In: unknown) => ArkErrors,\n ...ctx[\"cases\"],\n defaultCase\n ] : [...ctx[\"cases\"], defaultCase] : [\n ...ctx[\"cases\"],\n (In: ctx[\"input\"]) => ArkErrors\n ];\n checked: ctx[\"checked\"];\n key: ctx[\"key\"];\n}>;\ntype CaseKeyKind = \"def\" | \"string\";\ntype casesToMorphTuple = unionToTuple]: cases[def] extends (Morph) ? kind extends \"def\" ? (In: inferCaseArg) => o : (In: maybeLiftToKey) => o : never;\n}>>;\ntype addCasesToParser = cases extends {\n default: infer defaultDef extends DefaultCase;\n} ? finalizeMatchParser>, defaultDef> : ChainableMatchParser>>;\ntype inferCaseArg = _finalizeCaseArg, ctx>, ctx, endpoint>;\ntype maybeLiftToKey = ctx[\"key\"] extends PropertyKey ? {\n [k in ctx[\"key\"]]: t;\n} : t;\ntype _finalizeCaseArg = ctxInput extends unknown ? t extends unknown ? distill extends infer result ? ctxInput extends result ? ctxInput : show : never : never : never;\ntype CaseParser = (def: type.validate, resolve: (In: inferCaseArg) => ret) => ChainableMatchParser) => ret]>>;\ntype validateKey = ctx[\"key\"] extends Key ? ErrorMessage : ctx[\"cases\"][\"length\"] extends 0 ? keyof ctx[\"input\"] extends never ? key : conform : ErrorMessage;\ninterface StringsParser {\n (def: cases extends validateStringCases ? cases : validateStringCases): addCasesToParser;\n}\ntype validateStringCases = unknown extends ctx[\"input\"] ? {\n [k in keyof cases]?: k extends \"default\" ? DefaultCase : (In: _finalizeCaseArg, ctx, \"out\">) => unknown;\n} & {\n default?: DefaultCase;\n} : {\n [k in keyof cases]?: k extends \"default\" ? DefaultCase : k extends stringValue ? (In: _finalizeCaseArg, ctx, \"out\">) => unknown : ErrorType<`${k & string} must be a possible string value`>;\n} & {\n [k in stringValue]?: unknown;\n} & {\n default?: DefaultCase;\n};\ntype stringValue = ctx[\"input\"] extends string ? ctx[\"input\"] : ctx[\"key\"] extends keyof ctx[\"input\"] ? ctx[\"input\"][ctx[\"key\"]] extends infer s extends string ? s : never : never;\ninterface AtParser {\n (key: validateKey): ChainableMatchParser>;\n >(key: validateKey, cases: cases extends validateCases ? cases : errorCases): addCasesToParser;\n}\ninterface ChainableMatchParser {\n case: CaseParser;\n match: CaseMatchParser;\n default: DefaultMethod;\n at: AtParser;\n /** @experimental */\n strings: StringsParser;\n}\ntype DefaultCaseKeyword = \"never\" | \"assert\" | \"reject\";\ntype DefaultCase> = DefaultCaseKeyword | Morph;\ntype DefaultMethod = >(def: def) => finalizeMatchParser;\ntype validateCases = {\n [def in keyof cases | BaseCompletions]?: def extends \"default\" ? DefaultCase : def extends number ? (In: inferCaseArg<`${def}`, ctx, \"out\">) => unknown : def extends type.validate ? (In: inferCaseArg) => unknown : type.validate;\n};\ntype errorCases = {\n [def in keyof cases]?: def extends \"default\" ? DefaultCase : def extends number ? (In: inferCaseArg<`${def}`, ctx, \"out\">) => unknown : def extends type.validate ? (In: inferCaseArg) => unknown : ErrorType>;\n} & {\n [k in BaseCompletions]?: (In: inferCaseArg) => unknown;\n} & {\n default?: DefaultCase;\n};\ntype CaseMatchParser = (def: cases extends validateCases ? cases : errorCases) => addCasesToParser;\ntype finalizeMatchParser> = addDefaultToContext extends (infer ctx extends MatchParserContext) ? Match : never;\ninterface Match extends Inferred<(In: Morph.In) => Out>> {\n (data: data): {\n [i in numericStringKeyOf]: isDisjoint> extends true ? never : Morph.Out;\n }[numericStringKeyOf];\n}\ndeclare class InternalMatchParser extends Callable {\n $: InternalScope;\n constructor($: InternalScope);\n in(def?: unknown): InternalChainedMatchParser;\n at(key: Key, cases?: InternalCases): InternalChainedMatchParser | Match;\n case(when: unknown, then: Morph): InternalChainedMatchParser;\n}\ntype InternalCases = Record;\ntype InternalCaseParserFn = (cases: InternalCases) => InternalChainedMatchParser | Match;\ntype CaseEntry = [BaseRoot, Morph] | [\"default\", DefaultCase];\ndeclare class InternalChainedMatchParser extends Callable {\n $: InternalScope;\n in: BaseRoot | undefined;\n protected key: Key | undefined;\n protected branches: BaseRoot[];\n constructor($: InternalScope, In?: BaseRoot);\n at(key: Key, cases?: InternalCases): InternalChainedMatchParser | Match;\n case(def: unknown, resolver: Morph): InternalChainedMatchParser;\n protected caseEntry(node: BaseRoot, resolver: Morph): InternalChainedMatchParser;\n match(cases: InternalCases): InternalChainedMatchParser | Match;\n strings(cases: InternalCases): InternalChainedMatchParser | Match;\n protected caseEntries(entries: CaseEntry[]): InternalChainedMatchParser | Match;\n default(defaultCase: DefaultCase): Match;\n}\ndeclare const chainedAtMessage = \"A key matcher must be specified before the first case i.e. match.at('foo') or match.in().at('bar')\";\ntype chainedAtMessage = typeof chainedAtMessage;\ndeclare const doubleAtMessage = \"At most one key matcher may be specified per expression\";\ntype doubleAtMessage = typeof doubleAtMessage;\n\ntype maybeValidateTupleExpression = def extends IndexZeroExpression ? validatePrefixExpression : def extends IndexOneExpression ? validateIndexOneExpression : def extends (readonly [\"\", ...unknown[]] | readonly [unknown, \"\", ...unknown[]]) ? readonly [\n def[0] extends \"\" ? BaseCompletions<$, args, IndexZeroOperator | \"...\"> : def[0],\n def[1] extends \"\" ? BaseCompletions<$, args, IndexOneOperator | \"...\"> : def[1]\n] : null;\ntype inferTupleExpression = def[1] extends \"[]\" ? inferDefinition[] : def[1] extends \"?\" ? inferDefinition : def[1] extends \"&\" ? inferIntersection, inferDefinition> : def[1] extends \"|\" ? inferDefinition | inferDefinition : def[1] extends \":\" ? inferPredicate, def[2]> : def[1] extends \"=>\" ? parseMorph : def[1] extends \"|>\" ? parseTo : def[1] extends \"=\" ? withDefault, unwrapDefault> : def[1] extends \"@\" ? inferDefinition : def extends readonly [\"===\", ...infer values] ? values[number] : def extends (readonly [\"instanceof\", ...infer constructors extends Constructor[]]) ? InstanceType : def[0] extends \"keyof\" ? inferKeyOfExpression : never;\ntype validatePrefixExpression = def[\"length\"] extends 1 ? readonly [writeMissingRightOperandMessage] : def[0] extends \"keyof\" ? readonly [def[0], validateDefinition] : def[0] extends \"===\" ? readonly [def[0], ...unknown[]] : def[0] extends \"instanceof\" ? readonly [def[0], ...Constructor[]] : never;\ntype validateIndexOneExpression = def[1] extends TuplePostfixOperator ? readonly [validateDefinition, def[1]] : readonly [\n validateDefinition,\n def[\"length\"] extends 2 ? writeMissingRightOperandMessage : def[1],\n def[1] extends \"|\" ? validateDefinition : def[1] extends \"&\" ? validateDefinition : def[1] extends \":\" ? Predicate> : def[1] extends \"=>\" ? Morph> : def[1] extends \"|>\" ? validateDefinition : def[1] extends \"=\" ? defaultFor> : def[1] extends \"@\" ? TypeMeta.MappableInput : validateDefinition,\n ...(def[1] extends \"@\" ? [NodeSelector?] : [])\n];\ntype inferKeyOfExpression = show>;\ntype TupleExpression = IndexZeroExpression | IndexOneExpression;\ntype ArgTwoOperator = Exclude;\ntype parseTo = inferPipe, inferDefinition>;\ntype parseMorph = morph extends Morph ? inferMorphOut extends infer out ? (In: distill.In>) => Out : never : never;\ntype IndexOneExpression = readonly [unknown, token, ...unknown[]];\ntype IndexOneParser = (def: IndexOneExpression, ctx: BaseParseContext) => BaseRoot;\ndeclare const postfixParsers: {\n \"?\": IndexOneParser<\"?\">;\n \"[]\": IndexOneParser<\"[]\">;\n};\ntype TuplePostfixOperator = keyof typeof postfixParsers;\ndeclare const infixParsers: {\n \"|\": IndexOneParser<\"|\">;\n \"=\": IndexOneParser<\"=\">;\n \"|>\": IndexOneParser<\"|>\">;\n \"&\": IndexOneParser<\"&\">;\n \"=>\": IndexOneParser<\"=>\">;\n \":\": IndexOneParser<\":\">;\n \"@\": IndexOneParser<\"@\">;\n};\ntype TupleInfixOperator = keyof typeof infixParsers;\ndeclare const indexOneParsers: {\n \"|\": IndexOneParser<\"|\">;\n \"=\": IndexOneParser<\"=\">;\n \"|>\": IndexOneParser<\"|>\">;\n \"&\": IndexOneParser<\"&\">;\n \"=>\": IndexOneParser<\"=>\">;\n \":\": IndexOneParser<\":\">;\n \"@\": IndexOneParser<\"@\">;\n \"?\": IndexOneParser<\"?\">;\n \"[]\": IndexOneParser<\"[]\">;\n};\ntype IndexOneOperator = keyof typeof indexOneParsers;\ntype IndexZeroParser = (def: IndexZeroExpression, ctx: BaseParseContext) => BaseRoot;\ntype IndexZeroExpression = readonly [\n token,\n ...unknown[]\n];\ndeclare const indexZeroParsers: {\n keyof: IndexZeroParser<\"keyof\">;\n instanceof: IndexZeroParser<\"instanceof\">;\n \"===\": IndexZeroParser<\"===\">;\n};\ntype IndexZeroOperator = keyof typeof indexZeroParsers;\n\n/** The convenience properties attached to `type` */\ntype TypeParserAttachments = Omit;\ninterface TypeParser<$ = {}> extends Ark.boundTypeAttachments<$> {\n /**\n * Create a {@link Type} from your definition.\n *\n * @example const Person = type({ name: \"string\" })\n */\n >(def: type.validate): r extends infer _ ? _ : never;\n /**\n * Create a {@link Generic} from a parameter string and body definition.\n *\n * @param params A string like \"\" specifying the\n * {@link Generic}'s parameters and any associated constraints via `extends`.\n *\n * @param def The definition for the body of the {@link Generic}. Can reference the\n * parameter names specified in the previous argument in addition to aliases\n * from its {@link Scope}.\n *\n * @example const BoxOf = type(\"\", { contents: \"t\" })\n */\n , def, $>>(params: validateParameterString, def: type.validate>>): r extends infer _ ? _ : never;\n /**\n * Create a {@link Type} from a [tuple expression](http://localhost:3000/docs/expressions)\n * spread as this function's arguments.\n *\n * @example type(\"string\", \"|\", { foo: \"number\" })\n */\n >(_0: zero extends IndexZeroOperator ? zero : type.validate, _1: zero extends \"keyof\" ? type.validate : zero extends \"instanceof\" ? conform : zero extends \"===\" ? conform : conform, ..._2: zero extends \"===\" ? rest : zero extends \"instanceof\" ? conform : one extends TupleInfixOperator ? one extends \":\" ? [Predicate>>] : one extends \"=>\" ? [Morph>, unknown>] : one extends \"|>\" ? [type.validate] : one extends \"@\" ? [TypeMeta.MappableInput, NodeSelector?] : [type.validate] : []): r extends infer _ ? _ : never;\n /**\n * An alias of the {@link ArkErrors} class, an instance of which is returned when a {@link Type}\n * is invoked with invalid input.\n *\n * @example\n * const out = myType(data)\n *\n * if(out instanceof type.errors) console.log(out.summary)\n */\n errors: typeof ArkErrors;\n hkt: typeof Hkt;\n keywords: typeof keywords;\n /**\n * The {@link Scope} in which definitions passed to this function will be parsed.\n */\n $: Scope<$>;\n /**\n * An alias of `type` with no type-level validation or inference.\n *\n * Useful when wrapping `type` or using it to parse a dynamic definition.\n */\n raw(def: unknown): Type$1;\n module: ModuleParser;\n scope: ScopeParser;\n define: DefinitionParser<$>;\n declare: DeclarationParser<$>;\n generic: GenericParser<$>;\n match: MatchParser<$>;\n schema: SchemaParser<$>;\n /**\n * Create a {@link Type} that is satisfied only by a value strictly equal (`===`) to the argument passed to this function.\n * @example const foo = type.unit('foo') // {@link Type}<'foo'>\n * @example const sym: unique symbol = Symbol(); type.unit(sym) // {@link Type}\n */\n unit: UnitTypeParser<$>;\n /**\n * Create a {@link Type} that is satisfied only by a value strictly equal (`===`) to one of the arguments passed to this function.\n * @example const enum = type.enumerated('foo', 'bar', obj) // obj is a by-reference object\n * @example const TupleForm = type(['===', 'foo', 'bar', obj])\n * @example const ArgsForm = type('===', 'foo', 'bar', obj)\n */\n enumerated: EnumeratedTypeParser<$>;\n /**\n * Create a {@link Type} that is satisfied only by one of the Object.values() of the argument passed to this function.\n *\n * ⚠️ For TypeScript enum compatibility, values at numeric keys with corresponding numeric values will not be included.\n * @example const myEnum = type.valueOf(myTsEnum)\n */\n valueOf: ValueOfTypeParser<$>;\n /**\n * Create a {@link Type} that is satisfied only by a value of a specific class.\n * @example const array = type.instanceOf(Array)\n */\n instanceOf: InstanceOfTypeParser<$>;\n /**\n * Create a {@link Type} from a union of definitions\n * @example const T = type.or(\"string\", \"number\")\n */\n or: NaryUnionParser<$>;\n /**\n * Create a {@link Type} from an intersection of definitions\n * @example const T = type.and({ a: \"1\" }, { b: \"2\" })\n */\n and: NaryIntersectionParser<$>;\n /**\n * Create a {@link Type} by merging object definitions, with later\n * definitions having precedence for overlapping keys\n * @example\n * // Type<{ a: \"3\", b: \"2\", c: \"4\" }>\n * const T = type.merge({ a: \"1\", b: \"2\" }, { a: \"3\", c: \"4\" })\n */\n merge: NaryMergeParser<$>;\n /**\n * Create a {@link Type} from a set of morphs (including Types)\n * @example\n * // Type<(In: string) => To>\n * const T = type.pipe(type.string, s => JSON.parse(s), type.object)\n */\n pipe: NaryPipeParser<$>;\n /**\n * Define a validated function\n * @example\n * const len = type.fn(\"string | unknown[]\", \":\", \"number\")(s => s.length)\n * len(\"foo\") // 3\n * // TypeScript: boolean is not assignable to string | unknown[]\n * // Runtime (throws): must be a string or an object (was boolean)\n * len(true)\n */\n fn: FnParser<$>;\n}\ndeclare class InternalTypeParser extends Callable<(...args: unknown[]) => BaseRoot | Generic, TypeParserAttachments> {\n constructor($: InternalScope);\n}\ntype UnitTypeParser<$> = (value: t) => Type;\ntype InstanceOfTypeParser<$> = (ctor: Constructor) => Type;\ntype EnumeratedTypeParser<$> = (...values: values) => Type;\ntype ValueOfTypeParser<$> = (o: o) => Type;\ntype DefinitionParser<$> = (def: type.validate) => def;\ntype SchemaParser<$> = (schema: RootSchema, opts?: BaseParseOptions) => Type;\ntype TypeConstructor = new (def: unknown, $: Scope<$>) => Type;\ntype Type = instantiateType;\ndeclare const Type: TypeConstructor;\n\ntype BaseFnParser<$ = {}> = , returnT = args extends readonly [...unknown[], \":\", infer returnDef] ? type.infer : unknown>(...args: {\n [i in keyof args]: conform, i>>;\n}) => ) => distill.In, externalSignature extends Fn = (...args: applyElementLabels, Parameters>) => args extends readonly [...unknown[], \":\", unknown] ? distill.Out : ReturnType>(implementation: internalSignature) => TypedFn;\ninterface FnParser<$ = {}> extends BaseFnParser<$> {\n /**\n * The {@link Scope} in which definitions passed to this function will be parsed.\n */\n $: Scope<$>;\n /**\n * An alias of `fn` with no type-level validation or inference.\n *\n * Useful when wrapping `fn` or using it to parse a dynamic definition.\n */\n raw: RawFnParser;\n}\ntype RawFnParser = (...args: unknown[]) => (...args: unknown[]) => unknown;\ndeclare class InternalFnParser extends Callable<(...args: unknown[]) => Fn> {\n constructor($: InternalScope);\n}\ndeclare namespace TypedFn {\n type meta = {\n introspectableReturn?: true;\n };\n}\ninterface TypedFn extends Callable {\n expression: string;\n params: signature extends Fn ? Type : never;\n returns: Type : unknown, $>;\n}\ndeclare namespace Return {\n interface introspectable {\n introspectableReturn: true;\n }\n}\ntype validateFnArgs = args extends readonly unknown[] ? args extends readonly [...infer paramDefs, \":\", infer returnDef] ? readonly [\n ...validateFnParamDefs,\n \":\",\n type.validate\n] : validateFnParamDefs : never;\ntype validateFnParamDefs = paramDefs extends validateTupleLiteral ? paramDefs : paramDefs extends {\n [i in keyof paramDefs]: paramDefs[i] extends \"...\" ? paramDefs[i] : validateInnerDefinition;\n} ? validateTupleLiteral : {\n [i in keyof paramDefs]: validateInnerDefinition;\n};\n\ninterface ArkScopeConfig extends ArkSchemaScopeConfig {\n}\ninterface ScopeParser {\n (def: scope.validate, config?: ArkScopeConfig): Scope>;\n define: (def: scope.validate) => def;\n}\ntype ModuleParser = (def: scope.validate, config?: ArkScopeConfig) => scope.infer extends infer $ ? Module<{\n [k in exportedNameOf<$>]: $[k];\n}> : never;\ntype bindThis = {\n this: Def;\n};\n/** nominal type for an unparsed definition used during scope bootstrapping */\ntype Def = Brand;\n/** sentinel indicating a scope that will be associated with a generic has not yet been parsed */\ntype UnparsedScope = \"$\";\n/** These are legal as values of a scope but not as definitions in other contexts */\ntype PreparsedResolution = PreparsedNodeResolution;\ntype bootstrapAliases = {\n [k in Exclude]: def[k] extends (PreparsedResolution) ? def[k] extends {\n t: infer g extends GenericAst;\n } ? g : def[k] extends Module | BoundModule ? Submodule<$> : def[k] : def[k] extends (() => infer thunkReturn extends PreparsedResolution) ? thunkReturn extends {\n t: infer g extends GenericAst;\n } ? g : thunkReturn extends Module | BoundModule ? Submodule<$> : thunkReturn : Def;\n} & {\n [k in keyof def & GenericDeclaration as extractGenericName]: GenericAst, bootstrapAliases>, def[k], UnparsedScope>;\n};\ntype inferBootstrapped<$> = {\n [name in keyof $]: $[name] extends Def ? inferDefinition : $[name] extends {\n t: infer g extends GenericAst;\n } ? bindGenericToScope : $[name];\n} & unknown;\ntype bindGenericToScope = GenericAst;\ntype extractGenericName = k extends GenericDeclaration ? name : never;\ntype extractGenericParameters = k extends `${string}<${infer params}>` ? ParameterString : never;\ntype resolutionToAst = [\n resolution\n] extends [anyOrNever] ? InferredAst : resolution extends Def ? DefAst : resolution extends {\n [arkKind]: \"module\";\n root: infer root;\n} ? InferredAst : resolution extends GenericAst ? resolution : InferredAst;\ninterface InternalScope {\n constructor: typeof InternalScope;\n}\ndeclare class InternalScope<$ extends {} = {}> extends BaseScope<$> {\n get ambientAttachments(): Ark.boundTypeAttachments<$> | undefined;\n protected preparseOwnAliasEntry(alias: string, def: unknown): AliasDefEntry;\n parseGenericParams(def: string, opts: BaseParseOptions): array;\n protected normalizeRootScopeValue(resolution: unknown): unknown;\n protected preparseOwnDefinitionFormat(def: unknown, opts: BaseParseOptions): BaseRoot | BaseParseContextInput;\n parseOwnDefinitionFormat(def: unknown, ctx: BaseParseContext): BaseRoot;\n unit: UnitTypeParser<$>;\n valueOf: ValueOfTypeParser<$>;\n enumerated: EnumeratedTypeParser<$>;\n instanceOf: InstanceOfTypeParser<$>;\n or: NaryUnionParser<$>;\n and: NaryIntersectionParser<$>;\n merge: NaryMergeParser<$>;\n pipe: NaryPipeParser<$>;\n fn: InternalFnParser;\n match: InternalMatchParser;\n declare: () => {\n type: InternalTypeParser;\n };\n define(def: def): def;\n type: InternalTypeParser;\n static scope: ScopeParser;\n static module: ModuleParser;\n}\ndeclare const scope: ScopeParser;\ndeclare namespace scope {\n type validate = {\n [k in keyof def]: k extends noSuggest ? unknown : parseScopeKey[\"params\"] extends infer params ? params extends array ? params[\"length\"] extends 0 ? def[k] extends type.Any | PreparsedResolution ? def[k] : k extends (PrivateDeclaration) ? ErrorType> : type.validate, {}> : type.validate, baseGenericConstraints> : params : never;\n };\n type infer = inferBootstrapped>;\n}\ninterface ScopeConstructor {\n new <$ = {}>(...args: ConstructorParameters): Scope<$>;\n scope: ScopeParser;\n module: ModuleParser;\n}\ninterface Scope<$ = {}> {\n t: $;\n [arkKind]: \"scope\";\n config: ArkScopeConfig;\n references: readonly BaseNode[];\n json: JsonStructure;\n exportedNames: array>;\n /** The set of names defined at the root-level of the scope mapped to their\n * corresponding definitions.**/\n aliases: Record;\n internal: toInternalScope<$>;\n defineSchema(schema: def): def;\n node>(kinds: kinds, schema: NodeSchema>, opts?: BaseParseOptions): nodeOfKind>>;\n unit: UnitTypeParser<$>;\n enumerated: EnumeratedTypeParser<$>;\n valueOf: ValueOfTypeParser<$>;\n instanceOf: InstanceOfTypeParser<$>;\n type: TypeParser<$>;\n match: MatchParser<$>;\n fn: FnParser<$>;\n declare: DeclarationParser<$>;\n define: DefinitionParser<$>;\n generic: GenericParser<$>;\n schema: SchemaParser<$>;\n import(): Module<{\n [k in exportedNameOf<$> as PrivateDeclaration]: $[k];\n }>;\n import[]>(...names: names): BoundModule<{\n [k in names[number] as PrivateDeclaration]: $[k];\n } & unknown, $>;\n export(): Module<{\n [k in exportedNameOf<$>]: $[k];\n }>;\n export[]>(...names: names): BoundModule<{\n [k in names[number]]: $[k];\n } & unknown, $>;\n resolve>(name: name): instantiateExport<$[name], $>;\n}\ndeclare const Scope: ScopeConstructor;\ntype parseScopeKey = k extends `${infer name}<${infer params}>` ? parseGenericScopeKey : {\n name: k;\n params: [];\n};\ntype parseGenericScopeKey = {\n name: name;\n params: parseGenericParams>;\n};\ntype InnerParseResult = BaseRoot | ParsedOptionalProperty | ParsedDefaultableProperty;\n\ntype inferDefinition = [\n def\n] 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;\ntype inferStandardSchema, o = StandardSchemaV1.InferOutput> = [i, o] extends [o, i] ? i : (In: i) => Out;\ntype 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;\ntype validateInnerDefinition = [\n def\n] extends [TerminalObjectDefinition] ? def : def extends string ? validateString : unknown extends def ? BaseCompletions<$, args> | {} : def extends readonly unknown[] ? validateTuple : def extends BadDefinitionType ? ErrorMessage>> : validateObjectLiteral;\ntype validateTuple = maybeValidateTupleExpression extends infer result ? result extends null ? validateTupleLiteral : result : never;\ntype inferTuple = def extends TupleExpression ? inferTupleExpression : inferTupleLiteral;\ntype TerminalObjectDefinition = type.cast | Fn | RegExp | StandardSchemaV1;\ntype ThunkCast = () => type.cast;\ntype BadDefinitionType = Exclude;\ndeclare const writeBadDefinitionTypeMessage: (actual: actual) => writeBadDefinitionTypeMessage;\ntype writeBadDefinitionTypeMessage = `Type definitions must be strings or objects (was ${actual})`;\n\ntype DeclarationParser<$> = () => {\n type: (def: [preinferred] extends [unset] ? [\n preinferred\n ] extends [anyOrNever] ? validateDeclared : ErrorMessage<`declare() requires a generic argument`> : validateDeclared) => Type, $>;\n};\ntype finalizePreinferred = ctx[\"side\"] extends distill.Side ? ctx[\"side\"] extends \"in\" ? (In: preinferred) => type.infer.Out : (In: type.infer.In) => preinferred : preinferred;\ntype DeclareContext = {\n side?: \"in\" | \"out\";\n};\ntype validateDeclared = def extends type.validate ? validateInference, ctx> : type.validate;\ntype validateInference = def extends TerminalObjectDefinition | ThunkCast | TupleExpression ? keyof def extends never ? validateObjectInference : validateShallowInference, declared, ctx> : def extends array ? validateArrayInference : def extends object ? validateObjectInference : validateShallowInference, declared, ctx>;\ntype validateArrayInference = declared extends array ? {\n [i in keyof declared]: i extends keyof def ? validateInference : declared[i];\n} : show, declared>>;\ntype validateObjectInference = show<{\n [k in requiredKeyOf]: k extends keyof def ? validateInference : declared[k];\n} & {\n [k in optionalKeyOf & string as declaredOptionalKeySuggestion]: declaredOptionalValueSuggestion;\n}>;\ntype declaredOptionalKeySuggestion = k extends keyof def ? def[k] extends OptionalPropertyDefinition ? k : `${k}?` : `${k}?`;\ntype declaredOptionalValueSuggestion = k extends keyof def ? def[k] extends OptionalPropertyDefinition ? validateInference[k], $, args, ctx> : declared[k] : `${k}?` extends keyof def ? validateInference[k], $, args, ctx> : declared[k];\ntype validateShallowInference : t> = equals extends true ? unknown : show>;\ntype declarationMismatch = ErrorType<{\n declared: declared;\n inferred: inferred;\n}>;\n\ndeclare class MergeHkt extends Hkt<[base: object, props: object]> {\n body: util.merge;\n description: string;\n}\ndeclare const Merge: _ark_schema.GenericRoot;\ndeclare const arkBuiltins: arkBuiltins;\ntype arkBuiltins = Module;\ndeclare namespace arkBuiltins {\n type submodule = Submodule<$>;\n type $ = {\n Key: Key;\n Merge: typeof Merge.t;\n };\n}\n\ndeclare const number: number.module;\ndeclare namespace number {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: number;\n epoch: number;\n integer: number;\n safe: number;\n NaN: number;\n Infinity: number;\n NegativeInfinity: number;\n };\n}\n\ndeclare const stringInteger: stringInteger.module;\ndeclare namespace stringInteger {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n}\ndeclare const base64: Module<{\n root: unknown;\n url: unknown;\n}>;\ndeclare namespace base64 {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n url: string;\n };\n}\ndeclare const capitalize: capitalize.module;\ndeclare namespace capitalize {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n}\ndeclare const stringDate: stringDate.module;\ndeclare namespace stringDate {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n iso: iso.submodule;\n epoch: epoch.submodule;\n };\n namespace iso {\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n }\n namespace epoch {\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n }\n}\ndeclare const ip: ip.module;\ndeclare namespace ip {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n v4: string;\n v6: string;\n };\n}\ndeclare namespace stringJson {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n}\ndeclare namespace lower {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n}\ndeclare const normalize: Module<{\n root: unknown;\n NFC: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFD: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFKC: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFKD: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n}>;\ndeclare namespace normalize {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n NFC: NFC.submodule;\n NFD: NFD.submodule;\n NFKC: NFKC.submodule;\n NFKD: NFKD.submodule;\n };\n namespace NFC {\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n }\n namespace NFD {\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n }\n namespace NFKC {\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n }\n namespace NFKD {\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n }\n}\ndeclare const stringNumeric: stringNumeric.module;\ndeclare namespace stringNumeric {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n}\ndeclare namespace trim {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n}\ndeclare const upper: upper.module;\ndeclare namespace upper {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n}\ndeclare const url: url.module;\ndeclare namespace url {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n}\ndeclare const uuid: Module<{\n root: string;\n v1: unknown;\n v2: unknown;\n v3: unknown;\n v4: unknown;\n v5: unknown;\n v6: unknown;\n v7: unknown;\n v8: unknown;\n}>;\ndeclare namespace uuid {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n v1: string;\n v2: string;\n v3: string;\n v4: string;\n v5: string;\n v6: string;\n v7: string;\n v8: string;\n };\n namespace $ {\n type flat = {};\n }\n}\ndeclare const string: Module<{\n integer: Submodule;\n trim: Submodule;\n normalize: Submodule<{\n root: unknown;\n NFC: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFD: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFKC: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFKD: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n }>;\n date: Submodule;\n root: unknown;\n email: unknown;\n uuid: Submodule<{\n root: string;\n v1: unknown;\n v2: unknown;\n v3: unknown;\n v4: unknown;\n v5: unknown;\n v6: unknown;\n v7: unknown;\n v8: unknown;\n }>;\n regex: unknown;\n json: Submodule;\n lower: Submodule;\n upper: Submodule;\n alpha: unknown;\n alphanumeric: unknown;\n hex: unknown;\n base64: Submodule<{\n root: unknown;\n url: unknown;\n }>;\n capitalize: Submodule;\n creditCard: unknown;\n digits: unknown;\n ip: Submodule;\n numeric: Submodule;\n semver: unknown;\n url: Submodule;\n}>;\ndeclare namespace string {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: base64.submodule;\n capitalize: capitalize.submodule;\n creditCard: string;\n date: stringDate.submodule;\n digits: string;\n email: string;\n integer: stringInteger.submodule;\n ip: ip.submodule;\n json: stringJson.submodule;\n lower: lower.submodule;\n normalize: normalize.submodule;\n numeric: stringNumeric.submodule;\n regex: string;\n semver: string;\n trim: trim.submodule;\n upper: upper.submodule;\n url: url.submodule;\n uuid: uuid.submodule;\n };\n}\n\ndeclare const arkTsKeywords: arkTsKeywords;\ntype arkTsKeywords = Module;\ndeclare namespace arkTsKeywords {\n type submodule = Submodule<$>;\n type $ = {\n bigint: bigint;\n boolean: boolean;\n false: false;\n never: never;\n null: null;\n number: number;\n object: object;\n string: string;\n symbol: symbol;\n true: true;\n unknown: unknown;\n undefined: undefined;\n };\n}\ndeclare const unknown: Module<{\n any: unknown;\n root: unknown;\n}>;\ndeclare namespace unknown {\n type submodule = Submodule<$>;\n type $ = {\n root: unknown;\n any: any;\n };\n}\ndeclare const json: Module<{\n stringify: unknown;\n root: unknown;\n}>;\ndeclare namespace json {\n type submodule = Submodule<$>;\n type $ = {\n root: Json;\n stringify: (In: Json) => To;\n };\n}\ndeclare const object: Module<{\n root: unknown;\n json: Submodule<{\n stringify: unknown;\n root: unknown;\n }>;\n}>;\ndeclare namespace object {\n type submodule = Submodule<$>;\n type $ = {\n root: object;\n json: json.submodule;\n };\n}\ndeclare class RecordHkt extends Hkt<[Key, unknown]> {\n body: Record;\n description: string;\n}\ndeclare const Record: _ark_schema.GenericRoot;\ndeclare class PickHkt extends Hkt<[object, Key]> {\n body: pick;\n description: string;\n}\ndeclare const Pick: _ark_schema.GenericRoot;\ndeclare class OmitHkt extends Hkt<[object, Key]> {\n body: omit;\n description: string;\n}\ndeclare const Omit: _ark_schema.GenericRoot;\ndeclare class PartialHkt extends Hkt<[object]> {\n body: show>;\n description: string;\n}\ndeclare const Partial: _ark_schema.GenericRoot;\ndeclare class RequiredHkt extends Hkt<[object]> {\n body: show>;\n description: string;\n}\ndeclare const Required$1: _ark_schema.GenericRoot;\ndeclare class ExcludeHkt extends Hkt<[unknown, unknown]> {\n body: Exclude;\n description: string;\n}\ndeclare const Exclude: _ark_schema.GenericRoot;\ndeclare class ExtractHkt extends Hkt<[unknown, unknown]> {\n body: Extract;\n description: string;\n}\ndeclare const Extract: _ark_schema.GenericRoot;\ndeclare const arkTsGenerics: arkTsGenerics.module;\ndeclare namespace arkTsGenerics {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n Exclude: typeof Exclude.t;\n Extract: typeof Extract.t;\n Omit: typeof Omit.t;\n Partial: typeof Partial.t;\n Pick: typeof Pick.t;\n Record: typeof Record.t;\n Required: typeof Required$1.t;\n };\n}\n\ninterface Ark extends Omit, Ark.wrapped {\n}\ndeclare namespace Ark {\n interface keywords extends arkTsKeywords.$, arkTsGenerics.$, arkPrototypes.keywords, arkBuiltins.$ {\n }\n interface wrapped extends arkPrototypes.wrapped {\n string: string.submodule;\n number: number.submodule;\n object: object.submodule;\n unknown: unknown.submodule;\n }\n type flat = flatResolutionsOf;\n interface typeAttachments extends arkTsKeywords.$ {\n arrayIndex: arkPrototypes.$[\"Array\"][\"index\"];\n Key: arkBuiltins.$[\"Key\"];\n Record: arkTsGenerics.$[\"Record\"];\n Date: arkPrototypes.$[\"Date\"];\n Array: arkPrototypes.$[\"Array\"][\"root\"];\n }\n interface boundTypeAttachments<$> extends Omit, arkKind> {\n }\n}\ndeclare const ark: Scope;\ndeclare const keywords: Module;\ndeclare const type: TypeParser<{}>;\ndeclare namespace type {\n interface cast {\n [inferred]?: to;\n }\n type errors = ArkErrors;\n type validate> = validateDefinition;\n type instantiate> = instantiateType, $>;\n type infer> = inferDefinition;\n namespace infer {\n type In = distill.In>;\n type Out = distill.Out>;\n namespace introspectable {\n type Out = distill.introspectable.Out>;\n }\n }\n type brand = t extends InferredMorph ? o[\"introspectable\"] extends true ? (In: i) => To> : (In: i) => Out> : Brand;\n /** @ts-ignore cast variance */\n interface Any extends Type$1 {\n }\n}\ntype type = Type;\ndeclare const match: MatchParser<{}>;\ndeclare const fn: FnParser<{}>;\ndeclare const generic: GenericParser<{}>;\ndeclare const define: DefinitionParser<{}>;\ndeclare const declare: DeclarationParser<{}>;\n\ntype ParameterString = `<${params}>`;\ntype extractParams = s extends ParameterString ? params : never;\ntype validateParameterString = parseGenericParams, $> extends infer e extends ErrorMessage ? e : s;\ntype validateGenericArg = type.infer extends param[1] ? unknown : ErrorType<[`Invalid argument for ${param[0]}`, expected: param[1]]>;\ntype GenericInstantiator, def, $, args$> = params[\"length\"] extends 1 ? {\n >(a: type.validate & validateGenericArg): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 2 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 3 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 4 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 5 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 6 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : (error: ErrorMessage<`You may not define more than 6 positional generic parameters`>) => never;\ntype instantiateGeneric, args, $, args$> = Type<[\n def\n] extends [Hkt] ? Hkt.apply;\n}> : inferDefinition>, args$>;\ntype bindGenericArgs, $, args> = {\n [i in keyof params & `${number}` as params[i][0]]: type.infer;\n};\ntype baseGenericResolutions, $> = baseGenericConstraints extends infer baseConstraints ? {\n [k in keyof baseConstraints]: Type;\n} : never;\ntype baseGenericConstraints> = {\n [i in keyof params & `${number}` as params[i][0]]: params[i][1];\n};\ntype GenericConstructor = array, bodyDef = unknown, $ = {}, arg$ = {}> = new () => Generic;\ninterface Generic = array, bodyDef = unknown, $ = {}, arg$ = $> extends Callable> {\n [arkKind]: \"generic\";\n t: GenericAst;\n bodyDef: bodyDef;\n params: {\n [i in keyof params]: [params[i][0], Type];\n };\n names: genericParamNames;\n constraints: {\n [i in keyof params]: Type;\n };\n $: Scope<$>;\n arg$: Scope;\n internal: GenericRoot;\n json: JsonStructure;\n}\ndeclare const Generic: GenericConstructor;\ntype GenericDeclaration = `${name}${params}`;\ntype parseValidGenericParams = conform, $>, array>;\ndeclare const emptyGenericParameterMessage = \"An empty string is not a valid generic parameter name\";\ntype emptyGenericParameterMessage = typeof emptyGenericParameterMessage;\ntype parseGenericParams = parseNextNameChar, \"\", [\n], $>;\ntype ParamsTerminator = WhitespaceChar | \",\";\ntype parseName, $> = parseNextNameChar, \"\", result, $>;\ntype parseNextNameChar, $> = unscanned extends `${infer lookahead}${infer nextUnscanned}` ? lookahead extends ParamsTerminator ? name extends \"\" ? ErrorMessage : lookahead extends \",\" ? parseName : lookahead extends WhitespaceChar ? _parseOptionalConstraint : never : parseNextNameChar : name extends \"\" ? result : [...result, [name, unknown]];\ndeclare const extendsToken = \"extends \";\ntype extendsToken = typeof extendsToken;\ndeclare const _parseOptionalConstraint: (scanner: Scanner, name: string, result: GenericParamDef[], ctx: BaseParseContext) => GenericParamDef[];\ntype _parseOptionalConstraint, $> = Scanner.skipWhitespace extends (`${extendsToken}${infer nextUnscanned}`) ? parseUntilFinalizer, $, {}> extends (infer finalArgState extends StaticState) ? validateAst extends (infer e extends ErrorMessage) ? e : parseName]\n], $> : never : parseName extends `,${infer nextUnscanned}` ? nextUnscanned : unscanned, [\n ...result,\n [name, unknown]\n], $>;\ntype genericParamDefToAst = schema extends string ? [schema, unknown] : schema extends readonly [infer name, infer def] ? [name, type.infer] : never;\ntype genericParamDefsToAst, $> = [\n ...{\n [i in keyof defs]: genericParamDefToAst;\n }\n];\ntype GenericParser<$ = {}> = >(...params: {\n [i in keyof paramsDef]: paramsDef[i] extends (readonly [infer name, infer def]) ? readonly [name, type.validate] : paramsDef[i];\n}) => GenericBodyParser, $>;\ninterface GenericBodyParser, $> {\n (body: type.validate>): Generic;\n (instantiateDef: LazyGenericBody>, hkt: hkt): Generic, $, $>;\n}\n\ndeclare const Module: new <$ extends {}>(exports: exportScope<$>) => Module<$>;\ninterface Module<$ extends {} = {}> extends RootModule> {\n}\ntype exportScope<$> = bindExportsToScope<$, $>;\ndeclare const BoundModule: new (exports: bindExportsToScope, $: $) => BoundModule;\ninterface BoundModule extends RootModule> {\n}\ntype bindExportsToScope = {\n [k in keyof exports]: instantiateExport;\n} & unknown;\ntype Submodule = RootModule;\ntype instantiateExport = [\n t\n] extends [PreparsedNodeResolution] ? [\n t\n] extends [anyOrNever] ? Type : t extends GenericAst ? Generic : t extends Submodule ? BoundModule : never : Type;\n\ndeclare class liftFromHkt extends Hkt<[element: unknown]> {\n body: liftArray extends infer lifted ? (In: this[0] | lifted) => To : never;\n}\ndeclare const liftFrom: _ark_schema.GenericRoot;\ndeclare const arkArray: arkArray.module;\ndeclare namespace arkArray {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: unknown[];\n readonly: readonly unknown[];\n index: NonNegativeIntegerString;\n liftFrom: typeof liftFrom.t;\n };\n}\ntype NonNegativeIntegerString = `${Digit}` | (`${Exclude}${string}` & `${bigint}`);\n\ntype FormDataValue = string | File;\ntype ParsedFormData = Record;\ndeclare const arkFormData: arkFormData.module;\ndeclare namespace arkFormData {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: FormData;\n value: FormDataValue;\n parse: (In: FormData) => To;\n parsed: ParsedFormData;\n };\n}\n\ndeclare const TypedArray: TypedArray.module;\ndeclare namespace TypedArray {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n Int8: Int8Array;\n Uint8: Uint8Array;\n Uint8Clamped: Uint8ClampedArray;\n Int16: Int16Array;\n Uint16: Uint16Array;\n Int32: Int32Array;\n Uint32: Uint32Array;\n Float32: Float32Array;\n Float64: Float64Array;\n BigInt64: BigInt64Array;\n BigUint64: BigUint64Array;\n };\n}\n\ndeclare const omittedPrototypes: {\n Boolean: 1;\n Number: 1;\n String: 1;\n};\ndeclare const arkPrototypes: arkPrototypes.module;\ndeclare namespace arkPrototypes {\n type module = Module;\n type submodule = Submodule<$>;\n interface keywords extends ecmascript, platform {\n }\n interface $ extends Omit, wrapped {\n }\n interface wrapped {\n Array: arkArray.submodule;\n TypedArray: TypedArray.submodule;\n FormData: arkFormData.submodule;\n }\n type ecmascript = Omit;\n type platform = PlatformObjects;\n interface instances extends ecmascript, platform {\n }\n type NonDegenerateName = keyof instances extends infer k ? k extends keyof instances ? {} extends instances[k] ? never : k : never : never;\n type instanceOf = instances[name];\n}\n\ntype DateLiteral = `d\"${source}\"` | `d'${source}'`;\ntype LimitLiteral = number | DateLiteral;\ntype distill = finalizeDistillation>;\ndeclare namespace distill {\n type Side = \"in\" | \"out\" | \"introspectableOut\";\n type In = distill;\n type Out = distill;\n namespace introspectable {\n type Out = distill;\n }\n}\ntype finalizeDistillation = equals extends true ? t : distilled;\ntype _distill = t extends undefined ? t : [t] extends [anyOrNever] ? t : unknown extends t ? unknown : t extends Brand ? side extends \"in\" ? base : t : t extends TerminallyInferredObject | Primitive ? t : t extends Function ? t extends (...args: never) => anyOrNever ? t : t extends InferredMorph ? distillIo : t : t extends Default ? _distill : t extends array ? distillArray : isSafelyMappable extends true ? distillMappable : t;\ntype distillMappable = side extends \"in\" ? show<{\n [k in keyof o as k extends inferredDefaultKeyOf ? never : k]: _distill;\n} & {\n [k in inferredDefaultKeyOf]?: _distill;\n}> : {\n [k in keyof o]: _distill;\n};\ntype distillIo = side extends \"out\" ? _distill : side extends \"in\" ? _distill : o extends To ? _distill : unknown;\ntype unwrapInput = t extends InferredMorph ? t extends anyOrNever ? t : i : t;\ntype inferredDefaultKeyOf = keyof o extends infer k ? k extends keyof o ? unwrapInput extends Default ? [\n t\n] extends [anyOrNever] ? never : k : never : never : never;\ntype distillArray = t[number][] extends t ? alignReadonly<_distill[], t> : distillNonArraykeys, t>, side>;\ntype alignReadonly = original extends unknown[] ? result : Readonly;\ntype distillNonArraykeys = keyof originalArray extends keyof distilledArray ? distilledArray : distilledArray & _distill<{\n [k in keyof originalArray as k extends keyof distilledArray ? never : k]: originalArray[k];\n}, side>;\ntype distillArrayFromPrefix = t extends readonly [infer head, ...infer tail] ? distillArrayFromPrefix?] : [...prefix, _distill]> : [...prefix, ...distillArrayFromPostfix];\ntype distillArrayFromPostfix = t extends readonly [...infer init, infer last] ? distillArrayFromPostfix, ...postfix]> : [...{\n [i in keyof t]: _distill;\n}, ...postfix];\ntype BuiltinTerminalObjectKind = Exclude;\n/** Objects we don't want to expand during inference like Date or Promise */\ntype TerminallyInferredObject = arkPrototypes.instanceOf | ArkEnv.prototypes;\ntype inferPredicate = predicate extends (data: any, ...args: any[]) => data is infer narrowed ? narrowed : t;\ntype inferNaryPipe = _inferNaryPipe;\ntype _inferNaryPipe = remaining extends (readonly [infer head extends Morph, ...infer tail extends Morph[]]) ? _inferNaryPipe> : result;\ntype inferNaryIntersection = number extends types[\"length\"] ? _inferNaryIntersection, unknown> : _inferNaryIntersection;\ntype _inferNaryIntersection = remaining extends readonly [infer head, ...infer tail] ? _inferNaryIntersection> : result;\ntype inferNaryMerge = number extends types[\"length\"] ? _inferUnorderedMerge : _inferNaryMerge;\ntype _inferUnorderedMerge, requiredKey extends PropertyKey = Exclude, optionalKey>> = show<{\n [k in requiredKey]: types[number] extends infer v ? v extends unknown ? k extends keyof v ? v[k] : never : never : never;\n} & {\n [k in optionalKey]?: types[number] extends infer v ? v extends unknown ? k extends keyof v ? v[k] : never : never : never;\n}>;\n/** Coalesce keys that exist and are optional on one or more branches of a union */\ntype optionalAtLeastOnceUnionKeyOf = t extends unknown ? optionalKeyOf : never;\ntype _inferNaryMerge = remaining extends (readonly [infer head, ...infer tail extends readonly unknown[]]) ? _inferNaryMerge> : result;\ntype inferMorphOut = Exclude, ArkError | ArkErrors>;\ndeclare const isMorphOutKey: \" isMorphOut\";\ninterface Out {\n [isMorphOutKey]: true;\n t: o;\n introspectable: boolean;\n}\ninterface To extends Out {\n introspectable: true;\n}\ntype InferredMorph = (In: i) => o;\ndeclare const defaultsToKey: \" defaultsTo\";\ntype Default = {\n [defaultsToKey]: [t, v];\n};\ntype withDefault = t extends InferredMorph ? addDefaultToMorph : Default, v>;\ntype addDefaultToMorph = [\n normalizeMorphDistribution\n] extends [InferredMorph] ? (In: Default) => o : never;\ntype normalizeMorphDistribution ? i : never, undistributedOut extends Out = t extends InferredMorph ? [\n o\n] extends [To] ? To : o : never> = (Extract extends anyOrNever ? never : Extract extends InferredMorph ? [\n undistributedOut\n] extends [o] ? (In: undistributedIn) => undistributedOut : [undistributedIn] extends [i] ? (In: undistributedIn) => undistributedOut : t : never) | Exclude extends infer _ ? _ : never;\ntype defaultFor = (Primitive extends t ? Primitive : t extends Primitive ? t : never) | (() => t);\ntype inferIntersection = normalizeMorphDistribution<_inferIntersection>;\ntype inferMorph = morph extends type.cast ? inferPipe : inferMorphOut extends infer out ? (In: distill.In) => Out : never;\ntype inferPipe = normalizeMorphDistribution<_inferIntersection>;\ntype _inferIntersection = [\n l & r\n] extends [infer t extends anyOrNever] ? t : l extends InferredMorph ? r extends InferredMorph ? piped extends true ? (In: lIn) => rOut : never : piped extends true ? (In: lIn) => To : (In: _inferIntersection) => lOut : r extends InferredMorph ? (In: _inferIntersection) => rOut : [l, r] extends [object, object] ? intersectObjects extends infer result ? result : never : l & r;\ninterface MorphableIntersection extends Hkt<[unknown, unknown]> {\n body: _inferIntersection;\n}\ntype intersectObjects = l extends array ? r extends array ? intersectArrays> : // for an intersection with exactly one array operand like { name: string } & string[],\nl & r : r extends array ? l & r : keyof l & keyof r extends never ? show : show<{\n [k in keyof l]: k extends keyof r ? _inferIntersection : l[k];\n} & {\n [k in keyof r]: k extends keyof l ? _inferIntersection : r[k];\n}>;\n\nexport { Ark, ArkAmbient, type ArkConfig, type Type$1 as BaseType, BoundModule, Generic, type KeywordConfig, Module, type Out, Scope, type Submodule, Type, ark, type bindThis, configure, declare, define, distill, fn, generic, type inferDefinition, keywords, match, scope, type, type validateDefinition };\n\n}" +export const typeDts = "declare module \"arktype\" {\n import * as _ark_schema from '@ark/schema';\nimport { BaseRoot, BaseParseContext, TypeMeta, arkKind, GenericAst, GenericParamAst, writeUnsatisfiedParameterConstraintMessage, GenericRoot, genericParamNames, resolvableReferenceIn, writeUnresolvableMessage, writeNonSubmoduleDotMessage, emptyBrandNameMessage, writeUnboundableMessage, writeUnassignableDefaultValueMessage, writeIndivisibleMessage, writeNonStructuralOperandMessage, PrivateDeclaration, writeMissingSubmoduleAccessMessage, writeInvalidPropertyKeyMessage, UndeclaredKeyBehavior, Sequence, postfixAfterOptionalOrDefaultableMessage, BaseMappedPropInner, OptionalMappedPropInner, Prop, InclusiveNumericRangeSchema, ExclusiveNumericRangeSchema, ExactLength, InclusiveDateRangeSchema, ExclusiveDateRangeSchema, Divisor, Pattern, Morph, ToJsonSchema, JsonSchema, NodeSelector, Predicate, BaseNode, Disjoint, StandardSchemaV1, ArkErrors, unwrapDefault, RootSchema, BaseParseOptions, ArkSchemaScopeConfig, exportedNameOf, toInternalScope, NodeKind, RootKind, NodeSchema, nodeOfKind, reducibleKindOf, PreparsedNodeResolution, writeDuplicateAliasError, BaseScope, AliasDefEntry, GenericParamDef, BaseParseContextInput, flatResolutionsOf, LazyGenericBody, RootModule, ArkError } from '@ark/schema';\nexport { ArkError, ArkErrors, ArkSchemaConfig, ArkSchemaScopeConfig, JsonSchema, Traversal, TraversalError } from '@ark/schema';\nimport * as util from '@ark/util';\nimport { Scanner, requireKeys, ErrorMessage, Completion, writeUnmatchedGroupCloseMessage, writeUnclosedGroupMessage, defined, anyOrNever, Stringifiable, Hkt, array, typeToString, arkKeyOf, NumberLiteral, join, lastOf, BigintLiteral, WhitespaceChar, trim as trim$1, writeMalformedNumericLiteralMessage, show, merge, Key, Backslash, ErrorType, satisfy, conform, arkIndexableOf, arkGet, toArkKey, listable, intersectUnion, inferred, optionalKeyOf, JsonStructure, Callable, unset, numericStringKeyOf, isDisjoint, unionToTuple, propValueOf, Constructor, get, Fn, applyElementLabels, flattenListable, Brand, noSuggest, ifEmptyObjectLiteral, Primitive, objectKindOrDomainOf, requiredKeyOf, equals, Json, omit, pick, Digit, liftArray, EcmascriptObjects, PlatformObjects, isSafelyMappable, intersectArrays, unionKeyOf } from '@ark/util';\nexport { Hkt, ParseError, inferred } from '@ark/util';\nimport { regex, Regex } from 'arkregex';\nexport { regex } from 'arkregex';\nimport { ArkSchemaConfig } from '@ark/schema/config';\n\ntype StringifiablePrefixOperator = \"keyof\";\ndeclare const minComparators: {\n readonly \">\": true;\n readonly \">=\": true;\n};\ntype MinComparator = keyof typeof minComparators;\ndeclare const maxComparators: {\n readonly \"<\": true;\n readonly \"<=\": true;\n};\ntype MaxComparator = keyof typeof maxComparators;\ndeclare const comparators: {\n \">\": boolean;\n \">=\": boolean;\n \"<\": boolean;\n \"<=\": boolean;\n \"==\": boolean;\n};\ntype Comparator = keyof typeof comparators;\ntype InvertedComparators = {\n \"<\": \">\";\n \">\": \"<\";\n \"<=\": \">=\";\n \">=\": \"<=\";\n \"==\": \"==\";\n};\ntype BranchOperator = \"&\" | \"|\" | \"|>\";\ntype OpenLeftBound = {\n limit: LimitLiteral;\n comparator: MinComparator;\n};\ndeclare const writeOpenRangeMessage: (min: min, comparator: comparator) => writeOpenRangeMessage;\ntype writeOpenRangeMessage = `Left bounds are only valid when paired with right bounds (try ...${comparator}${min})`;\ntype writeUnpairableComparatorMessage = `Left-bounded expressions must specify their limits using < or <= (was ${comparator})`;\ndeclare const writeUnpairableComparatorMessage: (comparator: comparator) => writeUnpairableComparatorMessage;\ndeclare const writeMultipleLeftBoundsMessage: (openLimit: openLimit, openComparator: openComparator, limit: limit, comparator: comparator) => writeMultipleLeftBoundsMessage;\ntype writeMultipleLeftBoundsMessage = `An expression may have at most one left bound (parsed ${openLimit}${InvertedComparators[openComparator]}, ${limit}${InvertedComparators[comparator]})`;\n\ndeclare const terminatingChars: {\n readonly \" \": 1;\n readonly \"\\n\": 1;\n readonly \"\\t\": 1;\n readonly \"<\": 1;\n readonly \">\": 1;\n readonly \"=\": 1;\n readonly \"|\": 1;\n readonly \"&\": 1;\n readonly \")\": 1;\n readonly \"[\": 1;\n readonly \"%\": 1;\n readonly \",\": 1;\n readonly \":\": 1;\n readonly \"?\": 1;\n readonly \"#\": 1;\n};\ntype TerminatingChar = keyof typeof terminatingChars;\ndeclare const finalizingLookaheads: {\n readonly \">\": 1;\n readonly \",\": 1;\n readonly \"\": 1;\n readonly \"=\": 1;\n readonly \"?\": 1;\n};\ntype FinalizingLookahead = keyof typeof finalizingLookaheads;\ndeclare const lookaheadIsFinalizing: (lookahead: string, unscanned: string) => lookahead is \">\" | \",\" | \"=\" | \"?\";\ntype lookaheadIsFinalizing = lookahead extends \">\" ? unscanned extends `=${infer nextUnscanned}` ? nextUnscanned extends `=${string}` ? true : false : Scanner.skipWhitespace extends (\"\" | `${TerminatingChar}${string}`) ? true : false : lookahead extends \"=\" ? unscanned extends `=${string}` ? false : true : lookahead extends \",\" | \"?\" ? true : false;\ntype InfixToken = Comparator | \"|\" | \"&\" | \"%\" | \":\" | \"=>\" | \"|>\" | \"#\" | \"@\" | \"=\";\ntype PostfixToken = \"[]\" | \"?\";\n\ntype BranchState$1 = {\n prefixes: StringifiablePrefixOperator[];\n leftBound: OpenLeftBound | null;\n intersection: BaseRoot | null;\n union: BaseRoot | null;\n pipe: BaseRoot | null;\n};\ntype RootedRuntimeState = requireKeys;\ndeclare class RuntimeState {\n root: BaseRoot | undefined;\n branches: BranchState$1;\n finalizer: FinalizingLookahead | undefined;\n groups: BranchState$1[];\n scanner: Scanner;\n ctx: BaseParseContext;\n constructor(scanner: Scanner, ctx: BaseParseContext);\n error(message: string): never;\n hasRoot(): this is RootedRuntimeState;\n setRoot(root: BaseRoot): void;\n unsetRoot(): this[\"root\"];\n constrainRoot(...args: Parameters[\"constrain\"]>): void;\n finalize(finalizer: FinalizingLookahead): void;\n reduceLeftBound(limit: LimitLiteral, comparator: Comparator): void;\n finalizeBranches(): void;\n finalizeGroup(): void;\n addPrefix(prefix: StringifiablePrefixOperator): void;\n applyPrefixes(): void;\n pushRootToBranch(token: BranchOperator): void;\n parseUntilFinalizer(): RootedRuntimeState;\n parseOperator(this: RootedRuntimeState): void;\n parseOperand(): void;\n private assertRangeUnset;\n reduceGroupOpen(): void;\n previousOperator(): MinComparator | StringifiablePrefixOperator | InfixToken | undefined;\n shiftedBy(count: number): this;\n}\n\ntype StaticState = {\n root: unknown;\n branches: BranchState;\n groups: BranchState[];\n finalizer: FinalizingLookahead | ErrorMessage | undefined;\n scanned: string;\n unscanned: string;\n};\ntype BranchState = {\n prefixes: StringifiablePrefixOperator[];\n leftBound: OpenLeftBound | undefined;\n intersection: unknown;\n pipe: unknown;\n union: unknown;\n};\ndeclare namespace s {\n type initialize = from<{\n root: undefined;\n branches: initialBranches;\n groups: [];\n finalizer: undefined;\n scanned: \"\";\n unscanned: def;\n }>;\n type error = from<{\n root: ErrorMessage;\n branches: initialBranches;\n groups: [];\n finalizer: ErrorMessage;\n scanned: \"\";\n unscanned: \"\";\n }>;\n type completion = from<{\n root: Completion;\n branches: initialBranches;\n groups: [];\n finalizer: Completion;\n scanned: \"\";\n unscanned: \"\";\n }>;\n type initialBranches = branchesFrom<{\n prefixes: [];\n leftBound: undefined;\n intersection: undefined;\n pipe: undefined;\n union: undefined;\n }>;\n type updateScanned = previousUnscanned extends `${infer justScanned}${updatedUnscanned}` ? `${previousScanned}${justScanned}` : previousScanned;\n type setRoot = from<{\n root: root;\n branches: s[\"branches\"];\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type addPrefix = from<{\n root: s[\"root\"];\n branches: {\n prefixes: [...s[\"branches\"][\"prefixes\"], prefix];\n leftBound: s[\"branches\"][\"leftBound\"];\n intersection: s[\"branches\"][\"intersection\"];\n pipe: s[\"branches\"][\"pipe\"];\n union: s[\"branches\"][\"union\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type reduceBranch = s[\"branches\"][\"leftBound\"] extends {} ? openRangeError : from<{\n root: undefined;\n branches: {\n prefixes: [];\n leftBound: undefined;\n intersection: token extends \"&\" ? mergeToIntersection : undefined;\n union: token extends \"|\" ? mergeToUnion : token extends \"|>\" ? undefined : s[\"branches\"][\"union\"];\n pipe: token extends \"|>\" ? mergeToPipe : s[\"branches\"][\"pipe\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type reduceLeftBound = comparator extends \"<\" | \"<=\" ? s[\"branches\"][\"leftBound\"] extends {} ? s.error> : from<{\n root: undefined;\n branches: {\n prefixes: s[\"branches\"][\"prefixes\"];\n leftBound: {\n limit: limit;\n comparator: InvertedComparators[comparator];\n };\n intersection: s[\"branches\"][\"intersection\"];\n pipe: s[\"branches\"][\"pipe\"];\n union: s[\"branches\"][\"union\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }> : s.error>;\n type reduceRange = s.from<{\n root: [minLimit, minComparator, [s[\"root\"], maxComparator, maxLimit]];\n branches: {\n prefixes: s[\"branches\"][\"prefixes\"];\n leftBound: undefined;\n intersection: s[\"branches\"][\"intersection\"];\n pipe: s[\"branches\"][\"pipe\"];\n union: s[\"branches\"][\"union\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type reduceSingleBound = s.from<{\n root: [s[\"root\"], comparator, limit];\n branches: {\n prefixes: s[\"branches\"][\"prefixes\"];\n leftBound: undefined;\n intersection: s[\"branches\"][\"intersection\"];\n pipe: s[\"branches\"][\"pipe\"];\n union: s[\"branches\"][\"union\"];\n };\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type mergeToIntersection = s[\"branches\"][\"intersection\"] extends undefined ? mergePrefixes : [s[\"branches\"][\"intersection\"], \"&\", mergePrefixes];\n type mergeToUnion = s[\"branches\"][\"union\"] extends undefined ? mergeToIntersection : [s[\"branches\"][\"union\"], \"|\", mergeToIntersection];\n type mergeToPipe = s[\"branches\"][\"pipe\"] extends undefined ? mergeToUnion : [s[\"branches\"][\"pipe\"], \"|>\", mergeToUnion];\n type mergePrefixes = remaining extends [infer head, ...infer tail] ? [\n head,\n mergePrefixes\n ] : s[\"root\"];\n type popGroup = [\n ...stack,\n top\n ];\n type finalizeGroup = s[\"branches\"][\"leftBound\"] extends {} ? openRangeError : s[\"groups\"] extends popGroup ? from<{\n groups: stack;\n branches: top;\n root: mergeToPipe;\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }> : s.error>;\n type reduceGroupOpen = from<{\n groups: [...s[\"groups\"], s[\"branches\"]];\n branches: initialBranches;\n root: undefined;\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type finalize = s[\"groups\"] extends [] ? s[\"branches\"][\"leftBound\"] extends {} ? openRangeError : from<{\n root: mergeToPipe;\n groups: s[\"groups\"];\n branches: initialBranches;\n finalizer: finalizer;\n scanned: s[\"scanned\"];\n unscanned: s[\"unscanned\"];\n }> : s.error>;\n type openRangeError> = s.error>;\n type previousOperator = s[\"branches\"][\"leftBound\"] extends {} ? s[\"branches\"][\"leftBound\"][\"comparator\"] : s[\"branches\"][\"prefixes\"] extends ([\n ...unknown[],\n infer tail extends string\n ]) ? tail : s[\"branches\"][\"intersection\"] extends {} ? \"&\" : s[\"branches\"][\"union\"] extends {} ? \"|\" : undefined;\n type scanTo = from<{\n root: s[\"root\"];\n branches: s[\"branches\"];\n groups: s[\"groups\"];\n finalizer: s[\"finalizer\"];\n scanned: updateScanned;\n unscanned: unscanned;\n }>;\n type from = s;\n type branchesFrom = b;\n}\n\ntype KeywordConfig = {\n [k in keyof Ark.flat as parseConfigurableFlatAlias]?: TypeMeta.Collapsible;\n};\ntype parseConfigurableFlatAlias = [\n v\n] extends [anyOrNever] ? k : v extends {\n [arkKind]: \"generic\" | \"module\";\n} ? never : k extends `${infer prefix}.root` ? prefix : k;\ninterface ArkConfig extends ArkSchemaConfig {\n keywords?: KeywordConfig;\n}\ndeclare const configure: (config: config) => config;\ndeclare global {\n export interface ArkEnv {\n $(): Ark;\n }\n}\n/**\n * This mirrors the global ArkEnv namespace as a local export. We use it instead\n * of the global internally due to a bug in twoslash that prevents `ark/docs`\n * from building if we refer to the global directly.\n *\n * If, in the future, docs can build while arktype refers to `ArkEnv.$` directly,\n * this can be removed.\n */\ndeclare namespace ArkAmbient {\n type $ = ReturnType;\n type meta = ArkEnv.meta;\n type prototypes = ArkEnv.prototypes;\n}\n\ntype astToString = ast extends InferredAst | DefAst ? ast[2] : ast extends PostfixExpression ? operator extends \"[]\" ? `${astToString}[]` : never : ast extends InfixExpression ? operator extends \"&\" | \"|\" | \"%\" | Comparator ? `${astToString} ${operator} ${astToString}` : never : ast extends Stringifiable ? `${ast extends bigint ? `${ast}n` : ast}` : \"...\";\ntype writeConstrainedMorphMessage = `To constrain the output of ${astToString}, pipe like myMorph.to('number > 0').\nTo constrain the input, intersect like myMorph.and('number > 0').`;\n\ntype GenericInstantiationAst = [generic, \"<>\", argAsts];\ntype inferGenericInstantiation = g[\"bodyDef\"] extends Hkt ? Hkt.apply;\n}> : inferDefinition, {\n [i in keyof g[\"names\"] & `${number}` as g[\"names\"][i]]: inferExpression, args>;\n}>;\ntype validateGenericInstantiation = validateGenericArgs;\ntype validateGenericArgs, argAsts extends array, $, args, indices extends 1[]> = argAsts extends readonly [infer arg, ...infer argsTail] ? validateAst extends infer e extends ErrorMessage ? e : inferAstRoot extends params[indices[\"length\"]][1] ? validateGenericArgs : ErrorMessage, astToString>> : undefined;\ntype resolveScope = g$ extends UnparsedScope ? $ : g$;\n\ntype inferAstRoot = ast extends array ? inferExpression : never;\ntype inferAstIn = distill.In>;\ntype DefAst = [\n def,\n \"def\",\n alias\n];\ntype InferredAst = [\n t,\n \"inferred\",\n def\n];\ntype inferExpression = ast extends array ? ast extends InferredAst ? resolution : ast extends DefAst ? inferDefinition : ast extends GenericInstantiationAst ? inferGenericInstantiation : ast[1] extends \"[]\" ? inferExpression[] : ast[1] extends \"|\" ? inferExpression | inferExpression : ast[1] extends \"&\" ? inferIntersection, inferExpression> : ast[1] extends \"|>\" ? inferPipe, inferExpression> : ast[1] extends \"=\" ? type.infer extends infer defaultValue ? withDefault, defaultValue> : never : ast[1] extends \"#\" ? type.brand, ast[2]> : ast[1] extends Comparator ? ast[0] extends LimitLiteral ? inferExpression : inferExpression : ast[1] extends \"%\" ? inferExpression : ast[1] extends \"?\" ? inferExpression : ast[0] extends \"keyof\" ? arkKeyOf> : never : never;\ntype PostfixExpression = readonly [operand, operator];\ntype InfixExpression = [l, operator, r];\n\ntype StringLiteral = DoubleQuotedStringLiteral | SingleQuotedStringLiteral;\ntype DoubleQuotedStringLiteral = `\"${contents}\"`;\ntype SingleQuotedStringLiteral = `'${contents}'`;\ndeclare const parseEnclosed: (s: RuntimeState, enclosing: EnclosingStartToken) => void;\ntype parseEnclosed = Scanner.shiftUntilEscapable extends Scanner.shiftResult ? _parseEnclosed : never;\ntype _parseEnclosed = nextUnscanned extends \"\" ? s.error> : enclosingStart extends EnclosingQuote ? s.setRoot, nextUnscanned extends Scanner.shift ? unscanned : \"\"> : enclosingStart extends EnclosingRegexToken ? regex.parse extends infer r ? r extends Regex ? s.setRoot Out, def>, nextUnscanned extends Scanner.shift ? unscanned : \"\"> : r extends ErrorMessage ? s.error : never : never : s.setRoot, nextUnscanned extends Scanner.shift ? unscanned : \"\">;\ndeclare const enclosingQuote: {\n readonly \"'\": 1;\n readonly '\"': 1;\n};\ntype EnclosingQuote = keyof typeof enclosingQuote;\ndeclare const enclosingLiteralTokens: {\n readonly \"d'\": \"'\";\n readonly 'd\"': \"\\\"\";\n readonly \"'\": \"'\";\n readonly '\"': \"\\\"\";\n};\ntype EnclosingLiteralTokens = typeof enclosingLiteralTokens;\ntype EnclosingLiteralStartToken = keyof EnclosingLiteralTokens;\ndeclare const enclosingRegexTokens: {\n readonly \"/\": \"/\";\n readonly \"x/\": \"/\";\n};\ntype EnclosingRegexTokens = typeof enclosingRegexTokens;\ntype EnclosingRegexToken = keyof EnclosingRegexTokens;\ndeclare const enclosingTokens: {\n readonly \"/\": \"/\";\n readonly \"x/\": \"/\";\n readonly \"d'\": \"'\";\n readonly 'd\"': \"\\\"\";\n readonly \"'\": \"'\";\n readonly '\"': \"\\\"\";\n};\ntype EnclosingTokens = typeof enclosingTokens;\ntype EnclosingStartToken = keyof EnclosingTokens;\ndeclare const enclosingCharDescriptions: {\n readonly '\"': \"double-quote\";\n readonly \"'\": \"single-quote\";\n readonly \"/\": \"forward slash\";\n};\ntype enclosingCharDescriptions = typeof enclosingCharDescriptions;\ndeclare const writeUnterminatedEnclosedMessage: (fragment: fragment, enclosingStart: enclosingStart) => writeUnterminatedEnclosedMessage;\ntype writeUnterminatedEnclosedMessage = `${enclosingStart}${fragment} requires a closing ${enclosingCharDescriptions[EnclosingTokens[enclosingStart]]}`;\n\ndeclare const parseUnenclosed: (s: RuntimeState) => void;\ntype parseUnenclosed = Scanner.shiftUntil extends (Scanner.shiftResult) ? tryResolve extends s.from ? s : never : never;\ntype parseResolution = resolutionToAst extends infer ast ? ast extends GenericAst ? parseGenericInstantiation, $, args> : s.setRoot : never;\ndeclare const parseGenericInstantiation: (name: string, g: GenericRoot, s: RuntimeState) => BaseRoot;\ntype parseGenericInstantiation = Scanner.skipWhitespace extends `<${infer unscanned}` ? parseGenericArgs extends infer result ? result extends ParsedArgs ? s.setRoot, nextUnscanned> : result : never : s.error, [\n]>>;\ntype tryResolve = token extends keyof args ? parseResolution : token extends keyof $ ? parseResolution : token extends keyof ArkAmbient.$ ? parseResolution : `#${token}` extends keyof $ ? parseResolution : token extends NumberLiteral ? s.setRoot, unscanned> : token extends (`${infer submodule extends keyof $ & string}.${infer reference}`) ? tryResolveSubmodule : token extends (`${infer submodule extends keyof ArkAmbient.$ & string}.${infer reference}`) ? tryResolveSubmodule : token extends BigintLiteral ? s.setRoot, unscanned> : token extends \"keyof\" ? s.addPrefix : unresolvableState;\ntype tryResolveSubmodule = resolution extends {\n [arkKind]: \"module\";\n} ? reference extends keyof resolution ? parseResolution : reference extends (`${infer nestedSubmodule extends keyof resolution & string}.${infer nestedReference}`) ? tryResolveSubmodule : unresolvableState : s.error>>;\n/** Provide valid completions for the current token, or fallback to an\n * unresolvable error if there are none */\ntype unresolvableState = [\n token,\n s[\"unscanned\"]\n] extends [\"\", Scanner.shift<\"#\", infer unscanned>] ? Scanner.shiftUntil extends (Scanner.shiftResult) ? s.error> : never : validReferenceFromToken extends (never) ? s.error>> : s.completion<`${s[\"scanned\"]}${qualifiedReference, submodulePath>}`>;\ntype qualifiedReference = join<[...submodulePath, reference], \".\">;\ntype validReferenceFromToken = Extract : resolvableReferenceIn<$>, `${token}${string}`>;\ntype writeMissingRightOperandMessage = `Token '${token}' requires a right operand${unscanned extends \"\" ? \"\" : ` before '${unscanned}'`}`;\ndeclare const writeMissingRightOperandMessage: (token: token, unscanned?: unscanned) => writeMissingRightOperandMessage;\n\ndeclare const parseOperand: (s: RuntimeState) => void;\ntype parseOperand = s[\"unscanned\"] extends Scanner.shift ? lookahead extends \"(\" ? s.reduceGroupOpen : lookahead extends EnclosingStartToken ? parseEnclosed : lookahead extends WhitespaceChar ? parseOperand, $, args> : lookahead extends \"d\" ? unscanned extends (Scanner.shift) ? parseEnclosed : parseUnenclosed : lookahead extends \"x\" ? unscanned extends Scanner.shift<\"/\", infer nextUnscanned> ? parseEnclosed : parseUnenclosed : parseUnenclosed : s.completion<`${s[\"scanned\"]}${BaseCompletions<$, args>}`>;\n\ntype UnitLiteralKeyword = \"null\" | \"undefined\" | \"true\" | \"false\";\ntype UnitLiteral = UnenclosedUnitLiteral | EnclosedUnitLiteral;\ntype UnenclosedUnitLiteral = BigintLiteral | NumberLiteral | UnitLiteralKeyword;\ntype EnclosedUnitLiteral = StringLiteral | DateLiteral;\ntype ParsedDefaultableProperty = readonly [BaseRoot, \"=\", unknown];\ndeclare const parseDefault: (s: RootedRuntimeState) => ParsedDefaultableProperty;\ntype parseDefault = trim$1 extends infer defaultExpression extends string ? defaultExpression extends UnenclosedUnitLiteral ? [\n root,\n \"=\",\n defaultExpression\n] : defaultExpression extends (`${infer start extends EnclosingLiteralStartToken}${string}`) ? defaultExpression extends `${start}${infer nextUnscanned}` ? isValidEnclosedLiteral extends true ? [\n root,\n \"=\",\n defaultExpression\n] : ErrorMessage> : never : ErrorMessage> : never;\ntype isValidEnclosedLiteral = Scanner.shiftUntilEscapable extends Scanner.shiftResult ? nextUnscanned extends EnclosingLiteralTokens[start] ? true : false : false;\ndeclare const writeNonLiteralDefaultMessage: (defaultDef: defaultDef) => writeNonLiteralDefaultMessage;\ntype writeNonLiteralDefaultMessage = `Default value '${defaultDef}' must be a literal value`;\n\ndeclare const parseBound: (s: RootedRuntimeState, start: ComparatorStartChar) => void;\ntype parseBound = shiftComparator extends infer shiftResultOrError ? shiftResultOrError extends (Scanner.shiftResult) ? s[\"root\"] extends (InferredAst) ? s.reduceLeftBound : parseRightBound, comparator, $, args> : shiftResultOrError : never;\ntype OneCharComparator = \">\" | \"<\";\ntype ComparatorStartChar = Comparator extends `${infer char}${string}` ? char : never;\ndeclare const shiftComparator: (s: RuntimeState, start: ComparatorStartChar) => Comparator;\ntype shiftComparator = unscanned extends `=${infer nextUnscanned}` ? [`${start}=`, nextUnscanned] : [start & OneCharComparator, unscanned];\ndeclare const parseRightBound: (s: RootedRuntimeState, comparator: Comparator) => void;\ntype parseRightBound = parseOperand extends infer nextState extends StaticState ? nextState[\"root\"] extends (InferredAst) ? s[\"branches\"][\"leftBound\"] extends {} ? comparator extends MaxComparator ? s.reduceRange : s.error> : s.reduceSingleBound : s.error, \"right\">> : never;\ndeclare const writeInvalidLimitMessage: (comparator: comparator, limit: limit, boundKind: boundKind) => writeInvalidLimitMessage;\ntype writeInvalidLimitMessage = `Comparator ${boundKind extends \"left\" ? InvertedComparators[comparator] : comparator} must be ${boundKind extends \"left\" ? \"preceded\" : \"followed\"} by a corresponding literal (was ${limit})`;\ntype BoundExpressionKind = \"left\" | \"right\";\n\ndeclare const parseBrand: (s: RootedRuntimeState) => void;\ntype parseBrand = Scanner.shiftUntil, TerminatingChar> extends Scanner.shiftResult<`${infer brandName}`, infer nextUnscanned> ? brandName extends \"\" ? s.error : s.setRoot : never;\n\ndeclare const parseDivisor: (s: RootedRuntimeState) => void;\ntype parseDivisor = Scanner.shiftUntil, TerminatingChar> extends Scanner.shiftResult ? scanned extends `${infer divisor extends number}` ? divisor extends 0 ? s.error> : s.setRoot : s.error> : never;\ndeclare const writeInvalidDivisorMessage: (divisor: divisor) => writeInvalidDivisorMessage;\ntype writeInvalidDivisorMessage = `% operator must be followed by a non-zero integer literal (was ${divisor})`;\n\ndeclare const parseOperator: (s: RootedRuntimeState) => void;\ntype parseOperator = s[\"unscanned\"] extends Scanner.shift ? lookahead extends \"[\" ? unscanned extends Scanner.shift<\"]\", infer nextUnscanned> ? s.setRoot : s.error : lookahead extends \"|\" ? unscanned extends Scanner.shift<\">\", infer nextUnscanned> ? s.reduceBranch\", nextUnscanned> : s.reduceBranch : lookahead extends \"&\" ? s.reduceBranch : lookahead extends \")\" ? s.finalizeGroup : lookaheadIsFinalizing extends true ? s.finalize, lookahead & FinalizingLookahead> : lookahead extends ComparatorStartChar ? parseBound : lookahead extends \"%\" ? parseDivisor : lookahead extends \"#\" ? parseBrand : lookahead extends WhitespaceChar ? parseOperator, $, args> : s.error> : s.finalize;\ndeclare const writeUnexpectedCharacterMessage: (char: char, shouldBe?: shouldBe) => writeUnexpectedCharacterMessage;\ntype writeUnexpectedCharacterMessage = `'${char}' is not allowed here${shouldBe extends \"\" ? \"\" : ` (should be ${shouldBe})`}`;\ndeclare const incompleteArrayTokenMessage = \"Missing expected ']'\";\ntype incompleteArrayTokenMessage = typeof incompleteArrayTokenMessage;\n\ndeclare const parseString: (def: string, ctx: BaseParseContext) => InnerParseResult;\n/**\n * Try to parse the definition from right to left using the most common syntax.\n * This can be much more efficient for simple definitions.\n */\ntype parseString = def extends keyof $ ? resolutionToAst : def extends `${infer child}[]` ? child extends keyof $ ? [\n resolutionToAst,\n \"[]\"\n] : fullStringParse, $, args> : fullStringParse, $, args>;\ntype inferString = inferAstRoot, $, args>;\ntype BaseCompletions<$, args, otherSuggestions extends string = never> = resolvableReferenceIn<$> | resolvableReferenceIn | (keyof args & string) | StringifiablePrefixOperator | otherSuggestions;\ndeclare const fullStringParse: (s: RuntimeState) => InnerParseResult;\ntype fullStringParse = extractFinalizedResult>;\ndeclare const parseUntilFinalizer: (s: RuntimeState) => RootedRuntimeState;\ntype parseUntilFinalizer = s[\"finalizer\"] extends undefined ? parseUntilFinalizer, $, args> : s;\ndeclare const next: (s: RuntimeState) => void;\ntype next = s[\"root\"] extends undefined ? parseOperand : parseOperator;\ntype extractFinalizedResult = s[\"finalizer\"] extends \"\" ? s[\"root\"] : s[\"finalizer\"] extends ErrorMessage ? s[\"finalizer\"] : s[\"finalizer\"] extends \"?\" ? [s[\"root\"], \"?\"] : s[\"finalizer\"] extends \"=\" ? parseDefault : ErrorMessage>;\n\ndeclare const parseGenericArgs: (name: string, g: GenericRoot, s: RuntimeState) => BaseRoot[];\ntype parseGenericArgs = _parseGenericArgs;\ntype ParsedArgs = {\n result: result;\n unscanned: unscanned;\n};\ndeclare const _parseGenericArgs: (name: string, g: GenericRoot, s: RuntimeState, argNodes: BaseRoot[]) => BaseRoot[];\ntype _parseGenericArgs = parseUntilFinalizer, $, args> extends (infer finalArgState extends StaticState) ? {\n defs: [\n ...argDefs,\n finalArgState[\"scanned\"] extends `${infer def}${\",\" | \">\"}` ? def : finalArgState[\"scanned\"]\n ];\n asts: [...argAsts, finalArgState[\"root\"]];\n unscanned: finalArgState[\"unscanned\"];\n} extends ({\n defs: infer nextDefs extends string[];\n asts: infer nextAsts extends unknown[];\n unscanned: infer nextUnscanned extends string;\n}) ? finalArgState[\"finalizer\"] extends \">\" ? nextAsts[\"length\"] extends g[\"paramsAst\"][\"length\"] ? ParsedArgs : s.error, nextDefs>> : finalArgState[\"finalizer\"] extends \",\" ? _parseGenericArgs : finalArgState[\"finalizer\"] extends ErrorMessage ? finalArgState : s.error\">> : never : never;\ndeclare const writeInvalidGenericArgCountMessage: , argDefs extends array>(name: name, params: params, argDefs: argDefs) => writeInvalidGenericArgCountMessage;\ntype writeInvalidGenericArgCountMessage, argDefs extends array> = `${name}<${join}> requires exactly ${params[\"length\"]} args (got ${argDefs[\"length\"]}${argDefs[\"length\"] extends (0) ? \"\" : `: ${join}`})`;\n\ntype validateRange = [\n l\n] extends [LimitLiteral] ? validateBound : [l] extends [[infer leftAst, Comparator, unknown]] ? ErrorMessage>> : validateBound;\ntype validateBound = inferAstRoot extends infer bounded ? isNumericallyBoundable extends true ? limit extends number ? validateAst : ErrorMessage> : [bounded] extends [Date] ? validateAst : [bounded] extends [InferredMorph] ? ErrorMessage> : ErrorMessage>> : never;\ntype isNumericallyBoundable = [\n bounded\n] extends [number] ? true : [bounded] extends [string] ? true : [bounded] extends [array] ? true : false;\ndeclare const writeDoubleRightBoundMessage: (root: root) => writeDoubleRightBoundMessage;\ntype writeDoubleRightBoundMessage = `Expression ${root} must have at most one right bound`;\n\ntype validateDefault = validateAst extends infer e extends ErrorMessage ? e : type.infer extends inferAstIn ? undefined : ErrorMessage, unitLiteral>>;\n\ntype validateDivisor = inferAstRoot extends infer data ? [\n data\n] extends [number] ? validateAst : [data] extends [InferredMorph] ? ErrorMessage> : ErrorMessage> : never;\n\ntype validateKeyof = inferAstRoot extends infer data ? [\n data\n] extends [object] ? validateAst : ErrorMessage>> : never;\n\ntype validateAst = ast extends ErrorMessage ? ast : ast extends InferredAst ? validateInferredAst : ast extends DefAst ? ast[2] extends PrivateDeclaration ? ErrorMessage> : undefined : ast extends PostfixExpression<\"[]\" | \"?\", infer operand> ? validateAst : ast extends InfixExpression ? operator extends BranchOperator ? validateInfix : operator extends Comparator ? validateRange : operator extends \"%\" ? validateDivisor : operator extends \"=\" ? validateDefault : operator extends \"#\" ? validateAst : ErrorMessage>> : ast extends [\"keyof\", infer operand] ? validateKeyof : ast extends GenericInstantiationAst ? validateGenericInstantiation : ErrorMessage>> & {\n ast: ast;\n};\ntype writeUnexpectedExpressionMessage = `Failed to parse the expression resulting from ${expression}`;\ndeclare const writePrefixedPrivateReferenceMessage: (name: name) => writePrefixedPrivateReferenceMessage;\ntype writePrefixedPrivateReferenceMessage = `Private type references should not include '#'. Use '${name}' instead.`;\ntype validateInferredAst = def extends NumberLiteral ? number extends inferred ? ErrorMessage> : undefined : def extends BigintLiteral ? bigint extends inferred ? ErrorMessage> : undefined : [inferred] extends [anyOrNever] ? undefined : def extends PrivateDeclaration ? ErrorMessage> : inferred extends Generic ? ErrorMessage> : inferred extends {\n [arkKind]: \"module\";\n} ? \"root\" extends keyof inferred ? undefined : ErrorMessage> : def extends ErrorMessage ? def : undefined;\ntype validateString = parseString extends infer ast ? validateAst extends infer result extends ErrorMessage ? result extends Completion ? text : result : def : never;\ntype validateInfix = validateAst extends infer e extends ErrorMessage ? e : validateAst extends infer e extends ErrorMessage ? e : undefined;\ndeclare const shallowOptionalMessage = \"Optional definitions like 'string?' are only valid as properties in an object or tuple\";\ntype shallowOptionalMessage = typeof shallowOptionalMessage;\ndeclare const shallowDefaultableMessage = \"Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple\";\ntype shallowDefaultableMessage = typeof shallowDefaultableMessage;\n\ntype inferObjectLiteral = show<\"...\" extends keyof def ? merge, _inferObjectLiteral> : _inferObjectLiteral>;\n/**\n * Infers the contents of an object literal, ignoring a spread definition\n */\ntype _inferObjectLiteral = {\n -readonly [k in keyof def as nonOptionalKeyFromEntry]: inferDefinition;\n} & {\n -readonly [k in keyof def as optionalKeyFromEntry]?: def[k] extends OptionalPropertyDefinition ? inferDefinition : inferDefinition;\n};\ntype validateObjectLiteral = {\n [k in keyof def]: preparseKey extends (infer parsedKey extends PreparsedKey) ? parsedKey extends PreparsedEntryKey<\"index\"> ? validateString extends (ErrorMessage) ? ErrorType : inferDefinition extends Key ? validateProperty : ErrorMessage> : validateProperty : never;\n};\ntype nonOptionalKeyFromEntry = preparseKey extends infer parsedKey ? parsedKey extends PreparsedEntryKey<\"required\"> ? [\n v\n] extends [OptionalPropertyDefinition] ? [\n v\n] extends [anyOrNever] ? parsedKey[\"normalized\"] : never : parsedKey[\"normalized\"] : parsedKey extends PreparsedEntryKey<\"index\"> ? inferDefinition & Key : never : never;\ntype optionalKeyFromEntry = preparseKey extends infer parsedKey ? parsedKey extends PreparsedEntryKey<\"optional\"> ? parsedKey[\"normalized\"] : v extends OptionalPropertyDefinition ? k : never : never;\ntype normalizedKeyKind = kind extends \"index\" ? string : Key;\ntype PreparsedEntryKey = normalizedKeyKind> = {\n kind: kind;\n normalized: normalized;\n};\ntype PreparsedSpecialKey = {\n kind: kind;\n};\ntype PreparsedKey = PreparsedEntryKey | PreparsedSpecialKey;\ndeclare namespace PreparsedKey {\n type from = t;\n}\ntype ParsedKeyKind = EntryKeyKind | SpecialKeyKind;\ntype EntryKeyKind = \"required\" | \"optional\" | \"index\";\ntype SpecialKeyKind = \"spread\" | \"undeclared\";\ntype MetaKey = \"...\" | \"+\";\ntype IndexKey = `[${def}]`;\ndeclare const preparseKey: (key: Key) => PreparsedKey;\ntype preparseKey = k extends symbol ? PreparsedKey.from<{\n kind: \"required\";\n normalized: k;\n}> : k extends `${infer inner}?` ? inner extends `${infer baseName}${Backslash}` ? PreparsedKey.from<{\n kind: \"required\";\n normalized: `${baseName}?`;\n}> : PreparsedKey.from<{\n kind: \"optional\";\n normalized: inner;\n}> : k extends \"+\" ? {\n kind: \"undeclared\";\n} : k extends \"...\" ? {\n kind: \"spread\";\n} : k extends `${Backslash}${infer escapedMeta extends MetaKey}` ? PreparsedKey.from<{\n kind: \"required\";\n normalized: escapedMeta;\n}> : k extends IndexKey ? PreparsedKey.from<{\n kind: \"index\";\n normalized: def;\n}> : PreparsedKey.from<{\n kind: \"required\";\n normalized: k extends (`${Backslash}${infer escapedIndexKey extends IndexKey}`) ? escapedIndexKey : k extends Key ? k : `${k & number}`;\n}>;\ndeclare const writeInvalidSpreadTypeMessage: (def: def) => writeInvalidSpreadTypeMessage;\ntype writeInvalidSpreadTypeMessage = `Spread operand must resolve to an object literal type (was ${def})`;\n\ntype ParsedOptionalProperty = readonly [BaseRoot, \"?\"];\ntype validateProperty = [\n def\n] extends [anyOrNever] ? \n/** this extra [anyOrNever] check is required to ensure that nested `type` invocations\n * like the following are not prematurely validated by the outer call:\n *\n * ```ts\n * type({\n * \t\"test?\": type(\"string\").pipe(x => x === \"true\")\n * })\n * ```\n */\ndef : keyKind extends \"spread\" ? def extends validateInnerDefinition ? inferDefinition extends object ? def : ErrorType>>> : validateInnerDefinition : keyKind extends \"undeclared\" ? UndeclaredKeyBehavior : keyKind extends \"required\" ? validateInnerDefinition : def extends OptionalPropertyDefinition ? ErrorMessage : isDefaultable extends true ? ErrorMessage : validateInnerDefinition;\ntype isDefaultable = def extends DefaultablePropertyTuple ? true : def extends PossibleDefaultableStringDefinition ? parseString extends DefaultablePropertyTuple ? true : false : false;\ntype OptionalPropertyDefinition = OptionalPropertyTuple | OptionalPropertyString;\ntype OptionalPropertyString = `${baseDef}?`;\ntype OptionalPropertyTuple = readonly [baseDef, \"?\"];\ntype PossibleDefaultableStringDefinition = `${string}=${string}`;\ntype DefaultablePropertyTuple = readonly [baseDef, \"=\", thunkableProperty];\ndeclare const invalidOptionalKeyKindMessage = \"Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }\";\ntype invalidOptionalKeyKindMessage = typeof invalidOptionalKeyKindMessage;\ndeclare const invalidDefaultableKeyKindMessage = \"Only required keys may specify default values, e.g. { value: 'number = 0' }\";\ntype invalidDefaultableKeyKindMessage = typeof invalidDefaultableKeyKindMessage;\n\ntype validateTupleLiteral = parseSequence extends infer s extends SequenceParseState ? Readonly : never;\ntype inferTupleLiteral = parseSequence extends infer s extends SequenceParseState ? s[\"inferred\"] : never;\ntype SequencePhase = satisfy;\ndeclare namespace SequencePhase {\n type prefix = \"prefix\";\n type optionals = \"optionals\";\n type defaultables = \"defaultables\";\n type postfix = \"postfix\";\n}\ntype SequenceParseState = {\n unscanned: array;\n inferred: array;\n validated: array;\n phase: SequencePhase;\n};\ntype parseSequence = parseNextElement<{\n unscanned: def;\n inferred: [];\n validated: [];\n phase: SequencePhase.prefix;\n}, $, args>;\ntype PreparsedElementKind = \"required\" | SequencePhase.optionals | SequencePhase.defaultables;\ntype PreparsedElement = {\n head: unknown;\n tail: array;\n inferred: unknown;\n validated: unknown;\n kind: PreparsedElementKind;\n spread: boolean;\n};\ndeclare namespace PreparsedElement {\n type from = result;\n type required = \"required\";\n type optionals = \"optionals\";\n type defaultables = \"defaultables\";\n}\ntype preparseNextState = s[\"unscanned\"] extends readonly [\"...\", infer head, ...infer tail] ? preparseNextElement : s[\"unscanned\"] extends readonly [infer head, ...infer tail] ? preparseNextElement : null;\ntype preparseNextElement = PreparsedElement.from<{\n head: head;\n tail: tail;\n inferred: inferDefinition;\n validated: validateInnerDefinition;\n kind: head extends OptionalPropertyDefinition ? PreparsedElement.optionals : head extends DefaultablePropertyTuple ? PreparsedElement.defaultables : isDefaultable extends true ? PreparsedElement.defaultables : PreparsedElement.required;\n spread: spread;\n}>;\ntype parseNextElement = preparseNextState extends infer next extends PreparsedElement ? parseNextElement<{\n unscanned: next[\"tail\"];\n inferred: nextInferred;\n validated: nextValidated;\n phase: next[\"kind\"] extends (SequencePhase.optionals | SequencePhase.defaultables) ? next[\"kind\"] : number extends nextInferred[\"length\"] ? s[\"phase\"] : SequencePhase.prefix;\n}, $, args> : s;\ntype nextInferred = next[\"spread\"] extends true ? [\n ...s[\"inferred\"],\n ...conform\n] : next[\"kind\"] extends SequencePhase.optionals ? [\n ...s[\"inferred\"],\n next[\"inferred\"]?\n] : [...s[\"inferred\"], next[\"inferred\"]];\ntype nextValidated = [\n ...s[\"validated\"],\n ...nextValidatedSpreadOperatorIfPresent,\n nextValidatedElement\n];\ntype nextValidatedSpreadOperatorIfPresent = next[\"spread\"] extends true ? [\n next[\"inferred\"] extends infer spreadOperand extends array ? [\n number,\n number\n ] extends ([\n s[\"inferred\"][\"length\"],\n spreadOperand[\"length\"]\n ]) ? ErrorMessage : \"...\" : ErrorMessage>\n] : [];\ntype nextValidatedElement = next[\"kind\"] extends SequencePhase.optionals ? next[\"spread\"] extends true ? ErrorMessage : s[\"phase\"] extends SequencePhase.postfix ? ErrorMessage : next[\"validated\"] : next[\"kind\"] extends SequencePhase.defaultables ? next[\"spread\"] extends true ? ErrorMessage : s[\"phase\"] extends SequencePhase.optionals ? ErrorMessage : s[\"phase\"] extends SequencePhase.postfix ? ErrorMessage : next[\"validated\"] : [s[\"phase\"], next[\"spread\"]] extends ([\n SequencePhase.optionals | SequencePhase.defaultables,\n false\n]) ? ErrorMessage : next[\"validated\"];\ndeclare const writeNonArraySpreadMessage: (operand: operand) => writeNonArraySpreadMessage;\ntype writeNonArraySpreadMessage = `Spread element must be an array${operand extends string ? ` (was ${operand})` : \"\"}`;\ndeclare const multipleVariadicMesage = \"A tuple may have at most one variadic element\";\ntype multipleVariadicMessage = typeof multipleVariadicMesage;\ndeclare const optionalOrDefaultableAfterVariadicMessage = \"An optional element may not follow a variadic element\";\ntype optionalOrDefaultableAfterVariadicMessage = typeof optionalOrDefaultableAfterVariadicMessage;\ndeclare const spreadOptionalMessage = \"A spread element cannot be optional\";\ntype spreadOptionalMessage = typeof spreadOptionalMessage;\ndeclare const spreadDefaultableMessage = \"A spread element cannot have a default\";\ntype spreadDefaultableMessage = typeof spreadDefaultableMessage;\ndeclare const defaultablePostOptionalMessage = \"A defaultable element may not follow an optional element without a default\";\ntype defaultablePostOptionalMessage = typeof defaultablePostOptionalMessage;\n\n/** @ts-ignore cast variance */\ninterface Type$6 extends Type$1 {\n readonly(): t extends array ? Type$5<{\n readonly [i in keyof t]: t[i];\n }, $> : Type$6<{\n readonly [k in keyof t]: t[k];\n }, $>;\n keyof(): instantiateType, $>;\n /**\n * Get the `Type` of a property of this `Type`.\n * @example type({ foo: \"string\" }).get(\"foo\") // Type\n */\n get, r = instantiateType, $>>(k1: k1 | type.cast): r extends infer _ ? _ : never;\n get, const k2 extends arkIndexableOf>, r = instantiateType, k2>, $>>(k1: k1 | type.cast, k2: k2 | type.cast): r extends infer _ ? _ : never;\n get, const k2 extends arkIndexableOf>, const k3 extends arkIndexableOf, k2>>, r = instantiateType, k2>, k3>, $>>(k1: k1 | type.cast, k2: k2 | type.cast, k3: k3 | type.cast): r extends infer _ ? _ : never;\n /**\n * Create a copy of this `Type` with only the specified properties.\n * @example type({ foo: \"string\", bar: \"number\" }).pick(\"foo\") // Type<{ foo: string }>\n */\n pick = never>(...keys: (key | type.cast)[]): Type$6<{\n [k in keyof t as Extract, key>]: t[k];\n }, $>;\n /**\n * Create a copy of this `Type` with all properties except the specified ones.\n * @example type({ foo: \"string\", bar: \"number\" }).omit(\"foo\") // Type<{ bar: number }>\n */\n omit = never>(...keys: (key | type.cast)[]): Type$6<{\n [k in keyof t as Exclude, key>]: t[k];\n }, $>;\n /**\n * Merge another `Type` definition, overriding properties of this `Type` with the duplicate keys.\n * @example type({ a: \"1\", b: \"2\" }).merge({ b: \"3\", c: \"4\" }) // Type<{ a: 1, b: 3, c: 4 }>\n */\n merge, r = Type$6, $>>(def: type.validate & (inferredDef extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredDef]>)): r extends infer _ ? _ : never;\n /**\n * Create a copy of this `Type` with all properties required.\n * @example const T = type({ \"foo?\"\": \"string\" }).required() // Type<{ foo: string }>\n */\n required(): Type$6<{\n [k in keyof t]-?: t[k];\n }, $>;\n /**\n * Create a copy of this `Type` with all properties optional.\n * @example: const T = type({ foo: \"string\" }).optional() // Type<{ foo?: string }>\n */\n partial(): Type$6<{\n [k in keyof t]?: t[k];\n }, $>;\n map, r = Type$6, $>>(flatMapEntry: (entry: typePropOf) => transformed): r extends infer _ ? _ : never;\n /**\n * List of property info of this `Type`.\n * @example type({ foo: \"string = \"\" }).props // [{ kind: \"required\", key: \"foo\", value: Type, default: \"\" }]\n */\n props: array>;\n}\ntype typePropOf = keyof o extends infer k ? k extends keyof o ? typeProp : never : never;\ntype typeProp = t extends Default ? DefaultedTypeProp : BaseTypeProp ? \"optional\" : \"required\", k & Key, t, $>;\ninterface BaseTypeProp {\n kind: kind;\n key: k;\n value: instantiateType;\n meta: ArkEnv.meta;\n toJSON: () => JsonStructure;\n}\ninterface DefaultedTypeProp extends BaseTypeProp<\"optional\", k, v, $> {\n default: defaultValue;\n}\ntype MappedTypeProp = BaseMappedTypeProp | OptionalMappedTypeProp;\ntype BaseMappedTypeProp = merge;\n}>;\ntype OptionalMappedTypeProp = merge;\n default?: v;\n}>;\ntype constructMapped> = show>>;\ntype fromTypeProps> = show<{\n [prop in props[number] as Extract, {\n kind: \"required\";\n }>[\"key\"]]: prop[\"value\"][inferred];\n} & {\n [prop in props[number] as Extract, {\n kind: \"optional\";\n default?: never;\n }>[\"key\"]]?: prop[\"value\"][inferred];\n} & {\n [prop in props[number] as Extract, {\n kind: \"optional\";\n default: unknown;\n }>[\"key\"]]: withDefault;\n}>;\ntype NonObjectMergeErrorMessage = \"Merged type must be an object\";\ntype applyHomomorphicOptionality = prop[\"kind\"] extends string ? prop : prop & {\n kind: prop[\"key\"] extends optionalKeyOf ? \"optional\" : \"required\";\n};\n\ninterface Type$5<\n/** @ts-ignore cast variance */\nout t extends readonly unknown[] = readonly unknown[], $ = {}> extends Type$6 {\n atLeastLength(schema: InclusiveNumericRangeSchema): this;\n atMostLength(schema: InclusiveNumericRangeSchema): this;\n moreThanLength(schema: ExclusiveNumericRangeSchema): this;\n lessThanLength(schema: ExclusiveNumericRangeSchema): this;\n exactlyLength(schema: ExactLength.Schema): this;\n}\n\n/** @ts-ignore cast variance */\ninterface Type$4 extends Type$6 {\n atOrAfter(schema: InclusiveDateRangeSchema): this;\n atOrBefore(schema: InclusiveDateRangeSchema): this;\n laterThan(schema: ExclusiveDateRangeSchema): this;\n earlierThan(schema: ExclusiveDateRangeSchema): this;\n}\n\n/** @ts-ignore cast variance */\ninterface Type$3 extends Type$1 {\n divisibleBy(schema: Divisor.Schema): this;\n atLeast(schema: InclusiveNumericRangeSchema): this;\n atMost(schema: InclusiveNumericRangeSchema): this;\n moreThan(schema: ExclusiveNumericRangeSchema): this;\n lessThan(schema: ExclusiveNumericRangeSchema): this;\n}\n\n/** @ts-ignore cast variance */\ninterface Type$2 extends Type$1 {\n matching(schema: schema): schema extends string ? Type$2, $> : schema extends {\n rule: infer pattern extends string;\n } ? Type$2, $> : this;\n atLeastLength(schema: InclusiveNumericRangeSchema): this;\n atMostLength(schema: InclusiveNumericRangeSchema): this;\n moreThanLength(schema: ExclusiveNumericRangeSchema): this;\n lessThanLength(schema: ExclusiveNumericRangeSchema): this;\n exactlyLength(schema: ExactLength.Schema): this;\n}\n\ntype instantiateType = [\n t\n] extends [anyOrNever] ? Type$1 : [t] extends [object] ? [\n t\n] extends [array] ? Type$5 : [t] extends [Date] ? Type$4 : Type$6 : [t] extends [string] ? Type$2 : [t] extends [number] ? Type$3 : Type$1;\n\ntype NaryUnionParser<$> = {\n (): Type;\n , $>>(a: type.validate): r extends infer _ ? _ : never;\n | type.infer, $>>(a: type.validate, b: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate, p: type.validate): r extends infer _ ? _ : never;\n | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer | type.infer, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate, p: type.validate, q: type.validate): r extends infer _ ? _ : never;\n , $>>(...defs: {\n [i in keyof defs]: type.validate;\n }): r extends infer _ ? _ : never;\n};\ntype NaryIntersectionParser<$> = {\n (): Type;\n , $>>(a: type.validate): r extends infer _ ? _ : never;\n , type.infer>, $>>(a: type.validate, b: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate, p: type.validate): r extends infer _ ? _ : never;\n ,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer,\n type.infer\n ]>, $>>(a: type.validate, b: type.validate, c: type.validate, d: type.validate, e: type.validate, f: type.validate, g: type.validate, h: type.validate, i: type.validate, j: type.validate, k: type.validate, l: type.validate, m: type.validate, n: type.validate, o: type.validate, p: type.validate, q: type.validate): r extends infer _ ? _ : never;\n ;\n }>, $>>(...defs: {\n [i in keyof defs]: type.validate;\n }): r extends infer _ ? _ : never;\n};\ntype NaryMergeParser<$> = {\n (): Type;\n , r = Type>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, inferredN = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>), n: type.validate & (inferredN extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredN]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, inferredN = type.infer, inferredO = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>), n: type.validate & (inferredN extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredN]>), o: type.validate & (inferredO extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredO]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, inferredN = type.infer, inferredO = type.infer, inferredP = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>), n: type.validate & (inferredN extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredN]>), o: type.validate & (inferredO extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredO]>), p: type.validate & (inferredP extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredP]>)): r extends infer _ ? _ : never;\n , inferredB = type.infer, inferredC = type.infer, inferredD = type.infer, inferredE = type.infer, inferredF = type.infer, inferredG = type.infer, inferredH = type.infer, inferredI = type.infer, inferredJ = type.infer, inferredK = type.infer, inferredL = type.infer, inferredM = type.infer, inferredN = type.infer, inferredO = type.infer, inferredP = type.infer, inferredQ = type.infer, r = Type, $>>(a: type.validate & (inferredA extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredA]>), b: type.validate & (inferredB extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredB]>), c: type.validate & (inferredC extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredC]>), d: type.validate & (inferredD extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredD]>), e: type.validate & (inferredE extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredE]>), f: type.validate & (inferredF extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredF]>), g: type.validate & (inferredG extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredG]>), h: type.validate & (inferredH extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredH]>), i: type.validate & (inferredI extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredI]>), j: type.validate & (inferredJ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredJ]>), k: type.validate & (inferredK extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredK]>), l: type.validate & (inferredL extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredL]>), m: type.validate & (inferredM extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredM]>), n: type.validate & (inferredN extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredN]>), o: type.validate & (inferredO extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredO]>), p: type.validate & (inferredP extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredP]>), q: type.validate & (inferredQ extends object ? unknown : ErrorType<[NonObjectMergeErrorMessage, actual: inferredQ]>)): r extends infer _ ? _ : never;\n ;\n }>, $>>(...defs: {\n [i in keyof defs]: type.validate & (type.infer extends object ? unknown : ErrorType<[\n NonObjectMergeErrorMessage,\n actual: type.infer\n ]>);\n }): r extends infer _ ? _ : never;\n};\ntype NaryPipeParser<$, initial = unknown> = {\n (): Type;\n >, r = instantiateType, $>>(a: a): r extends infer _ ? _ : never;\n >, b extends Morph>, r = instantiateType, a, b]>, $>>(a: a, b: b): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, r = instantiateType, a, b, c]>, $>>(a: a, b: b, c: c): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, r = instantiateType, a, b, c, d]>, $>>(a: a, b: b, c: c, d: d): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, r = instantiateType, a, b, c, d, e]>, $>>(a: a, b: b, c: c, d: d, e: e): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, r = instantiateType, a, b, c, d, e, f]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, r = instantiateType, a, b, c, d, e, f, g]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j, k]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j, k, l]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j, k, l, m]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, n extends Morph>, r = instantiateType, a, b, c, d, e, f, g, h, i, j, k, l, m, n]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, n extends Morph>, o extends Morph>, r = instantiateType,\n a,\n b,\n c,\n d,\n e,\n f,\n g,\n h,\n i,\n j,\n k,\n l,\n m,\n n,\n o\n ]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, n extends Morph>, o extends Morph>, p extends Morph>, r = instantiateType,\n a,\n b,\n c,\n d,\n e,\n f,\n g,\n h,\n i,\n j,\n k,\n l,\n m,\n n,\n o,\n p\n ]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o, p: p): r extends infer _ ? _ : never;\n >, b extends Morph>, c extends Morph>, d extends Morph>, e extends Morph>, f extends Morph>, g extends Morph>, h extends Morph>, i extends Morph>, j extends Morph>, k extends Morph>, l extends Morph>, m extends Morph>, n extends Morph>, o extends Morph>, p extends Morph>, q extends Morph>, r = instantiateType,\n a,\n b,\n c,\n d,\n e,\n f,\n g,\n h,\n i,\n j,\n k,\n l,\n m,\n n,\n o,\n p,\n q\n ]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o, p: p, q: q): r extends infer _ ? _ : never;\n , $>>(...defs: morphs): r extends infer _ ? _ : never;\n};\n\n/** @ts-ignore cast variance */\ninterface Inferred {\n internal: BaseRoot;\n [inferred]: t;\n /**\n * precompiled JS used to optimize validation\n *\n * ⚠️ will be `undefined` in [jitless](https://arktype.io/docs/configuration#jitless) mode\n */\n precompilation: string | undefined;\n /**\n * generic parameter representing this Type\n *\n * @typeonly\n *\n * ⚠️ May contain types representing morphs or default values that would\n * be inaccurate if used directly for runtime values. In those cases,\n * you should use {@link infer} or {@link inferIn} on this object instead.\n */\n t: t;\n /**\n * #### {@link Scope} in which chained methods are parsed\n */\n $: Scope<$>;\n /**\n * #### type of output this returns\n *\n * @typeonly\n *\n * @example\n * const parseNumber = type(\"string\").pipe(s => Number.parseInt(s))\n * type ParsedNumber = typeof parseNumber.infer // number\n */\n infer: this[\"inferOut\"];\n /**\n * type of output this returns\n *\n * 🔗 alias of {@link infer}\n * @typeonly\n *\n *\n * @example\n * const parseNumber = type(\"string\").pipe(s => Number.parseInt(s))\n * type ParsedNumber = typeof parseNumber.infer // number\n */\n inferOut: distill.Out;\n /**\n * type of output that can be introspected at runtime (e.g. via {@link out})\n *\n * ⚠️ If your Type contains morphs, they will be inferred as `unknown` unless\n * they are an ArkType keyword or have an explicitly defined output validator.\n *\n * @typeonly\n *\n * @example\n * const Unmorphed = type(\"string\")\n * // with no morphs, we can introspect the input and output as a single Type\n * type UnmorphedOut = typeof Unmorphed.inferIntrospectableOut // string\n *\n * const Morphed = type(\"string\").pipe(s => s.length)\n * // with a standard user-defined morph, TypeScript can infer a\n * // return type from your function, but we have no way to\n * // know the shape at runtime\n * type MorphOut = typeof Morphed.inferIntrospectableOut // unknown\n *\n * const Validated = type(\"string\").pipe(s => s.length).to(\"number\")\n * // morphs with validated output, including all morph keywords, are introspectable\n * type ValidatedMorphOut = typeof Validated.inferIntrospectableOut\n */\n inferIntrospectableOut: distill.introspectable.Out;\n /**\n * #### type of input this allows\n *\n * @typeonly\n *\n * @example\n * const parseNumber = type(\"string\").pipe(s => Number.parseInt(s))\n * type UnparsedNumber = typeof parseNumber.inferIn // string\n */\n inferIn: distill.In;\n /**\n * #### internal JSON representation\n */\n json: JsonStructure;\n /**\n * alias of {@link json} for `JSON.stringify` compatibility\n */\n toJSON(): JsonStructure;\n /**\n * #### generate a JSON Schema\n *\n * @throws {ToJsonSchema.Error} if this cannot be converted to JSON Schema\n */\n toJsonSchema(options?: ToJsonSchema.Options): JsonSchema;\n /**\n * #### metadata like custom descriptions and error messages\n *\n * ✅ type {@link https://arktype.io/docs/configuration#custom | can be customized} for your project\n */\n meta: ArkAmbient.meta;\n /**\n * #### human-readable English description\n *\n * ✅ works best for primitive values\n *\n * @example\n * const N = type(\"0 < number <= 100\")\n * console.log(N.description) // positive and at most 100\n */\n description: string;\n /**\n * #### syntax string similar to native TypeScript\n *\n * ✅ works well for both primitives and structures\n *\n * @example\n * const Loc = type({ coords: [\"number\", \"number\"] })\n * console.log(Loc.expression) // { coords: [number, number] }\n */\n expression: string;\n /**\n * #### validate and return transformed data or throw\n *\n * ✅ sugar to avoid checking for {@link type.errors} if they are unrecoverable\n *\n * @example\n * const CriticalPayload = type({\n * superImportantValue: \"string\"\n * })\n * // throws TraversalError: superImportantValue must be a string (was missing)\n * const data = CriticalPayload.assert({ irrelevantValue: \"whoops\" })\n * console.log(data.superImportantValue) // valid output can be accessed directly\n *\n * @throws {TraversalError}\n */\n assert: (data: unknown) => this[\"infer\"];\n /**\n * #### check input without applying morphs\n *\n * ✅ good for stuff like filtering that doesn't benefit from detailed errors\n *\n * @example\n * const Numeric = type(\"number | bigint\")\n * // [0, 2n]\n * const numerics = [0, \"one\", 2n].filter(Numeric.allows)\n */\n allows: (data: unknown) => data is this[\"inferIn\"];\n /**\n * #### add metadata to shallow references\n *\n * ⚠️ does not affect error messages within properties of an object\n *\n * @example\n * const NotOdd = type(\"number % 2\").configure({ description: \"not odd\" })\n * // all constraints at the root are affected\n * const odd = NotOdd(3) // must be not odd (was 3)\n * const nonNumber = NotOdd(\"two\") // must be not odd (was \"two\")\n *\n * const NotOddBox = type({\n * // we should have referenced notOdd or added meta here\n * notOdd: \"number % 2\",\n * // but instead chained from the root object\n * }).configure({ description: \"not odd\" })\n * // error message at path notOdd is not affected\n * const oddProp = NotOddBox({ notOdd: 3 }) // notOdd must be even (was 3)\n * // error message at root is affected, leading to a misleading description\n * const nonObject = NotOddBox(null) // must be not odd (was null)\n */\n configure: NodeSelector.SelectableFn;\n /**\n * #### add description to shallow references\n *\n * 🔗 equivalent to `.configure({ description })` (see {@link configure})\n * ⚠️ does not affect error messages within properties of an object\n *\n * @example\n * const AToZ = type(/^a.*z$/).describe(\"a string like 'a...z'\")\n * const good = AToZ(\"alcatraz\") // \"alcatraz\"\n * // ArkErrors: must be a string like 'a...z' (was \"albatross\")\n * const badPattern = AToZ(\"albatross\")\n */\n describe: NodeSelector.SelectableFn;\n /**\n * #### apply undeclared key behavior\n *\n * {@inheritDoc UndeclaredKeyBehavior}\n */\n onUndeclaredKey(behavior: UndeclaredKeyBehavior): this;\n /**\n * #### deeply apply undeclared key behavior\n *\n * {@inheritDoc UndeclaredKeyBehavior}\n **/\n onDeepUndeclaredKey(behavior: UndeclaredKeyBehavior): this;\n /**\n * #### alias for {@link assert} with typed input\n *\n * @example\n * const T = type({ foo: \"string\" });\n * // TypeScript: foo must be a string (was 5)\n * const data = T.from({ foo: 5 });\n */\n from(literal: this[\"inferIn\"]): this[\"infer\"];\n /**\n * #### deeply extract inputs\n *\n * ✅ will never include morphs\n * ✅ good for generating JSON Schema or other non-transforming formats\n *\n * @example\n * const User = type({\n * age: \"string.numeric.parse\"\n * })\n * // { age: 25 } (age parsed to a number)\n * const out = User({ age: \"25\" })\n * // { age: \"25\" } (age is still a string)\n * const inOut = User.in({ age: \"25\" })\n */\n get in(): instantiateType;\n /**\n * #### deeply extract outputs\n *\n * ✅ will never include morphs\n * ⚠️ if your type includes morphs, their output will likely be unknown unless they\n * were defined with an explicit output validator via `.to(outputDef)` or `.pipe(morph, outputType)`\n *\n * @example\n * const join = type(\"string[]\").pipe(a => a.join(\",\"))\n *\n * const T = type({\n * // all keywords have introspectable output\n * keyword: \"string.numeric.parse\",\n * // TypeScript knows this returns a string, but we can't introspect that at runtime\n * unvalidated: join,\n * // if needed, it can be made introspectable with an output validator\n * validated: join.to(\"string\")\n * })\n *\n * // Type<{ keyword: number; unvalidated: unknown; validated: string }>\n * const baseOut = base.out\n */\n get out(): instantiateType;\n /**\n * #### add a compile-time brand to output\n *\n * @typenoop\n *\n * @example\n * const Palindrome = type(\"string\")\n * .narrow(s => s === [...s].reverse().join(\"\"))\n * .brand(\"palindrome\")\n * // Brand\n * const out = Palindrome.assert(\"racecar\")\n */\n brand, $>>(name: name): r extends infer _ ? _ : never;\n /**\n * #### an array of this\n *\n * @example\n * // Type<{ rebmun: number }[]>\n * const T = type({ rebmun: \"number\" }).array();\n */\n array(): Type$5;\n /**\n * #### {@link https://arktype.io/docs/objects#properties-optional | optional definition}\n *\n * @chainedDefinition\n *\n * @example\n * const Prop = type({ foo: \"number\" })\n * // Type<{ bar?: { foo: number } }>\n * const Obj = type({ bar: Prop.optional() })\n */\n optional(): [this, \"?\"];\n /**\n * #### {@link https://arktype.io/docs/objects#properties-defaultable | defaultable definition}\n *\n * ✅ object defaults can be returned from a function\n * ⚠️ throws if the default value is not allowed\n * @chainedDefinition\n *\n * @example\n * // Type<{ count: Default }>\n * const State = type({ count: type.number.default(0) })\n * const Prop = type({ nested: \"boolean\" })\n * const ForObj = type({\n * key: Prop.default(() => ({ nested: false }))\n * })\n */\n default>(value: value): [this, \"=\", value];\n /**\n * #### apply a predicate function to input\n *\n * ⚠️ the behavior of {@link narrow}, this method's output counterpart, is usually more desirable\n * ✅ most useful for morphs with input types that are re-used externally\n * @predicateCast\n *\n * @example\n * const stringifyUser = type({ name: \"string\" }).pipe(user => JSON.stringify(user))\n * const stringifySafe = stringifyUser.filter(user => user.name !== \"Bobby Tables\")\n * // Type<(In: `${string}Z`) => To>\n * const WithPredicate = type(\"string.date.parse\").filter((s): s is `${string}Z` =>\n * s.endsWith(\"Z\")\n * )\n */\n filter ? (In: narrowed) => o : narrowed, $>>(predicate: Predicate.Castable): r extends infer _ ? _ : never;\n /**\n * #### apply a predicate function to output\n *\n * ✅ go-to fallback for validation not composable via built-in types and operators\n * ✅ runs after all other validators and morphs, if present\n * @predicateCast\n *\n * @example\n * const Palindrome = type(\"string\").narrow(s => s === [...s].reverse().join(\"\"))\n *\n * const PalindromicEmail = type(\"string.date.parse\").narrow((date, ctx) =>\n *\t\tdate.getFullYear() === 2025 || ctx.mustBe(\"the current year\")\n * )\n * // Type<`${string}.tsx`>\n * const WithPredicate = type(\"string\").narrow((s): s is `${string}.tsx` => /\\.tsx?$/.test(s))\n */\n narrow ? o extends To ? (In: i) => To : (In: i) => Out : narrowed, $>>(predicate: Predicate.Castable): r extends infer _ ? _ : never;\n /**\n * #### pipe output through arbitrary transformations or other Types\n *\n * @example\n * const User = type({ name: \"string\" })\n *\n * // parse a string and validate that the result as a user\n * const parseUser = type(\"string\").pipe(s => JSON.parse(s), user)\n */\n pipe: ChainedPipeParser<$, t>;\n /**\n * #### parse a definition as an output validator\n *\n * 🔗 `to({ name: \"string\" })` is equivalent to `.pipe(type({ name: \"string\" }))`\n *\n * @example\n * // parse a string and validate that the result as a user\n * const parseUser = type(\"string\").pipe(s => JSON.parse(s)).to({ name: \"string\" })\n */\n to>, $>>(def: type.validate): r extends infer _ ? _ : never;\n /**\n * #### query internal node references\n *\n * @experimental filters and returns the Type's internal representation from `@ark/schema`\n *\n * @example\n * // [\"blue\", \"red\"]\n * const values = type(\"'red' | 'blue'\").select(\"unit\").map(u => u.unit)\n */\n select: BaseNode[\"select\"];\n}\n/** @ts-ignore cast variance */\ninterface Type$1 extends Callable<(data: unknown) => distill.Out | ArkEnv.onFail>, Inferred {\n /**\n * #### cast the way this is inferred\n *\n * @typenoop\n *\n * @example\n * // Type<`LEEEEEEEE${string}ROY`>\n * const Leeroy = type(/^LE{8,}ROY$/).as<`LEEEEEEEE${string}ROY`>()\n */\n as(...args: validateChainedAsArgs): instantiateType;\n /**\n * #### intersect the parsed Type, throwing if the result is unsatisfiable\n *\n * @example\n * // Type<{ foo: number; bar: string }>\n * const T = type({ foo: \"number\" }).and({ bar: \"string\" })\n * // ParseError: Intersection at foo of number and string results in an unsatisfiable type\n * const Bad = type({ foo: \"number\" }).and({ foo: \"string\" })\n */\n and>, $>>(def: type.validate): r extends infer _ ? _ : never;\n /**\n * #### union with the parsed Type\n *\n * ⚠️ a union that could apply different morphs to the same data is a ParseError ({@link https://arktype.io/docs/expressions#union-morphs | docs})\n *\n * @example\n * // Type\n * const T = type(\"string\").or({ box: \"string\" })\n */\n or, $>>(def: type.validate): r extends infer _ ? _ : never;\n /**\n * #### intersect the parsed Type, returning an introspectable {@link Disjoint} if the result is unsatisfiable\n *\n * @example\n * // Type<{ foo: number; bar: string }>\n * const T = type({ foo: \"number\" }).intersect({ bar: \"string\" })\n * const Bad = type(\"number > 10\").intersect(\"number < 5\")\n * // logs \"Intersection of > 10 and < 5 results in an unsatisfiable type\"\n * if (Bad instanceof Disjoint) console.log(`${bad.summary}`)\n */\n intersect>, $>>(def: type.validate): r extends infer _ ? _ | Disjoint : never;\n /**\n * #### check if the parsed Type's constraints are identical\n *\n * ✅ equal types have identical input and output constraints and transforms\n * @ignoresMeta\n *\n * @example\n * const DivisibleBy6 = type.number.divisibleBy(6).moreThan(0)\n * // false (left side must also be positive)\n * DivisibleBy6.equals(\"number % 6\")\n * // false (right side has an additional <100 constraint)\n * console.log(DivisibleBy6.equals(\"0 < (number % 6) < 100\"))\n * const ThirdTry = type(\"(number % 2) > 0\").divisibleBy(3)\n * // true (types are normalized and reduced)\n * console.log(DivisibleBy6.equals(ThirdTry))\n */\n equals(def: type.validate): boolean;\n /**\n * #### narrow this based on an {@link equals} check\n *\n * @ignoresMeta\n *\n * @example\n * const N = type.raw(`${Math.random()}`)\n * // Type<0.5> | undefined\n * const Ez = N.ifEquals(\"0.5\")\n */\n ifEquals>(def: type.validate): r extends infer _ ? _ | undefined : never;\n /**\n * #### check if this is a subtype of the parsed Type\n *\n * ✅ a subtype must include all constraints from the base type\n * ✅ unlike {@link equals}, additional constraints may be present\n * @ignoresMeta\n *\n * @example\n * type.string.extends(\"unknown\") // true\n * type.string.extends(/^a.*z$/) // false\n */\n extends(other: type.validate): boolean;\n /**\n * #### narrow this based on an {@link extends} check\n *\n * @ignoresMeta\n *\n * @example\n * const N = type(Math.random() > 0.5 ? \"true\" : \"0\") // Type<0 | true>\n * const Ez = N.ifExtends(\"boolean\") // Type | undefined\n */\n ifExtends>(other: type.validate): r extends infer _ ? _ | undefined : never;\n /**\n * #### check if a value could satisfy this and the parsed Type\n *\n * ⚠️ will return true unless a {@link Disjoint} can be proven\n *\n * @example\n * type.string.overlaps(\"string | number\") // true (e.g. \"foo\")\n * type(\"string | number\").overlaps(\"1\") // true (1)\n * type(\"number > 0\").overlaps(\"number < 0\") // false (no values exist)\n *\n * const NoAt = type(\"string\").narrow(s => !s.includes(\"@\"))\n * NoAt.overlaps(\"string.email\") // true (no values exist, but not provable)\n */\n overlaps(r: type.validate): boolean;\n /**\n * #### extract branches {@link extend}ing the parsed Type\n *\n * @example\n * // Type\n * const T = type(\"boolean | 0 | 'one' | 2 | bigint\").extract(\"number | 0n | true\")\n */\n extract ? t : never, $>>(r: type.validate): r extends infer _ extends r ? _ : never;\n /**\n * #### exclude branches {@link extend}ing the parsed Type\n *\n * @example\n *\n * // Type\n * const T = type(\"boolean | 0 | 'one' | 2 | bigint\").exclude(\"number | 0n | true\")\n */\n exclude ? never : t, $>>(r: type.validate): r extends infer _ ? _ : never;\n /**\n * @experimental\n * Map and optionally reduce branches of a union. Types that are not unions\n * are treated as a single branch.\n *\n * @param mapBranch - the mapping function, accepting a branch Type\n * Returning another `Type` is common, but any value can be returned and\n * inferred as part of the output.\n *\n * @param [reduceMapped] - an operation to perform on the mapped branches\n * Can be used to e.g. merge an array of returned Types representing\n * branches back to a single union.\n */\n distribute(mapBranch: (branch: Type$1, i: number, branches: array) => mapOut, reduceMapped?: (mappedBranches: mapOut[]) => reduceOut): reduceOut;\n /** The Type's [StandardSchema](https://github.com/standard-schema/standard-schema) properties */\n \"~standard\": StandardSchemaV1.ArkTypeProps;\n /** @deprecated */\n apply: Function[\"apply\"];\n /** @deprecated */\n bind: Function[\"bind\"];\n /** @deprecated */\n call: Function[\"call\"];\n /** @deprecated */\n caller: Function;\n /** @deprecated */\n length: number;\n /** @deprecated */\n name: string;\n /** @deprecated */\n prototype: Function[\"prototype\"];\n /** @deprecated */\n arguments: Function[\"arguments\"];\n /** @deprecated */\n Symbol: never;\n}\ninterface ChainedPipeParser<$, t> extends NaryPipeParser<$, t> {\n try: NaryPipeParser<$, t>;\n}\ntype validateChainedAsArgs = [\n t\n] extends [unset] ? [\n t\n] extends [anyOrNever] ? [\n] : [\n ErrorMessage<\"as requires an explicit type parameter like myType.as()\">\n] : [];\n\ntype MatchParserContext = {\n cases: Morph[];\n $: unknown;\n input: input;\n checked: boolean;\n key: PropertyKey | null;\n};\ndeclare namespace ctx {\n type from = ctx;\n type init<$, input = unknown, checked extends boolean = false> = from<{\n cases: [];\n $: $;\n input: input;\n checked: checked;\n key: null;\n }>;\n type atKey = from<{\n cases: ctx[\"cases\"];\n $: ctx[\"$\"];\n input: ctx[\"input\"];\n checked: ctx[\"checked\"];\n key: key;\n }>;\n}\ninterface MatchParser<$> extends CaseMatchParser> {\n in(def: type.validate): ChainableMatchParser, true>>;\n in(...args: [typedInput] extends [never] ? [\n ErrorMessage<\"in requires a definition or type argument (in('string') or in())\">\n ] : []): ChainableMatchParser>;\n in(def: type.validate): ChainableMatchParser, true>>;\n case: CaseParser>;\n at: AtParser>;\n}\ntype addCasesToContext = cases extends Morph[] ? ctx.from<{\n $: ctx[\"$\"];\n input: ctx[\"input\"];\n cases: [...ctx[\"cases\"], ...cases];\n checked: ctx[\"checked\"];\n key: ctx[\"key\"];\n}> : never;\ntype addDefaultToContext> = ctx.from<{\n $: ctx[\"$\"];\n input: defaultCase extends \"never\" ? Morph.In : ctx[\"input\"];\n cases: defaultCase extends \"never\" | \"assert\" ? ctx[\"cases\"] : defaultCase extends Morph ? ctx[\"checked\"] extends true ? [\n (In: unknown) => ArkErrors,\n ...ctx[\"cases\"],\n defaultCase\n ] : [...ctx[\"cases\"], defaultCase] : [\n ...ctx[\"cases\"],\n (In: ctx[\"input\"]) => ArkErrors\n ];\n checked: ctx[\"checked\"];\n key: ctx[\"key\"];\n}>;\ntype CaseKeyKind = \"def\" | \"string\";\ntype casesToMorphTuple = unionToTuple]: cases[def] extends (Morph) ? kind extends \"def\" ? (In: inferCaseArg) => o : (In: maybeLiftToKey) => o : never;\n}>>;\ntype addCasesToParser = cases extends {\n default: infer defaultDef extends DefaultCase;\n} ? finalizeMatchParser>, defaultDef> : ChainableMatchParser>>;\ntype inferCaseArg = _finalizeCaseArg, ctx>, ctx, endpoint>;\ntype maybeLiftToKey = ctx[\"key\"] extends PropertyKey ? {\n [k in ctx[\"key\"]]: t;\n} : t;\ntype _finalizeCaseArg = ctxInput extends unknown ? t extends unknown ? distill extends infer result ? ctxInput extends result ? ctxInput : show : never : never : never;\ntype CaseParser = (def: type.validate, resolve: (In: inferCaseArg) => ret) => ChainableMatchParser) => ret]>>;\ntype validateKey = ctx[\"key\"] extends Key ? ErrorMessage : ctx[\"cases\"][\"length\"] extends 0 ? keyof ctx[\"input\"] extends never ? key : conform : ErrorMessage;\ninterface StringsParser {\n (def: cases extends validateStringCases ? cases : validateStringCases): addCasesToParser;\n}\ntype validateStringCases = unknown extends ctx[\"input\"] ? {\n [k in keyof cases]?: k extends \"default\" ? DefaultCase : (In: _finalizeCaseArg, ctx, \"out\">) => unknown;\n} & {\n default?: DefaultCase;\n} : {\n [k in keyof cases]?: k extends \"default\" ? DefaultCase : k extends stringValue ? (In: _finalizeCaseArg, ctx, \"out\">) => unknown : ErrorType<`${k & string} must be a possible string value`>;\n} & {\n [k in stringValue]?: unknown;\n} & {\n default?: DefaultCase;\n};\ntype stringValue = ctx[\"input\"] extends string ? ctx[\"input\"] : ctx[\"key\"] extends keyof ctx[\"input\"] ? ctx[\"input\"][ctx[\"key\"]] extends infer s extends string ? s : never : never;\ninterface AtParser {\n (key: validateKey): ChainableMatchParser>;\n >(key: validateKey, cases: cases extends validateCases ? cases : errorCases): addCasesToParser;\n}\ninterface ChainableMatchParser {\n case: CaseParser;\n match: CaseMatchParser;\n default: DefaultMethod;\n at: AtParser;\n /** @experimental */\n strings: StringsParser;\n}\ntype DefaultCaseKeyword = \"never\" | \"assert\" | \"reject\";\ntype DefaultCase> = DefaultCaseKeyword | Morph;\ntype DefaultMethod = >(def: def) => finalizeMatchParser;\ntype validateCases = {\n [def in keyof cases | BaseCompletions]?: def extends \"default\" ? DefaultCase : def extends number ? (In: inferCaseArg<`${def}`, ctx, \"out\">) => unknown : def extends type.validate ? (In: inferCaseArg) => unknown : type.validate;\n};\ntype errorCases = {\n [def in keyof cases]?: def extends \"default\" ? DefaultCase : def extends number ? (In: inferCaseArg<`${def}`, ctx, \"out\">) => unknown : def extends type.validate ? (In: inferCaseArg) => unknown : ErrorType>;\n} & {\n [k in BaseCompletions]?: (In: inferCaseArg) => unknown;\n} & {\n default?: DefaultCase;\n};\ntype CaseMatchParser = (def: cases extends validateCases ? cases : errorCases) => addCasesToParser;\ntype finalizeMatchParser> = addDefaultToContext extends (infer ctx extends MatchParserContext) ? Match : never;\ninterface Match extends Inferred<(In: Morph.In) => Out>> {\n (data: data): {\n [i in numericStringKeyOf]: isDisjoint> extends true ? never : Morph.Out;\n }[numericStringKeyOf];\n}\ndeclare class InternalMatchParser extends Callable {\n $: InternalScope;\n constructor($: InternalScope);\n in(def?: unknown): InternalChainedMatchParser;\n at(key: Key, cases?: InternalCases): InternalChainedMatchParser | Match;\n case(when: unknown, then: Morph): InternalChainedMatchParser;\n}\ntype InternalCases = Record;\ntype InternalCaseParserFn = (cases: InternalCases) => InternalChainedMatchParser | Match;\ntype CaseEntry = [BaseRoot, Morph] | [\"default\", DefaultCase];\ndeclare class InternalChainedMatchParser extends Callable {\n $: InternalScope;\n in: BaseRoot | undefined;\n protected key: Key | undefined;\n protected branches: BaseRoot[];\n constructor($: InternalScope, In?: BaseRoot);\n at(key: Key, cases?: InternalCases): InternalChainedMatchParser | Match;\n case(def: unknown, resolver: Morph): InternalChainedMatchParser;\n protected caseEntry(node: BaseRoot, resolver: Morph): InternalChainedMatchParser;\n match(cases: InternalCases): InternalChainedMatchParser | Match;\n strings(cases: InternalCases): InternalChainedMatchParser | Match;\n protected caseEntries(entries: CaseEntry[]): InternalChainedMatchParser | Match;\n default(defaultCase: DefaultCase): Match;\n}\ndeclare const chainedAtMessage = \"A key matcher must be specified before the first case i.e. match.at('foo') or match.in().at('bar')\";\ntype chainedAtMessage = typeof chainedAtMessage;\ndeclare const doubleAtMessage = \"At most one key matcher may be specified per expression\";\ntype doubleAtMessage = typeof doubleAtMessage;\n\ntype maybeValidateTupleExpression = def extends IndexZeroExpression ? validatePrefixExpression : def extends IndexOneExpression ? validateIndexOneExpression : def extends (readonly [\"\", ...unknown[]] | readonly [unknown, \"\", ...unknown[]]) ? readonly [\n def[0] extends \"\" ? BaseCompletions<$, args, IndexZeroOperator | \"...\"> : def[0],\n def[1] extends \"\" ? BaseCompletions<$, args, IndexOneOperator | \"...\"> : def[1]\n] : null;\ntype inferTupleExpression = def[1] extends \"[]\" ? inferDefinition[] : def[1] extends \"?\" ? inferDefinition : def[1] extends \"&\" ? inferIntersection, inferDefinition> : def[1] extends \"|\" ? inferDefinition | inferDefinition : def[1] extends \":\" ? inferPredicate, def[2]> : def[1] extends \"=>\" ? parseMorph : def[1] extends \"|>\" ? parseTo : def[1] extends \"=\" ? withDefault, unwrapDefault> : def[1] extends \"@\" ? inferDefinition : def extends readonly [\"===\", ...infer values] ? values[number] : def extends (readonly [\"instanceof\", ...infer constructors extends Constructor[]]) ? InstanceType : def[0] extends \"keyof\" ? inferKeyOfExpression : never;\ntype validatePrefixExpression = def[\"length\"] extends 1 ? readonly [writeMissingRightOperandMessage] : def[0] extends \"keyof\" ? readonly [def[0], validateDefinition] : def[0] extends \"===\" ? readonly [def[0], ...unknown[]] : def[0] extends \"instanceof\" ? readonly [def[0], ...Constructor[]] : never;\ntype validateIndexOneExpression = def[1] extends TuplePostfixOperator ? readonly [validateDefinition, def[1]] : readonly [\n validateDefinition,\n def[\"length\"] extends 2 ? writeMissingRightOperandMessage : def[1],\n def[1] extends \"|\" ? validateDefinition : def[1] extends \"&\" ? validateDefinition : def[1] extends \":\" ? Predicate> : def[1] extends \"=>\" ? Morph> : def[1] extends \"|>\" ? validateDefinition : def[1] extends \"=\" ? defaultFor> : def[1] extends \"@\" ? TypeMeta.MappableInput : validateDefinition,\n ...(def[1] extends \"@\" ? [NodeSelector?] : [])\n];\ntype inferKeyOfExpression = show>;\ntype TupleExpression = IndexZeroExpression | IndexOneExpression;\ntype ArgTwoOperator = Exclude;\ntype parseTo = inferPipe, inferDefinition>;\ntype parseMorph = morph extends Morph ? inferMorphOut extends infer out ? (In: distill.In>) => Out : never : never;\ntype IndexOneExpression = readonly [unknown, token, ...unknown[]];\ntype IndexOneParser = (def: IndexOneExpression, ctx: BaseParseContext) => BaseRoot;\ndeclare const postfixParsers: {\n \"?\": IndexOneParser<\"?\">;\n \"[]\": IndexOneParser<\"[]\">;\n};\ntype TuplePostfixOperator = keyof typeof postfixParsers;\ndeclare const infixParsers: {\n \"|\": IndexOneParser<\"|\">;\n \"=\": IndexOneParser<\"=\">;\n \"|>\": IndexOneParser<\"|>\">;\n \"&\": IndexOneParser<\"&\">;\n \"=>\": IndexOneParser<\"=>\">;\n \":\": IndexOneParser<\":\">;\n \"@\": IndexOneParser<\"@\">;\n};\ntype TupleInfixOperator = keyof typeof infixParsers;\ndeclare const indexOneParsers: {\n \"|\": IndexOneParser<\"|\">;\n \"=\": IndexOneParser<\"=\">;\n \"|>\": IndexOneParser<\"|>\">;\n \"&\": IndexOneParser<\"&\">;\n \"=>\": IndexOneParser<\"=>\">;\n \":\": IndexOneParser<\":\">;\n \"@\": IndexOneParser<\"@\">;\n \"?\": IndexOneParser<\"?\">;\n \"[]\": IndexOneParser<\"[]\">;\n};\ntype IndexOneOperator = keyof typeof indexOneParsers;\ntype IndexZeroParser = (def: IndexZeroExpression, ctx: BaseParseContext) => BaseRoot;\ntype IndexZeroExpression = readonly [\n token,\n ...unknown[]\n];\ndeclare const indexZeroParsers: {\n keyof: IndexZeroParser<\"keyof\">;\n instanceof: IndexZeroParser<\"instanceof\">;\n \"===\": IndexZeroParser<\"===\">;\n};\ntype IndexZeroOperator = keyof typeof indexZeroParsers;\n\n/** The convenience properties attached to `type` */\ntype TypeParserAttachments = Omit;\ninterface TypeParser<$ = {}> extends Ark.boundTypeAttachments<$> {\n /**\n * Create a {@link Type} from your definition.\n *\n * @example const Person = type({ name: \"string\" })\n */\n >(def: type.validate): r extends infer _ ? _ : never;\n /**\n * Create a {@link Generic} from a parameter string and body definition.\n *\n * @param params A string like \"\" specifying the\n * {@link Generic}'s parameters and any associated constraints via `extends`.\n *\n * @param def The definition for the body of the {@link Generic}. Can reference the\n * parameter names specified in the previous argument in addition to aliases\n * from its {@link Scope}.\n *\n * @example const BoxOf = type(\"\", { contents: \"t\" })\n */\n , def, $>>(params: validateParameterString, def: type.validate>>): r extends infer _ ? _ : never;\n /**\n * Create a {@link Type} from a [tuple expression](http://localhost:3000/docs/expressions)\n * spread as this function's arguments.\n *\n * @example type(\"string\", \"|\", { foo: \"number\" })\n */\n >(_0: zero extends IndexZeroOperator ? zero : type.validate, _1: zero extends \"keyof\" ? type.validate : zero extends \"instanceof\" ? conform : zero extends \"===\" ? conform : conform, ..._2: zero extends \"===\" ? rest : zero extends \"instanceof\" ? conform : one extends TupleInfixOperator ? one extends \":\" ? [Predicate>>] : one extends \"=>\" ? [Morph>, unknown>] : one extends \"|>\" ? [type.validate] : one extends \"@\" ? [TypeMeta.MappableInput, NodeSelector?] : [type.validate] : []): r extends infer _ ? _ : never;\n /**\n * An alias of the {@link ArkErrors} class, an instance of which is returned when a {@link Type}\n * is invoked with invalid input.\n *\n * @example\n * const out = myType(data)\n *\n * if(out instanceof type.errors) console.log(out.summary)\n */\n errors: typeof ArkErrors;\n hkt: typeof Hkt;\n keywords: typeof keywords;\n /**\n * The {@link Scope} in which definitions passed to this function will be parsed.\n */\n $: Scope<$>;\n /**\n * An alias of `type` with no type-level validation or inference.\n *\n * Useful when wrapping `type` or using it to parse a dynamic definition.\n */\n raw(def: unknown): Type$1;\n module: ModuleParser;\n scope: ScopeParser;\n define: DefinitionParser<$>;\n declare: DeclarationParser<$>;\n generic: GenericParser<$>;\n match: MatchParser<$>;\n schema: SchemaParser<$>;\n /**\n * Create a {@link Type} that is satisfied only by a value strictly equal (`===`) to the argument passed to this function.\n * @example const foo = type.unit('foo') // {@link Type}<'foo'>\n * @example const sym: unique symbol = Symbol(); type.unit(sym) // {@link Type}\n */\n unit: UnitTypeParser<$>;\n /**\n * Create a {@link Type} that is satisfied only by a value strictly equal (`===`) to one of the arguments passed to this function.\n * @example const enum = type.enumerated('foo', 'bar', obj) // obj is a by-reference object\n * @example const TupleForm = type(['===', 'foo', 'bar', obj])\n * @example const ArgsForm = type('===', 'foo', 'bar', obj)\n */\n enumerated: EnumeratedTypeParser<$>;\n /**\n * Create a {@link Type} that is satisfied only by one of the Object.values() of the argument passed to this function.\n *\n * ⚠️ For TypeScript enum compatibility, values at numeric keys with corresponding numeric values will not be included.\n * @example const myEnum = type.valueOf(myTsEnum)\n */\n valueOf: ValueOfTypeParser<$>;\n /**\n * Create a {@link Type} that is satisfied only by a value of a specific class.\n * @example const array = type.instanceOf(Array)\n */\n instanceOf: InstanceOfTypeParser<$>;\n /**\n * Create a {@link Type} from a union of definitions\n * @example const T = type.or(\"string\", \"number\")\n */\n or: NaryUnionParser<$>;\n /**\n * Create a {@link Type} from an intersection of definitions\n * @example const T = type.and({ a: \"1\" }, { b: \"2\" })\n */\n and: NaryIntersectionParser<$>;\n /**\n * Create a {@link Type} by merging object definitions, with later\n * definitions having precedence for overlapping keys\n * @example\n * // Type<{ a: \"3\", b: \"2\", c: \"4\" }>\n * const T = type.merge({ a: \"1\", b: \"2\" }, { a: \"3\", c: \"4\" })\n */\n merge: NaryMergeParser<$>;\n /**\n * Create a {@link Type} from a set of morphs (including Types)\n * @example\n * // Type<(In: string) => To>\n * const T = type.pipe(type.string, s => JSON.parse(s), type.object)\n */\n pipe: NaryPipeParser<$>;\n /**\n * Define a validated function\n * @example\n * const len = type.fn(\"string | unknown[]\", \":\", \"number\")(s => s.length)\n * len(\"foo\") // 3\n * // TypeScript: boolean is not assignable to string | unknown[]\n * // Runtime (throws): must be a string or an object (was boolean)\n * len(true)\n */\n fn: FnParser<$>;\n}\ndeclare class InternalTypeParser extends Callable<(...args: unknown[]) => BaseRoot | Generic, TypeParserAttachments> {\n constructor($: InternalScope);\n}\ntype UnitTypeParser<$> = (value: t) => Type;\ntype InstanceOfTypeParser<$> = (ctor: Constructor) => Type;\ntype EnumeratedTypeParser<$> = (...values: values) => Type;\ntype ValueOfTypeParser<$> = (o: o) => Type;\ntype DefinitionParser<$> = (def: type.validate) => def;\ntype SchemaParser<$> = (schema: RootSchema, opts?: BaseParseOptions) => Type;\ntype TypeConstructor = new (def: unknown, $: Scope<$>) => Type;\ntype Type = instantiateType;\ndeclare const Type: TypeConstructor;\n\ntype BaseFnParser<$ = {}> = , returnT = args extends readonly [...unknown[], \":\", infer returnDef] ? type.infer : unknown>(...args: {\n [i in keyof args]: conform, i>>;\n}) => ) => distill.In, externalSignature extends Fn = (...args: applyElementLabels, Parameters>) => args extends readonly [...unknown[], \":\", unknown] ? distill.Out : ReturnType>(implementation: internalSignature) => TypedFn;\ninterface FnParser<$ = {}> extends BaseFnParser<$> {\n /**\n * The {@link Scope} in which definitions passed to this function will be parsed.\n */\n $: Scope<$>;\n /**\n * An alias of `fn` with no type-level validation or inference.\n *\n * Useful when wrapping `fn` or using it to parse a dynamic definition.\n */\n raw: RawFnParser;\n}\ntype RawFnParser = (...args: unknown[]) => (...args: unknown[]) => unknown;\ndeclare class InternalFnParser extends Callable<(...args: unknown[]) => Fn> {\n constructor($: InternalScope);\n}\ndeclare namespace TypedFn {\n type meta = {\n introspectableReturn?: true;\n };\n}\ninterface TypedFn extends Callable {\n expression: string;\n params: signature extends Fn ? Type : never;\n returns: Type : unknown, $>;\n}\ndeclare namespace Return {\n interface introspectable {\n introspectableReturn: true;\n }\n}\ntype validateFnArgs = args extends readonly unknown[] ? args extends readonly [...infer paramDefs, \":\", infer returnDef] ? readonly [\n ...validateFnParamDefs,\n \":\",\n type.validate\n] : validateFnParamDefs : never;\ntype validateFnParamDefs = paramDefs extends validateTupleLiteral ? paramDefs : paramDefs extends {\n [i in keyof paramDefs]: paramDefs[i] extends \"...\" ? paramDefs[i] : validateInnerDefinition;\n} ? validateTupleLiteral : {\n [i in keyof paramDefs]: validateInnerDefinition;\n};\n\ninterface ArkScopeConfig extends ArkSchemaScopeConfig {\n}\ninterface ScopeParser {\n (def: scope.validate, config?: ArkScopeConfig): Scope>;\n define: (def: scope.validate) => def;\n}\ntype ModuleParser = (def: scope.validate, config?: ArkScopeConfig) => scope.infer extends infer $ ? Module<{\n [k in exportedNameOf<$>]: $[k];\n}> : never;\ntype bindThis = {\n this: Def;\n};\n/** nominal type for an unparsed definition used during scope bootstrapping */\ntype Def = Brand;\n/** sentinel indicating a scope that will be associated with a generic has not yet been parsed */\ntype UnparsedScope = \"$\";\n/** These are legal as values of a scope but not as definitions in other contexts */\ntype PreparsedResolution = PreparsedNodeResolution;\ntype bootstrapAliases = {\n [k in Exclude]: def[k] extends (PreparsedResolution) ? def[k] extends {\n t: infer g extends GenericAst;\n } ? g : def[k] extends Module | BoundModule ? Submodule<$> : def[k] : def[k] extends (() => infer thunkReturn extends PreparsedResolution) ? thunkReturn extends {\n t: infer g extends GenericAst;\n } ? g : thunkReturn extends Module | BoundModule ? Submodule<$> : thunkReturn : Def;\n} & {\n [k in keyof def & GenericDeclaration as extractGenericName]: GenericAst, bootstrapAliases>, def[k], UnparsedScope>;\n};\ntype inferBootstrapped<$> = {\n [name in keyof $]: $[name] extends Def ? inferDefinition : $[name] extends {\n t: infer g extends GenericAst;\n } ? bindGenericToScope : $[name];\n} & unknown;\ntype bindGenericToScope = GenericAst;\ntype extractGenericName = k extends GenericDeclaration ? name : never;\ntype extractGenericParameters = k extends `${string}<${infer params}>` ? ParameterString : never;\ntype resolutionToAst = [\n resolution\n] extends [anyOrNever] ? InferredAst : resolution extends Def ? DefAst : resolution extends {\n [arkKind]: \"module\";\n root: infer root;\n} ? InferredAst : resolution extends GenericAst ? resolution : InferredAst;\ninterface InternalScope {\n constructor: typeof InternalScope;\n}\ndeclare class InternalScope<$ extends {} = {}> extends BaseScope<$> {\n get ambientAttachments(): Ark.boundTypeAttachments<$> | undefined;\n protected preparseOwnAliasEntry(alias: string, def: unknown): AliasDefEntry;\n parseGenericParams(def: string, opts: BaseParseOptions): array;\n protected normalizeRootScopeValue(resolution: unknown): unknown;\n protected preparseOwnDefinitionFormat(def: unknown, opts: BaseParseOptions): BaseRoot | BaseParseContextInput;\n parseOwnDefinitionFormat(def: unknown, ctx: BaseParseContext): BaseRoot;\n unit: UnitTypeParser<$>;\n valueOf: ValueOfTypeParser<$>;\n enumerated: EnumeratedTypeParser<$>;\n instanceOf: InstanceOfTypeParser<$>;\n or: NaryUnionParser<$>;\n and: NaryIntersectionParser<$>;\n merge: NaryMergeParser<$>;\n pipe: NaryPipeParser<$>;\n fn: InternalFnParser;\n match: InternalMatchParser;\n declare: () => {\n type: InternalTypeParser;\n };\n define(def: def): def;\n type: InternalTypeParser;\n static scope: ScopeParser;\n static module: ModuleParser;\n}\ndeclare const scope: ScopeParser;\ndeclare namespace scope {\n type validate = {\n [k in keyof def]: k extends noSuggest ? unknown : parseScopeKey[\"params\"] extends infer params ? params extends array ? params[\"length\"] extends 0 ? def[k] extends type.Any | PreparsedResolution ? def[k] : k extends (PrivateDeclaration) ? ErrorType> : type.validate, {}> : type.validate, baseGenericConstraints> : params : never;\n };\n type infer = inferBootstrapped>;\n}\ninterface ScopeConstructor {\n new <$ = {}>(...args: ConstructorParameters): Scope<$>;\n scope: ScopeParser;\n module: ModuleParser;\n}\ninterface Scope<$ = {}> {\n t: $;\n [arkKind]: \"scope\";\n config: ArkScopeConfig;\n references: readonly BaseNode[];\n json: JsonStructure;\n exportedNames: array>;\n /** The set of names defined at the root-level of the scope mapped to their\n * corresponding definitions.**/\n aliases: Record;\n internal: toInternalScope<$>;\n defineSchema(schema: def): def;\n node>(kinds: kinds, schema: NodeSchema>, opts?: BaseParseOptions): nodeOfKind>>;\n unit: UnitTypeParser<$>;\n enumerated: EnumeratedTypeParser<$>;\n valueOf: ValueOfTypeParser<$>;\n instanceOf: InstanceOfTypeParser<$>;\n type: TypeParser<$>;\n match: MatchParser<$>;\n fn: FnParser<$>;\n declare: DeclarationParser<$>;\n define: DefinitionParser<$>;\n generic: GenericParser<$>;\n schema: SchemaParser<$>;\n import(): Module<{\n [k in exportedNameOf<$> as PrivateDeclaration]: $[k];\n }>;\n import[]>(...names: names): BoundModule<{\n [k in names[number] as PrivateDeclaration]: $[k];\n } & unknown, $>;\n export(): Module<{\n [k in exportedNameOf<$>]: $[k];\n }>;\n export[]>(...names: names): BoundModule<{\n [k in names[number]]: $[k];\n } & unknown, $>;\n resolve>(name: name): instantiateExport<$[name], $>;\n}\ndeclare const Scope: ScopeConstructor;\ntype parseScopeKey = k extends `${infer name}<${infer params}>` ? parseGenericScopeKey : {\n name: k;\n params: [];\n};\ntype parseGenericScopeKey = {\n name: name;\n params: parseGenericParams>;\n};\ntype InnerParseResult = BaseRoot | ParsedOptionalProperty | ParsedDefaultableProperty;\n\ntype inferDefinition = [\n def\n] 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;\ntype inferStandardSchema, o = StandardSchemaV1.InferOutput> = [i, o] extends [o, i] ? i : (In: i) => Out;\ntype 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;\ntype validateInnerDefinition = [\n def\n] extends [TerminalObjectDefinition] ? def : def extends string ? validateString : unknown extends def ? BaseCompletions<$, args> | {} : def extends readonly unknown[] ? validateTuple : def extends BadDefinitionType ? ErrorMessage>> : validateObjectLiteral;\ntype validateTuple = maybeValidateTupleExpression extends infer result ? result extends null ? validateTupleLiteral : result : never;\ntype inferTuple = def extends TupleExpression ? inferTupleExpression : inferTupleLiteral;\ntype TerminalObjectDefinition = type.cast | Fn | RegExp | StandardSchemaV1;\ntype ThunkCast = () => type.cast;\ntype BadDefinitionType = Exclude;\ndeclare const writeBadDefinitionTypeMessage: (actual: actual) => writeBadDefinitionTypeMessage;\ntype writeBadDefinitionTypeMessage = `Type definitions must be strings or objects (was ${actual})`;\n\ntype DeclarationParser<$> = () => {\n type: (def: [preinferred] extends [unset] ? [\n preinferred\n ] extends [anyOrNever] ? validateDeclared : ErrorMessage<`declare() requires a generic argument`> : validateDeclared) => Type, $>;\n};\ntype finalizePreinferred = ctx[\"side\"] extends distill.Side ? ctx[\"side\"] extends \"in\" ? (In: preinferred) => type.infer.Out : (In: type.infer.In) => preinferred : preinferred;\ntype DeclareContext = {\n side?: \"in\" | \"out\";\n};\ntype validateDeclared = def extends type.validate ? validateInference, ctx> : type.validate;\ntype validateInference = def extends TerminalObjectDefinition | ThunkCast | TupleExpression ? keyof def extends never ? validateObjectInference : validateShallowInference, declared, ctx> : def extends array ? validateArrayInference : def extends object ? validateObjectInference : validateShallowInference, declared, ctx>;\ntype validateArrayInference = declared extends array ? {\n [i in keyof declared]: i extends keyof def ? validateInference : declared[i];\n} : show, declared>>;\ntype validateObjectInference = show<{\n [k in requiredKeyOf]: k extends keyof def ? validateInference : declared[k];\n} & {\n [k in optionalKeyOf & string as declaredOptionalKeySuggestion]: declaredOptionalValueSuggestion;\n}>;\ntype declaredOptionalKeySuggestion = k extends keyof def ? def[k] extends OptionalPropertyDefinition ? k : `${k}?` : `${k}?`;\ntype declaredOptionalValueSuggestion = k extends keyof def ? def[k] extends OptionalPropertyDefinition ? validateInference[k], $, args, ctx> : declared[k] : `${k}?` extends keyof def ? validateInference[k], $, args, ctx> : declared[k];\ntype validateShallowInference : t> = equals extends true ? unknown : show>;\ntype declarationMismatch = ErrorType<{\n declared: declared;\n inferred: inferred;\n}>;\n\ndeclare class MergeHkt extends Hkt<[base: object, props: object]> {\n body: util.merge;\n description: string;\n}\ndeclare const Merge: _ark_schema.GenericRoot;\ndeclare const arkBuiltins: arkBuiltins;\ntype arkBuiltins = Module;\ndeclare namespace arkBuiltins {\n type submodule = Submodule<$>;\n type $ = {\n Key: Key;\n Merge: typeof Merge.t;\n };\n}\n\ndeclare const number: number.module;\ndeclare namespace number {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: number;\n epoch: number;\n integer: number;\n safe: number;\n NaN: number;\n Infinity: number;\n NegativeInfinity: number;\n };\n}\n\ndeclare const stringInteger: stringInteger.module;\ndeclare namespace stringInteger {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n}\ndeclare const base64: Module<{\n root: unknown;\n url: unknown;\n}>;\ndeclare namespace base64 {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n url: string;\n };\n}\ndeclare const capitalize: capitalize.module;\ndeclare namespace capitalize {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n}\ndeclare const stringDate: stringDate.module;\ndeclare namespace stringDate {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n iso: iso.submodule;\n epoch: epoch.submodule;\n };\n namespace iso {\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n }\n namespace epoch {\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n }\n}\ndeclare const ip: ip.module;\ndeclare namespace ip {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n v4: string;\n v6: string;\n };\n}\ndeclare namespace stringJson {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n}\ndeclare namespace lower {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n}\ndeclare const normalize: Module<{\n root: unknown;\n NFC: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFD: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFKC: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFKD: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n}>;\ndeclare namespace normalize {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n NFC: NFC.submodule;\n NFD: NFD.submodule;\n NFKC: NFKC.submodule;\n NFKD: NFKD.submodule;\n };\n namespace NFC {\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n }\n namespace NFD {\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n }\n namespace NFKC {\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n }\n namespace NFKD {\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n }\n}\ndeclare const stringNumeric: stringNumeric.module;\ndeclare namespace stringNumeric {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n}\ndeclare namespace trim {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n}\ndeclare const upper: upper.module;\ndeclare namespace upper {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: (In: string) => To;\n preformatted: string;\n };\n}\ndeclare const url: url.module;\ndeclare namespace url {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n parse: (In: string) => To;\n };\n}\ndeclare const uuid: Module<{\n root: string;\n v1: unknown;\n v2: unknown;\n v3: unknown;\n v4: unknown;\n v5: unknown;\n v6: unknown;\n v7: unknown;\n v8: unknown;\n}>;\ndeclare namespace uuid {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n v1: string;\n v2: string;\n v3: string;\n v4: string;\n v5: string;\n v6: string;\n v7: string;\n v8: string;\n };\n namespace $ {\n type flat = {};\n }\n}\ndeclare const string: Module<{\n integer: Submodule;\n trim: Submodule;\n normalize: Submodule<{\n root: unknown;\n NFC: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFD: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFKC: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n NFKD: Submodule<{\n root: unknown;\n preformatted: unknown;\n }>;\n }>;\n date: Submodule;\n root: unknown;\n email: unknown;\n uuid: Submodule<{\n root: string;\n v1: unknown;\n v2: unknown;\n v3: unknown;\n v4: unknown;\n v5: unknown;\n v6: unknown;\n v7: unknown;\n v8: unknown;\n }>;\n regex: unknown;\n json: Submodule;\n lower: Submodule;\n upper: Submodule;\n alpha: unknown;\n alphanumeric: unknown;\n hex: unknown;\n base64: Submodule<{\n root: unknown;\n url: unknown;\n }>;\n capitalize: Submodule;\n creditCard: unknown;\n digits: unknown;\n ip: Submodule;\n isbn: unknown;\n numeric: Submodule;\n semver: unknown;\n url: Submodule;\n}>;\ndeclare namespace string {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: base64.submodule;\n capitalize: capitalize.submodule;\n creditCard: string;\n date: stringDate.submodule;\n digits: string;\n email: string;\n integer: stringInteger.submodule;\n ip: ip.submodule;\n isbn: string;\n json: stringJson.submodule;\n lower: lower.submodule;\n normalize: normalize.submodule;\n numeric: stringNumeric.submodule;\n regex: string;\n semver: string;\n trim: trim.submodule;\n upper: upper.submodule;\n url: url.submodule;\n uuid: uuid.submodule;\n };\n}\n\ndeclare const arkTsKeywords: arkTsKeywords;\ntype arkTsKeywords = Module;\ndeclare namespace arkTsKeywords {\n type submodule = Submodule<$>;\n type $ = {\n bigint: bigint;\n boolean: boolean;\n false: false;\n never: never;\n null: null;\n number: number;\n object: object;\n string: string;\n symbol: symbol;\n true: true;\n unknown: unknown;\n undefined: undefined;\n };\n}\ndeclare const unknown: Module<{\n any: unknown;\n root: unknown;\n}>;\ndeclare namespace unknown {\n type submodule = Submodule<$>;\n type $ = {\n root: unknown;\n any: any;\n };\n}\ndeclare const json: Module<{\n stringify: unknown;\n root: unknown;\n}>;\ndeclare namespace json {\n type submodule = Submodule<$>;\n type $ = {\n root: Json;\n stringify: (In: Json) => To;\n };\n}\ndeclare const object: Module<{\n root: unknown;\n json: Submodule<{\n stringify: unknown;\n root: unknown;\n }>;\n}>;\ndeclare namespace object {\n type submodule = Submodule<$>;\n type $ = {\n root: object;\n json: json.submodule;\n };\n}\ndeclare class RecordHkt extends Hkt<[Key, unknown]> {\n body: Record;\n description: string;\n}\ndeclare const Record: _ark_schema.GenericRoot;\ndeclare class PickHkt extends Hkt<[object, Key]> {\n body: pick;\n description: string;\n}\ndeclare const Pick: _ark_schema.GenericRoot;\ndeclare class OmitHkt extends Hkt<[object, Key]> {\n body: omit;\n description: string;\n}\ndeclare const Omit: _ark_schema.GenericRoot;\ndeclare class PartialHkt extends Hkt<[object]> {\n body: show>;\n description: string;\n}\ndeclare const Partial: _ark_schema.GenericRoot;\ndeclare class RequiredHkt extends Hkt<[object]> {\n body: show>;\n description: string;\n}\ndeclare const Required$1: _ark_schema.GenericRoot;\ndeclare class ExcludeHkt extends Hkt<[unknown, unknown]> {\n body: Exclude;\n description: string;\n}\ndeclare const Exclude: _ark_schema.GenericRoot;\ndeclare class ExtractHkt extends Hkt<[unknown, unknown]> {\n body: Extract;\n description: string;\n}\ndeclare const Extract: _ark_schema.GenericRoot;\ndeclare const arkTsGenerics: arkTsGenerics.module;\ndeclare namespace arkTsGenerics {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n Exclude: typeof Exclude.t;\n Extract: typeof Extract.t;\n Omit: typeof Omit.t;\n Partial: typeof Partial.t;\n Pick: typeof Pick.t;\n Record: typeof Record.t;\n Required: typeof Required$1.t;\n };\n}\n\ninterface Ark extends Omit, Ark.wrapped {\n}\ndeclare namespace Ark {\n interface keywords extends arkTsKeywords.$, arkTsGenerics.$, arkPrototypes.keywords, arkBuiltins.$ {\n }\n interface wrapped extends arkPrototypes.wrapped {\n string: string.submodule;\n number: number.submodule;\n object: object.submodule;\n unknown: unknown.submodule;\n }\n type flat = flatResolutionsOf;\n interface typeAttachments extends arkTsKeywords.$ {\n arrayIndex: arkPrototypes.$[\"Array\"][\"index\"];\n Key: arkBuiltins.$[\"Key\"];\n Record: arkTsGenerics.$[\"Record\"];\n Date: arkPrototypes.$[\"Date\"];\n Array: arkPrototypes.$[\"Array\"][\"root\"];\n }\n interface boundTypeAttachments<$> extends Omit, arkKind> {\n }\n}\ndeclare const ark: Scope;\ndeclare const keywords: Module;\ndeclare const type: TypeParser<{}>;\ndeclare namespace type {\n interface cast {\n [inferred]?: to;\n }\n type errors = ArkErrors;\n type validate> = validateDefinition;\n type instantiate> = instantiateType, $>;\n type infer> = inferDefinition;\n namespace infer {\n type In = distill.In>;\n type Out = distill.Out>;\n namespace introspectable {\n type Out = distill.introspectable.Out>;\n }\n }\n type brand = t extends InferredMorph ? o[\"introspectable\"] extends true ? (In: i) => To> : (In: i) => Out> : Brand;\n /** @ts-ignore cast variance */\n interface Any extends Type$1 {\n }\n}\ntype type = Type;\ndeclare const match: MatchParser<{}>;\ndeclare const fn: FnParser<{}>;\ndeclare const generic: GenericParser<{}>;\ndeclare const define: DefinitionParser<{}>;\ndeclare const declare: DeclarationParser<{}>;\n\ntype ParameterString = `<${params}>`;\ntype extractParams = s extends ParameterString ? params : never;\ntype validateParameterString = parseGenericParams, $> extends infer e extends ErrorMessage ? e : s;\ntype validateGenericArg = type.infer extends param[1] ? unknown : ErrorType<[`Invalid argument for ${param[0]}`, expected: param[1]]>;\ntype GenericInstantiator, def, $, args$> = params[\"length\"] extends 1 ? {\n >(a: type.validate & validateGenericArg): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 2 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 3 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 4 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 5 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : params[\"length\"] extends 6 ? {\n >(...args: [\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg,\n type.validate & validateGenericArg\n ]): r extends infer _ ? _ : never;\n} : (error: ErrorMessage<`You may not define more than 6 positional generic parameters`>) => never;\ntype instantiateGeneric, args, $, args$> = Type<[\n def\n] extends [Hkt] ? Hkt.apply;\n}> : inferDefinition>, args$>;\ntype bindGenericArgs, $, args> = {\n [i in keyof params & `${number}` as params[i][0]]: type.infer;\n};\ntype baseGenericResolutions, $> = baseGenericConstraints extends infer baseConstraints ? {\n [k in keyof baseConstraints]: Type;\n} : never;\ntype baseGenericConstraints> = {\n [i in keyof params & `${number}` as params[i][0]]: params[i][1];\n};\ntype GenericConstructor = array, bodyDef = unknown, $ = {}, arg$ = {}> = new () => Generic;\ninterface Generic = array, bodyDef = unknown, $ = {}, arg$ = $> extends Callable> {\n [arkKind]: \"generic\";\n t: GenericAst;\n bodyDef: bodyDef;\n params: {\n [i in keyof params]: [params[i][0], Type];\n };\n names: genericParamNames;\n constraints: {\n [i in keyof params]: Type;\n };\n $: Scope<$>;\n arg$: Scope;\n internal: GenericRoot;\n json: JsonStructure;\n}\ndeclare const Generic: GenericConstructor;\ntype GenericDeclaration = `${name}${params}`;\ntype parseValidGenericParams = conform, $>, array>;\ndeclare const emptyGenericParameterMessage = \"An empty string is not a valid generic parameter name\";\ntype emptyGenericParameterMessage = typeof emptyGenericParameterMessage;\ntype parseGenericParams = parseNextNameChar, \"\", [\n], $>;\ntype ParamsTerminator = WhitespaceChar | \",\";\ntype parseName, $> = parseNextNameChar, \"\", result, $>;\ntype parseNextNameChar, $> = unscanned extends `${infer lookahead}${infer nextUnscanned}` ? lookahead extends ParamsTerminator ? name extends \"\" ? ErrorMessage : lookahead extends \",\" ? parseName : lookahead extends WhitespaceChar ? _parseOptionalConstraint : never : parseNextNameChar : name extends \"\" ? result : [...result, [name, unknown]];\ndeclare const extendsToken = \"extends \";\ntype extendsToken = typeof extendsToken;\ndeclare const _parseOptionalConstraint: (scanner: Scanner, name: string, result: GenericParamDef[], ctx: BaseParseContext) => GenericParamDef[];\ntype _parseOptionalConstraint, $> = Scanner.skipWhitespace extends (`${extendsToken}${infer nextUnscanned}`) ? parseUntilFinalizer, $, {}> extends (infer finalArgState extends StaticState) ? validateAst extends (infer e extends ErrorMessage) ? e : parseName]\n], $> : never : parseName extends `,${infer nextUnscanned}` ? nextUnscanned : unscanned, [\n ...result,\n [name, unknown]\n], $>;\ntype genericParamDefToAst = schema extends string ? [schema, unknown] : schema extends readonly [infer name, infer def] ? [name, type.infer] : never;\ntype genericParamDefsToAst, $> = [\n ...{\n [i in keyof defs]: genericParamDefToAst;\n }\n];\ntype GenericParser<$ = {}> = >(...params: {\n [i in keyof paramsDef]: paramsDef[i] extends (readonly [infer name, infer def]) ? readonly [name, type.validate] : paramsDef[i];\n}) => GenericBodyParser, $>;\ninterface GenericBodyParser, $> {\n (body: type.validate>): Generic;\n (instantiateDef: LazyGenericBody>, hkt: hkt): Generic, $, $>;\n}\n\ndeclare const Module: new <$ extends {}>(exports: exportScope<$>) => Module<$>;\ninterface Module<$ extends {} = {}> extends RootModule> {\n}\ntype exportScope<$> = bindExportsToScope<$, $>;\ndeclare const BoundModule: new (exports: bindExportsToScope, $: $) => BoundModule;\ninterface BoundModule extends RootModule> {\n}\ntype bindExportsToScope = {\n [k in keyof exports]: instantiateExport;\n} & unknown;\ntype Submodule = RootModule;\ntype instantiateExport = [\n t\n] extends [PreparsedNodeResolution] ? [\n t\n] extends [anyOrNever] ? Type : t extends GenericAst ? Generic : t extends Submodule ? BoundModule : never : Type;\n\ndeclare class liftFromHkt extends Hkt<[element: unknown]> {\n body: liftArray extends infer lifted ? (In: this[0] | lifted) => To : never;\n}\ndeclare const liftFrom: _ark_schema.GenericRoot;\ndeclare const arkArray: arkArray.module;\ndeclare namespace arkArray {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: unknown[];\n readonly: readonly unknown[];\n index: NonNegativeIntegerString;\n liftFrom: typeof liftFrom.t;\n };\n}\ntype NonNegativeIntegerString = `${Digit}` | (`${Exclude}${string}` & `${bigint}`);\n\ntype FormDataValue = string | File;\ntype ParsedFormData = Record;\ndeclare const arkFormData: arkFormData.module;\ndeclare namespace arkFormData {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n root: FormData;\n value: FormDataValue;\n parse: (In: FormData) => To;\n parsed: ParsedFormData;\n };\n}\n\ndeclare const TypedArray: TypedArray.module;\ndeclare namespace TypedArray {\n type module = Module;\n type submodule = Submodule<$>;\n type $ = {\n Int8: Int8Array;\n Uint8: Uint8Array;\n Uint8Clamped: Uint8ClampedArray;\n Int16: Int16Array;\n Uint16: Uint16Array;\n Int32: Int32Array;\n Uint32: Uint32Array;\n Float32: Float32Array;\n Float64: Float64Array;\n BigInt64: BigInt64Array;\n BigUint64: BigUint64Array;\n };\n}\n\ndeclare const omittedPrototypes: {\n Boolean: 1;\n Number: 1;\n String: 1;\n};\ndeclare const arkPrototypes: arkPrototypes.module;\ndeclare namespace arkPrototypes {\n type module = Module;\n type submodule = Submodule<$>;\n interface keywords extends ecmascript, platform {\n }\n interface $ extends Omit, wrapped {\n }\n interface wrapped {\n Array: arkArray.submodule;\n TypedArray: TypedArray.submodule;\n FormData: arkFormData.submodule;\n }\n type ecmascript = Omit;\n type platform = PlatformObjects;\n interface instances extends ecmascript, platform {\n }\n type NonDegenerateName = keyof instances extends infer k ? k extends keyof instances ? {} extends instances[k] ? never : k : never : never;\n type instanceOf = instances[name];\n}\n\ntype DateLiteral = `d\"${source}\"` | `d'${source}'`;\ntype LimitLiteral = number | DateLiteral;\ntype distill = finalizeDistillation>;\ndeclare namespace distill {\n type Side = \"in\" | \"out\" | \"introspectableOut\";\n type In = distill;\n type Out = distill;\n namespace introspectable {\n type Out = distill;\n }\n}\ntype finalizeDistillation = equals extends true ? t : distilled;\ntype _distill = t extends undefined ? t : [t] extends [anyOrNever] ? t : unknown extends t ? unknown : t extends Brand ? side extends \"in\" ? base : t : t extends TerminallyInferredObject | Primitive ? t : t extends Function ? t extends (...args: never) => anyOrNever ? t : t extends InferredMorph ? distillIo : t : t extends Default ? _distill : t extends array ? distillArray : isSafelyMappable extends true ? distillMappable : t;\ntype distillMappable = side extends \"in\" ? show<{\n [k in keyof o as k extends inferredDefaultKeyOf ? never : k]: _distill;\n} & {\n [k in inferredDefaultKeyOf]?: _distill;\n}> : {\n [k in keyof o]: _distill;\n};\ntype distillIo = side extends \"out\" ? _distill : side extends \"in\" ? _distill : o extends To ? _distill : unknown;\ntype unwrapInput = t extends InferredMorph ? t extends anyOrNever ? t : i : t;\ntype inferredDefaultKeyOf = keyof o extends infer k ? k extends keyof o ? unwrapInput extends Default ? [\n t\n] extends [anyOrNever] ? never : k : never : never : never;\ntype distillArray = t[number][] extends t ? alignReadonly<_distill[], t> : distillNonArraykeys, t>, side>;\ntype alignReadonly = original extends unknown[] ? result : Readonly;\ntype distillNonArraykeys = keyof originalArray extends keyof distilledArray ? distilledArray : distilledArray & _distill<{\n [k in keyof originalArray as k extends keyof distilledArray ? never : k]: originalArray[k];\n}, side>;\ntype distillArrayFromPrefix = t extends readonly [infer head, ...infer tail] ? distillArrayFromPrefix?] : [...prefix, _distill]> : [...prefix, ...distillArrayFromPostfix];\ntype distillArrayFromPostfix = t extends readonly [...infer init, infer last] ? distillArrayFromPostfix, ...postfix]> : [...{\n [i in keyof t]: _distill;\n}, ...postfix];\ntype BuiltinTerminalObjectKind = Exclude;\n/** Objects we don't want to expand during inference like Date or Promise */\ntype TerminallyInferredObject = arkPrototypes.instanceOf | ArkEnv.prototypes;\ntype inferPredicate = predicate extends (data: any, ...args: any[]) => data is infer narrowed ? narrowed : t;\ntype inferNaryPipe = _inferNaryPipe;\ntype _inferNaryPipe = remaining extends (readonly [infer head extends Morph, ...infer tail extends Morph[]]) ? _inferNaryPipe> : result;\ntype inferNaryIntersection = number extends types[\"length\"] ? _inferNaryIntersection, unknown> : _inferNaryIntersection;\ntype _inferNaryIntersection = remaining extends readonly [infer head, ...infer tail] ? _inferNaryIntersection> : result;\ntype inferNaryMerge = number extends types[\"length\"] ? _inferUnorderedMerge : _inferNaryMerge;\ntype _inferUnorderedMerge, requiredKey extends PropertyKey = Exclude, optionalKey>> = show<{\n [k in requiredKey]: types[number] extends infer v ? v extends unknown ? k extends keyof v ? v[k] : never : never : never;\n} & {\n [k in optionalKey]?: types[number] extends infer v ? v extends unknown ? k extends keyof v ? v[k] : never : never : never;\n}>;\n/** Coalesce keys that exist and are optional on one or more branches of a union */\ntype optionalAtLeastOnceUnionKeyOf = t extends unknown ? optionalKeyOf : never;\ntype _inferNaryMerge = remaining extends (readonly [infer head, ...infer tail extends readonly unknown[]]) ? _inferNaryMerge> : result;\ntype inferMorphOut = Exclude, ArkError | ArkErrors>;\ndeclare const isMorphOutKey: \" isMorphOut\";\ninterface Out {\n [isMorphOutKey]: true;\n t: o;\n introspectable: boolean;\n}\ninterface To extends Out {\n introspectable: true;\n}\ntype InferredMorph = (In: i) => o;\ndeclare const defaultsToKey: \" defaultsTo\";\ntype Default = {\n [defaultsToKey]: [t, v];\n};\ntype withDefault = t extends InferredMorph ? addDefaultToMorph : Default, v>;\ntype addDefaultToMorph = [\n normalizeMorphDistribution\n] extends [InferredMorph] ? (In: Default) => o : never;\ntype normalizeMorphDistribution ? i : never, undistributedOut extends Out = t extends InferredMorph ? [\n o\n] extends [To] ? To : o : never> = (Extract extends anyOrNever ? never : Extract extends InferredMorph ? [\n undistributedOut\n] extends [o] ? (In: undistributedIn) => undistributedOut : [undistributedIn] extends [i] ? (In: undistributedIn) => undistributedOut : t : never) | Exclude extends infer _ ? _ : never;\ntype defaultFor = (Primitive extends t ? Primitive : t extends Primitive ? t : never) | (() => t);\ntype inferIntersection = normalizeMorphDistribution<_inferIntersection>;\ntype inferMorph = morph extends type.cast ? inferPipe : inferMorphOut extends infer out ? (In: distill.In) => Out : never;\ntype inferPipe = normalizeMorphDistribution<_inferIntersection>;\ntype _inferIntersection = [\n l & r\n] extends [infer t extends anyOrNever] ? t : l extends InferredMorph ? r extends InferredMorph ? piped extends true ? (In: lIn) => rOut : never : piped extends true ? (In: lIn) => To : (In: _inferIntersection) => lOut : r extends InferredMorph ? (In: _inferIntersection) => rOut : [l, r] extends [object, object] ? intersectObjects extends infer result ? result : never : l & r;\ninterface MorphableIntersection extends Hkt<[unknown, unknown]> {\n body: _inferIntersection;\n}\ntype intersectObjects = l extends array ? r extends array ? intersectArrays> : // for an intersection with exactly one array operand like { name: string } & string[],\nl & r : r extends array ? l & r : keyof l & keyof r extends never ? show : show<{\n [k in keyof l]: k extends keyof r ? _inferIntersection : l[k];\n} & {\n [k in keyof r]: k extends keyof l ? _inferIntersection : r[k];\n}>;\n\nexport { Ark, ArkAmbient, type ArkConfig, type Type$1 as BaseType, BoundModule, Generic, type KeywordConfig, Module, type Out, Scope, type Submodule, Type, ark, type bindThis, configure, declare, define, distill, fn, generic, type inferDefinition, keywords, match, scope, type, type validateDefinition };\n\n}" diff --git a/ark/type/__tests__/integration/allConfig.ts b/ark/type/__tests__/integration/allConfig.ts index 2208e49f04..9f3ea2e8cc 100644 --- a/ark/type/__tests__/integration/allConfig.ts +++ b/ark/type/__tests__/integration/allConfig.ts @@ -116,6 +116,9 @@ configure({ "string.creditCard": { description: "configured" }, + "string.isbn": { + description: "configured" + }, "string.date.parse": { description: "configured" }, diff --git a/ark/type/__tests__/keywords/string.test.ts b/ark/type/__tests__/keywords/string.test.ts index 06fd5ae464..c20f37da22 100644 --- a/ark/type/__tests__/keywords/string.test.ts +++ b/ark/type/__tests__/keywords/string.test.ts @@ -88,6 +88,44 @@ contextualize(() => { ).snap('must be a credit card number (was "5489582921773370")') }) + it("isbn", () => { + const Isbn = type("string.isbn") + // ISBN-10 + attest(Isbn("4873118735")).equals("4873118735") + attest(Isbn("4-87311-873-5")).equals("4-87311-873-5") + attest(Isbn("4 87311 873 5")).equals("4 87311 873 5") + attest(Isbn("020530902X")).equals("020530902X") + attest(Isbn("0-205-30902-X")).equals("0-205-30902-X") + // ISBN-13 + attest(Isbn("9784873118734")).equals("9784873118734") + attest(Isbn("978-4-87311-873-4")).equals("978-4-87311-873-4") + attest(Isbn("9790000000001")).equals("9790000000001") + // Invalid checksum + attest(Isbn("4873118736").toString()).equals( + 'must be an ISBN (was "4873118736")' + ) + attest(Isbn("9784873118735").toString()).equals( + 'must be an ISBN (was "9784873118735")' + ) + // Lowercase x is not accepted + attest(Isbn("020530902x").toString()).equals( + 'must be an ISBN (was "020530902x")' + ) + // X in wrong position + attest(Isbn("X234567890").toString()).equals( + 'must be an ISBN (was "X234567890")' + ) + // Wrong length + attest(Isbn("978487311873").toString()).equals( + 'must be an ISBN (was "978487311873")' + ) + // Non-digit characters + attest(Isbn("abc1234567890").toString()).equals( + 'must be an ISBN (was "abc1234567890")' + ) + attest(Isbn("").toString()).equals('must be an ISBN (was "")') + }) + it("semver", () => { attest(keywords.string.semver("1.0.0")).snap("1.0.0") attest(keywords.string.semver("-1.0.0").toString()).snap( diff --git a/ark/type/keywords/string.ts b/ark/type/keywords/string.ts index 05064933b5..6530cdeb58 100644 --- a/ark/type/keywords/string.ts +++ b/ark/type/keywords/string.ts @@ -170,6 +170,44 @@ export const creditCard = rootSchema({ } }) +// https://en.wikipedia.org/wiki/ISBN#ISBN-10_check_digits +export const isIsbn10 = (input: string): boolean => { + let sum = 0 + for (let i = 0; i < 10; i++) { + const char = input[i] + const value = char === "X" ? 10 : Number.parseInt(char, 10) + sum += value * (10 - i) + } + return sum % 11 === 0 +} + +// https://en.wikipedia.org/wiki/ISBN#ISBN-13_check_digit_calculation +export const isIsbn13 = (input: string): boolean => { + let sum = 0 + for (let i = 0; i < 13; i++) { + const value = Number.parseInt(input[i], 10) + sum += value * (i % 2 === 0 ? 1 : 3) + } + return sum % 10 === 0 +} + +const isbnSeparatorMatcher = /[ -]+/g +const isbn10Matcher = /^\d{9}[\dX]$/ +const isbn13Matcher = /^\d{13}$/ + +export const isbn = rootSchema({ + domain: "string", + predicate: { + meta: "an ISBN", + predicate: (input: string) => { + const sanitized = input.replace(isbnSeparatorMatcher, "") + if (isbn10Matcher.test(sanitized)) return isIsbn10(sanitized) + if (isbn13Matcher.test(sanitized)) return isIsbn13(sanitized) + return false + } + } +}) + type DayDelimiter = "." | "/" | "-" const dayDelimiterMatcher = /^[./-]$/ @@ -919,6 +957,7 @@ export const string = Scope.module( email, integer: stringInteger, ip, + isbn, json, lower, normalize, @@ -953,6 +992,7 @@ export declare namespace string { email: string integer: stringInteger.submodule ip: ip.submodule + isbn: string json: stringJson.submodule lower: lower.submodule normalize: normalize.submodule