diff --git a/ark/docs/components/dts/schema.ts b/ark/docs/components/dts/schema.ts index f3ae8803fd..64d7862a37 100644 --- a/ark/docs/components/dts/schema.ts +++ b/ark/docs/components/dts/schema.ts @@ -1,3 +1,3 @@ /** THIS FILE IS AUTOGENERATED FROM ark/repo/dtsGen.ts **/ // prettier-ignore -export const schemaDts = "declare module \"@ark/schema\" {\n import { DynamicBase, anyOrNever, ReadonlyArray as ReadonlyArray$1, array, propwiseXor, merge, show, CastableBase, ReadonlyPath, JsonObject, JsonArray, mutable, Thunk, Callable, Hkt, JsonStructure, autocomplete, listable, satisfy, Domain as Domain$1, Constructor, Json, requireKeys, NonNegativeIntegerLiteral, flattenListable, noSuggest, intersectUnion, conform, ParseError, Key, propValueOf, Entry, KeySet, keySetOf, arrayIndexOf, JsonPrimitive, SerializedPrimitive, inferred, Fn, BuiltinObjectKind, describe, GuardablePredicate, Brand, dict, ArkRegistry } from '@ark/util';\nexport { ParseError } from '@ark/util';\n\ndeclare const intrinsic: {\n emptyStructure: StructureNode;\n jsonPrimitive: BaseRoot;\n jsonObject: BaseRoot;\n jsonData: BaseRoot;\n integer: BaseRoot;\n key: BaseRoot;\n lengthBoundable: BaseRoot;\n nonNegativeIntegerString: BaseRoot;\n string: BaseRoot;\n number: BaseRoot;\n bigint: BaseRoot;\n boolean: BaseRoot;\n symbol: BaseRoot;\n undefined: BaseRoot;\n object: BaseRoot;\n null: BaseRoot;\n Array: BaseRoot;\n Date: BaseRoot;\n never: BaseRoot;\n unknown: BaseRoot;\n true: BaseRoot;\n false: BaseRoot;\n};\n\ntype PreparsedNodeResolution = {\n [arkKind]: \"generic\" | \"module\";\n};\ndeclare class RootModule extends DynamicBase {\n get [arkKind](): \"module\";\n}\ninterface InternalModule extends RootModule {\n root?: BaseRoot;\n}\ndeclare const bindModule: (module: InternalModule, $: BaseScope) => InternalModule;\ntype exportSchemaScope<$> = {\n [k in keyof $]: instantiateRoot<$[k]>;\n};\ntype instantiateRoot = t extends InternalResolution ? [\n t\n] extends [anyOrNever] ? BaseRoot : t : BaseRoot;\ndeclare const SchemaModule: new <$ = {}>(types: exportSchemaScope<$>) => SchemaModule<$>;\ninterface SchemaModule<$ = {}> extends RootModule> {\n}\n\n/** From https://github.com/standard-schema/standard-schema */\n/**\n * The Standard Schema interface.\n */\ntype StandardSchemaV1 = {\n /**\n * The Standard Schema properties.\n */\n readonly \"~standard\": StandardSchemaV1.Props;\n};\ndeclare namespace StandardSchemaV1 {\n /**\n * The Standard Schema properties interface.\n */\n export interface Props {\n /**\n * The version number of the standard.\n */\n readonly version: 1;\n /**\n * The vendor name of the schema library.\n */\n readonly vendor: string;\n /**\n * Validates unknown input values.\n */\n readonly validate: (value: unknown) => Result | Promise>;\n /**\n * Inferred types associated with the schema.\n */\n readonly types?: Types | undefined;\n }\n export interface ArkTypeProps extends Props {\n readonly vendor: \"arktype\";\n }\n /**\n * The result interface of the validate function.\n */\n export type Result = SuccessResult | FailureResult;\n /**\n * The result interface if validation succeeds.\n */\n export interface SuccessResult {\n /**\n * The typed output value.\n */\n readonly value: Output;\n /**\n * The non-existent issues.\n */\n readonly issues?: undefined;\n }\n /**\n * The result interface if validation fails.\n */\n export interface FailureResult {\n /**\n * The issues of failed validation.\n */\n readonly issues: ReadonlyArray;\n }\n /**\n * The issue interface of the failure output.\n */\n export interface Issue {\n /**\n * The error message of the issue.\n */\n readonly message: string;\n /**\n * The path of the issue, if any.\n */\n readonly path?: ReadonlyArray | undefined;\n }\n /**\n * The path segment interface of the issue.\n */\n export interface PathSegment {\n /**\n * The key representing a path segment.\n */\n readonly key: PropertyKey;\n }\n /**\n * The Standard Schema types interface.\n */\n export interface Types {\n /**\n * The input type of the schema.\n */\n readonly input: Input;\n /**\n * The output type of the schema.\n */\n readonly output: Output;\n }\n /**\n * Infers the input type of a Standard Schema.\n */\n export type InferInput = NonNullable[\"input\"];\n /**\n * Infers the output type of a Standard Schema.\n */\n export type InferOutput = NonNullable[\"output\"];\n export { };\n}\n\ntype ArkErrorResult = ArkError | ArkErrors;\ndeclare class ArkError extends CastableBase> {\n readonly [arkKind] = \"error\";\n path: ReadonlyPath;\n data: Prerequisite;\n private nodeConfig;\n protected input: ArkErrorContextInput;\n protected ctx: Traversal;\n constructor(input: ArkErrorContextInput, ctx: Traversal);\n transform(f: (input: ArkErrorContextInput) => ArkErrorContextInput): ArkError;\n hasCode(code: code): this is ArkError;\n get propString(): string;\n get expected(): string;\n get actual(): string;\n get problem(): string;\n get message(): string;\n get flat(): ArkError[];\n toJSON(): JsonObject;\n toString(): string;\n throw(): never;\n}\ndeclare namespace ArkErrors {\n type Handler = (errors: ArkErrors) => returns;\n}\n/**\n * A ReadonlyArray of `ArkError`s returned by a Type on invalid input.\n *\n * Subsequent errors added at an existing path are merged into an\n * ArkError intersection.\n */\ndeclare class ArkErrors extends ReadonlyArray$1 implements StandardSchemaV1.FailureResult {\n readonly [arkKind] = \"errors\";\n protected ctx: Traversal;\n constructor(ctx: Traversal);\n /**\n * Errors by a pathString representing their location.\n */\n byPath: Record;\n /**\n * {@link byPath} flattened so that each value is an array of ArkError instances at that path.\n *\n * ✅ Since \"intersection\" errors will be flattened to their constituent `.errors`,\n * they will never be directly present in this representation.\n */\n get flatByPath(): Record;\n /**\n * {@link byPath} flattened so that each value is an array of problem strings at that path.\n */\n get flatProblemsByPath(): Record;\n /**\n * All pathStrings at which errors are present mapped to the errors occuring\n * at that path or any nested path within it.\n */\n byAncestorPath: Record;\n count: number;\n private mutable;\n /**\n * Throw a TraversalError based on these errors.\n */\n throw(): never;\n /**\n * Converts ArkErrors to TraversalError, a subclass of `Error` suitable for throwing with nice\n * formatting.\n */\n toTraversalError(): TraversalError;\n /**\n * Append an ArkError to this array, ignoring duplicates.\n */\n add(error: ArkError): void;\n transform(f: (e: ArkError) => ArkError): ArkErrors;\n /**\n * Add all errors from an ArkErrors instance, ignoring duplicates and\n * prefixing their paths with that of the current Traversal.\n */\n merge(errors: ArkErrors): void;\n /**\n * A human-readable summary of all errors.\n */\n get summary(): string;\n /**\n * Alias of this ArkErrors instance for StandardSchema compatibility.\n */\n get issues(): this;\n toJSON(): JsonArray;\n toString(): string;\n private _add;\n private addAncestorPaths;\n}\ndeclare class TraversalError extends Error {\n readonly name = \"TraversalError\";\n arkErrors: ArkErrors;\n constructor(errors: ArkErrors);\n}\ninterface DerivableErrorContext {\n expected: string;\n actual: string;\n problem: string;\n message: string;\n data: Prerequisite;\n path: array;\n propString: string;\n}\ntype DerivableErrorContextInput = Partial> & propwiseXor<{\n path?: array;\n}, {\n relativePath?: array;\n prefixPath?: array;\n}>;\ntype ArkErrorCode = {\n [kind in NodeKind]: errorContext extends null ? never : kind;\n}[NodeKind];\ntype ArkErrorContextInputsByCode = {\n [code in ArkErrorCode]: errorContext & DerivableErrorContextInput;\n};\ntype ArkErrorContextInput = merge;\ntype NodeErrorContextInput = ArkErrorContextInputsByCode[code] & {\n meta: NodeMeta;\n};\ntype MessageContext = Omit, \"message\">;\ntype ProblemContext = Omit, \"problem\">;\ntype CustomErrorInput = show<{\n code?: undefined;\n} & DerivableErrorContextInput>;\ntype ArkErrorInput = string | ArkErrorContextInput | CustomErrorInput;\ntype ProblemConfig = string | ProblemWriter;\ntype ProblemWriter = (context: ProblemContext) => string;\ntype MessageConfig = string | MessageWriter;\ntype MessageWriter = (context: MessageContext) => string;\ntype getAssociatedDataForError = code extends NodeKind ? Prerequisite : unknown;\ntype ExpectedConfig = string | ExpectedWriter;\ntype ExpectedWriter = (source: errorContext) => string;\ntype ActualConfig = string | ActualWriter;\ntype ActualWriter = (data: getAssociatedDataForError) => string;\n\ndeclare const makeRootAndArrayPropertiesMutable: (o: o) => makeRootAndArrayPropertiesMutable;\ntype makeRootAndArrayPropertiesMutable = {\n -readonly [k in keyof inner]: inner[k] extends array | undefined ? mutable : inner[k];\n} & unknown;\ntype internalImplementationOf = {\n [k in Exclude]: external[k] extends ((...args: infer args) => unknown) ? (...args: {\n [i in keyof args]: never;\n }) => unknown : unknown;\n};\ntype arkKind = typeof arkKind;\ndeclare const arkKind: \" arkKind\";\ninterface ArkKinds {\n constraint: BaseConstraint;\n root: BaseRoot;\n scope: BaseScope;\n generic: GenericRoot;\n module: InternalModule;\n error: ArkError;\n errors: ArkErrors;\n context: BaseParseContext;\n}\ntype ArkKind = show;\ndeclare const hasArkKind: (value: unknown, kind: kind) => value is ArkKinds[kind];\ndeclare const isNode: (value: unknown) => value is BaseNode;\ntype unwrapDefault = thunkableValue extends Thunk ? returnValue : thunkableValue;\n\ntype GenericParamAst = [name: name, constraint: constraint];\ntype GenericParamDef = name | readonly [name, unknown];\ndeclare const parseGeneric: (paramDefs: array, bodyDef: unknown, $: BaseScope) => GenericRoot;\ntype genericParamNames> = {\n [i in keyof params]: params[i][0];\n};\ntype genericParamConstraints> = {\n [i in keyof params]: params[i][1];\n};\ntype GenericArgResolutions = array> = {\n [i in keyof params as params[i & `${number}`][0]]: BaseRoot;\n};\ndeclare class LazyGenericBody extends Callable<(args: argResolutions) => returns> {\n}\ninterface GenericAst = array, bodyDef = unknown, $ = unknown, arg$ = $> {\n [arkKind]: \"generic\";\n paramsAst: params;\n bodyDef: bodyDef;\n $: $;\n arg$: arg$;\n names: genericParamNames;\n t: this;\n}\ndeclare class GenericRoot = array, bodyDef = unknown> extends Callable<(...args: {\n [i in keyof params]: BaseRoot;\n}) => BaseRoot> {\n readonly [arkKind] = \"generic\";\n readonly paramsAst: params;\n readonly t: GenericAst;\n paramDefs: array;\n bodyDef: bodyDef;\n $: BaseScope;\n arg$: BaseScope;\n baseInstantiation: BaseRoot;\n hkt: Hkt.constructor | null;\n description: string;\n constructor(paramDefs: array, bodyDef: bodyDef, $: BaseScope, arg$: BaseScope, hkt: Hkt.constructor | null);\n defIsLazy(): this is GenericRoot;\n protected cacheGetter(name: name, value: this[name]): this[name];\n get json(): JsonStructure;\n get params(): {\n [i in keyof params]: [params[i][0], BaseRoot];\n };\n get names(): genericParamNames;\n get constraints(): {\n [i in keyof params]: BaseRoot;\n };\n get internal(): this;\n get referencesById(): Record;\n get references(): BaseNode[];\n}\ntype genericParamSchemasToAst = {\n [i in keyof schemas]: schemas[i] extends GenericParamDef ? [\n name,\n unknown\n ] : never;\n};\ntype genericHktToConstraints Hkt> = InstanceType[\"constraints\"];\ntype GenericRootParser = (...params: paramsDef) => GenericRootBodyParser>;\ntype GenericRootBodyParser> = {\n (body: RootSchema): GenericRoot;\n (instantiateDef: LazyGenericBody>, hkt: hkt): GenericRoot<{\n [i in keyof params]: [params[i][0], genericHktToConstraints[i]];\n }, InstanceType>;\n};\ndeclare const writeUnsatisfiedParameterConstraintMessage: (name: name, constraint: constraint, arg: arg) => writeUnsatisfiedParameterConstraintMessage;\ntype writeUnsatisfiedParameterConstraintMessage = `${name} must be assignable to ${constraint} (was ${arg})`;\n\ntype ListableJsonSchema = listable;\ntype JsonSchemaOrBoolean = listable;\ntype JsonSchema = JsonSchema.NonBooleanBranch;\ndeclare namespace JsonSchema {\n type TypeName = \"string\" | \"integer\" | \"number\" | \"object\" | \"array\" | \"boolean\" | \"null\";\n /**\n * a subset of JSON Schema's annotations, see:\n * https://json-schema.org/understanding-json-schema/reference/annotations\n **/\n interface Meta extends UniversalMeta {\n $schema?: string;\n $defs?: Record;\n }\n type Format = autocomplete<\"date-time\" | \"date\" | \"time\" | \"email\" | \"ipv4\" | \"ipv6\" | \"uri\" | \"uuid\" | \"regex\">;\n /**\n * doesn't include root-only keys like $schema\n */\n interface UniversalMeta {\n title?: string;\n description?: string;\n format?: Format;\n deprecated?: true;\n default?: t;\n examples?: readonly t[];\n }\n type Composition = Union | OneOf | Intersection | Not;\n type NonBooleanBranch = Constrainable | Const | Composition | Enum | String | Numeric | Object | Array | Ref;\n type Branch = boolean | JsonSchema;\n type RefString = `#/$defs/${string}`;\n interface Ref extends Meta {\n $ref: RefString;\n type?: never;\n }\n interface Constrainable extends Meta {\n type?: listable;\n }\n interface Intersection extends Meta {\n allOf: readonly JsonSchema[];\n }\n interface Not extends Meta {\n not: JsonSchema;\n }\n interface OneOf extends Meta {\n oneOf: readonly JsonSchema[];\n }\n interface Union extends Meta {\n anyOf: readonly JsonSchema[];\n }\n interface Const extends Meta {\n const: unknown;\n }\n interface Enum extends Meta {\n enum: array;\n }\n interface String extends Meta {\n type: \"string\";\n minLength?: number;\n maxLength?: number;\n pattern?: string;\n format?: string;\n }\n interface Numeric extends Meta {\n type: \"number\" | \"integer\";\n multipleOf?: number;\n minimum?: number;\n exclusiveMinimum?: number;\n maximum?: number;\n exclusiveMaximum?: number;\n }\n interface Object extends Meta {\n type: \"object\";\n properties?: Record;\n required?: string[];\n patternProperties?: Record;\n additionalProperties?: JsonSchemaOrBoolean;\n maxProperties?: number;\n minProperties?: number;\n propertyNames?: String;\n }\n interface Array extends Meta {\n type: \"array\";\n additionalItems?: JsonSchemaOrBoolean;\n contains?: JsonSchemaOrBoolean;\n uniqueItems?: boolean;\n minItems?: number;\n maxItems?: number;\n items?: JsonSchemaOrBoolean;\n prefixItems?: readonly Branch[];\n }\n type LengthBoundable = String | Array;\n type Structure = Object | Array;\n}\n\ndeclare class ToJsonSchemaError extends Error {\n readonly name = \"ToJsonSchemaError\";\n readonly code: code;\n readonly context: ToJsonSchema.ContextByCode[code];\n constructor(code: code, context: ToJsonSchema.ContextByCode[code]);\n hasCode(code: code): this is ToJsonSchemaError;\n}\ndeclare const ToJsonSchema: {\n Error: typeof ToJsonSchemaError;\n throw: (code: keyof ToJsonSchema.ContextByCode, context: ToJsonSchema.MorphContext | ToJsonSchema.UnitContext | ToJsonSchema.ProtoContext | ToJsonSchema.DomainContext | ToJsonSchema.PredicateContext | ToJsonSchema.DateContext | ToJsonSchema.ArrayObjectContext | ToJsonSchema.ArrayPostfixContext | ToJsonSchema.DefaultValueContext | ToJsonSchema.PatternIntersectionContext | ToJsonSchema.SymbolKeyContext) => never;\n throwInternalOperandError: (kind: ConstraintKind, schema: JsonSchema) => never;\n defaultConfig: ToJsonSchema.Context;\n};\ndeclare namespace ToJsonSchema {\n type Unjsonifiable = object | symbol | bigint | undefined;\n type Error = InstanceType;\n interface BaseContext {\n code: code;\n base: base;\n }\n interface ArrayObjectContext extends BaseContext<\"arrayObject\", JsonSchema.Array> {\n object: JsonSchema.Object;\n }\n interface ArrayPostfixContext extends BaseContext<\"arrayPostfix\", VariadicArraySchema> {\n elements: readonly JsonSchema[];\n }\n interface DefaultValueContext extends BaseContext<\"defaultValue\", JsonSchema> {\n value: Unjsonifiable;\n }\n interface DomainContext extends BaseContext<\"domain\", JsonSchema> {\n domain: satisfy;\n }\n interface MorphContext extends BaseContext<\"morph\", JsonSchema> {\n out: JsonSchema | null;\n }\n interface PatternIntersectionContext extends BaseContext<\"patternIntersection\", StringSchemaWithPattern> {\n pattern: string;\n }\n interface PredicateContext extends BaseContext<\"predicate\", JsonSchema> {\n predicate: Predicate;\n }\n interface ProtoContext extends BaseContext<\"proto\", JsonSchema> {\n proto: Constructor;\n }\n type SymbolKeyContext = IndexSymbolKeyContext | RequiredSymbolKeyContext | OptionalSymbolKeyContext;\n interface IndexSymbolKeyContext extends BaseContext<\"symbolKey\", JsonSchema.Object> {\n key: null;\n value: JsonSchema;\n optional: false;\n }\n interface RequiredSymbolKeyContext extends BaseContext<\"symbolKey\", JsonSchema.Object> {\n key: symbol;\n value: JsonSchema;\n optional: false;\n }\n interface OptionalSymbolKeyContext extends BaseContext<\"symbolKey\", JsonSchema.Object> {\n key: symbol;\n value: JsonSchema;\n optional: true;\n default?: Json;\n }\n interface UnitContext extends BaseContext<\"unit\", JsonSchema> {\n unit: Unjsonifiable;\n }\n interface DateContext extends BaseContext<\"date\", JsonSchema> {\n before?: Date;\n after?: Date;\n }\n interface ContextByCode {\n arrayObject: ArrayObjectContext;\n arrayPostfix: ArrayPostfixContext;\n defaultValue: DefaultValueContext;\n domain: DomainContext;\n morph: MorphContext;\n patternIntersection: PatternIntersectionContext;\n predicate: PredicateContext;\n proto: ProtoContext;\n symbolKey: SymbolKeyContext;\n unit: UnitContext;\n date: DateContext;\n }\n type Code = keyof ContextByCode;\n type FallbackContext = ContextByCode[Code];\n type HandlerByCode = satisfy<{\n [code in Code]: (ctx: ContextByCode[code]) => unknown;\n }, {\n arrayObject: (ctx: ArrayObjectContext) => JsonSchema.Structure;\n arrayPostfix: (ctx: ArrayPostfixContext) => VariadicArraySchema;\n defaultValue: (ctx: DefaultValueContext) => JsonSchema;\n domain: (ctx: DomainContext) => JsonSchema;\n morph: (ctx: MorphContext) => JsonSchema;\n patternIntersection: (ctx: PatternIntersectionContext) => JsonSchema.String;\n predicate: (ctx: PredicateContext) => JsonSchema;\n proto: (ctx: ProtoContext) => JsonSchema;\n symbolKey: (ctx: SymbolKeyContext) => JsonSchema.Object;\n unit: (ctx: UnitContext) => JsonSchema;\n date: (ctx: DateContext) => JsonSchema;\n }>;\n type VariadicArraySchema = requireKeys;\n type StringSchemaWithPattern = requireKeys;\n type UniversalFallback = (ctx: FallbackContext) => JsonSchema;\n interface FallbackObject extends Partial {\n default?: UniversalFallback;\n }\n type FallbackOption = UniversalFallback | FallbackObject;\n interface Options {\n /** value to assign to the generated $schema key\n *\n * - set to `null` to omit the `$schema` key\n * - does not affect the contents of the generated schema\n *\n * @default \"https://json-schema.org/draft/2020-12/schema\"\n */\n dialect?: string | null;\n useRefs?: boolean;\n fallback?: FallbackOption;\n }\n interface Context extends Required {\n fallback: HandlerByCode;\n }\n}\n\ndeclare class AliasNode extends BaseRoot {\n readonly expression: string;\n readonly structure: undefined;\n get resolution(): BaseRoot;\n protected _resolve(): BaseRoot;\n get resolutionId(): NodeId;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n}\ndeclare namespace Alias {\n type Schema = `$${alias}` | NormalizedSchema;\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly reference: alias;\n readonly resolve?: () => BaseRoot;\n }\n interface Inner {\n readonly reference: alias;\n readonly resolve?: () => BaseRoot;\n }\n interface Declaration extends declareNode<{\n kind: \"alias\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n }> {\n }\n type Node = AliasNode;\n}\ndeclare const Alias: {\n implementation: nodeImplementationOf;\n Node: typeof AliasNode;\n};\n\ndeclare const registryName: string;\ndeclare const $ark: ArkSchemaRegistry;\ndeclare const reference: (name: string) => RegisteredReference;\ndeclare const registeredReference: (value: object | symbol) => RegisteredReference;\ntype RegisteredReference = `$ark${\"\" | NonNegativeIntegerLiteral}.${to}`;\n\ntype InternalResolutions = Record;\ntype exportedNameOf<$> = Exclude;\ntype resolvableReferenceIn<$> = {\n [k in keyof $]: k extends string ? k extends PrivateDeclaration ? alias : k extends noSuggest | \"root\" ? never : k : never;\n}[keyof $];\ntype resolveReference, $> = reference extends keyof $ ? $[reference] : $[`#${reference}` & keyof $];\ntype flatResolutionsOf<$> = show extends infer k ? k extends keyof $ & string ? resolutionsOfReference : unknown : unknown>>;\ntype resolutionsOfReference = [\n v\n] extends [{\n [arkKind]: \"module\";\n}] ? [\n v\n] extends [anyOrNever] ? {\n [_ in k]: v;\n} : prefixKeys, k> & {\n [innerKey in keyof v as innerKey extends \"root\" ? k : never]: v[innerKey];\n} : {\n [_ in k]: v;\n};\ntype prefixKeys = {\n [k in keyof o & string as `${prefix}.${k}`]: o[k];\n} & unknown;\ntype PrivateDeclaration = `#${key}`;\ntype InternalResolution = BaseRoot | GenericRoot | InternalModule;\ntype toInternalScope<$> = BaseScope<{\n [k in keyof $]: $[k] extends {\n [arkKind]: infer kind;\n } ? [\n $[k]\n ] extends [anyOrNever] ? BaseRoot : kind extends \"generic\" ? GenericRoot : kind extends \"module\" ? InternalModule : never : BaseRoot;\n}>;\ntype CachedResolution = NodeId | BaseRoot | GenericRoot;\ndeclare const writeDuplicateAliasError: (alias: alias) => writeDuplicateAliasError;\ntype writeDuplicateAliasError = `#${alias} duplicates public alias ${alias}`;\ntype AliasDefEntry = [name: string, defValue: unknown];\ntype GlobalOnlyConfigOptionName = satisfy;\ninterface ScopeOnlyConfigOptions {\n name?: string;\n prereducedAliases?: boolean;\n}\ninterface ArkSchemaScopeConfig extends Omit, ScopeOnlyConfigOptions {\n}\ninterface ResolvedScopeConfig extends ResolvedConfig, ScopeOnlyConfigOptions {\n}\ntype PrecompiledReferences = {\n [k: `${string}Allows`]: TraverseAllows;\n [k: `${string}Apply`]: TraverseApply;\n [k: `${string}Optimistic`]: (data: unknown) => unknown;\n};\ndeclare abstract class BaseScope<$ extends {} = {}> {\n readonly config: ArkSchemaScopeConfig;\n readonly resolvedConfig: ResolvedScopeConfig;\n readonly name: string;\n get [arkKind](): \"scope\";\n readonly referencesById: {\n [id: string]: BaseNode;\n };\n references: readonly BaseNode[];\n readonly resolutions: {\n [alias: string]: CachedResolution | undefined;\n };\n exportedNames: string[];\n readonly aliases: Record;\n protected resolved: boolean;\n readonly nodesByHash: Record;\n readonly intrinsic: Omit;\n constructor(\n /** The set of names defined at the root-level of the scope mapped to their\n * corresponding definitions.**/\n def: Record, config?: ArkSchemaScopeConfig);\n protected cacheGetter(name: name, value: this[name]): this[name];\n get internal(): this;\n private _json;\n get json(): JsonStructure;\n defineSchema(def: def): def;\n generic: GenericRootParser;\n units: (values: array, opts?: BaseParseOptions) => BaseRoot;\n protected lazyResolutions: Alias.Node[];\n lazilyResolve(resolve: () => BaseRoot, syntheticAlias?: string): Alias.Node;\n schema: InternalSchemaParser;\n parseSchema: InternalSchemaParser;\n protected preparseNode(kinds: NodeKind | listable, schema: unknown, opts: BaseParseOptions): BaseNode | NodeParseContextInput;\n bindReference(reference: reference): reference;\n resolveRoot(name: string): BaseRoot;\n maybeResolveRoot(name: string): BaseRoot | undefined;\n /** If name is a valid reference to a submodule alias, return its resolution */\n protected maybeResolveSubalias(name: string): BaseRoot | GenericRoot | undefined;\n get ambient(): InternalModule;\n maybeResolve(name: string): Exclude | undefined;\n protected createParseContext(input: input): input & AttachedParseContext;\n traversal(root: unknown): Traversal;\n import(): SchemaModule<{\n [k in exportedNameOf<$> as PrivateDeclaration]: $[k];\n }>;\n import[]>(...names: names): SchemaModule<{\n [k in names[number] as PrivateDeclaration]: $[k];\n } & unknown>;\n precompilation: string | undefined;\n private _exportedResolutions;\n private _exports;\n export(): SchemaModule<{\n [k in exportedNameOf<$>]: $[k];\n }>;\n export[]>(...names: names): SchemaModule<{\n [k in names[number]]: $[k];\n } & unknown>;\n resolve>(name: name): instantiateRoot<$[name]>;\n node: , prereduced extends boolean = false>(kinds: kinds, nodeSchema: NodeSchema>, opts?: BaseParseOptions) => nodeOfKind : reducibleKindOf>>;\n parse: (def: unknown, opts?: BaseParseOptions) => BaseRoot;\n parseDefinition(def: unknown, opts?: BaseParseOptions): BaseRoot;\n finalize(node: node): node;\n protected abstract preparseOwnDefinitionFormat(def: unknown, opts: BaseParseOptions): BaseRoot | BaseParseContextInput;\n abstract parseOwnDefinitionFormat(def: unknown, ctx: BaseParseContext): BaseRoot;\n protected abstract preparseOwnAliasEntry(k: string, v: unknown): AliasDefEntry;\n protected abstract normalizeRootScopeValue(resolution: unknown): unknown;\n}\ndeclare class SchemaScope<$ extends {} = {}> extends BaseScope<$> {\n parseOwnDefinitionFormat(def: unknown, ctx: NodeParseContext): BaseRoot;\n protected preparseOwnDefinitionFormat(schema: RootSchema, opts: BaseParseOptions): BaseRoot | NodeParseContextInput;\n protected preparseOwnAliasEntry(k: string, v: unknown): AliasDefEntry;\n protected normalizeRootScopeValue(v: unknown): unknown;\n}\ntype instantiateAliases = {\n [k in keyof aliases]: aliases[k] extends InternalResolution ? aliases[k] : BaseRoot;\n} & unknown;\ntype SchemaScopeParser = (aliases: {\n [k in keyof aliases]: conform;\n}, config?: ArkSchemaScopeConfig) => BaseScope>;\ndeclare const schemaScope: SchemaScopeParser;\ntype InternalSchemaParser = (schema: RootSchema, opts?: BaseParseOptions) => BaseRoot;\ndeclare const rootSchemaScope: SchemaScope;\ndeclare const parseAsSchema: (def: unknown, opts?: BaseParseOptions) => BaseRoot | ParseError;\ntype RootExportCache = Record;\ndeclare const writeUnresolvableMessage: (token: token) => writeUnresolvableMessage;\ntype writeUnresolvableMessage = `'${token}' is unresolvable`;\ndeclare const writeNonSubmoduleDotMessage: (name: name) => writeNonSubmoduleDotMessage;\ntype writeNonSubmoduleDotMessage = `'${name}' must reference a module to be accessed using dot syntax`;\ndeclare const writeMissingSubmoduleAccessMessage: (name: name) => writeMissingSubmoduleAccessMessage;\ntype writeMissingSubmoduleAccessMessage = `Reference to submodule '${name}' must specify an alias`;\ndeclare const rootSchema: BaseScope[\"schema\"];\ndeclare const node: BaseScope[\"node\"];\ndeclare const defineSchema: BaseScope[\"defineSchema\"];\ndeclare const genericNode: BaseScope[\"generic\"];\n\ndeclare class IndexNode extends BaseConstraint {\n impliedBasis: BaseRoot;\n expression: string;\n flatRefs: FlatRef>[];\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n protected _transform(mapper: DeepNodeTransformation, ctx: DeepNodeTransformContext): BaseNode | null;\n compile(): void;\n}\ndeclare namespace Index {\n type KeyKind = Exclude;\n type KeyNode = nodeOfKind;\n interface Schema extends BaseNormalizedSchema {\n readonly signature: RootSchema;\n readonly value: RootSchema;\n }\n interface Inner {\n readonly signature: KeyNode;\n readonly value: BaseRoot;\n }\n interface Declaration extends declareNode<{\n kind: \"index\";\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n prerequisite: object;\n intersectionIsOpen: true;\n childKind: RootKind;\n }> {\n }\n type Node = IndexNode;\n}\ndeclare const Index: {\n implementation: nodeImplementationOf;\n Node: typeof IndexNode;\n};\ndeclare const writeEnumerableIndexBranches: (keys: string[]) => string;\ndeclare const writeInvalidPropertyKeyMessage: (indexSchema: indexSchema) => writeInvalidPropertyKeyMessage;\ntype writeInvalidPropertyKeyMessage = `Indexed key definition '${indexSchema}' must be a string or symbol`;\n\ndeclare class RequiredNode extends BaseProp<\"required\"> {\n expression: string;\n errorContext: NodeErrorContextInput<\"required\">;\n compiledErrorContext: string;\n}\ndeclare namespace Required$1 {\n interface ErrorContext extends BaseErrorContext<\"required\"> {\n missingValueDescription: string;\n }\n interface Schema extends Prop.Schema {\n }\n interface Inner extends Prop.Inner {\n }\n type Declaration = declareNode & {\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n errorContext: ErrorContext;\n }>;\n type Node = RequiredNode;\n}\ndeclare const Required$1: {\n implementation: nodeImplementationOf<{\n reducibleTo: \"required\";\n kind: \"required\";\n prerequisite: object;\n intersectionIsOpen: true;\n childKind: RootKind;\n schema: Required$1.Schema;\n normalizedSchema: Required$1.Schema;\n inner: Required$1.Inner;\n errorContext: Required$1.ErrorContext;\n }>;\n Node: typeof RequiredNode;\n};\n\ndeclare namespace Prop {\n type Kind = \"required\" | \"optional\";\n type Node = nodeOfKind;\n interface Schema extends BaseNormalizedSchema {\n readonly key: Key;\n readonly value: RootSchema;\n }\n interface Inner {\n readonly key: Key;\n readonly value: BaseRoot;\n }\n interface Declaration {\n kind: kind;\n prerequisite: object;\n intersectionIsOpen: true;\n childKind: RootKind;\n }\n}\ndeclare const intersectProps: (l: nodeOfKind, r: nodeOfKind, ctx: IntersectionContext) => nodeOfKind | Disjoint | null;\ndeclare abstract class BaseProp extends BaseConstraint {\n required: boolean;\n optional: boolean;\n impliedBasis: BaseRoot;\n serializedKey: string;\n compiledKey: string;\n flatRefs: FlatRef[];\n protected _transform(mapper: DeepNodeTransformation, ctx: DeepNodeTransformContext): BaseNode | null;\n hasDefault(): this is Optional.Node.withDefault;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n}\ndeclare const writeDefaultIntersectionMessage: (lValue: unknown, rValue: unknown) => string;\n\ndeclare class OptionalNode extends BaseProp<\"optional\"> {\n constructor(...args: ConstructorParameters);\n get outProp(): Prop.Node;\n expression: string;\n defaultValueMorph: Morph | undefined;\n defaultValueMorphRef: string | undefined;\n}\ndeclare namespace Optional {\n interface Schema extends Prop.Schema {\n default?: unknown;\n }\n interface Inner extends Prop.Inner {\n default?: unknown;\n }\n type Declaration = declareNode & {\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n }>;\n type Node = OptionalNode;\n namespace Node {\n type withDefault = requireKeys;\n }\n}\ndeclare const Optional: {\n implementation: nodeImplementationOf<{\n reducibleTo: \"optional\";\n errorContext: null;\n kind: \"optional\";\n prerequisite: object;\n intersectionIsOpen: true;\n childKind: RootKind;\n schema: Optional.Schema;\n normalizedSchema: Optional.Schema;\n inner: Optional.Inner;\n }>;\n Node: typeof OptionalNode;\n};\ndeclare const computeDefaultValueMorph: (key: PropertyKey, value: BaseRoot, defaultInput: unknown) => Morph;\ndeclare const assertDefaultValueAssignability: (node: BaseRoot, value: unknown, key: PropertyKey | null) => unknown;\ntype writeUnassignableDefaultValueMessage = `Default value ${defaultValue} must be assignable to ${baseDef}`;\ndeclare const writeNonPrimitiveNonFunctionDefaultValueMessage: (key: PropertyKey | null) => string;\n\ninterface BaseRangeDeclaration extends BaseNodeDeclaration {\n kind: RangeKind;\n inner: BaseRangeInner;\n normalizedSchema: UnknownExpandedRangeSchema;\n}\ndeclare abstract class BaseRange extends InternalPrimitiveConstraint {\n readonly exclusive?: true;\n readonly boundOperandKind: OperandKindsByBoundKind[d[\"kind\"]];\n readonly compiledActual: string;\n readonly comparator: RelativeComparator;\n readonly numericLimit: number;\n readonly expression: string;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly stringLimit: string;\n readonly limitKind: LimitKind;\n isStricterThan(r: nodeOfKind>): boolean;\n overlapsRange(r: nodeOfKind>): boolean;\n overlapIsUnit(r: nodeOfKind>): boolean;\n}\ninterface BaseRangeInner {\n readonly rule: LimitValue;\n}\ntype LimitValue = Date | number;\ntype LimitSchemaValue = Date | number | string;\ntype LimitInnerValue = kind extends \"before\" | \"after\" ? Date : number;\ninterface UnknownExpandedRangeSchema extends BaseNormalizedSchema {\n readonly rule: LimitSchemaValue;\n readonly exclusive?: boolean;\n}\ninterface UnknownNormalizedRangeSchema extends BaseNormalizedSchema {\n readonly rule: LimitSchemaValue;\n}\ntype UnknownRangeSchema = LimitSchemaValue | UnknownExpandedRangeSchema;\ninterface ExclusiveExpandedDateRangeSchema extends BaseNormalizedSchema {\n rule: LimitSchemaValue;\n exclusive?: true;\n}\ntype ExclusiveDateRangeSchema = LimitSchemaValue | ExclusiveExpandedDateRangeSchema;\ninterface InclusiveExpandedDateRangeSchema extends BaseNormalizedSchema {\n rule: LimitSchemaValue;\n exclusive?: false;\n}\ntype InclusiveDateRangeSchema = LimitSchemaValue | InclusiveExpandedDateRangeSchema;\ninterface ExclusiveNormalizedNumericRangeSchema extends BaseNormalizedSchema {\n rule: number;\n exclusive?: true;\n}\ntype ExclusiveNumericRangeSchema = number | ExclusiveNormalizedNumericRangeSchema;\ninterface InclusiveNormalizedNumericRangeSchema extends BaseNormalizedSchema {\n rule: number;\n exclusive?: false;\n}\ntype InclusiveNumericRangeSchema = number | InclusiveNormalizedNumericRangeSchema;\ntype LimitKind = \"lower\" | \"upper\";\ntype RelativeComparator = {\n lower: \">\" | \">=\";\n upper: \"<\" | \"<=\";\n}[kind];\ndeclare const boundKindPairsByLower: BoundKindPairsByLower;\ntype BoundKindPairsByLower = {\n min: \"max\";\n minLength: \"maxLength\";\n after: \"before\";\n};\ntype BoundKindPairsByUpper = {\n max: \"min\";\n maxLength: \"minLength\";\n before: \"after\";\n};\ntype pairedRangeKind = kind extends LowerBoundKind ? BoundKindPairsByLower[kind] : BoundKindPairsByUpper[kind & UpperBoundKind];\ntype LowerBoundKind = keyof typeof boundKindPairsByLower;\ntype LowerNode = nodeOfKind;\ntype UpperBoundKind = propValueOf;\ntype UpperNode = nodeOfKind;\ntype NumericallyBoundable = string | number | array;\ntype Boundable = NumericallyBoundable | Date;\ndeclare const parseExclusiveKey: keySchemaDefinitions>[\"exclusive\"];\ndeclare const createLengthSchemaNormalizer: (kind: kind) => (schema: NodeSchema) => NormalizedSchema;\ndeclare const createDateSchemaNormalizer: (kind: kind) => (schema: NodeSchema) => NormalizedSchema;\ndeclare const parseDateLimit: (limit: LimitSchemaValue) => Date;\ntype LengthBoundKind = \"minLength\" | \"maxLength\" | \"exactLength\";\ndeclare const writeInvalidLengthBoundMessage: (kind: LengthBoundKind, limit: number) => string;\ndeclare const createLengthRuleParser: (kind: LengthBoundKind) => (limit: number) => number | undefined;\ntype OperandKindsByBoundKind = satisfy, {\n min: \"value\";\n max: \"value\";\n minLength: \"length\";\n maxLength: \"length\";\n after: \"date\";\n before: \"date\";\n}>;\ndeclare const compileComparator: (kind: RangeKind, exclusive: boolean | undefined) => RelativeComparator;\ntype BoundOperandKind = \"value\" | \"length\" | \"date\";\ntype LengthBoundableData = string | array;\ntype DateRangeKind = \"before\" | \"after\";\ndeclare const dateLimitToString: (limit: LimitSchemaValue) => string;\ndeclare const writeUnboundableMessage: (root: root) => writeUnboundableMessage;\ntype writeUnboundableMessage = `Bounded expression ${root} must be exactly one of number, string, Array, or Date`;\n\ndeclare class ExactLengthNode extends InternalPrimitiveConstraint {\n traverseAllows: TraverseAllows;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly impliedBasis: BaseRoot;\n readonly expression: string;\n reduceJsonSchema(schema: JsonSchema.LengthBoundable): JsonSchema.LengthBoundable;\n}\ndeclare namespace ExactLength {\n interface Inner {\n readonly rule: number;\n }\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly rule: number;\n }\n type Schema = NormalizedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"exactLength\">, Inner {\n }\n type Declaration = declareNode<{\n kind: \"exactLength\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: LengthBoundableData;\n errorContext: ErrorContext;\n }>;\n type Node = ExactLengthNode;\n}\ndeclare const ExactLength: {\n implementation: nodeImplementationOf<{\n intersectionIsOpen: false;\n childKind: never;\n reducibleTo: \"exactLength\";\n kind: \"exactLength\";\n schema: ExactLength.Schema;\n normalizedSchema: ExactLength.NormalizedSchema;\n inner: ExactLength.Inner;\n prerequisite: LengthBoundableData;\n errorContext: ExactLength.ErrorContext;\n }>;\n Node: typeof ExactLengthNode;\n};\n\ndeclare class MaxLengthNode extends BaseRange {\n readonly impliedBasis: BaseRoot;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(schema: JsonSchema.LengthBoundable): JsonSchema.LengthBoundable;\n}\ndeclare namespace MaxLength {\n interface Inner extends BaseRangeInner {\n rule: number;\n }\n interface NormalizedSchema extends UnknownNormalizedRangeSchema {\n rule: number;\n }\n interface ExpandedSchema extends UnknownExpandedRangeSchema {\n rule: number;\n }\n type Schema = ExpandedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"maxLength\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"maxLength\";\n schema: Schema;\n reducibleTo: \"exactLength\";\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: LengthBoundableData;\n errorContext: ErrorContext;\n }> {\n }\n type Node = MaxLengthNode;\n}\ndeclare const MaxLength: {\n implementation: nodeImplementationOf;\n Node: typeof MaxLengthNode;\n};\n\ndeclare class MinLengthNode extends BaseRange {\n readonly impliedBasis: BaseRoot;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(schema: JsonSchema.LengthBoundable): JsonSchema.LengthBoundable;\n}\ndeclare namespace MinLength {\n interface Inner extends BaseRangeInner {\n rule: number;\n }\n interface NormalizedSchema extends UnknownNormalizedRangeSchema {\n rule: number;\n }\n interface ExpandedSchema extends UnknownExpandedRangeSchema {\n rule: number;\n }\n type Schema = ExpandedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"minLength\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"minLength\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: LengthBoundableData;\n reducibleTo: \"intersection\";\n errorContext: ErrorContext;\n }> {\n }\n type Node = MinLengthNode;\n}\ndeclare const MinLength: {\n implementation: nodeImplementationOf;\n Node: typeof MinLengthNode;\n};\n\ndeclare class SequenceNode extends BaseConstraint {\n impliedBasis: BaseRoot;\n tuple: SequenceTuple;\n prefixLength: number;\n defaultablesLength: number;\n optionalsLength: number;\n postfixLength: number;\n defaultablesAndOptionals: BaseRoot[];\n prevariadic: array;\n variadicOrPostfix: array;\n flatRefs: FlatRef[];\n protected addFlatRefs(): FlatRef[];\n isVariadicOnly: boolean;\n minVariadicLength: number;\n minLength: number;\n minLengthNode: MinLengthNode | null;\n maxLength: number | null;\n maxLengthNode: MaxLengthNode | ExactLengthNode | null;\n impliedSiblings: array;\n defaultValueMorphs: Morph[];\n defaultValueMorphsReference: `$ark.${string}` | `$ark0.${string}` | `$ark${`1${string}` & `${bigint}`}.${string}` | `$ark${`4${string}` & `${bigint}`}.${string}` | `$ark${`2${string}` & `${bigint}`}.${string}` | `$ark${`3${string}` & `${bigint}`}.${string}` | `$ark${`5${string}` & `${bigint}`}.${string}` | `$ark${`6${string}` & `${bigint}`}.${string}` | `$ark${`7${string}` & `${bigint}`}.${string}` | `$ark${`8${string}` & `${bigint}`}.${string}` | `$ark${`9${string}` & `${bigint}`}.${string}` | undefined;\n protected elementAtIndex(data: array, index: number): SequenceElement;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n get element(): BaseRoot;\n compile(js: NodeCompiler): void;\n protected _transform(mapper: DeepNodeTransformation, ctx: DeepNodeTransformContext): BaseNode | null;\n expression: string;\n reduceJsonSchema(schema: JsonSchema.Array, ctx: ToJsonSchema.Context): JsonSchema.Array;\n}\ndeclare namespace Sequence {\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly prefix?: array;\n readonly defaultables?: array;\n readonly optionals?: array;\n readonly variadic?: RootSchema;\n readonly minVariadicLength?: number;\n readonly postfix?: array;\n }\n type Schema = NormalizedSchema | RootSchema;\n type DefaultableSchema = [schema: RootSchema, defaultValue: unknown];\n type DefaultableElement = [node: BaseRoot, defaultValue: unknown];\n interface Inner {\n readonly prefix?: array;\n readonly defaultables?: array;\n readonly optionals?: array;\n readonly variadic?: BaseRoot;\n readonly minVariadicLength?: number;\n readonly postfix?: array;\n }\n interface Declaration extends declareNode<{\n kind: \"sequence\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: array;\n reducibleTo: \"sequence\";\n childKind: RootKind;\n }> {\n }\n type Node = SequenceNode;\n}\ndeclare const Sequence: {\n implementation: nodeImplementationOf;\n Node: typeof SequenceNode;\n};\ndeclare const postfixAfterOptionalOrDefaultableMessage = \"A postfix required element cannot follow an optional or defaultable element\";\ntype postfixAfterOptionalOrDefaultableMessage = typeof postfixAfterOptionalOrDefaultableMessage;\ndeclare const postfixWithoutVariadicMessage = \"A postfix element requires a variadic element\";\ntype postfixWithoutVariadicMessage = typeof postfixWithoutVariadicMessage;\ntype SequenceElement = PrevariadicSequenceElement | VariadicSequenceElement | PostfixSequenceElement;\ntype SequenceElementKind = satisfy;\ntype PrevariadicSequenceElement = PrefixSequenceElement | DefaultableSequenceElement | OptionalSequenceElement;\ntype PrefixSequenceElement = {\n kind: \"prefix\";\n node: BaseRoot;\n};\ntype OptionalSequenceElement = {\n kind: \"optionals\";\n node: BaseRoot;\n};\ntype PostfixSequenceElement = {\n kind: \"postfix\";\n node: BaseRoot;\n};\ntype VariadicSequenceElement = {\n kind: \"variadic\";\n node: BaseRoot;\n};\ntype DefaultableSequenceElement = {\n kind: \"defaultables\";\n node: BaseRoot;\n default: unknown;\n};\ntype SequenceTuple = array;\n\n/**\n * - `\"ignore\"` (default) - allow and preserve extra properties\n * - `\"reject\"` - disallow extra properties\n * - `\"delete\"` - clone and remove extra properties from output\n */\ntype UndeclaredKeyBehavior = \"ignore\" | UndeclaredKeyHandling;\ntype UndeclaredKeyHandling = \"reject\" | \"delete\";\ndeclare class StructureNode extends BaseConstraint {\n impliedBasis: BaseRoot;\n impliedSiblings: BaseConstraint[];\n props: array;\n propsByKey: Record;\n propsByKeyReference: RegisteredReference;\n expression: string;\n requiredKeys: Key[];\n optionalKeys: Key[];\n literalKeys: Key[];\n _keyof: BaseRoot | undefined;\n keyof(): BaseRoot;\n map(flatMapProp: PropFlatMapper): StructureNode;\n assertHasKeys(keys: array): void;\n get(indexer: GettableKeyOrNode, ...path: array): BaseRoot;\n pick(...keys: KeyOrKeyNode[]): StructureNode;\n omit(...keys: KeyOrKeyNode[]): StructureNode;\n optionalize(): StructureNode;\n require(): StructureNode;\n merge(r: StructureNode): StructureNode;\n private filterKeys;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n protected _traverse: (traversalKind: TraversalKind, data: object, ctx: InternalTraversal) => boolean;\n get defaultable(): Optional.Node.withDefault[];\n declaresKey: (k: Key) => boolean;\n _compileDeclaresKey(js: NodeCompiler): string;\n get structuralMorph(): Morph | undefined;\n structuralMorphRef: RegisteredReference | undefined;\n compile(js: NodeCompiler): unknown;\n protected compileExhaustiveEntry(js: NodeCompiler): NodeCompiler;\n reduceJsonSchema(schema: JsonSchema.Structure, ctx: ToJsonSchema.Context): JsonSchema.Structure;\n reduceObjectJsonSchema(schema: JsonSchema.Object, ctx: ToJsonSchema.Context): JsonSchema.Object;\n}\ntype PropFlatMapper = (entry: Prop.Node) => listable;\ntype MappedPropInner = BaseMappedPropInner | OptionalMappedPropInner;\ninterface BaseMappedPropInner extends Required$1.Schema {\n kind?: \"required\" | \"optional\";\n}\ninterface OptionalMappedPropInner extends Optional.Schema {\n kind: \"optional\";\n}\ndeclare namespace Structure {\n interface Schema extends BaseNormalizedSchema {\n readonly optional?: readonly Optional.Schema[];\n readonly required?: readonly Required$1.Schema[];\n readonly index?: readonly Index.Schema[];\n readonly sequence?: Sequence.Schema;\n readonly undeclared?: UndeclaredKeyBehavior;\n }\n interface Inner {\n readonly optional?: readonly Optional.Node[];\n readonly required?: readonly Required$1.Node[];\n readonly index?: readonly Index.Node[];\n readonly sequence?: Sequence.Node;\n readonly undeclared?: UndeclaredKeyHandling;\n }\n namespace Inner {\n type mutable = makeRootAndArrayPropertiesMutable;\n }\n interface Declaration extends declareNode<{\n kind: \"structure\";\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n prerequisite: object;\n childKind: StructuralKind;\n }> {\n }\n type Node = StructureNode;\n}\ndeclare const Structure: {\n implementation: nodeImplementationOf;\n Node: typeof StructureNode;\n};\ndeclare const writeNumberIndexMessage: (indexExpression: string, sequenceExpression: string) => string;\ntype NormalizedIndex = {\n index?: Index.Node;\n required?: Required$1.Node[];\n optional?: Optional.Node[];\n};\n/** extract enumerable named props from an index signature */\ndeclare const normalizeIndex: (signature: BaseRoot, value: BaseRoot, $: BaseScope) => NormalizedIndex;\ndeclare const typeKeyToString: (k: KeyOrKeyNode) => string;\ndeclare const writeInvalidKeysMessage: >(o: o, keys: keys) => string;\n\ndeclare const basisKinds: readonly [\"unit\", \"proto\", \"domain\"];\ntype BasisKind = (typeof basisKinds)[number];\ndeclare const structuralKinds: readonly [\"required\", \"optional\", \"index\", \"sequence\"];\ntype StructuralKind = (typeof structuralKinds)[number];\ntype RangeKind = Exclude;\ntype BoundKind = Exclude;\ndeclare const refinementKinds: readonly [\"pattern\", \"divisor\", \"exactLength\", \"max\", \"min\", \"maxLength\", \"minLength\", \"before\", \"after\"];\ntype RefinementKind = (typeof refinementKinds)[number];\ntype orderedConstraintKinds = [\n ...typeof refinementKinds,\n ...typeof structuralKinds,\n \"structure\",\n \"predicate\"\n];\ndeclare const constraintKinds: orderedConstraintKinds;\ntype ConstraintKind = (typeof constraintKinds)[number];\ndeclare const rootKinds: readonly [\"alias\", \"union\", \"morph\", \"unit\", \"intersection\", \"proto\", \"domain\"];\ntype RootKind = (typeof rootKinds)[number];\ntype NodeKind = RootKind | ConstraintKind;\ntype orderedNodeKinds = [...typeof rootKinds, ...typeof constraintKinds];\ndeclare const nodeKinds: orderedNodeKinds;\ntype OpenNodeKind = {\n [k in NodeKind]: Declaration[\"intersectionIsOpen\"] extends true ? k : never;\n}[NodeKind];\ntype ClosedNodeKind = Exclude;\ntype PrimitiveKind = RefinementKind | BasisKind | \"predicate\";\ntype CompositeKind = Exclude;\ntype OrderedNodeKinds = typeof nodeKinds;\ndeclare const constraintKeys: KeySet;\ndeclare const structureKeys: keySetOf;\ntype RightsByKind = accumulateRightKinds;\ntype kindOrRightOf = kind | kindRightOf;\ntype kindLeftOf = Exclude>;\ntype kindOrLeftOf = kind | kindLeftOf;\ntype accumulateRightKinds = remaining extends (readonly [infer head extends NodeKind, ...infer tail extends NodeKind[]]) ? accumulateRightKinds : result;\ninterface InternalIntersectionOptions {\n pipe: boolean;\n}\ninterface IntersectionContext extends InternalIntersectionOptions {\n $: BaseScope;\n invert: boolean;\n}\ntype ConstraintIntersection> = (l: nodeOfKind, r: nodeOfKind, ctx: IntersectionContext) => BaseNode | Disjoint | null;\ntype ConstraintIntersectionMap = show<{\n [_ in kind]: ConstraintIntersection;\n} & {\n [rKind in kindRightOf]?: ConstraintIntersection;\n}>;\ntype RootIntersection> = (l: nodeOfKind, r: nodeOfKind, ctx: IntersectionContext) => BaseRoot | Disjoint;\ntype TypeIntersectionMap = {\n [rKind in schemaKindOrRightOf]: RootIntersection;\n};\ntype IntersectionMap = kind extends RootKind ? TypeIntersectionMap : ConstraintIntersectionMap;\ntype UnknownIntersectionMap = {\n [k in NodeKind]?: (l: BaseNode, r: BaseNode, ctx: IntersectionContext) => UnknownIntersectionResult;\n};\ntype UnknownIntersectionResult = BaseNode | Disjoint | null;\ntype PrecedenceByKind = {\n [i in arrayIndexOf as OrderedNodeKinds[i]]: i;\n};\ndeclare const precedenceByKind: PrecedenceByKind;\ndeclare const isNodeKind: (value: unknown) => value is NodeKind;\ndeclare function assertNodeKind(value: BaseNode, kind: kind): asserts value is nodeOfKind;\ntype precedenceOfKind = PrecedenceByKind[kind];\ndeclare const precedenceOfKind: (kind: kind) => precedenceOfKind;\ntype kindRightOf = RightsByKind[kind];\ndeclare const schemaKindsRightOf: (kind: kind) => schemaKindRightOf[];\ndeclare const unionChildKinds: readonly [...(\"intersection\" | \"morph\" | \"unit\" | \"proto\" | \"domain\")[], \"alias\"];\ntype UnionChildKind = (typeof unionChildKinds)[number];\ndeclare const morphChildKinds: readonly [...(\"intersection\" | \"unit\" | \"proto\" | \"domain\")[], \"alias\"];\ntype MorphChildKind = (typeof morphChildKinds)[number];\ntype keySchemaDefinitions = {\n [k in keyRequiringSchemaDefinition]: NodeKeyImplementation;\n};\ntype keyRequiringSchemaDefinition = Exclude;\ndeclare const defaultValueSerializer: (v: unknown) => Json;\ntype NodeKeyImplementation : never> = requireKeys<{\n preserveUndefined?: true;\n child?: boolean | ((value: instantiated) => BaseNode[]);\n serialize?: (schema: instantiated) => Json;\n reduceIo?: (ioKind: \"in\" | \"out\", inner: makeRootAndArrayPropertiesMutable, value: d[\"inner\"][k]) => void;\n parse?: (schema: Exclude, ctx: NodeParseContext) => instantiated | undefined;\n}, (d[\"normalizedSchema\"][k] extends instantiated | undefined ? never : \"parse\") | ([instantiated] extends [listable] ? \"child\" : never)>;\ninterface CommonNodeImplementationInput {\n kind: d[\"kind\"];\n keys: keySchemaDefinitions;\n normalize: (schema: d[\"schema\"], $: BaseScope) => d[\"normalizedSchema\"];\n applyConfig?: (schema: d[\"normalizedSchema\"], config: ResolvedScopeConfig) => d[\"normalizedSchema\"];\n hasAssociatedError: d[\"errorContext\"] extends null ? false : true;\n finalizeInnerJson?: (json: {\n [k in keyof d[\"inner\"]]: Json;\n }) => JsonStructure;\n collapsibleKey?: keyof d[\"inner\"];\n reduce?: (inner: d[\"inner\"], $: BaseScope) => nodeOfKind | Disjoint | undefined;\n obviatesBasisDescription?: d[\"kind\"] extends RefinementKind ? true : never;\n obviatesBasisExpression?: d[\"kind\"] extends RefinementKind ? true : never;\n}\ninterface UnknownNodeImplementation extends CommonNodeImplementationInput {\n defaults: ResolvedUnknownNodeConfig;\n intersectionIsOpen: boolean;\n intersections: UnknownIntersectionMap;\n keys: Record>;\n}\ndeclare const compileObjectLiteral: (ctx: object) => string;\ntype nodeImplementationOf = nodeImplementationInputOf & {\n intersections: IntersectionMap;\n intersectionIsOpen: d[\"intersectionIsOpen\"];\n defaults: Required>;\n};\ntype nodeImplementationInputOf = CommonNodeImplementationInput & {\n intersections: IntersectionMap;\n defaults: nodeSchemaaultsImplementationInputFor;\n} & (d[\"intersectionIsOpen\"] extends true ? {\n intersectionIsOpen: true;\n} : {}) & (d[\"reducibleTo\"] extends d[\"kind\"] ? {} : {\n reduce: {};\n});\ntype nodeSchemaaultsImplementationInputFor = requireKeys, \"description\" | (Inner extends (Omit, keyof BaseErrorContext | \"description\">) ? never : \"expected\" & keyof NodeConfig)>;\ntype DescriptionWriter = (node: nodeOfKind) => string;\ninterface UnknownAttachments {\n readonly kind: NodeKind;\n readonly impl: UnknownNodeImplementation;\n readonly id: NodeId;\n readonly inner: Record;\n readonly innerEntries: readonly Entry[];\n readonly innerJson: object;\n readonly innerHash: string;\n readonly meta: NodeMeta;\n readonly metaJson: object;\n readonly json: object;\n readonly hash: string;\n readonly collapsibleJson: Json;\n readonly children: BaseNode[];\n}\ninterface NarrowedAttachments extends UnknownAttachments {\n kind: d[\"kind\"];\n inner: d[\"inner\"];\n json: JsonStructure;\n innerJson: JsonStructure;\n collapsibleJson: Json;\n children: nodeOfKind[];\n}\ndeclare const implementNode: (_: nodeImplementationInputOf) => nodeImplementationOf;\n\ndeclare abstract class InternalBasis extends BaseRoot {\n abstract compiledCondition: string;\n abstract compiledNegation: string;\n structure: undefined;\n traverseApply: TraverseApply;\n get errorContext(): d[\"errorContext\"];\n get compiledErrorContext(): string;\n compile(js: NodeCompiler): void;\n}\n\ndeclare class DomainNode extends InternalBasis {\n private readonly requiresNaNCheck;\n readonly traverseAllows: TraverseAllows;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly expression: string;\n get nestableExpression(): string;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema.Constrainable;\n}\ntype Domain = Domain$1;\ndeclare namespace Domain {\n type Enumerable = \"undefined\" | \"null\" | \"boolean\";\n type NonEnumerable = Exclude;\n interface Inner {\n readonly domain: domain;\n readonly numberAllowsNaN?: boolean;\n }\n interface NormalizedSchema extends BaseNormalizedSchema, Inner {\n }\n type Schema = domain | NormalizedSchema;\n interface ErrorContext extends BaseErrorContext<\"domain\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"domain\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n errorContext: ErrorContext;\n }> {\n }\n type Node = DomainNode;\n}\ndeclare const Domain: {\n implementation: nodeImplementationOf;\n Node: typeof DomainNode;\n writeBadAllowNanMessage: (actual: Exclude) => string;\n};\n\ninterface DisjointEntry {\n kind: kind;\n l: OperandsByDisjointKind[kind];\n r: OperandsByDisjointKind[kind];\n path: Key[];\n optional: boolean;\n}\ntype OperandsByDisjointKind = {\n domain: nodeOfKind<\"domain\"> | Domain.Enumerable;\n unit: nodeOfKind<\"unit\">;\n proto: nodeOfKind<\"proto\">;\n presence: BaseRoot;\n range: nodeOfKind;\n assignability: BaseNode;\n union: readonly BaseRoot[];\n};\ntype DisjointEntryContext = {\n path?: Key[];\n optional?: true;\n};\ndeclare class Disjoint extends Array {\n static init(kind: kind, l: OperandsByDisjointKind[kind], r: OperandsByDisjointKind[kind], ctx?: DisjointEntryContext): Disjoint;\n add(kind: kind, l: OperandsByDisjointKind[kind], r: OperandsByDisjointKind[kind], ctx?: DisjointEntryContext): Disjoint;\n get summary(): string;\n describeReasons(): string;\n throw(): never;\n invert(): Disjoint;\n withPrefixKey(key: PropertyKey, kind: Prop.Kind): Disjoint;\n toNeverIfDisjoint(): BaseRoot;\n}\ntype DisjointKind = keyof OperandsByDisjointKind;\ndeclare const writeUnsatisfiableExpressionError: (expression: expression) => writeUnsatisfiableExpressionError;\ntype writeUnsatisfiableExpressionError = `${expression} results in an unsatisfiable type`;\n\ntype withMetaPrefixedKeys = {\n [k in keyof o as k extends string ? `meta.${k}` : never]: o[k];\n};\ninterface DefaultArkEnv {\n meta(): {};\n onFail(errors: ArkErrors): ArkErrors;\n}\ninterface NodeMeta extends JsonSchema.UniversalMeta, UnknownErrorConfigs {\n alias?: string;\n onFail?: ArkErrors.Handler;\n}\ndeclare global {\n export interface ArkEnv extends DefaultArkEnv {\n }\n export namespace ArkEnv {\n type meta = show>;\n type onFail = ReturnType;\n }\n}\ntype TypeMeta = Omit;\ndeclare namespace TypeMeta {\n type Collapsible = meta | string;\n type Mapper = (existing: Readonly) => meta;\n type MappableInput = Collapsible | Mapper;\n namespace MappableInput {\n type Internal = MappableInput;\n }\n}\ninterface BaseNormalizedSchema extends withMetaPrefixedKeys {\n readonly meta?: ArkEnv.meta | string;\n}\ninterface DeclarationInput {\n kind: NodeKind;\n schema: unknown;\n normalizedSchema: BaseNormalizedSchema;\n inner: object;\n errorContext?: BaseErrorContext;\n reducibleTo?: NodeKind;\n intersectionIsOpen?: true;\n prerequisite?: unknown;\n childKind?: NodeKind;\n}\ninterface BaseErrorContext {\n readonly description?: string;\n readonly code: kind;\n readonly meta: NodeMeta;\n}\ntype defaultErrorContext = show & d[\"inner\"]>;\ntype declareNode = merge<{\n intersectionIsOpen: false;\n prerequisite: prerequisiteOf;\n childKind: never;\n reducibleTo: d[\"kind\"];\n errorContext: null;\n}, d>;\ntype prerequisiteOf = \"prerequisite\" extends keyof d ? d[\"prerequisite\"] : unknown;\ntype attachmentsOf = NarrowedAttachments & attachedInner;\ntype attachedInner = \"intersection\" & d[\"kind\"] extends never ? d[\"inner\"] : {};\ninterface BaseNodeDeclaration {\n kind: NodeKind;\n schema: unknown;\n normalizedSchema: BaseNormalizedSchema;\n inner: {};\n reducibleTo: NodeKind;\n prerequisite: any;\n intersectionIsOpen: boolean;\n childKind: NodeKind;\n errorContext: BaseErrorContext | null;\n}\ntype ownIntersectionResult = nodeOfKind> | Disjoint;\n\ndeclare class DivisorNode extends InternalPrimitiveConstraint {\n traverseAllows: TraverseAllows;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly impliedBasis: BaseRoot;\n readonly expression: string;\n reduceJsonSchema(schema: JsonSchema.Numeric): JsonSchema.Numeric;\n}\ndeclare namespace Divisor {\n interface Inner {\n readonly rule: number;\n }\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly rule: number;\n }\n type Schema = NormalizedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"divisor\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"divisor\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: number;\n errorContext: ErrorContext;\n }> {\n }\n type Node = DivisorNode;\n}\ndeclare const Divisor: {\n implementation: nodeImplementationOf;\n Node: typeof DivisorNode;\n};\ndeclare const writeIndivisibleMessage: (t: BaseRoot) => string;\ntype writeIndivisibleMessage = writeInvalidOperandMessage<\"divisor\", actual>;\ndeclare const writeNonIntegerDivisorMessage: (divisor: divisor) => writeNonIntegerDivisorMessage;\ntype writeNonIntegerDivisorMessage = `divisor must be an integer (was ${divisor})`;\n\ndeclare class PatternNode extends InternalPrimitiveConstraint {\n readonly instance: RegExp;\n readonly expression: string;\n traverseAllows: (string: string) => boolean;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly impliedBasis: BaseRoot;\n reduceJsonSchema(base: JsonSchema.String, ctx: ToJsonSchema.Context): JsonSchema.String;\n}\ndeclare namespace Pattern {\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly rule: string;\n readonly flags?: string;\n }\n interface Inner {\n readonly rule: string;\n readonly flags?: string;\n }\n type Schema = NormalizedSchema | string | RegExp;\n interface ErrorContext extends BaseErrorContext<\"pattern\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"pattern\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n intersectionIsOpen: true;\n prerequisite: string;\n errorContext: ErrorContext;\n }> {\n }\n type Node = PatternNode;\n}\ndeclare const Pattern: {\n implementation: nodeImplementationOf;\n Node: typeof PatternNode;\n};\n\ndeclare class UnitNode extends InternalBasis {\n compiledValue: JsonPrimitive;\n serializedValue: string;\n compiledCondition: string;\n compiledNegation: string;\n expression: string;\n domain: Domain$1;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n traverseAllows: TraverseAllows;\n}\ndeclare namespace Unit {\n interface Schema extends BaseNormalizedSchema {\n readonly unit: value;\n }\n interface Inner {\n readonly unit: value;\n }\n interface ErrorContext extends BaseErrorContext<\"unit\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"unit\";\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n errorContext: ErrorContext;\n }> {\n }\n type Node = UnitNode;\n}\ndeclare const Unit: {\n implementation: nodeImplementationOf;\n Node: typeof UnitNode;\n};\n\ndeclare class UnionNode extends BaseRoot {\n isBoolean: boolean;\n get branchGroups(): BaseRoot[];\n unitBranches: (MorphNode | UnitNode)[];\n discriminant: Discriminant | null;\n discriminantJson: JsonStructure | null;\n expression: string;\n createBranchedOptimisticRootApply(): BaseNode[\"rootApply\"];\n get shallowMorphs(): array;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n traverseOptimistic: (data: unknown) => unknown;\n compile(js: NodeCompiler): void;\n private compileIndiscriminable;\n get nestableExpression(): string;\n discriminate(): Discriminant | null;\n}\ndeclare namespace Union {\n type ChildKind = UnionChildKind;\n type ChildSchema = NodeSchema;\n type ChildNode = nodeOfKind;\n type Schema = NormalizedSchema | readonly RootSchema[];\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly branches: array;\n readonly ordered?: true;\n }\n interface Inner {\n readonly branches: readonly ChildNode[];\n readonly ordered?: true;\n }\n interface ErrorContext extends BaseErrorContext<\"union\"> {\n errors: readonly ArkError[];\n }\n interface Declaration extends declareNode<{\n kind: \"union\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n errorContext: ErrorContext;\n reducibleTo: RootKind;\n childKind: UnionChildKind;\n }> {\n }\n type Node = UnionNode;\n}\ndeclare const Union: {\n implementation: nodeImplementationOf;\n Node: typeof UnionNode;\n};\ntype DescribeBranchesOptions = {\n delimiter?: string;\n finalDelimiter?: string;\n};\ndeclare const describeBranches: (descriptions: string[], opts?: DescribeBranchesOptions) => string;\ndeclare const intersectBranches: (l: readonly Union.ChildNode[], r: readonly Union.ChildNode[], ctx: IntersectionContext) => readonly Union.ChildNode[] | Disjoint;\ndeclare const reduceBranches: ({ branches, ordered }: Union.Inner) => readonly Union.ChildNode[];\ntype CaseKey = DiscriminantKind extends kind ? string : DiscriminantKinds[kind] | \"default\";\ntype DiscriminantLocation = {\n path: PropertyKey[];\n optionallyChainedPropString: string;\n kind: kind;\n};\ninterface Discriminant extends DiscriminantLocation {\n cases: DiscriminatedCases;\n}\ntype CaseContext = {\n branchIndices: number[];\n condition: nodeOfKind | Domain.Enumerable;\n};\ntype CaseDiscriminant = nodeOfKind | Domain.Enumerable;\ntype DiscriminatedCases = {\n [caseKey in CaseKey]: BaseRoot | true;\n};\ntype DiscriminantKinds = {\n domain: Domain;\n unit: SerializedPrimitive | RegisteredReference;\n};\ntype DiscriminantKind = show;\ndeclare const pruneDiscriminant: (discriminantBranch: BaseRoot, discriminantCtx: DiscriminantLocation) => BaseRoot | null;\ndeclare const writeIndiscriminableMorphMessage: (lDescription: string, rDescription: string) => string;\ndeclare const writeOrderedIntersectionMessage: (lDescription: string, rDescription: string) => string;\n\ninterface InternalRootDeclaration extends BaseNodeDeclaration {\n kind: RootKind;\n}\ndeclare abstract class BaseRoot<\n/** @ts-ignore cast variance */\nout d extends InternalRootDeclaration = InternalRootDeclaration> extends BaseNode implements StandardSchemaV1 {\n readonly [arkKind]: \"root\";\n readonly [inferred]: unknown;\n constructor(attachments: UnknownAttachments, $: BaseScope);\n get internal(): this;\n get \"~standard\"(): StandardSchemaV1.ArkTypeProps;\n as(): this;\n brand(name: string): this;\n readonly(): this;\n readonly branches: readonly nodeOfKind[];\n distribute(mapBranch: (branch: nodeOfKind, i: number, branches: array>) => mapOut, reduceMapped?: (mappedBranches: mapOut[]) => reduceOut): reduceOut;\n abstract get defaultShortDescription(): string;\n get shortDescription(): string;\n toJsonSchema(opts?: ToJsonSchema.Options): JsonSchema;\n toJsonSchemaRecurse(ctx: ToJsonSchema.Context): JsonSchema;\n get alwaysExpandJsonSchema(): boolean;\n protected toResolvedJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n protected abstract innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n intersect(r: unknown): BaseRoot | Disjoint;\n rawIntersect(r: BaseRoot): BaseRoot;\n toNeverIfDisjoint(): BaseRoot;\n and(r: unknown): BaseRoot;\n rawAnd(r: BaseRoot): BaseRoot;\n or(r: unknown): BaseRoot;\n rawOr(r: BaseRoot): BaseRoot;\n map(flatMapEntry: PropFlatMapper): BaseRoot;\n pick(...keys: KeyOrKeyNode[]): BaseRoot;\n omit(...keys: KeyOrKeyNode[]): BaseRoot;\n required(): BaseRoot;\n partial(): BaseRoot;\n private _keyof?;\n keyof(): BaseRoot;\n get props(): Prop.Node[];\n merge(r: unknown): BaseRoot;\n private applyStructuralOperation;\n get(...path: GettableKeyOrNode[]): BaseRoot;\n extract(r: unknown): BaseRoot;\n exclude(r: unknown): BaseRoot;\n array(): BaseRoot;\n overlaps(r: unknown): boolean;\n extends(r: unknown): boolean;\n ifExtends(r: unknown): BaseRoot | undefined;\n subsumes(r: unknown): boolean;\n configure(meta: TypeMeta.MappableInput, selector?: NodeSelector): this;\n describe(description: string, selector?: NodeSelector): this;\n optional(): [this, \"?\"];\n default(thunkableValue: unknown): [this, \"=\", unknown];\n from(input: unknown): unknown;\n protected _pipe(...morphs: Morph[]): BaseRoot;\n protected tryPipe(...morphs: Morph[]): BaseRoot;\n pipe: ((...morphs: Morph[]) => BaseRoot) & {\n try: (...morphs: Morph[]) => BaseRoot;\n };\n to(def: unknown): BaseRoot;\n private toNode;\n rawPipeOnce(morph: Morph): BaseRoot;\n narrow(predicate: Predicate): BaseRoot;\n constrain(kind: kind, schema: NodeSchema): BaseRoot;\n constrainIn(kind: kind, schema: NodeSchema): BaseRoot;\n constrainOut(kind: kind, schema: NodeSchema): BaseRoot;\n private _constrain;\n onUndeclaredKey(cfg: UndeclaredKeyBehavior | UndeclaredKeyConfig): BaseRoot;\n hasEqualMorphs(r: BaseRoot): boolean;\n onDeepUndeclaredKey(behavior: UndeclaredKeyBehavior): BaseRoot;\n filter(predicate: Predicate): BaseRoot;\n divisibleBy(schema: Divisor.Schema): BaseRoot;\n matching(schema: Pattern.Schema): BaseRoot;\n atLeast(schema: InclusiveNumericRangeSchema): BaseRoot;\n atMost(schema: InclusiveNumericRangeSchema): BaseRoot;\n moreThan(schema: ExclusiveNumericRangeSchema): BaseRoot;\n lessThan(schema: ExclusiveNumericRangeSchema): BaseRoot;\n atLeastLength(schema: InclusiveNumericRangeSchema): BaseRoot;\n atMostLength(schema: InclusiveNumericRangeSchema): BaseRoot;\n moreThanLength(schema: ExclusiveNumericRangeSchema): BaseRoot;\n lessThanLength(schema: ExclusiveNumericRangeSchema): BaseRoot;\n exactlyLength(schema: ExactLength.Schema): BaseRoot;\n atOrAfter(schema: InclusiveDateRangeSchema): BaseRoot;\n atOrBefore(schema: InclusiveDateRangeSchema): BaseRoot;\n laterThan(schema: ExclusiveDateRangeSchema): BaseRoot;\n earlierThan(schema: ExclusiveDateRangeSchema): BaseRoot;\n}\ntype UndeclaredKeyConfig = {\n rule: UndeclaredKeyBehavior;\n deep?: boolean;\n};\ndeclare const emptyBrandNameMessage = \"Expected a non-empty brand name after #\";\ntype emptyBrandNameMessage = typeof emptyBrandNameMessage;\ndeclare const exclusivizeRangeSchema: (schema: schema) => schema;\ntype exclusivizeRangeSchema = schema extends LimitSchemaValue ? {\n rule: schema;\n exclusive: true;\n} : schema;\ndeclare const typeOrTermExtends: (t: unknown, base: unknown) => boolean;\ntype intersectRoot = [\n l,\n r\n] extends [r, l] ? l : asymmetricIntersectionOf | asymmetricIntersectionOf;\ntype asymmetricIntersectionOf = l extends unknown ? r extends kindRightOf ? l | reducibleKindOf : never : never;\ntype schemaKindRightOf = Extract, RootKind>;\ntype schemaKindOrRightOf = kind | schemaKindRightOf;\ntype StructuralOperationBranchResultByName = {\n keyof: Union.ChildNode;\n pick: Union.ChildNode;\n omit: Union.ChildNode;\n get: Union.ChildNode;\n map: Union.ChildNode;\n required: Union.ChildNode;\n partial: Union.ChildNode;\n merge: Union.ChildNode;\n props: array;\n};\ntype StructuralOperationName = keyof StructuralOperationBranchResultByName;\ndeclare const writeLiteralUnionEntriesMessage: (expression: string) => string;\ndeclare const writeNonStructuralOperandMessage: (operation: operation, operand: operand) => writeNonStructuralOperandMessage;\ntype writeNonStructuralOperandMessage = `${operation} operand must be an object (was ${operand})`;\n\ndeclare class MorphNode extends BaseRoot {\n serializedMorphs: string[];\n compiledMorphs: string;\n lastMorph: BaseRoot | Morph | undefined;\n lastMorphIfNode: BaseRoot | undefined;\n introspectableIn: BaseRoot | undefined;\n introspectableOut: BaseRoot | undefined;\n get shallowMorphs(): array;\n get in(): BaseRoot;\n get out(): BaseRoot;\n declareIn(declaredIn: BaseRoot): MorphNode;\n declareOut(declaredOut: BaseRoot): MorphNode;\n expression: string;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n compile(js: NodeCompiler): void;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n /** Check if the morphs of r are equal to those of this node */\n hasEqualMorphs(r: MorphNode): boolean;\n}\ndeclare namespace Morph {\n interface Inner {\n readonly in?: BaseRoot;\n readonly morphs: array;\n readonly declaredIn?: BaseRoot;\n readonly declaredOut?: BaseRoot;\n }\n interface Schema extends BaseNormalizedSchema {\n readonly in?: RootSchema;\n readonly morphs: listable;\n readonly declaredIn?: BaseRoot;\n readonly declaredOut?: BaseRoot;\n }\n interface Declaration extends declareNode<{\n kind: \"morph\";\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n childKind: RootKind;\n }> {\n }\n type Node = MorphNode;\n type In = morph extends Morph ? i : never;\n type Out = morph extends Morph ? o : never;\n type ContextFree = (In: i) => o;\n}\ntype Morph = (In: i, ctx: Traversal) => o;\ndeclare const Morph: {\n implementation: nodeImplementationOf;\n Node: typeof MorphNode;\n};\ndeclare const writeMorphIntersectionMessage: (lDescription: string, rDescription: string) => string;\n\ntype MorphsAtPath = {\n path: ReadonlyPath;\n morphs: array;\n};\ntype BranchTraversal = {\n error: ArkError | undefined;\n queuedMorphs: MorphsAtPath[];\n};\ntype InternalTraversal = Omit;\ndeclare class Traversal {\n /**\n * #### the path being validated or morphed\n *\n * ✅ array indices represented as numbers\n * ⚠️ mutated during traversal - use `path.slice(0)` to snapshot\n * 🔗 use {@link propString} for a stringified version\n */\n path: PropertyKey[];\n /**\n * #### {@link ArkErrors} that will be part of this traversal's finalized result\n *\n * ✅ will always be an empty array for a valid traversal\n */\n errors: ArkErrors;\n /**\n * #### the original value being traversed\n */\n root: unknown;\n /**\n * #### configuration for this traversal\n *\n * ✅ options can affect traversal results and error messages\n * ✅ defaults < global config < scope config\n * ✅ does not include options configured on individual types\n */\n config: ResolvedConfig;\n queuedMorphs: MorphsAtPath[];\n branches: BranchTraversal[];\n seen: {\n [id in string]?: unknown[];\n };\n constructor(root: unknown, config: ResolvedConfig);\n /**\n * #### the data being validated or morphed\n *\n * ✅ extracted from {@link root} at {@link path}\n */\n get data(): unknown;\n /**\n * #### a string representing {@link path}\n *\n * @propString\n */\n get propString(): string;\n /**\n * #### add an {@link ArkError} and return `false`\n *\n * ✅ useful for predicates like `.narrow`\n */\n reject(input: ArkErrorInput): false;\n /**\n * #### add an {@link ArkError} from a description and return `false`\n *\n * ✅ useful for predicates like `.narrow`\n * 🔗 equivalent to {@link reject}({ expected })\n */\n mustBe(expected: string): false;\n /**\n * #### add and return an {@link ArkError}\n *\n * ✅ useful for morphs like `.pipe`\n */\n error(input: input): ArkError;\n /**\n * #### whether {@link currentBranch} (or the traversal root, outside a union) has one or more errors\n */\n hasError(): boolean;\n get currentBranch(): BranchTraversal | undefined;\n queueMorphs(morphs: array): void;\n finalize(onFail?: ArkErrors.Handler | null): unknown;\n get currentErrorCount(): number;\n get failFast(): boolean;\n pushBranch(): void;\n popBranch(): BranchTraversal | undefined;\n private errorFromContext;\n private applyQueuedMorphs;\n private applyMorphsAtPath;\n}\ndeclare const traverseKey: (key: PropertyKey, fn: () => result, ctx: InternalTraversal | undefined) => result;\ntype TraversalMethodsByKind = {\n Allows: TraverseAllows;\n Apply: TraverseApply;\n};\ntype TraversalKind = keyof TraversalMethodsByKind;\ntype TraverseAllows = (data: data, ctx: InternalTraversal) => boolean;\ntype TraverseApply = (data: data, ctx: InternalTraversal) => void;\n\ntype CoercibleValue = string | number | boolean | null | undefined;\ndeclare class CompiledFunction unknown, args extends readonly string[] = readonly string[]> extends CastableBase<{\n [k in args[number]]: k;\n}> {\n readonly argNames: args;\n readonly body = \"\";\n constructor(...args: args);\n indentation: number;\n indent(): this;\n dedent(): this;\n prop(key: PropertyKey, optional?: boolean): string;\n index(key: string | number, optional?: boolean): string;\n line(statement: string): this;\n const(identifier: string, expression: CoercibleValue): this;\n let(identifier: string, expression: CoercibleValue): this;\n set(identifier: string, expression: CoercibleValue): this;\n if(condition: string, then: (self: this) => this): this;\n elseIf(condition: string, then: (self: this) => this): this;\n else(then: (self: this) => this): this;\n /** Current index is \"i\" */\n for(until: string, body: (self: this) => this, initialValue?: CoercibleValue): this;\n /** Current key is \"k\" */\n forIn(object: string, body: (self: this) => this): this;\n block(prefix: string, contents: (self: this) => this, suffix?: string): this;\n return(expression?: CoercibleValue): this;\n write(name?: string, indent?: number): string;\n compile(): compiledSignature;\n}\ndeclare const compileSerializedValue: (value: unknown) => string;\ndeclare const compileLiteralPropAccess: (key: PropertyKey, optional?: boolean) => string;\ndeclare const serializeLiteralKey: (key: PropertyKey) => string;\ndeclare const indexPropAccess: (key: string, optional?: boolean) => string;\ninterface InvokeOptions extends ReferenceOptions {\n arg?: string;\n}\ninterface ReferenceOptions {\n kind?: TraversalKind;\n bind?: string;\n}\ndeclare namespace NodeCompiler {\n interface Context {\n kind: TraversalKind;\n optimistic?: true;\n }\n}\ndeclare class NodeCompiler extends CompiledFunction {\n traversalKind: TraversalKind;\n optimistic: boolean;\n constructor(ctx: NodeCompiler.Context);\n invoke(node: BaseNode | NodeId, opts?: InvokeOptions): string;\n referenceToId(id: NodeId, opts?: ReferenceOptions): string;\n requiresContextFor(node: BaseNode): boolean;\n initializeErrorCount(): this;\n returnIfFail(): this;\n returnIfFailFast(): this;\n traverseKey(keyExpression: string, accessExpression: string, node: BaseNode): this;\n check(node: BaseNode, opts?: InvokeOptions): this;\n}\n\ndeclare class PredicateNode extends BaseConstraint {\n serializedPredicate: RegisteredReference;\n compiledCondition: string;\n compiledNegation: string;\n impliedBasis: null;\n expression: string;\n traverseAllows: TraverseAllows;\n errorContext: Predicate.ErrorContext;\n compiledErrorContext: string;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n reduceJsonSchema(base: JsonSchema.Constrainable, ctx: ToJsonSchema.Context): JsonSchema;\n}\ndeclare namespace Predicate {\n type Schema = NormalizedSchema | predicate;\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly predicate: predicate;\n }\n interface Inner {\n readonly predicate: predicate;\n }\n interface ErrorContext extends BaseErrorContext<\"predicate\"> {\n readonly predicate?: Predicate;\n }\n interface Declaration extends declareNode<{\n kind: \"predicate\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n intersectionIsOpen: true;\n errorContext: ErrorContext;\n }> {\n }\n type Node = PredicateNode;\n}\ndeclare const Predicate: {\n implementation: nodeImplementationOf;\n Node: typeof PredicateNode;\n};\ntype Predicate = (data: data, ctx: Traversal) => boolean;\ndeclare namespace Predicate {\n type Casted = (input: input, ctx: Traversal) => input is narrowed;\n type Castable = Predicate | Casted;\n}\n\ndeclare class ProtoNode extends InternalBasis {\n builtinName: BuiltinObjectKind | null;\n serializedConstructor: string;\n private readonly requiresInvalidDateCheck;\n traverseAllows: TraverseAllows;\n compiledCondition: string;\n compiledNegation: string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n expression: string;\n get nestableExpression(): string;\n readonly domain = \"object\";\n get defaultShortDescription(): string;\n}\ndeclare namespace Proto {\n type Reference = Constructor | BuiltinObjectKind;\n type Schema = proto | ExpandedSchema;\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly proto: proto;\n readonly dateAllowsInvalid?: boolean;\n }\n interface ExpandedSchema {\n readonly proto: proto;\n readonly dateAllowsInvalid?: boolean;\n }\n interface Inner {\n readonly proto: proto;\n readonly dateAllowsInvalid?: boolean;\n }\n interface ErrorContext extends BaseErrorContext<\"proto\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"proto\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n errorContext: ErrorContext;\n }> {\n }\n type Node = ProtoNode;\n}\ndeclare const Proto: {\n implementation: nodeImplementationOf;\n Node: typeof ProtoNode;\n writeBadInvalidDateMessage: (actual: Constructor) => string;\n writeInvalidSchemaMessage: (actual: unknown) => string;\n};\n\ndeclare class IntersectionNode extends BaseRoot {\n basis: nodeOfKind | null;\n refinements: array>;\n structure: Structure.Node | undefined;\n expression: string;\n get shallowMorphs(): array;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n}\ndeclare namespace Intersection {\n type BasisKind = \"domain\" | \"proto\";\n type ChildKind = BasisKind | RefinementKind | \"predicate\" | \"structure\";\n type FlattenedChildKind = ChildKind | StructuralKind;\n type RefinementsInner = {\n [k in RefinementKind]?: intersectionChildInnerValueOf;\n };\n interface Inner extends RefinementsInner {\n domain?: Domain.Node;\n proto?: Proto.Node;\n structure?: Structure.Node;\n predicate?: array;\n }\n namespace Inner {\n type mutable = makeRootAndArrayPropertiesMutable;\n }\n type ConstraintsSchema = show>;\n type NormalizedSchema = Omit;\n type Schema = ConstraintsSchema;\n interface AstSchema extends BaseNormalizedSchema {\n intersection: readonly RootSchema[];\n }\n interface ErrorContext extends BaseErrorContext<\"intersection\">, Inner {\n errors: readonly ArkError[];\n }\n type Declaration = declareNode<{\n kind: \"intersection\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n reducibleTo: \"intersection\" | BasisKind;\n errorContext: ErrorContext;\n childKind: ChildKind;\n }>;\n type Node = IntersectionNode;\n}\ndeclare const Intersection: {\n implementation: nodeImplementationOf<{\n intersectionIsOpen: false;\n prerequisite: unknown;\n kind: \"intersection\";\n schema: Intersection.Schema;\n normalizedSchema: Intersection.NormalizedSchema;\n inner: Intersection.Inner;\n reducibleTo: \"intersection\" | Intersection.BasisKind;\n errorContext: Intersection.ErrorContext;\n childKind: Intersection.ChildKind;\n }>;\n Node: typeof IntersectionNode;\n};\ntype ConditionalTerminalIntersectionRoot = {\n undeclared?: UndeclaredKeyBehavior;\n};\ntype ConditionalTerminalIntersectionKey = keyof ConditionalTerminalIntersectionRoot;\ntype ConditionalIntersectionKey = ConstraintKind | ConditionalTerminalIntersectionKey;\ntype constraintKindOf = {\n [k in ConstraintKind]: t extends Prerequisite ? k : never;\n}[ConstraintKind];\ntype conditionalIntersectionKeyOf = constraintKindOf | (t extends object ? \"undeclared\" : never);\ntype intersectionChildSchemaValueOf = k extends OpenNodeKind ? listable> : NodeSchema;\ntype conditionalSchemaValueOfKey = k extends Intersection.FlattenedChildKind ? intersectionChildSchemaValueOf : ConditionalTerminalIntersectionRoot[k & ConditionalTerminalIntersectionKey];\ntype intersectionChildInnerValueOf = k extends OpenNodeKind ? readonly nodeOfKind[] : nodeOfKind;\ntype conditionalRootOf = {\n [k in conditionalIntersectionKeyOf]?: conditionalSchemaValueOfKey;\n};\n\ndeclare namespace Constraint {\n interface Declaration extends BaseNodeDeclaration {\n kind: ConstraintKind;\n }\n type ReductionResult = BaseRoot | Disjoint | Intersection.Inner.mutable;\n interface Attachments {\n impliedBasis: BaseRoot | null;\n impliedSiblings?: array | null;\n }\n type PrimitiveKind = Exclude;\n}\ndeclare abstract class BaseConstraint<\n/** @ts-ignore allow instantiation assignment to the base type */\nout d extends Constraint.Declaration = Constraint.Declaration> extends BaseNode {\n readonly [arkKind]: \"constraint\";\n constructor(attachments: UnknownAttachments, $: BaseScope);\n abstract readonly impliedBasis: BaseRoot | null;\n readonly impliedSiblings?: array;\n intersect(r: r): intersectConstraintKinds;\n}\ndeclare abstract class InternalPrimitiveConstraint extends BaseConstraint {\n abstract traverseAllows: TraverseAllows;\n abstract readonly compiledCondition: string;\n abstract readonly compiledNegation: string;\n abstract reduceJsonSchema(base: JsonSchema.Constrainable, ctx: ToJsonSchema.Context): JsonSchema.Constrainable;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n get errorContext(): d[\"errorContext\"];\n get compiledErrorContext(): string;\n}\ndeclare const constraintKeyParser: (kind: kind) => (schema: listable>, ctx: NodeParseContext) => innerAttachedAs | undefined;\ntype ConstraintGroupKind = satisfy;\ninterface ConstraintIntersectionState {\n kind: kind;\n baseInner: Record;\n l: BaseConstraint[];\n r: BaseConstraint[];\n roots: BaseRoot[];\n ctx: IntersectionContext;\n}\ndeclare const intersectConstraints: (s: ConstraintIntersectionState) => nodeOfKind> | Disjoint;\ndeclare const flattenConstraints: (inner: object) => BaseConstraint[];\ntype FlatIntersectionInner = Intersection.Inner & Structure.Inner;\ndeclare const unflattenConstraints: (constraints: array) => FlatIntersectionInner;\ntype constraintKindLeftOf = ConstraintKind & kindLeftOf;\ntype constraintKindOrLeftOf = kind | constraintKindLeftOf;\ntype intersectConstraintKinds = nodeOfKind | Disjoint | null;\ndeclare const throwInvalidOperandError: (...args: Parameters) => never;\ndeclare const writeInvalidOperandMessage: (kind: kind, expected: expected, actual: actual) => string;\ntype writeInvalidOperandMessage = `${Capitalize} operand must be ${describe>} (was ${describe>>})`;\n\ndeclare abstract class BaseNode<\n/** @ts-ignore allow instantiation assignment to the base type */\nout d extends BaseNodeDeclaration = BaseNodeDeclaration> extends Callable<(data: d[\"prerequisite\"], ctx?: Traversal, onFail?: ArkErrors.Handler | null) => unknown, attachmentsOf> {\n attachments: UnknownAttachments;\n $: BaseScope;\n onFail: ArkErrors.Handler | null;\n includesTransform: boolean;\n includesContextualPredicate: boolean;\n isCyclic: boolean;\n allowsRequiresContext: boolean;\n rootApplyStrategy: \"allows\" | \"contextual\" | \"optimistic\" | \"branchedOptimistic\";\n contextFreeMorph: ((data: unknown) => unknown) | undefined;\n rootApply: (data: unknown, onFail: ArkErrors.Handler | null) => unknown;\n referencesById: Record;\n shallowReferences: BaseNode[];\n flatRefs: FlatRef[];\n flatMorphs: FlatRef[];\n allows: (data: d[\"prerequisite\"]) => boolean;\n get shallowMorphs(): array;\n constructor(attachments: UnknownAttachments, $: BaseScope);\n protected createRootApply(): this[\"rootApply\"];\n abstract traverseAllows: TraverseAllows;\n abstract traverseApply: TraverseApply;\n abstract expression: string;\n abstract compile(js: NodeCompiler): void;\n readonly compiledMeta: string;\n protected cacheGetter(name: name, value: this[name]): this[name];\n get description(): string;\n get references(): BaseNode[];\n readonly precedence: number;\n precompilation: string | undefined;\n assert: (data: d[\"prerequisite\"], pipedFromCtx?: Traversal) => unknown;\n traverse(data: d[\"prerequisite\"], pipedFromCtx?: Traversal): ArkErrors | {} | null | undefined;\n get in(): this extends {\n [arkKind]: \"root\";\n } ? BaseRoot : BaseNode;\n get out(): this extends {\n [arkKind]: \"root\";\n } ? BaseRoot : BaseNode;\n getIo(ioKind: \"in\" | \"out\"): BaseNode;\n toJSON(): JsonStructure;\n toString(): string;\n equals(r: unknown): boolean;\n ifEquals(r: unknown): BaseNode | undefined;\n hasKind(kind: kind): this is nodeOfKind;\n assertHasKind(kind: kind): nodeOfKind;\n hasKindIn(...kinds: kinds): this is nodeOfKind;\n assertHasKindIn(...kinds: kinds): nodeOfKind;\n isBasis(): this is nodeOfKind;\n isConstraint(): this is BaseConstraint;\n isStructural(): this is nodeOfKind;\n isRefinement(): this is nodeOfKind;\n isRoot(): this is BaseRoot;\n isUnknown(): boolean;\n isNever(): boolean;\n hasUnit(value: unknown): this is Unit.Node & {\n unit: value;\n };\n hasOpenIntersection(): this is nodeOfKind;\n get nestableExpression(): string;\n select>>(selector: NodeSelector.validateComposite): NodeSelector.infer;\n select(selector: selector): NodeSelector.infer;\n private _select;\n transform(mapper: mapper, opts?: DeepNodeTransformOptions): nodeOfKind> | Extract, null>;\n protected _createTransformContext(opts: DeepNodeTransformOptions | undefined): DeepNodeTransformContext;\n protected _transform(mapper: DeepNodeTransformation, ctx: DeepNodeTransformContext): BaseNode | null;\n configureReferences(meta: TypeMeta.MappableInput.Internal, selector?: NodeSelector): this;\n}\n/** a literal key (named property) or a node (index signatures) representing part of a type structure */\ntype KeyOrKeyNode = Key | BaseRoot;\ntype GettableKeyOrNode = KeyOrKeyNode | number;\ntype FlatRef = {\n path: array;\n node: root;\n propString: string;\n};\ntype NodeSelector = NodeSelector.Single | NodeSelector.Composite;\ndeclare namespace NodeSelector {\n type SelectableFn = {\n >>(input: input, selector?: NodeSelector.validateComposite): returns;\n (input: input, selector?: selector): returns;\n };\n type Single = NodeSelector.Boundary | NodeSelector.Kind | GuardablePredicate;\n type Boundary = \"self\" | \"child\" | \"shallow\" | \"references\";\n type Kind = NodeKind;\n type Method = \"filter\" | \"assertFilter\" | \"find\" | \"assertFind\";\n interface Composite {\n method?: Method;\n boundary?: Boundary;\n kind?: Kind;\n where?: GuardablePredicate;\n }\n type Normalized = requireKeys;\n type CompositeInput = Omit;\n type BaseResult = BaseNode | BaseNode[] | undefined;\n type validateComposite = {\n [k in keyof selector]: k extends \"where\" ? predicate : conform;\n };\n type infer = applyMethod ? narrowed : NodeSelector.inferSelectKind, selector>;\n type BoundaryInput = b | {\n boundary: b;\n };\n type KindInput = k | {\n kind: k;\n };\n type WhereCastInput = ((In: kindNode) => In is narrowed) | {\n where: (In: kindNode) => In is narrowed;\n };\n type inferSelectKind = selectKind extends infer kind extends NodeKind ? NodeKind extends kind ? BaseNode : nodeOfKind : never;\n type selectKind = selector extends BoundaryInput<\"self\"> ? selfKind : selector extends KindInput ? kind : selector extends BoundaryInput<\"child\"> ? selfKind | childKindOf : NodeKind;\n type applyMethod = selector extends {\n method: infer method extends Method;\n } ? method extends \"filter\" ? t[] : method extends \"assertFilter\" ? [t, ...t[]] : method extends \"find\" ? t | undefined : method extends \"assertFind\" ? t : never : t[];\n}\ndeclare const typePathToPropString: (path: array) => string;\ndeclare const flatRef: (path: array, node: node) => FlatRef;\ndeclare const flatRefsAreEqual: (l: FlatRef, r: FlatRef) => boolean;\ndeclare const appendUniqueFlatRefs: (existing: FlatRef[] | undefined, refs: listable>) => FlatRef[];\ndeclare const appendUniqueNodes: (existing: node[] | undefined, refs: listable) => node[];\ntype DeepNodeTransformOptions = {\n shouldTransform?: ShouldTransformFn;\n bindScope?: BaseScope;\n prereduced?: boolean;\n selected?: readonly BaseNode[] | undefined;\n};\ntype ShouldTransformFn = (node: BaseNode, ctx: DeepNodeTransformContext) => boolean;\ninterface DeepNodeTransformContext extends DeepNodeTransformOptions {\n root: BaseNode;\n selected: readonly BaseNode[] | undefined;\n path: mutable>;\n seen: {\n [originalId: string]: (() => BaseNode | undefined) | undefined;\n };\n parseOptions: BaseParseOptions;\n undeclaredKeyHandling: UndeclaredKeyHandling | undefined;\n}\ntype DeepNodeTransformation = (kind: kind, innerWithMeta: Inner & {\n meta: NodeMeta;\n}, ctx: DeepNodeTransformContext) => NormalizedSchema | null;\n\ndeclare class AfterNode extends BaseRange {\n impliedBasis: BaseRoot;\n collapsibleLimitString: string;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(base: JsonSchema, ctx: ToJsonSchema.Context): JsonSchema;\n}\ndeclare namespace After {\n interface Inner extends BaseRangeInner {\n rule: Date;\n }\n interface NormalizedSchema extends UnknownNormalizedRangeSchema {\n rule: LimitSchemaValue;\n }\n interface ExpandedSchema extends UnknownExpandedRangeSchema {\n rule: LimitSchemaValue;\n }\n type Schema = ExpandedSchema | LimitSchemaValue;\n interface ErrorContext extends BaseErrorContext<\"after\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"after\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: Date;\n errorContext: ErrorContext;\n }> {\n }\n type Node = AfterNode;\n}\ndeclare const After: {\n implementation: nodeImplementationOf;\n Node: typeof AfterNode;\n};\n\ndeclare class BeforeNode extends BaseRange {\n collapsibleLimitString: string;\n traverseAllows: TraverseAllows;\n impliedBasis: BaseRoot;\n reduceJsonSchema(base: JsonSchema, ctx: ToJsonSchema.Context): JsonSchema;\n}\ndeclare namespace Before {\n interface Inner extends BaseRangeInner {\n rule: Date;\n }\n interface NormalizedSchema extends UnknownNormalizedRangeSchema {\n rule: LimitSchemaValue;\n }\n interface ExpandedSchema extends UnknownExpandedRangeSchema {\n rule: LimitSchemaValue;\n }\n type Schema = ExpandedSchema | LimitSchemaValue;\n interface ErrorContext extends BaseErrorContext<\"before\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"before\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: Date;\n errorContext: ErrorContext;\n }> {\n }\n type Node = BeforeNode;\n}\ndeclare const Before: {\n implementation: nodeImplementationOf;\n Node: typeof BeforeNode;\n};\n\ndeclare class MaxNode extends BaseRange {\n impliedBasis: BaseRoot;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(schema: JsonSchema.Numeric): JsonSchema.Numeric;\n}\ndeclare namespace Max {\n interface Inner extends BaseRangeInner {\n rule: number;\n exclusive?: true;\n }\n interface NormalizedSchema extends UnknownExpandedRangeSchema {\n rule: number;\n }\n type Schema = NormalizedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"max\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"max\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: number;\n errorContext: ErrorContext;\n }> {\n }\n type Node = MaxNode;\n}\ndeclare const Max: {\n implementation: nodeImplementationOf;\n Node: typeof MaxNode;\n};\n\ndeclare class MinNode extends BaseRange {\n readonly impliedBasis: BaseRoot;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(schema: JsonSchema.Numeric): JsonSchema.Numeric;\n}\ndeclare namespace Min {\n interface Inner extends BaseRangeInner {\n rule: number;\n exclusive?: true;\n }\n interface NormalizedSchema extends UnknownExpandedRangeSchema {\n rule: number;\n }\n type Schema = NormalizedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"min\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"min\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: number;\n errorContext: ErrorContext;\n }> {\n }\n type Node = MinNode;\n}\ndeclare const Min: {\n implementation: nodeImplementationOf;\n Node: typeof MinNode;\n};\n\ninterface BoundDeclarations {\n min: Min.Declaration;\n max: Max.Declaration;\n minLength: MinLength.Declaration;\n maxLength: MaxLength.Declaration;\n exactLength: ExactLength.Declaration;\n after: After.Declaration;\n before: Before.Declaration;\n}\ninterface BoundNodesByKind {\n min: Min.Node;\n max: Max.Node;\n minLength: MinLength.Node;\n maxLength: MaxLength.Node;\n exactLength: ExactLength.Node;\n after: After.Node;\n before: Before.Node;\n}\n\ninterface NodeDeclarationsByKind extends BoundDeclarations {\n alias: Alias.Declaration;\n domain: Domain.Declaration;\n unit: Unit.Declaration;\n proto: Proto.Declaration;\n union: Union.Declaration;\n morph: Morph.Declaration;\n intersection: Intersection.Declaration;\n sequence: Sequence.Declaration;\n divisor: Divisor.Declaration;\n required: Required$1.Declaration;\n optional: Optional.Declaration;\n index: Index.Declaration;\n pattern: Pattern.Declaration;\n predicate: Predicate.Declaration;\n structure: Structure.Declaration;\n}\ndeclare const nodeImplementationsByKind: Record;\ndeclare const nodeClassesByKind: Record BaseNode>;\ninterface NodesByKind extends BoundNodesByKind {\n alias: Alias.Node;\n union: Union.Node;\n morph: Morph.Node;\n intersection: Intersection.Node;\n unit: Unit.Node;\n proto: Proto.Node;\n domain: Domain.Node;\n divisor: Divisor.Node;\n pattern: Pattern.Node;\n predicate: Predicate.Node;\n required: Required$1.Node;\n optional: Optional.Node;\n index: Index.Node;\n sequence: Sequence.Node;\n structure: Structure.Node;\n}\ntype nodeOfKind = NodesByKind[kind];\ntype Declaration = NodeDeclarationsByKind[kind];\ntype NodeSchema = Declaration[\"schema\"];\ntype RootSchema = NodeSchema;\ntype NormalizedSchema = Declaration[\"normalizedSchema\"];\ntype childKindOf = Declaration[\"childKind\"];\ntype Prerequisite = Declaration[\"prerequisite\"];\ntype reducibleKindOf = Declaration[\"reducibleTo\"] extends NodeKind ? Declaration[\"reducibleTo\"] : kind;\ntype Inner = Declaration[\"inner\"];\ntype defAttachedAs = kind extends OpenNodeKind ? listable> : NodeSchema;\ntype innerAttachedAs = kind extends OpenNodeKind ? array> : nodeOfKind;\n/** make nested arrays mutable while keeping nested nodes immutable */\ntype mutableInnerOfKind = makeRootAndArrayPropertiesMutable>;\ntype mutableNormalizedRootOfKind = makeRootAndArrayPropertiesMutable>;\ntype errorContext = Declaration[\"errorContext\"];\n\ntype ContextualArgs = Record;\ntype BaseParseOptions = {\n alias?: string;\n prereduced?: prereduced;\n args?: ContextualArgs;\n id?: NodeId;\n};\ninterface BaseParseContextInput extends BaseParseOptions {\n prefix: string;\n def: unknown;\n}\ninterface AttachedParseContext {\n [arkKind]: \"context\";\n $: BaseScope;\n id: NodeId;\n phase: \"unresolved\" | \"resolving\" | \"resolved\";\n}\ninterface BaseParseContext extends BaseParseContextInput, AttachedParseContext {\n id: NodeId;\n}\ninterface NodeParseContextInput extends BaseParseContextInput {\n kind: kind;\n def: NormalizedSchema;\n}\ninterface NodeParseContext extends NodeParseContextInput, AttachedParseContext {\n id: NodeId;\n}\ndeclare const schemaKindOf: (schema: unknown, allowedKinds?: readonly kind[]) => kind;\ndeclare const writeInvalidSchemaMessage: (schema: unknown) => string;\ntype NodeId = Brand;\ntype NodeResolver = (id: NodeId) => BaseNode;\ndeclare const nodesByRegisteredId: Record;\ndeclare const registerNodeId: (prefix: string) => NodeId;\ndeclare const parseNode: (ctx: NodeParseContext) => BaseNode;\ntype CreateNodeInput = {\n id: NodeId;\n kind: NodeKind;\n inner: dict;\n meta: NodeMeta;\n $: BaseScope;\n ignoreCache?: true;\n};\ndeclare const createNode: ({ id, kind, inner, meta, $, ignoreCache }: CreateNodeInput) => BaseNode;\ndeclare const withId: (node: node, id: NodeId) => node;\ndeclare const withMeta: (node: node, meta: ArkEnv.meta, id?: NodeId) => node;\n\ninterface ArkSchemaRegistry extends ArkRegistry {\n intrinsic: typeof intrinsic;\n config: ArkSchemaConfig;\n defaultConfig: ResolvedConfig;\n resolvedConfig: ResolvedConfig;\n nodesByRegisteredId: typeof nodesByRegisteredId;\n}\ntype nodeConfigForKind = Readonly;\n} & (kind extends ArkErrorCode ? {\n expected?: ExpectedConfig;\n actual?: ActualConfig;\n problem?: ProblemConfig;\n message?: MessageConfig;\n} : {})>>;\ntype NodeConfigsByKind = {\n [kind in NodeKind]: nodeConfigForKind;\n};\ntype NodeConfig = NodeConfigsByKind[kind];\ninterface UnknownErrorConfigs {\n expected?: ExpectedConfig;\n actual?: ActualConfig;\n problem?: ProblemConfig;\n message?: MessageConfig;\n}\ninterface UnknownNodeConfig extends UnknownErrorConfigs {\n description?: DescriptionWriter;\n}\ntype ResolvedUnknownNodeConfig = requireKeys;\ndeclare const configureSchema: (config: ArkSchemaConfig) => ArkSchemaConfig;\ndeclare const mergeConfigs: (base: base, merged: ArkSchemaConfig | undefined) => base;\ntype MergeToJsonSchemaConfigs = (baseConfig: base, mergedConfig: ToJsonSchema.Options | undefined) => base extends ToJsonSchema.Context ? ToJsonSchema.Context : ToJsonSchema.Options;\ndeclare const mergeToJsonSchemaConfigs: MergeToJsonSchemaConfigs;\ntype CloneImplementation = (original: original) => original;\ninterface ArkSchemaConfig extends Partial> {\n readonly jitless?: boolean;\n readonly clone?: boolean | CloneImplementation;\n readonly onUndeclaredKey?: UndeclaredKeyBehavior;\n readonly numberAllowsNaN?: boolean;\n readonly dateAllowsInvalid?: boolean;\n readonly exactOptionalPropertyTypes?: boolean;\n readonly onFail?: ArkErrors.Handler | null;\n readonly keywords?: Record;\n readonly toJsonSchema?: ToJsonSchema.Options;\n}\ntype resolveConfig = show<{\n [k in keyof ArkSchemaConfig]-?: k extends NodeKind ? Required : k extends \"clone\" ? CloneImplementation | false : k extends \"keywords\" ? Record : k extends \"toJsonSchema\" ? ToJsonSchema.Context : config[k];\n} & Omit>;\ntype ResolvedConfig = resolveConfig;\n\ntype InternalNodeIntersection = (l: l, r: r, ctx: ctx) => l[\"kind\"] | r[\"kind\"] extends RootKind ? BaseRoot | Disjoint : BaseNode | Disjoint | null;\ndeclare const intersectNodesRoot: InternalNodeIntersection;\ndeclare const pipeNodesRoot: InternalNodeIntersection;\ndeclare const intersectOrPipeNodes: InternalNodeIntersection;\n\nexport { $ark, type ActualConfig, type ActualWriter, After, AfterNode, type AliasDefEntry, ArkError, type ArkErrorCode, type ArkErrorContextInput, type ArkErrorInput, type ArkErrorResult, ArkErrors, type ArkKind, type ArkKinds, type ArkSchemaConfig, type ArkSchemaRegistry, type ArkSchemaScopeConfig, type AttachedParseContext, BaseConstraint, type BaseErrorContext, type BaseMappedPropInner, BaseNode, type BaseNodeDeclaration, type BaseNormalizedSchema, type BaseParseContext, type BaseParseContextInput, type BaseParseOptions, BaseProp, BaseRange, type BaseRangeDeclaration, type BaseRangeInner, BaseRoot, BaseScope, type BasisKind, Before, BeforeNode, type BoundKind, type BoundOperandKind, type Boundable, type BranchTraversal, type CaseContext, type CaseDiscriminant, type CaseKey, type CloneImplementation, type ClosedNodeKind, type CoercibleValue, CompiledFunction, type CompositeKind, type ConditionalTerminalIntersectionRoot, Constraint, type ConstraintIntersection, type ConstraintIntersectionMap, type ConstraintKind, type ContextualArgs, type CreateNodeInput, type CustomErrorInput, type DateRangeKind, type Declaration, type DeepNodeTransformContext, type DeepNodeTransformOptions, type DeepNodeTransformation, type DefaultArkEnv, type DefaultableSequenceElement, type DerivableErrorContext, type DerivableErrorContextInput, type DescriptionWriter, type Discriminant, type DiscriminantKind, type DiscriminantKinds, type DiscriminatedCases, Disjoint, type DisjointEntry, type DisjointEntryContext, type DisjointKind, Divisor, DivisorNode, Domain, DomainNode, ExactLength, ExactLengthNode, type ExclusiveDateRangeSchema, type ExclusiveExpandedDateRangeSchema, type ExclusiveNormalizedNumericRangeSchema, type ExclusiveNumericRangeSchema, type ExpectedConfig, type ExpectedWriter, type FlatRef, type GenericArgResolutions, type GenericAst, type GenericParamAst, type GenericParamDef, GenericRoot, type GenericRootBodyParser, type GenericRootParser, type GettableKeyOrNode, type GlobalOnlyConfigOptionName, type InclusiveDateRangeSchema, type InclusiveExpandedDateRangeSchema, type InclusiveNormalizedNumericRangeSchema, type InclusiveNumericRangeSchema, Index, IndexNode, Inner, type InternalIntersectionOptions, type InternalModule, InternalPrimitiveConstraint, type InternalResolution, type InternalResolutions, type InternalRootDeclaration, type InternalSchemaParser, type InternalTraversal, Intersection, type IntersectionContext, type IntersectionMap, IntersectionNode, type InvokeOptions, JsonSchema, type JsonSchemaOrBoolean, type KeyOrKeyNode, LazyGenericBody, type LengthBoundKind, type LengthBoundableData, type LimitInnerValue, type LimitKind, type LimitSchemaValue, type LimitValue, type ListableJsonSchema, type LowerBoundKind, type LowerNode, type MappedPropInner, Max, MaxLength, MaxLengthNode, MaxNode, type MessageConfig, type MessageContext, type MessageWriter, Min, MinLength, MinLengthNode, MinNode, Morph, type MorphChildKind, MorphNode, type MorphsAtPath, type NarrowedAttachments, NodeCompiler, type NodeConfig, type NodeDeclarationsByKind, type NodeErrorContextInput, type NodeId, type NodeKeyImplementation, type NodeKind, type NodeMeta, type NodeParseContext, type NodeParseContextInput, type NodeResolver, type NodeSchema, NodeSelector, type NormalizedIndex, type NormalizedSchema, type NumericallyBoundable, type OpenNodeKind, Optional, type OptionalMappedPropInner, OptionalNode, type OptionalSequenceElement, type OrderedNodeKinds, Pattern, PatternNode, type PostfixSequenceElement, type PrecompiledReferences, Predicate, PredicateNode, type PrefixSequenceElement, type PreparsedNodeResolution, type Prerequisite, type PrevariadicSequenceElement, type PrimitiveKind, type PrivateDeclaration, type ProblemConfig, type ProblemContext, type ProblemWriter, Prop, type PropFlatMapper, Proto, ProtoNode, type RangeKind, type ReferenceOptions, type RefinementKind, type RegisteredReference, type RelativeComparator, Required$1 as Required, RequiredNode, type ResolvedConfig, type ResolvedScopeConfig, type ResolvedUnknownNodeConfig, type RootExportCache, type RootIntersection, type RootKind, RootModule, type RootSchema, SchemaModule, SchemaScope, type SchemaScopeParser, type ScopeOnlyConfigOptions, Sequence, type SequenceElement, type SequenceElementKind, SequenceNode, type SequenceTuple, type ShouldTransformFn, StandardSchemaV1, type StructuralKind, type StructuralOperationBranchResultByName, type StructuralOperationName, Structure, StructureNode, ToJsonSchema, Traversal, TraversalError, type TraversalKind, type TraversalMethodsByKind, type TraverseAllows, type TraverseApply, type TypeIntersectionMap, TypeMeta, type UndeclaredKeyBehavior, type UndeclaredKeyConfig, type UndeclaredKeyHandling, Union, type UnionChildKind, UnionNode, Unit, UnitNode, type UnknownAttachments, type UnknownErrorConfigs, type UnknownExpandedRangeSchema, type UnknownIntersectionMap, type UnknownIntersectionResult, type UnknownNodeImplementation, type UnknownNormalizedRangeSchema, type UnknownRangeSchema, type UpperBoundKind, type UpperNode, type VariadicSequenceElement, appendUniqueFlatRefs, appendUniqueNodes, arkKind, assertDefaultValueAssignability, assertNodeKind, type attachmentsOf, basisKinds, bindModule, boundKindPairsByLower, type childKindOf, compileComparator, compileLiteralPropAccess, compileObjectLiteral, compileSerializedValue, computeDefaultValueMorph, type conditionalRootOf, configureSchema, constraintKeyParser, constraintKeys, type constraintKindLeftOf, type constraintKindOf, type constraintKindOrLeftOf, constraintKinds, createDateSchemaNormalizer, createLengthRuleParser, createLengthSchemaNormalizer, createNode, dateLimitToString, type declareNode, type defAttachedAs, type defaultErrorContext, defaultValueSerializer, defineSchema, describeBranches, emptyBrandNameMessage, type errorContext, exclusivizeRangeSchema, type exportedNameOf, flatRef, flatRefsAreEqual, type flatResolutionsOf, flattenConstraints, type genericHktToConstraints, genericNode, type genericParamConstraints, type genericParamNames, type genericParamSchemasToAst, type getAssociatedDataForError, hasArkKind, implementNode, indexPropAccess, type innerAttachedAs, type instantiateRoot, type internalImplementationOf, intersectBranches, type intersectConstraintKinds, intersectConstraints, intersectNodesRoot, intersectOrPipeNodes, intersectProps, type intersectRoot, intrinsic, isNode, isNodeKind, type keySchemaDefinitions, type kindLeftOf, type kindOrLeftOf, type kindOrRightOf, type kindRightOf, makeRootAndArrayPropertiesMutable, mergeConfigs, mergeToJsonSchemaConfigs, morphChildKinds, type mutableInnerOfKind, type mutableNormalizedRootOfKind, node, nodeClassesByKind, type nodeImplementationInputOf, type nodeImplementationOf, nodeImplementationsByKind, nodeKinds, type nodeOfKind, nodesByRegisteredId, normalizeIndex, type ownIntersectionResult, type pairedRangeKind, parseAsSchema, parseDateLimit, parseExclusiveKey, parseGeneric, parseNode, pipeNodesRoot, postfixAfterOptionalOrDefaultableMessage, postfixWithoutVariadicMessage, precedenceByKind, precedenceOfKind, pruneDiscriminant, reduceBranches, type reducibleKindOf, reference, refinementKinds, registerNodeId, registeredReference, registryName, type resolvableReferenceIn, type resolveConfig, type resolveReference, rootKinds, rootSchema, rootSchemaScope, schemaKindOf, type schemaKindOrRightOf, type schemaKindRightOf, schemaKindsRightOf, schemaScope, serializeLiteralKey, structuralKinds, structureKeys, throwInvalidOperandError, type toInternalScope, traverseKey, typeKeyToString, typeOrTermExtends, typePathToPropString, unflattenConstraints, unionChildKinds, type unwrapDefault, withId, withMeta, writeDefaultIntersectionMessage, writeDuplicateAliasError, writeEnumerableIndexBranches, writeIndiscriminableMorphMessage, writeIndivisibleMessage, writeInvalidKeysMessage, writeInvalidLengthBoundMessage, writeInvalidOperandMessage, writeInvalidPropertyKeyMessage, writeInvalidSchemaMessage, writeLiteralUnionEntriesMessage, writeMissingSubmoduleAccessMessage, writeMorphIntersectionMessage, writeNonIntegerDivisorMessage, writeNonPrimitiveNonFunctionDefaultValueMessage, writeNonStructuralOperandMessage, writeNonSubmoduleDotMessage, writeNumberIndexMessage, writeOrderedIntersectionMessage, type writeUnassignableDefaultValueMessage, writeUnboundableMessage, writeUnresolvableMessage, writeUnsatisfiableExpressionError, writeUnsatisfiedParameterConstraintMessage };\n\n}" +export const schemaDts = "declare module \"@ark/schema\" {\n import { DynamicBase, anyOrNever, ReadonlyArray as ReadonlyArray$1, array, propwiseXor, merge, show, CastableBase, ReadonlyPath, JsonObject, JsonArray, mutable, Thunk, Callable, Hkt, JsonStructure, autocomplete, listable, satisfy, Domain as Domain$1, Constructor, Json, requireKeys, NonNegativeIntegerLiteral, flattenListable, noSuggest, intersectUnion, conform, ParseError, Key, propValueOf, Entry, KeySet, keySetOf, arrayIndexOf, JsonPrimitive, SerializedPrimitive, inferred, Fn, BuiltinObjectKind, describe, GuardablePredicate, Brand, dict, ArkRegistry } from '@ark/util';\nexport { ParseError } from '@ark/util';\n\ndeclare const intrinsic: {\n emptyStructure: StructureNode;\n jsonPrimitive: BaseRoot;\n jsonObject: BaseRoot;\n jsonData: BaseRoot;\n integer: BaseRoot;\n key: BaseRoot;\n lengthBoundable: BaseRoot;\n nonNegativeIntegerString: BaseRoot;\n string: BaseRoot;\n number: BaseRoot;\n bigint: BaseRoot;\n boolean: BaseRoot;\n symbol: BaseRoot;\n undefined: BaseRoot;\n object: BaseRoot;\n null: BaseRoot;\n Array: BaseRoot;\n Date: BaseRoot;\n never: BaseRoot;\n unknown: BaseRoot;\n true: BaseRoot;\n false: BaseRoot;\n};\n\ntype PreparsedNodeResolution = {\n [arkKind]: \"generic\" | \"module\";\n};\ndeclare class RootModule extends DynamicBase {\n get [arkKind](): \"module\";\n}\ninterface InternalModule extends RootModule {\n root?: BaseRoot;\n}\ndeclare const bindModule: (module: InternalModule, $: BaseScope) => InternalModule;\ntype exportSchemaScope<$> = {\n [k in keyof $]: instantiateRoot<$[k]>;\n};\ntype instantiateRoot = t extends InternalResolution ? [\n t\n] extends [anyOrNever] ? BaseRoot : t : BaseRoot;\ndeclare const SchemaModule: new <$ = {}>(types: exportSchemaScope<$>) => SchemaModule<$>;\ninterface SchemaModule<$ = {}> extends RootModule> {\n}\n\n/** From https://github.com/standard-schema/standard-schema */\n/**\n * The Standard Schema interface.\n */\ntype StandardSchemaV1 = {\n /**\n * The Standard Schema properties.\n */\n readonly \"~standard\": StandardSchemaV1.Props;\n};\ndeclare namespace StandardSchemaV1 {\n /**\n * The Standard Schema properties interface.\n */\n export interface Props {\n /**\n * The version number of the standard.\n */\n readonly version: 1;\n /**\n * The vendor name of the schema library.\n */\n readonly vendor: string;\n /**\n * Validates unknown input values.\n */\n readonly validate: (value: unknown) => Result | Promise>;\n /**\n * Inferred types associated with the schema.\n */\n readonly types?: Types | undefined;\n }\n export interface ArkTypeProps extends Props {\n readonly vendor: \"arktype\";\n }\n /**\n * The result interface of the validate function.\n */\n export type Result = SuccessResult | FailureResult;\n /**\n * The result interface if validation succeeds.\n */\n export interface SuccessResult {\n /**\n * The typed output value.\n */\n readonly value: Output;\n /**\n * The non-existent issues.\n */\n readonly issues?: undefined;\n }\n /**\n * The result interface if validation fails.\n */\n export interface FailureResult {\n /**\n * The issues of failed validation.\n */\n readonly issues: ReadonlyArray;\n }\n /**\n * The issue interface of the failure output.\n */\n export interface Issue {\n /**\n * The error message of the issue.\n */\n readonly message: string;\n /**\n * The path of the issue, if any.\n */\n readonly path?: ReadonlyArray | undefined;\n }\n /**\n * The path segment interface of the issue.\n */\n export interface PathSegment {\n /**\n * The key representing a path segment.\n */\n readonly key: PropertyKey;\n }\n /**\n * The Standard Schema types interface.\n */\n export interface Types {\n /**\n * The input type of the schema.\n */\n readonly input: Input;\n /**\n * The output type of the schema.\n */\n readonly output: Output;\n }\n /**\n * Infers the input type of a Standard Schema.\n */\n export type InferInput = NonNullable[\"input\"];\n /**\n * Infers the output type of a Standard Schema.\n */\n export type InferOutput = NonNullable[\"output\"];\n export { };\n}\n\ntype ArkErrorResult = ArkError | ArkErrors;\ndeclare class ArkError extends CastableBase> {\n readonly [arkKind] = \"error\";\n path: ReadonlyPath;\n data: Prerequisite;\n private nodeConfig;\n protected input: ArkErrorContextInput;\n protected ctx: Traversal;\n constructor(input: ArkErrorContextInput, ctx: Traversal);\n transform(f: (input: ArkErrorContextInput) => ArkErrorContextInput): ArkError;\n hasCode(code: code): this is ArkError;\n get propString(): string;\n get expected(): string;\n get actual(): string;\n get problem(): string;\n get message(): string;\n get flat(): ArkError[];\n toJSON(): JsonObject;\n toString(): string;\n throw(): never;\n}\ndeclare namespace ArkErrors {\n type Handler = (errors: ArkErrors) => returns;\n}\n/**\n * A ReadonlyArray of `ArkError`s returned by a Type on invalid input.\n *\n * Subsequent errors added at an existing path are merged into an\n * ArkError intersection.\n */\ndeclare class ArkErrors extends ReadonlyArray$1 implements StandardSchemaV1.FailureResult {\n readonly [arkKind] = \"errors\";\n protected ctx: Traversal;\n constructor(ctx: Traversal);\n /**\n * Errors by a pathString representing their location.\n */\n byPath: Record;\n /**\n * {@link byPath} flattened so that each value is an array of ArkError instances at that path.\n *\n * ✅ Since \"intersection\" errors will be flattened to their constituent `.errors`,\n * they will never be directly present in this representation.\n */\n get flatByPath(): Record;\n /**\n * {@link byPath} flattened so that each value is an array of problem strings at that path.\n */\n get flatProblemsByPath(): Record;\n /**\n * All pathStrings at which errors are present mapped to the errors occuring\n * at that path or any nested path within it.\n */\n byAncestorPath: Record;\n count: number;\n private mutable;\n /**\n * Throw a TraversalError based on these errors.\n */\n throw(): never;\n /**\n * Converts ArkErrors to TraversalError, a subclass of `Error` suitable for throwing with nice\n * formatting.\n */\n toTraversalError(): TraversalError;\n /**\n * Append an ArkError to this array, ignoring duplicates.\n */\n add(error: ArkError): void;\n transform(f: (e: ArkError) => ArkError): ArkErrors;\n /**\n * Add all errors from an ArkErrors instance, ignoring duplicates and\n * prefixing their paths with that of the current Traversal.\n */\n merge(errors: ArkErrors): void;\n /**\n * A human-readable summary of all errors.\n */\n get summary(): string;\n /**\n * Alias of this ArkErrors instance for StandardSchema compatibility.\n */\n get issues(): this;\n toJSON(): JsonArray;\n toString(): string;\n private _add;\n private addAncestorPaths;\n}\ndeclare class TraversalError extends Error {\n readonly name = \"TraversalError\";\n arkErrors: ArkErrors;\n constructor(errors: ArkErrors);\n}\ninterface DerivableErrorContext {\n expected: string;\n actual: string;\n problem: string;\n message: string;\n data: Prerequisite;\n path: array;\n propString: string;\n}\ntype DerivableErrorContextInput = Partial> & propwiseXor<{\n path?: array;\n}, {\n relativePath?: array;\n prefixPath?: array;\n}>;\ntype ArkErrorCode = {\n [kind in NodeKind]: errorContext extends null ? never : kind;\n}[NodeKind];\ntype ArkErrorContextInputsByCode = {\n [code in ArkErrorCode]: errorContext & DerivableErrorContextInput;\n};\ntype ArkErrorContextInput = merge;\ntype NodeErrorContextInput = ArkErrorContextInputsByCode[code] & {\n meta: NodeMeta;\n};\ntype MessageContext = Omit, \"message\">;\ntype ProblemContext = Omit, \"problem\">;\ntype CustomErrorInput = show<{\n code?: undefined;\n} & DerivableErrorContextInput>;\ntype ArkErrorInput = string | ArkErrorContextInput | CustomErrorInput;\ntype ProblemConfig = string | ProblemWriter;\ntype ProblemWriter = (context: ProblemContext) => string;\ntype MessageConfig = string | MessageWriter;\ntype MessageWriter = (context: MessageContext) => string;\ntype getAssociatedDataForError = code extends NodeKind ? Prerequisite : unknown;\ntype ExpectedConfig = string | ExpectedWriter;\ntype ExpectedWriter = (source: errorContext) => string;\ntype ActualConfig = string | ActualWriter;\ntype ActualWriter = (data: getAssociatedDataForError) => string;\n\ndeclare const makeRootAndArrayPropertiesMutable: (o: o) => makeRootAndArrayPropertiesMutable;\ntype makeRootAndArrayPropertiesMutable = {\n -readonly [k in keyof inner]: inner[k] extends array | undefined ? mutable : inner[k];\n} & unknown;\ntype internalImplementationOf = {\n [k in Exclude]: external[k] extends ((...args: infer args) => unknown) ? (...args: {\n [i in keyof args]: never;\n }) => unknown : unknown;\n};\ntype arkKind = typeof arkKind;\ndeclare const arkKind: \" arkKind\";\ninterface ArkKinds {\n constraint: BaseConstraint;\n root: BaseRoot;\n scope: BaseScope;\n generic: GenericRoot;\n module: InternalModule;\n error: ArkError;\n errors: ArkErrors;\n context: BaseParseContext;\n}\ntype ArkKind = show;\ndeclare const hasArkKind: (value: unknown, kind: kind) => value is ArkKinds[kind];\ndeclare const isNode: (value: unknown) => value is BaseNode;\ntype unwrapDefault = thunkableValue extends Thunk ? returnValue : thunkableValue;\n\ntype GenericParamAst = [name: name, constraint: constraint];\ntype GenericParamDef = name | readonly [name, unknown];\ndeclare const parseGeneric: (paramDefs: array, bodyDef: unknown, $: BaseScope) => GenericRoot;\ntype genericParamNames> = {\n [i in keyof params]: params[i][0];\n};\ntype genericParamConstraints> = {\n [i in keyof params]: params[i][1];\n};\ntype GenericArgResolutions = array> = {\n [i in keyof params as params[i & `${number}`][0]]: BaseRoot;\n};\ndeclare class LazyGenericBody extends Callable<(args: argResolutions) => returns> {\n}\ninterface GenericAst = array, bodyDef = unknown, $ = unknown, arg$ = $> {\n [arkKind]: \"generic\";\n paramsAst: params;\n bodyDef: bodyDef;\n $: $;\n arg$: arg$;\n names: genericParamNames;\n t: this;\n}\ndeclare class GenericRoot = array, bodyDef = unknown> extends Callable<(...args: {\n [i in keyof params]: BaseRoot;\n}) => BaseRoot> {\n readonly [arkKind] = \"generic\";\n readonly paramsAst: params;\n readonly t: GenericAst;\n paramDefs: array;\n bodyDef: bodyDef;\n $: BaseScope;\n arg$: BaseScope;\n baseInstantiation: BaseRoot;\n hkt: Hkt.constructor | null;\n description: string;\n constructor(paramDefs: array, bodyDef: bodyDef, $: BaseScope, arg$: BaseScope, hkt: Hkt.constructor | null);\n defIsLazy(): this is GenericRoot;\n protected cacheGetter(name: name, value: this[name]): this[name];\n get json(): JsonStructure;\n get params(): {\n [i in keyof params]: [params[i][0], BaseRoot];\n };\n get names(): genericParamNames;\n get constraints(): {\n [i in keyof params]: BaseRoot;\n };\n get internal(): this;\n get referencesById(): Record;\n get references(): BaseNode[];\n}\ntype genericParamSchemasToAst = {\n [i in keyof schemas]: schemas[i] extends GenericParamDef ? [\n name,\n unknown\n ] : never;\n};\ntype genericHktToConstraints Hkt> = InstanceType[\"constraints\"];\ntype GenericRootParser = (...params: paramsDef) => GenericRootBodyParser>;\ntype GenericRootBodyParser> = {\n (body: RootSchema): GenericRoot;\n (instantiateDef: LazyGenericBody>, hkt: hkt): GenericRoot<{\n [i in keyof params]: [params[i][0], genericHktToConstraints[i]];\n }, InstanceType>;\n};\ndeclare const writeUnsatisfiedParameterConstraintMessage: (name: name, constraint: constraint, arg: arg) => writeUnsatisfiedParameterConstraintMessage;\ntype writeUnsatisfiedParameterConstraintMessage = `${name} must be assignable to ${constraint} (was ${arg})`;\n\ntype ListableJsonSchema = listable;\ntype JsonSchemaOrBoolean = listable;\ntype JsonSchema = JsonSchema.NonBooleanBranch;\ndeclare namespace JsonSchema {\n type TypeName = \"string\" | \"integer\" | \"number\" | \"object\" | \"array\" | \"boolean\" | \"null\";\n /**\n * a subset of JSON Schema's annotations, see:\n * https://json-schema.org/understanding-json-schema/reference/annotations\n **/\n interface Meta extends UniversalMeta {\n $schema?: string;\n $defs?: Record;\n }\n type Format = autocomplete<\"date-time\" | \"date\" | \"time\" | \"email\" | \"ipv4\" | \"ipv6\" | \"uri\" | \"uuid\" | \"regex\">;\n /**\n * doesn't include root-only keys like $schema\n */\n interface UniversalMeta {\n title?: string;\n description?: string;\n format?: Format;\n deprecated?: true;\n default?: t;\n examples?: readonly t[];\n }\n type Composition = Union | OneOf | Intersection | Not;\n type NonBooleanBranch = Constrainable | Const | Composition | Enum | String | Numeric | Object | Array | Ref;\n type Branch = boolean | JsonSchema;\n type RefString = `#/$defs/${string}`;\n interface Ref extends Meta {\n $ref: RefString;\n type?: never;\n }\n interface Constrainable extends Meta {\n type?: listable;\n }\n interface Intersection extends Meta {\n allOf: readonly JsonSchema[];\n }\n interface Not extends Meta {\n not: JsonSchema;\n }\n interface OneOf extends Meta {\n oneOf: readonly JsonSchema[];\n }\n interface Union extends Meta {\n anyOf: readonly JsonSchema[];\n }\n interface Const extends Meta {\n const: unknown;\n }\n interface Enum extends Meta {\n enum: array;\n }\n interface String extends Meta {\n type: \"string\";\n minLength?: number;\n maxLength?: number;\n pattern?: string;\n format?: string;\n }\n interface Numeric extends Meta {\n type: \"number\" | \"integer\";\n multipleOf?: number;\n minimum?: number;\n exclusiveMinimum?: number;\n maximum?: number;\n exclusiveMaximum?: number;\n }\n interface Object extends Meta {\n type: \"object\";\n properties?: Record;\n required?: string[];\n patternProperties?: Record;\n additionalProperties?: JsonSchemaOrBoolean;\n maxProperties?: number;\n minProperties?: number;\n propertyNames?: String;\n }\n interface Array extends Meta {\n type: \"array\";\n additionalItems?: JsonSchemaOrBoolean;\n contains?: JsonSchemaOrBoolean;\n uniqueItems?: boolean;\n minItems?: number;\n maxItems?: number;\n items?: JsonSchemaOrBoolean;\n prefixItems?: readonly Branch[];\n }\n type LengthBoundable = String | Array;\n type Structure = Object | Array;\n}\n\ndeclare class ToJsonSchemaError extends Error {\n readonly name = \"ToJsonSchemaError\";\n readonly code: code;\n readonly context: ToJsonSchema.ContextByCode[code];\n constructor(code: code, context: ToJsonSchema.ContextByCode[code]);\n hasCode(code: code): this is ToJsonSchemaError;\n}\ndeclare const ToJsonSchema: {\n Error: typeof ToJsonSchemaError;\n throw: (code: keyof ToJsonSchema.ContextByCode, context: ToJsonSchema.MorphContext | ToJsonSchema.UnitContext | ToJsonSchema.ProtoContext | ToJsonSchema.DomainContext | ToJsonSchema.PredicateContext | ToJsonSchema.DateContext | ToJsonSchema.ArrayObjectContext | ToJsonSchema.ArrayPostfixContext | ToJsonSchema.DefaultValueContext | ToJsonSchema.PatternIntersectionContext | ToJsonSchema.SymbolKeyContext) => never;\n throwInternalOperandError: (kind: ConstraintKind, schema: JsonSchema) => never;\n defaultConfig: ToJsonSchema.Context;\n};\ndeclare namespace ToJsonSchema {\n type Unjsonifiable = object | symbol | bigint | undefined;\n type Error = InstanceType;\n interface BaseContext {\n code: code;\n base: base;\n }\n interface ArrayObjectContext extends BaseContext<\"arrayObject\", JsonSchema.Array> {\n object: JsonSchema.Object;\n }\n interface ArrayPostfixContext extends BaseContext<\"arrayPostfix\", VariadicArraySchema> {\n elements: readonly JsonSchema[];\n }\n interface DefaultValueContext extends BaseContext<\"defaultValue\", JsonSchema> {\n value: Unjsonifiable;\n }\n interface DomainContext extends BaseContext<\"domain\", JsonSchema> {\n domain: satisfy;\n }\n interface MorphContext extends BaseContext<\"morph\", JsonSchema> {\n out: JsonSchema | null;\n }\n interface PatternIntersectionContext extends BaseContext<\"patternIntersection\", StringSchemaWithPattern> {\n pattern: string;\n }\n interface PredicateContext extends BaseContext<\"predicate\", JsonSchema> {\n predicate: Predicate;\n }\n interface ProtoContext extends BaseContext<\"proto\", JsonSchema> {\n proto: Constructor;\n }\n type SymbolKeyContext = IndexSymbolKeyContext | RequiredSymbolKeyContext | OptionalSymbolKeyContext;\n interface IndexSymbolKeyContext extends BaseContext<\"symbolKey\", JsonSchema.Object> {\n key: null;\n value: JsonSchema;\n optional: false;\n }\n interface RequiredSymbolKeyContext extends BaseContext<\"symbolKey\", JsonSchema.Object> {\n key: symbol;\n value: JsonSchema;\n optional: false;\n }\n interface OptionalSymbolKeyContext extends BaseContext<\"symbolKey\", JsonSchema.Object> {\n key: symbol;\n value: JsonSchema;\n optional: true;\n default?: Json;\n }\n interface UnitContext extends BaseContext<\"unit\", JsonSchema> {\n unit: Unjsonifiable;\n }\n interface DateContext extends BaseContext<\"date\", JsonSchema> {\n before?: Date;\n after?: Date;\n }\n interface ContextByCode {\n arrayObject: ArrayObjectContext;\n arrayPostfix: ArrayPostfixContext;\n defaultValue: DefaultValueContext;\n domain: DomainContext;\n morph: MorphContext;\n patternIntersection: PatternIntersectionContext;\n predicate: PredicateContext;\n proto: ProtoContext;\n symbolKey: SymbolKeyContext;\n unit: UnitContext;\n date: DateContext;\n }\n type Code = keyof ContextByCode;\n type FallbackContext = ContextByCode[Code];\n type HandlerByCode = satisfy<{\n [code in Code]: (ctx: ContextByCode[code]) => unknown;\n }, {\n arrayObject: (ctx: ArrayObjectContext) => JsonSchema.Structure;\n arrayPostfix: (ctx: ArrayPostfixContext) => VariadicArraySchema;\n defaultValue: (ctx: DefaultValueContext) => JsonSchema;\n domain: (ctx: DomainContext) => JsonSchema;\n morph: (ctx: MorphContext) => JsonSchema;\n patternIntersection: (ctx: PatternIntersectionContext) => JsonSchema.String;\n predicate: (ctx: PredicateContext) => JsonSchema;\n proto: (ctx: ProtoContext) => JsonSchema;\n symbolKey: (ctx: SymbolKeyContext) => JsonSchema.Object;\n unit: (ctx: UnitContext) => JsonSchema;\n date: (ctx: DateContext) => JsonSchema;\n }>;\n type VariadicArraySchema = requireKeys;\n type StringSchemaWithPattern = requireKeys;\n type UniversalFallback = (ctx: FallbackContext) => JsonSchema;\n interface FallbackObject extends Partial {\n default?: UniversalFallback;\n }\n type FallbackOption = UniversalFallback | FallbackObject;\n interface Options {\n /** value to assign to the generated $schema key\n *\n * - set to `null` to omit the `$schema` key\n * - does not affect the contents of the generated schema\n *\n * @default \"https://json-schema.org/draft/2020-12/schema\"\n */\n dialect?: string | null;\n useRefs?: boolean;\n fallback?: FallbackOption;\n }\n interface Context extends Required {\n fallback: HandlerByCode;\n }\n}\n\ndeclare class AliasNode extends BaseRoot {\n readonly expression: string;\n readonly structure: undefined;\n get resolution(): BaseRoot;\n protected _resolve(): BaseRoot;\n get resolutionId(): NodeId;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n}\ndeclare namespace Alias {\n type Schema = `$${alias}` | NormalizedSchema;\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly reference: alias;\n readonly resolve?: () => BaseRoot;\n }\n interface Inner {\n readonly reference: alias;\n readonly resolve?: () => BaseRoot;\n }\n interface Declaration extends declareNode<{\n kind: \"alias\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n }> {\n }\n type Node = AliasNode;\n}\ndeclare const Alias: {\n implementation: nodeImplementationOf;\n Node: typeof AliasNode;\n};\n\ndeclare const registryName: string;\ndeclare const $ark: ArkSchemaRegistry;\ndeclare const reference: (name: string) => RegisteredReference;\ndeclare const registeredReference: (value: object | symbol) => RegisteredReference;\ntype RegisteredReference = `$ark${\"\" | NonNegativeIntegerLiteral}.${to}`;\n\ntype InternalResolutions = Record;\ntype exportedNameOf<$> = Exclude;\ntype resolvableReferenceIn<$> = {\n [k in keyof $]: k extends string ? k extends PrivateDeclaration ? alias : k extends noSuggest | \"root\" ? never : k : never;\n}[keyof $];\ntype resolveReference, $> = reference extends keyof $ ? $[reference] : $[`#${reference}` & keyof $];\ntype flatResolutionsOf<$> = show extends infer k ? k extends keyof $ & string ? resolutionsOfReference : unknown : unknown>>;\ntype resolutionsOfReference = [\n v\n] extends [{\n [arkKind]: \"module\";\n}] ? [\n v\n] extends [anyOrNever] ? {\n [_ in k]: v;\n} : prefixKeys, k> & {\n [innerKey in keyof v as innerKey extends \"root\" ? k : never]: v[innerKey];\n} : {\n [_ in k]: v;\n};\ntype prefixKeys = {\n [k in keyof o & string as `${prefix}.${k}`]: o[k];\n} & unknown;\ntype PrivateDeclaration = `#${key}`;\ntype InternalResolution = BaseRoot | GenericRoot | InternalModule;\ntype toInternalScope<$> = BaseScope<{\n [k in keyof $]: $[k] extends {\n [arkKind]: infer kind;\n } ? [\n $[k]\n ] extends [anyOrNever] ? BaseRoot : kind extends \"generic\" ? GenericRoot : kind extends \"module\" ? InternalModule : never : BaseRoot;\n}>;\ntype CachedResolution = NodeId | BaseRoot | GenericRoot;\ndeclare const writeDuplicateAliasError: (alias: alias) => writeDuplicateAliasError;\ntype writeDuplicateAliasError = `#${alias} duplicates public alias ${alias}`;\ntype AliasDefEntry = [name: string, defValue: unknown];\ntype GlobalOnlyConfigOptionName = satisfy;\ninterface ScopeOnlyConfigOptions {\n name?: string;\n prereducedAliases?: boolean;\n}\ninterface ArkSchemaScopeConfig extends Omit, ScopeOnlyConfigOptions {\n}\ninterface ResolvedScopeConfig extends ResolvedConfig, ScopeOnlyConfigOptions {\n}\ntype PrecompiledReferences = {\n [k: `${string}Allows`]: TraverseAllows;\n [k: `${string}Apply`]: TraverseApply;\n [k: `${string}Optimistic`]: (data: unknown) => unknown;\n};\ndeclare abstract class BaseScope<$ extends {} = {}> {\n readonly config: ArkSchemaScopeConfig;\n readonly resolvedConfig: ResolvedScopeConfig;\n readonly name: string;\n get [arkKind](): \"scope\";\n readonly referencesById: {\n [id: string]: BaseNode;\n };\n references: readonly BaseNode[];\n readonly resolutions: {\n [alias: string]: CachedResolution | undefined;\n };\n exportedNames: string[];\n readonly aliases: Record;\n protected resolved: boolean;\n readonly nodesByHash: Record;\n readonly intrinsic: Omit;\n constructor(\n /** The set of names defined at the root-level of the scope mapped to their\n * corresponding definitions.**/\n def: Record, config?: ArkSchemaScopeConfig);\n protected cacheGetter(name: name, value: this[name]): this[name];\n get internal(): this;\n private _json;\n get json(): JsonStructure;\n defineSchema(def: def): def;\n generic: GenericRootParser;\n units: (values: array, opts?: BaseParseOptions) => BaseRoot;\n protected lazyResolutions: Alias.Node[];\n lazilyResolve(resolve: () => BaseRoot, syntheticAlias?: string): Alias.Node;\n schema: InternalSchemaParser;\n parseSchema: InternalSchemaParser;\n protected preparseNode(kinds: NodeKind | listable, schema: unknown, opts: BaseParseOptions): BaseNode | NodeParseContextInput;\n bindReference(reference: reference): reference;\n resolveRoot(name: string): BaseRoot;\n maybeResolveRoot(name: string): BaseRoot | undefined;\n /** If name is a valid reference to a submodule alias, return its resolution */\n protected maybeResolveSubalias(name: string): BaseRoot | GenericRoot | undefined;\n get ambient(): InternalModule;\n maybeResolve(name: string): Exclude | undefined;\n protected createParseContext(input: input): input & AttachedParseContext;\n traversal(root: unknown): Traversal;\n import(): SchemaModule<{\n [k in exportedNameOf<$> as PrivateDeclaration]: $[k];\n }>;\n import[]>(...names: names): SchemaModule<{\n [k in names[number] as PrivateDeclaration]: $[k];\n } & unknown>;\n precompilation: string | undefined;\n private _exportedResolutions;\n private _exports;\n export(): SchemaModule<{\n [k in exportedNameOf<$>]: $[k];\n }>;\n export[]>(...names: names): SchemaModule<{\n [k in names[number]]: $[k];\n } & unknown>;\n resolve>(name: name): instantiateRoot<$[name]>;\n node: , prereduced extends boolean = false>(kinds: kinds, nodeSchema: NodeSchema>, opts?: BaseParseOptions) => nodeOfKind : reducibleKindOf>>;\n parse: (def: unknown, opts?: BaseParseOptions) => BaseRoot;\n parseDefinition(def: unknown, opts?: BaseParseOptions): BaseRoot;\n finalize(node: node): node;\n protected abstract preparseOwnDefinitionFormat(def: unknown, opts: BaseParseOptions): BaseRoot | BaseParseContextInput;\n abstract parseOwnDefinitionFormat(def: unknown, ctx: BaseParseContext): BaseRoot;\n protected abstract preparseOwnAliasEntry(k: string, v: unknown): AliasDefEntry;\n protected abstract normalizeRootScopeValue(resolution: unknown): unknown;\n}\ndeclare class SchemaScope<$ extends {} = {}> extends BaseScope<$> {\n parseOwnDefinitionFormat(def: unknown, ctx: NodeParseContext): BaseRoot;\n protected preparseOwnDefinitionFormat(schema: RootSchema, opts: BaseParseOptions): BaseRoot | NodeParseContextInput;\n protected preparseOwnAliasEntry(k: string, v: unknown): AliasDefEntry;\n protected normalizeRootScopeValue(v: unknown): unknown;\n}\ntype instantiateAliases = {\n [k in keyof aliases]: aliases[k] extends InternalResolution ? aliases[k] : BaseRoot;\n} & unknown;\ntype SchemaScopeParser = (aliases: {\n [k in keyof aliases]: conform;\n}, config?: ArkSchemaScopeConfig) => BaseScope>;\ndeclare const schemaScope: SchemaScopeParser;\ntype InternalSchemaParser = (schema: RootSchema, opts?: BaseParseOptions) => BaseRoot;\ndeclare const rootSchemaScope: SchemaScope;\ndeclare const parseAsSchema: (def: unknown, opts?: BaseParseOptions) => BaseRoot | ParseError;\ntype RootExportCache = Record;\ndeclare const writeUnresolvableMessage: (token: token) => writeUnresolvableMessage;\ntype writeUnresolvableMessage = `'${token}' is unresolvable`;\ndeclare const writeNonSubmoduleDotMessage: (name: name) => writeNonSubmoduleDotMessage;\ntype writeNonSubmoduleDotMessage = `'${name}' must reference a module to be accessed using dot syntax`;\ndeclare const writeMissingSubmoduleAccessMessage: (name: name) => writeMissingSubmoduleAccessMessage;\ntype writeMissingSubmoduleAccessMessage = `Reference to submodule '${name}' must specify an alias`;\ndeclare const rootSchema: BaseScope[\"schema\"];\ndeclare const node: BaseScope[\"node\"];\ndeclare const defineSchema: BaseScope[\"defineSchema\"];\ndeclare const genericNode: BaseScope[\"generic\"];\n\ndeclare class IndexNode extends BaseConstraint {\n impliedBasis: BaseRoot;\n expression: string;\n flatRefs: FlatRef>[];\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n protected _transform(mapper: DeepNodeTransformation, ctx: DeepNodeTransformContext): BaseNode | null;\n compile(): void;\n}\ndeclare namespace Index {\n type KeyKind = Exclude;\n type KeyNode = nodeOfKind;\n interface Schema extends BaseNormalizedSchema {\n readonly signature: RootSchema;\n readonly value: RootSchema;\n }\n interface Inner {\n readonly signature: KeyNode;\n readonly value: BaseRoot;\n }\n interface Declaration extends declareNode<{\n kind: \"index\";\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n prerequisite: object;\n intersectionIsOpen: true;\n childKind: RootKind;\n }> {\n }\n type Node = IndexNode;\n}\ndeclare const Index: {\n implementation: nodeImplementationOf;\n Node: typeof IndexNode;\n};\ndeclare const writeEnumerableIndexBranches: (keys: string[]) => string;\ndeclare const writeInvalidPropertyKeyMessage: (indexSchema: indexSchema) => writeInvalidPropertyKeyMessage;\ntype writeInvalidPropertyKeyMessage = `Indexed key definition '${indexSchema}' must be a string or symbol`;\n\ndeclare class RequiredNode extends BaseProp<\"required\"> {\n expression: string;\n errorContext: NodeErrorContextInput<\"required\">;\n compiledErrorContext: string;\n}\ndeclare namespace Required$1 {\n interface ErrorContext extends BaseErrorContext<\"required\"> {\n missingValueDescription: string;\n }\n interface Schema extends Prop.Schema {\n }\n interface Inner extends Prop.Inner {\n }\n type Declaration = declareNode & {\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n errorContext: ErrorContext;\n }>;\n type Node = RequiredNode;\n}\ndeclare const Required$1: {\n implementation: nodeImplementationOf<{\n reducibleTo: \"required\";\n kind: \"required\";\n prerequisite: object;\n intersectionIsOpen: true;\n childKind: RootKind;\n schema: Required$1.Schema;\n normalizedSchema: Required$1.Schema;\n inner: Required$1.Inner;\n errorContext: Required$1.ErrorContext;\n }>;\n Node: typeof RequiredNode;\n};\n\ndeclare namespace Prop {\n type Kind = \"required\" | \"optional\";\n type Node = nodeOfKind;\n interface Schema extends BaseNormalizedSchema {\n readonly key: Key;\n readonly value: RootSchema;\n }\n interface Inner {\n readonly key: Key;\n readonly value: BaseRoot;\n }\n interface Declaration {\n kind: kind;\n prerequisite: object;\n intersectionIsOpen: true;\n childKind: RootKind;\n }\n}\ndeclare const intersectProps: (l: nodeOfKind, r: nodeOfKind, ctx: IntersectionContext) => nodeOfKind | Disjoint | null;\ndeclare abstract class BaseProp extends BaseConstraint {\n required: boolean;\n optional: boolean;\n impliedBasis: BaseRoot;\n serializedKey: string;\n compiledKey: string;\n flatRefs: FlatRef[];\n protected _transform(mapper: DeepNodeTransformation, ctx: DeepNodeTransformContext): BaseNode | null;\n hasDefault(): this is Optional.Node.withDefault;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n}\ndeclare const writeDefaultIntersectionMessage: (lValue: unknown, rValue: unknown) => string;\n\ndeclare class OptionalNode extends BaseProp<\"optional\"> {\n constructor(...args: ConstructorParameters);\n get outProp(): Prop.Node;\n expression: string;\n defaultValueMorph: Morph | undefined;\n defaultValueMorphRef: string | undefined;\n}\ndeclare namespace Optional {\n interface Schema extends Prop.Schema {\n default?: unknown;\n }\n interface Inner extends Prop.Inner {\n default?: unknown;\n }\n type Declaration = declareNode & {\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n }>;\n type Node = OptionalNode;\n namespace Node {\n type withDefault = requireKeys;\n }\n}\ndeclare const Optional: {\n implementation: nodeImplementationOf<{\n reducibleTo: \"optional\";\n errorContext: null;\n kind: \"optional\";\n prerequisite: object;\n intersectionIsOpen: true;\n childKind: RootKind;\n schema: Optional.Schema;\n normalizedSchema: Optional.Schema;\n inner: Optional.Inner;\n }>;\n Node: typeof OptionalNode;\n};\ndeclare const computeDefaultValueMorph: (key: PropertyKey, value: BaseRoot, defaultInput: unknown) => Morph;\ndeclare const assertDefaultValueAssignability: (node: BaseRoot, value: unknown, key: PropertyKey | null) => unknown;\ntype writeUnassignableDefaultValueMessage = `Default value ${defaultValue} must be assignable to ${baseDef}`;\ndeclare const writeNonPrimitiveNonFunctionDefaultValueMessage: (key: PropertyKey | null) => string;\n\ninterface BaseRangeDeclaration extends BaseNodeDeclaration {\n kind: RangeKind;\n inner: BaseRangeInner;\n normalizedSchema: UnknownExpandedRangeSchema;\n}\ndeclare abstract class BaseRange extends InternalPrimitiveConstraint {\n readonly exclusive?: true;\n readonly boundOperandKind: OperandKindsByBoundKind[d[\"kind\"]];\n readonly compiledActual: string;\n readonly comparator: RelativeComparator;\n readonly numericLimit: number;\n readonly expression: string;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly stringLimit: string;\n readonly limitKind: LimitKind;\n isStricterThan(r: nodeOfKind>): boolean;\n overlapsRange(r: nodeOfKind>): boolean;\n overlapIsUnit(r: nodeOfKind>): boolean;\n}\ninterface BaseRangeInner {\n readonly rule: LimitValue;\n}\ntype LimitValue = Date | number;\ntype LimitSchemaValue = Date | number | string;\ntype LimitInnerValue = kind extends \"before\" | \"after\" ? Date : number;\ninterface UnknownExpandedRangeSchema extends BaseNormalizedSchema {\n readonly rule: LimitSchemaValue;\n readonly exclusive?: boolean;\n}\ninterface UnknownNormalizedRangeSchema extends BaseNormalizedSchema {\n readonly rule: LimitSchemaValue;\n}\ntype UnknownRangeSchema = LimitSchemaValue | UnknownExpandedRangeSchema;\ninterface ExclusiveExpandedDateRangeSchema extends BaseNormalizedSchema {\n rule: LimitSchemaValue;\n exclusive?: true;\n}\ntype ExclusiveDateRangeSchema = LimitSchemaValue | ExclusiveExpandedDateRangeSchema;\ninterface InclusiveExpandedDateRangeSchema extends BaseNormalizedSchema {\n rule: LimitSchemaValue;\n exclusive?: false;\n}\ntype InclusiveDateRangeSchema = LimitSchemaValue | InclusiveExpandedDateRangeSchema;\ninterface ExclusiveNormalizedNumericRangeSchema extends BaseNormalizedSchema {\n rule: number;\n exclusive?: true;\n}\ntype ExclusiveNumericRangeSchema = number | ExclusiveNormalizedNumericRangeSchema;\ninterface InclusiveNormalizedNumericRangeSchema extends BaseNormalizedSchema {\n rule: number;\n exclusive?: false;\n}\ntype InclusiveNumericRangeSchema = number | InclusiveNormalizedNumericRangeSchema;\ntype LimitKind = \"lower\" | \"upper\";\ntype RelativeComparator = {\n lower: \">\" | \">=\";\n upper: \"<\" | \"<=\";\n}[kind];\ndeclare const boundKindPairsByLower: BoundKindPairsByLower;\ntype BoundKindPairsByLower = {\n min: \"max\";\n minLength: \"maxLength\";\n after: \"before\";\n};\ntype BoundKindPairsByUpper = {\n max: \"min\";\n maxLength: \"minLength\";\n before: \"after\";\n};\ntype pairedRangeKind = kind extends LowerBoundKind ? BoundKindPairsByLower[kind] : BoundKindPairsByUpper[kind & UpperBoundKind];\ntype LowerBoundKind = keyof typeof boundKindPairsByLower;\ntype LowerNode = nodeOfKind;\ntype UpperBoundKind = propValueOf;\ntype UpperNode = nodeOfKind;\ntype NumericallyBoundable = string | number | array;\ntype Boundable = NumericallyBoundable | Date;\ndeclare const parseExclusiveKey: keySchemaDefinitions>[\"exclusive\"];\ndeclare const createLengthSchemaNormalizer: (kind: kind) => (schema: NodeSchema) => NormalizedSchema;\ndeclare const createDateSchemaNormalizer: (kind: kind) => (schema: NodeSchema) => NormalizedSchema;\ndeclare const parseDateLimit: (limit: LimitSchemaValue) => Date;\ntype LengthBoundKind = \"minLength\" | \"maxLength\" | \"exactLength\";\ndeclare const writeInvalidLengthBoundMessage: (kind: LengthBoundKind, limit: number) => string;\ndeclare const createLengthRuleParser: (kind: LengthBoundKind) => (limit: number) => number | undefined;\ntype OperandKindsByBoundKind = satisfy, {\n min: \"value\";\n max: \"value\";\n minLength: \"length\";\n maxLength: \"length\";\n after: \"date\";\n before: \"date\";\n}>;\ndeclare const compileComparator: (kind: RangeKind, exclusive: boolean | undefined) => RelativeComparator;\ntype BoundOperandKind = \"value\" | \"length\" | \"date\";\ntype LengthBoundableData = string | array;\ntype DateRangeKind = \"before\" | \"after\";\ndeclare const dateLimitToString: (limit: LimitSchemaValue) => string;\ndeclare const writeUnboundableMessage: (root: root) => writeUnboundableMessage;\ntype writeUnboundableMessage = `Bounded expression ${root} must be exactly one of number, string, Array, or Date`;\n\ndeclare class ExactLengthNode extends InternalPrimitiveConstraint {\n traverseAllows: TraverseAllows;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly impliedBasis: BaseRoot;\n readonly expression: string;\n reduceJsonSchema(schema: JsonSchema.LengthBoundable): JsonSchema.LengthBoundable;\n}\ndeclare namespace ExactLength {\n interface Inner {\n readonly rule: number;\n }\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly rule: number;\n }\n type Schema = NormalizedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"exactLength\">, Inner {\n }\n type Declaration = declareNode<{\n kind: \"exactLength\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: LengthBoundableData;\n errorContext: ErrorContext;\n }>;\n type Node = ExactLengthNode;\n}\ndeclare const ExactLength: {\n implementation: nodeImplementationOf<{\n intersectionIsOpen: false;\n childKind: never;\n reducibleTo: \"exactLength\";\n kind: \"exactLength\";\n schema: ExactLength.Schema;\n normalizedSchema: ExactLength.NormalizedSchema;\n inner: ExactLength.Inner;\n prerequisite: LengthBoundableData;\n errorContext: ExactLength.ErrorContext;\n }>;\n Node: typeof ExactLengthNode;\n};\n\ndeclare class MaxLengthNode extends BaseRange {\n readonly impliedBasis: BaseRoot;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(schema: JsonSchema.LengthBoundable): JsonSchema.LengthBoundable;\n}\ndeclare namespace MaxLength {\n interface Inner extends BaseRangeInner {\n rule: number;\n }\n interface NormalizedSchema extends UnknownNormalizedRangeSchema {\n rule: number;\n }\n interface ExpandedSchema extends UnknownExpandedRangeSchema {\n rule: number;\n }\n type Schema = ExpandedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"maxLength\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"maxLength\";\n schema: Schema;\n reducibleTo: \"exactLength\";\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: LengthBoundableData;\n errorContext: ErrorContext;\n }> {\n }\n type Node = MaxLengthNode;\n}\ndeclare const MaxLength: {\n implementation: nodeImplementationOf;\n Node: typeof MaxLengthNode;\n};\n\ndeclare class MinLengthNode extends BaseRange {\n readonly impliedBasis: BaseRoot;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(schema: JsonSchema.LengthBoundable): JsonSchema.LengthBoundable;\n}\ndeclare namespace MinLength {\n interface Inner extends BaseRangeInner {\n rule: number;\n }\n interface NormalizedSchema extends UnknownNormalizedRangeSchema {\n rule: number;\n }\n interface ExpandedSchema extends UnknownExpandedRangeSchema {\n rule: number;\n }\n type Schema = ExpandedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"minLength\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"minLength\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: LengthBoundableData;\n reducibleTo: \"intersection\";\n errorContext: ErrorContext;\n }> {\n }\n type Node = MinLengthNode;\n}\ndeclare const MinLength: {\n implementation: nodeImplementationOf;\n Node: typeof MinLengthNode;\n};\n\ndeclare class SequenceNode extends BaseConstraint {\n impliedBasis: BaseRoot;\n tuple: SequenceTuple;\n prefixLength: number;\n defaultablesLength: number;\n optionalsLength: number;\n postfixLength: number;\n defaultablesAndOptionals: BaseRoot[];\n prevariadic: array;\n variadicOrPostfix: array;\n flatRefs: FlatRef[];\n protected addFlatRefs(): FlatRef[];\n isVariadicOnly: boolean;\n minVariadicLength: number;\n minLength: number;\n minLengthNode: MinLengthNode | null;\n maxLength: number | null;\n maxLengthNode: MaxLengthNode | ExactLengthNode | null;\n impliedSiblings: array;\n defaultValueMorphs: Morph[];\n defaultValueMorphsReference: `$ark.${string}` | `$ark0.${string}` | `$ark${`1${string}` & `${bigint}`}.${string}` | `$ark${`4${string}` & `${bigint}`}.${string}` | `$ark${`2${string}` & `${bigint}`}.${string}` | `$ark${`3${string}` & `${bigint}`}.${string}` | `$ark${`5${string}` & `${bigint}`}.${string}` | `$ark${`6${string}` & `${bigint}`}.${string}` | `$ark${`7${string}` & `${bigint}`}.${string}` | `$ark${`8${string}` & `${bigint}`}.${string}` | `$ark${`9${string}` & `${bigint}`}.${string}` | undefined;\n protected elementAtIndex(data: array, index: number): SequenceElement;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n get element(): BaseRoot;\n compile(js: NodeCompiler): void;\n protected _transform(mapper: DeepNodeTransformation, ctx: DeepNodeTransformContext): BaseNode | null;\n expression: string;\n reduceJsonSchema(schema: JsonSchema.Array, ctx: ToJsonSchema.Context): JsonSchema.Array;\n}\ndeclare namespace Sequence {\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly prefix?: array;\n readonly defaultables?: array;\n readonly optionals?: array;\n readonly variadic?: RootSchema;\n readonly minVariadicLength?: number;\n readonly postfix?: array;\n }\n type Schema = NormalizedSchema | RootSchema;\n type DefaultableSchema = [schema: RootSchema, defaultValue: unknown];\n type DefaultableElement = [node: BaseRoot, defaultValue: unknown];\n interface Inner {\n readonly prefix?: array;\n readonly defaultables?: array;\n readonly optionals?: array;\n readonly variadic?: BaseRoot;\n readonly minVariadicLength?: number;\n readonly postfix?: array;\n }\n interface Declaration extends declareNode<{\n kind: \"sequence\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: array;\n reducibleTo: \"sequence\";\n childKind: RootKind;\n }> {\n }\n type Node = SequenceNode;\n}\ndeclare const Sequence: {\n implementation: nodeImplementationOf;\n Node: typeof SequenceNode;\n};\ndeclare const postfixAfterOptionalOrDefaultableMessage = \"A postfix required element cannot follow an optional or defaultable element\";\ntype postfixAfterOptionalOrDefaultableMessage = typeof postfixAfterOptionalOrDefaultableMessage;\ndeclare const postfixWithoutVariadicMessage = \"A postfix element requires a variadic element\";\ntype postfixWithoutVariadicMessage = typeof postfixWithoutVariadicMessage;\ntype SequenceElement = PrevariadicSequenceElement | VariadicSequenceElement | PostfixSequenceElement;\ntype SequenceElementKind = satisfy;\ntype PrevariadicSequenceElement = PrefixSequenceElement | DefaultableSequenceElement | OptionalSequenceElement;\ntype PrefixSequenceElement = {\n kind: \"prefix\";\n node: BaseRoot;\n};\ntype OptionalSequenceElement = {\n kind: \"optionals\";\n node: BaseRoot;\n};\ntype PostfixSequenceElement = {\n kind: \"postfix\";\n node: BaseRoot;\n};\ntype VariadicSequenceElement = {\n kind: \"variadic\";\n node: BaseRoot;\n};\ntype DefaultableSequenceElement = {\n kind: \"defaultables\";\n node: BaseRoot;\n default: unknown;\n};\ntype SequenceTuple = array;\n\n/**\n * - `\"ignore\"` (default) - allow and preserve extra properties\n * - `\"reject\"` - disallow extra properties\n * - `\"delete\"` - clone and remove extra properties from output\n */\ntype UndeclaredKeyBehavior = \"ignore\" | UndeclaredKeyHandling;\ntype UndeclaredKeyHandling = \"reject\" | \"delete\";\ndeclare class StructureNode extends BaseConstraint {\n impliedBasis: BaseRoot;\n impliedSiblings: BaseConstraint[];\n props: array;\n propsByKey: Record;\n propsByKeyReference: RegisteredReference;\n expression: string;\n requiredKeys: Key[];\n optionalKeys: Key[];\n literalKeys: Key[];\n _keyof: BaseRoot | undefined;\n keyof(): BaseRoot;\n map(flatMapProp: PropFlatMapper): StructureNode;\n assertHasKeys(keys: array): void;\n get(indexer: GettableKeyOrNode, ...path: array): BaseRoot;\n pick(...keys: KeyOrKeyNode[]): StructureNode;\n omit(...keys: KeyOrKeyNode[]): StructureNode;\n optionalize(): StructureNode;\n require(): StructureNode;\n merge(r: StructureNode): StructureNode;\n private filterKeys;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n protected _traverse: (traversalKind: TraversalKind, data: object, ctx: InternalTraversal) => boolean;\n get defaultable(): Optional.Node.withDefault[];\n declaresKey: (k: Key) => boolean;\n _compileDeclaresKey(js: NodeCompiler): string;\n get structuralMorph(): Morph | undefined;\n structuralMorphRef: RegisteredReference | undefined;\n compile(js: NodeCompiler): unknown;\n protected compileExhaustiveEntry(js: NodeCompiler): NodeCompiler;\n reduceJsonSchema(schema: JsonSchema.Structure, ctx: ToJsonSchema.Context): JsonSchema.Structure;\n reduceObjectJsonSchema(schema: JsonSchema.Object, ctx: ToJsonSchema.Context): JsonSchema.Object;\n}\ntype PropFlatMapper = (entry: Prop.Node) => listable;\ntype MappedPropInner = BaseMappedPropInner | OptionalMappedPropInner;\ninterface BaseMappedPropInner extends Required$1.Schema {\n kind?: \"required\" | \"optional\";\n}\ninterface OptionalMappedPropInner extends Optional.Schema {\n kind: \"optional\";\n}\ndeclare namespace Structure {\n interface Schema extends BaseNormalizedSchema {\n readonly optional?: readonly Optional.Schema[];\n readonly required?: readonly Required$1.Schema[];\n readonly index?: readonly Index.Schema[];\n readonly sequence?: Sequence.Schema;\n readonly undeclared?: UndeclaredKeyBehavior;\n }\n interface Inner {\n readonly optional?: readonly Optional.Node[];\n readonly required?: readonly Required$1.Node[];\n readonly index?: readonly Index.Node[];\n readonly sequence?: Sequence.Node;\n readonly undeclared?: UndeclaredKeyHandling;\n }\n namespace Inner {\n type mutable = makeRootAndArrayPropertiesMutable;\n }\n interface Declaration extends declareNode<{\n kind: \"structure\";\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n prerequisite: object;\n childKind: StructuralKind;\n }> {\n }\n type Node = StructureNode;\n}\ndeclare const Structure: {\n implementation: nodeImplementationOf;\n Node: typeof StructureNode;\n};\ndeclare const writeNumberIndexMessage: (indexExpression: string, sequenceExpression: string) => string;\ntype NormalizedIndex = {\n index?: Index.Node;\n required?: Required$1.Node[];\n optional?: Optional.Node[];\n};\n/** extract enumerable named props from an index signature */\ndeclare const normalizeIndex: (signature: BaseRoot, value: BaseRoot, $: BaseScope) => NormalizedIndex;\ndeclare const typeKeyToString: (k: KeyOrKeyNode) => string;\ndeclare const writeInvalidKeysMessage: >(o: o, keys: keys) => string;\n\ndeclare const basisKinds: readonly [\"unit\", \"proto\", \"domain\"];\ntype BasisKind = (typeof basisKinds)[number];\ndeclare const structuralKinds: readonly [\"required\", \"optional\", \"index\", \"sequence\"];\ntype StructuralKind = (typeof structuralKinds)[number];\ntype RangeKind = Exclude;\ntype BoundKind = Exclude;\ndeclare const refinementKinds: readonly [\"pattern\", \"divisor\", \"exactLength\", \"max\", \"min\", \"maxLength\", \"minLength\", \"before\", \"after\"];\ntype RefinementKind = (typeof refinementKinds)[number];\ntype orderedConstraintKinds = [\n ...typeof refinementKinds,\n ...typeof structuralKinds,\n \"structure\",\n \"predicate\"\n];\ndeclare const constraintKinds: orderedConstraintKinds;\ntype ConstraintKind = (typeof constraintKinds)[number];\ndeclare const rootKinds: readonly [\"alias\", \"union\", \"morph\", \"unit\", \"intersection\", \"proto\", \"domain\"];\ntype RootKind = (typeof rootKinds)[number];\ntype NodeKind = RootKind | ConstraintKind;\ntype orderedNodeKinds = [...typeof rootKinds, ...typeof constraintKinds];\ndeclare const nodeKinds: orderedNodeKinds;\ntype OpenNodeKind = {\n [k in NodeKind]: Declaration[\"intersectionIsOpen\"] extends true ? k : never;\n}[NodeKind];\ntype ClosedNodeKind = Exclude;\ntype PrimitiveKind = RefinementKind | BasisKind | \"predicate\";\ntype CompositeKind = Exclude;\ntype OrderedNodeKinds = typeof nodeKinds;\ndeclare const constraintKeys: KeySet;\ndeclare const structureKeys: keySetOf;\ntype RightsByKind = accumulateRightKinds;\ntype kindOrRightOf = kind | kindRightOf;\ntype kindLeftOf = Exclude>;\ntype kindOrLeftOf = kind | kindLeftOf;\ntype accumulateRightKinds = remaining extends (readonly [infer head extends NodeKind, ...infer tail extends NodeKind[]]) ? accumulateRightKinds : result;\ninterface InternalIntersectionOptions {\n pipe: boolean;\n}\ninterface IntersectionContext extends InternalIntersectionOptions {\n $: BaseScope;\n invert: boolean;\n}\ntype ConstraintIntersection> = (l: nodeOfKind, r: nodeOfKind, ctx: IntersectionContext) => BaseNode | Disjoint | null;\ntype ConstraintIntersectionMap = show<{\n [_ in kind]: ConstraintIntersection;\n} & {\n [rKind in kindRightOf]?: ConstraintIntersection;\n}>;\ntype RootIntersection> = (l: nodeOfKind, r: nodeOfKind, ctx: IntersectionContext) => BaseRoot | Disjoint;\ntype TypeIntersectionMap = {\n [rKind in schemaKindOrRightOf]: RootIntersection;\n};\ntype IntersectionMap = kind extends RootKind ? TypeIntersectionMap : ConstraintIntersectionMap;\ntype UnknownIntersectionMap = {\n [k in NodeKind]?: (l: BaseNode, r: BaseNode, ctx: IntersectionContext) => UnknownIntersectionResult;\n};\ntype UnknownIntersectionResult = BaseNode | Disjoint | null;\ntype PrecedenceByKind = {\n [i in arrayIndexOf as OrderedNodeKinds[i]]: i;\n};\ndeclare const precedenceByKind: PrecedenceByKind;\ndeclare const isNodeKind: (value: unknown) => value is NodeKind;\ndeclare function assertNodeKind(value: BaseNode, kind: kind): asserts value is nodeOfKind;\ntype precedenceOfKind = PrecedenceByKind[kind];\ndeclare const precedenceOfKind: (kind: kind) => precedenceOfKind;\ntype kindRightOf = RightsByKind[kind];\ndeclare const schemaKindsRightOf: (kind: kind) => schemaKindRightOf[];\ndeclare const unionChildKinds: readonly [...(\"intersection\" | \"morph\" | \"unit\" | \"proto\" | \"domain\")[], \"alias\"];\ntype UnionChildKind = (typeof unionChildKinds)[number];\ndeclare const morphChildKinds: readonly [...(\"intersection\" | \"unit\" | \"proto\" | \"domain\")[], \"alias\"];\ntype MorphChildKind = (typeof morphChildKinds)[number];\ntype keySchemaDefinitions = {\n [k in keyRequiringSchemaDefinition]: NodeKeyImplementation;\n};\ntype keyRequiringSchemaDefinition = Exclude;\ndeclare const defaultValueSerializer: (v: unknown) => Json;\ntype NodeKeyImplementation : never> = requireKeys<{\n preserveUndefined?: true;\n child?: boolean | ((value: instantiated) => BaseNode[]);\n serialize?: (schema: instantiated) => Json;\n reduceIo?: (ioKind: \"in\" | \"out\", inner: makeRootAndArrayPropertiesMutable, value: d[\"inner\"][k]) => void;\n parse?: (schema: Exclude, ctx: NodeParseContext) => instantiated | undefined;\n}, (d[\"normalizedSchema\"][k] extends instantiated | undefined ? never : \"parse\") | ([instantiated] extends [listable] ? \"child\" : never)>;\ninterface CommonNodeImplementationInput {\n kind: d[\"kind\"];\n keys: keySchemaDefinitions;\n normalize: (schema: d[\"schema\"], $: BaseScope) => d[\"normalizedSchema\"];\n applyConfig?: (schema: d[\"normalizedSchema\"], config: ResolvedScopeConfig) => d[\"normalizedSchema\"];\n hasAssociatedError: d[\"errorContext\"] extends null ? false : true;\n finalizeInnerJson?: (json: {\n [k in keyof d[\"inner\"]]: Json;\n }) => JsonStructure;\n collapsibleKey?: keyof d[\"inner\"];\n reduce?: (inner: d[\"inner\"], $: BaseScope) => nodeOfKind | Disjoint | undefined;\n obviatesBasisDescription?: d[\"kind\"] extends RefinementKind ? true : never;\n obviatesBasisExpression?: d[\"kind\"] extends RefinementKind ? true : never;\n}\ninterface UnknownNodeImplementation extends CommonNodeImplementationInput {\n defaults: ResolvedUnknownNodeConfig;\n intersectionIsOpen: boolean;\n intersections: UnknownIntersectionMap;\n keys: Record>;\n}\ndeclare const compileObjectLiteral: (ctx: object) => string;\ntype nodeImplementationOf = nodeImplementationInputOf & {\n intersections: IntersectionMap;\n intersectionIsOpen: d[\"intersectionIsOpen\"];\n defaults: Required>;\n};\ntype nodeImplementationInputOf = CommonNodeImplementationInput & {\n intersections: IntersectionMap;\n defaults: nodeSchemaaultsImplementationInputFor;\n} & (d[\"intersectionIsOpen\"] extends true ? {\n intersectionIsOpen: true;\n} : {}) & (d[\"reducibleTo\"] extends d[\"kind\"] ? {} : {\n reduce: {};\n});\ntype nodeSchemaaultsImplementationInputFor = requireKeys, \"description\" | (Inner extends (Omit, keyof BaseErrorContext | \"description\">) ? never : \"expected\" & keyof NodeConfig)>;\ntype DescriptionWriter = (node: nodeOfKind) => string;\ninterface UnknownAttachments {\n readonly kind: NodeKind;\n readonly impl: UnknownNodeImplementation;\n readonly id: NodeId;\n readonly inner: Record;\n readonly innerEntries: readonly Entry[];\n readonly innerJson: object;\n readonly innerHash: string;\n readonly meta: NodeMeta;\n readonly metaJson: object;\n readonly json: object;\n readonly hash: string;\n readonly collapsibleJson: Json;\n readonly children: BaseNode[];\n}\ninterface NarrowedAttachments extends UnknownAttachments {\n kind: d[\"kind\"];\n inner: d[\"inner\"];\n json: JsonStructure;\n innerJson: JsonStructure;\n collapsibleJson: Json;\n children: nodeOfKind[];\n}\ndeclare const implementNode: (_: nodeImplementationInputOf) => nodeImplementationOf;\n\ndeclare abstract class InternalBasis extends BaseRoot {\n abstract compiledCondition: string;\n abstract compiledNegation: string;\n structure: undefined;\n traverseApply: TraverseApply;\n get errorContext(): d[\"errorContext\"];\n get compiledErrorContext(): string;\n compile(js: NodeCompiler): void;\n}\n\ndeclare class DomainNode extends InternalBasis {\n private readonly requiresNaNCheck;\n readonly traverseAllows: TraverseAllows;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly expression: string;\n get nestableExpression(): string;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema.Constrainable;\n}\ntype Domain = Domain$1;\ndeclare namespace Domain {\n type Enumerable = \"undefined\" | \"null\" | \"boolean\";\n type NonEnumerable = Exclude;\n interface Inner {\n readonly domain: domain;\n readonly numberAllowsNaN?: boolean;\n }\n interface NormalizedSchema extends BaseNormalizedSchema, Inner {\n }\n type Schema = domain | NormalizedSchema;\n interface ErrorContext extends BaseErrorContext<\"domain\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"domain\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n errorContext: ErrorContext;\n }> {\n }\n type Node = DomainNode;\n}\ndeclare const Domain: {\n implementation: nodeImplementationOf;\n Node: typeof DomainNode;\n writeBadAllowNanMessage: (actual: Exclude) => string;\n};\n\ninterface DisjointEntry {\n kind: kind;\n l: OperandsByDisjointKind[kind];\n r: OperandsByDisjointKind[kind];\n path: Key[];\n optional: boolean;\n}\ntype OperandsByDisjointKind = {\n domain: nodeOfKind<\"domain\"> | Domain.Enumerable;\n unit: nodeOfKind<\"unit\">;\n proto: nodeOfKind<\"proto\">;\n presence: BaseRoot;\n range: nodeOfKind;\n assignability: BaseNode;\n union: readonly BaseRoot[];\n};\ntype DisjointEntryContext = {\n path?: Key[];\n optional?: true;\n};\ndeclare class Disjoint extends Array {\n static init(kind: kind, l: OperandsByDisjointKind[kind], r: OperandsByDisjointKind[kind], ctx?: DisjointEntryContext): Disjoint;\n add(kind: kind, l: OperandsByDisjointKind[kind], r: OperandsByDisjointKind[kind], ctx?: DisjointEntryContext): Disjoint;\n get summary(): string;\n describeReasons(): string;\n throw(): never;\n invert(): Disjoint;\n withPrefixKey(key: PropertyKey, kind: Prop.Kind): Disjoint;\n toNeverIfDisjoint(): BaseRoot;\n}\ntype DisjointKind = keyof OperandsByDisjointKind;\ndeclare const writeUnsatisfiableExpressionError: (expression: expression) => writeUnsatisfiableExpressionError;\ntype writeUnsatisfiableExpressionError = `${expression} results in an unsatisfiable type`;\n\ntype withMetaPrefixedKeys = {\n [k in keyof o as k extends string ? `meta.${k}` : never]: o[k];\n};\ninterface DefaultArkEnv {\n meta(): {};\n onFail(errors: ArkErrors): ArkErrors;\n}\ninterface NodeMeta extends JsonSchema.UniversalMeta, UnknownErrorConfigs {\n alias?: string;\n defId?: string;\n onFail?: ArkErrors.Handler;\n}\ndeclare global {\n export interface ArkEnv extends DefaultArkEnv {\n }\n export namespace ArkEnv {\n type meta = show>;\n type onFail = ReturnType;\n }\n}\ntype TypeMeta = Omit;\ndeclare namespace TypeMeta {\n type Collapsible = meta | string;\n type Mapper = (existing: Readonly) => meta;\n type MappableInput = Collapsible | Mapper;\n namespace MappableInput {\n type Internal = MappableInput;\n }\n}\ninterface BaseNormalizedSchema extends withMetaPrefixedKeys {\n readonly meta?: ArkEnv.meta | string;\n}\ninterface DeclarationInput {\n kind: NodeKind;\n schema: unknown;\n normalizedSchema: BaseNormalizedSchema;\n inner: object;\n errorContext?: BaseErrorContext;\n reducibleTo?: NodeKind;\n intersectionIsOpen?: true;\n prerequisite?: unknown;\n childKind?: NodeKind;\n}\ninterface BaseErrorContext {\n readonly description?: string;\n readonly code: kind;\n readonly meta: NodeMeta;\n}\ntype defaultErrorContext = show & d[\"inner\"]>;\ntype declareNode = merge<{\n intersectionIsOpen: false;\n prerequisite: prerequisiteOf;\n childKind: never;\n reducibleTo: d[\"kind\"];\n errorContext: null;\n}, d>;\ntype prerequisiteOf = \"prerequisite\" extends keyof d ? d[\"prerequisite\"] : unknown;\ntype attachmentsOf = NarrowedAttachments & attachedInner;\ntype attachedInner = \"intersection\" & d[\"kind\"] extends never ? d[\"inner\"] : {};\ninterface BaseNodeDeclaration {\n kind: NodeKind;\n schema: unknown;\n normalizedSchema: BaseNormalizedSchema;\n inner: {};\n reducibleTo: NodeKind;\n prerequisite: any;\n intersectionIsOpen: boolean;\n childKind: NodeKind;\n errorContext: BaseErrorContext | null;\n}\ntype ownIntersectionResult = nodeOfKind> | Disjoint;\n\ndeclare class DivisorNode extends InternalPrimitiveConstraint {\n traverseAllows: TraverseAllows;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly impliedBasis: BaseRoot;\n readonly expression: string;\n reduceJsonSchema(schema: JsonSchema.Numeric): JsonSchema.Numeric;\n}\ndeclare namespace Divisor {\n interface Inner {\n readonly rule: number;\n }\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly rule: number;\n }\n type Schema = NormalizedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"divisor\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"divisor\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: number;\n errorContext: ErrorContext;\n }> {\n }\n type Node = DivisorNode;\n}\ndeclare const Divisor: {\n implementation: nodeImplementationOf;\n Node: typeof DivisorNode;\n};\ndeclare const writeIndivisibleMessage: (t: BaseRoot) => string;\ntype writeIndivisibleMessage = writeInvalidOperandMessage<\"divisor\", actual>;\ndeclare const writeNonIntegerDivisorMessage: (divisor: divisor) => writeNonIntegerDivisorMessage;\ntype writeNonIntegerDivisorMessage = `divisor must be an integer (was ${divisor})`;\n\ndeclare class PatternNode extends InternalPrimitiveConstraint {\n readonly instance: RegExp;\n readonly expression: string;\n traverseAllows: (string: string) => boolean;\n readonly compiledCondition: string;\n readonly compiledNegation: string;\n readonly impliedBasis: BaseRoot;\n reduceJsonSchema(base: JsonSchema.String, ctx: ToJsonSchema.Context): JsonSchema.String;\n}\ndeclare namespace Pattern {\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly rule: string;\n readonly flags?: string;\n }\n interface Inner {\n readonly rule: string;\n readonly flags?: string;\n }\n type Schema = NormalizedSchema | string | RegExp;\n interface ErrorContext extends BaseErrorContext<\"pattern\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"pattern\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n intersectionIsOpen: true;\n prerequisite: string;\n errorContext: ErrorContext;\n }> {\n }\n type Node = PatternNode;\n}\ndeclare const Pattern: {\n implementation: nodeImplementationOf;\n Node: typeof PatternNode;\n};\n\ndeclare class UnitNode extends InternalBasis {\n compiledValue: JsonPrimitive;\n serializedValue: string;\n compiledCondition: string;\n compiledNegation: string;\n expression: string;\n domain: Domain$1;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n traverseAllows: TraverseAllows;\n}\ndeclare namespace Unit {\n interface Schema extends BaseNormalizedSchema {\n readonly unit: value;\n }\n interface Inner {\n readonly unit: value;\n }\n interface ErrorContext extends BaseErrorContext<\"unit\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"unit\";\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n errorContext: ErrorContext;\n }> {\n }\n type Node = UnitNode;\n}\ndeclare const Unit: {\n implementation: nodeImplementationOf;\n Node: typeof UnitNode;\n};\n\ndeclare class UnionNode extends BaseRoot {\n isBoolean: boolean;\n get branchGroups(): BaseRoot[];\n unitBranches: (MorphNode | UnitNode)[];\n discriminant: Discriminant | null;\n discriminantJson: JsonStructure | null;\n expression: string;\n createBranchedOptimisticRootApply(): BaseNode[\"rootApply\"];\n get shallowMorphs(): array;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n traverseOptimistic: (data: unknown) => unknown;\n compile(js: NodeCompiler): void;\n private compileIndiscriminable;\n get nestableExpression(): string;\n discriminate(): Discriminant | null;\n}\ndeclare namespace Union {\n type ChildKind = UnionChildKind;\n type ChildSchema = NodeSchema;\n type ChildNode = nodeOfKind;\n type Schema = NormalizedSchema | readonly RootSchema[];\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly branches: array;\n readonly ordered?: true;\n }\n interface Inner {\n readonly branches: readonly ChildNode[];\n readonly ordered?: true;\n }\n interface ErrorContext extends BaseErrorContext<\"union\"> {\n errors: readonly ArkError[];\n }\n interface Declaration extends declareNode<{\n kind: \"union\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n errorContext: ErrorContext;\n reducibleTo: RootKind;\n childKind: UnionChildKind;\n }> {\n }\n type Node = UnionNode;\n}\ndeclare const Union: {\n implementation: nodeImplementationOf;\n Node: typeof UnionNode;\n};\ntype DescribeBranchesOptions = {\n delimiter?: string;\n finalDelimiter?: string;\n};\ndeclare const describeBranches: (descriptions: string[], opts?: DescribeBranchesOptions) => string;\ndeclare const intersectBranches: (l: readonly Union.ChildNode[], r: readonly Union.ChildNode[], ctx: IntersectionContext) => readonly Union.ChildNode[] | Disjoint;\ndeclare const reduceBranches: ({ branches, ordered }: Union.Inner) => readonly Union.ChildNode[];\ntype CaseKey = DiscriminantKind extends kind ? string : DiscriminantKinds[kind] | \"default\";\ntype DiscriminantLocation = {\n path: PropertyKey[];\n optionallyChainedPropString: string;\n kind: kind;\n};\ninterface Discriminant extends DiscriminantLocation {\n cases: DiscriminatedCases;\n}\ntype CaseContext = {\n branchIndices: number[];\n condition: nodeOfKind | Domain.Enumerable;\n};\ntype CaseDiscriminant = nodeOfKind | Domain.Enumerable;\ntype DiscriminatedCases = {\n [caseKey in CaseKey]: BaseRoot | true;\n};\ntype DiscriminantKinds = {\n domain: Domain;\n unit: SerializedPrimitive | RegisteredReference;\n};\ntype DiscriminantKind = show;\ndeclare const pruneDiscriminant: (discriminantBranch: BaseRoot, discriminantCtx: DiscriminantLocation) => BaseRoot | null;\ndeclare const writeIndiscriminableMorphMessage: (lDescription: string, rDescription: string) => string;\ndeclare const writeOrderedIntersectionMessage: (lDescription: string, rDescription: string) => string;\n\ninterface InternalRootDeclaration extends BaseNodeDeclaration {\n kind: RootKind;\n}\ndeclare abstract class BaseRoot<\n/** @ts-ignore cast variance */\nout d extends InternalRootDeclaration = InternalRootDeclaration> extends BaseNode implements StandardSchemaV1 {\n readonly [arkKind]: \"root\";\n readonly [inferred]: unknown;\n constructor(attachments: UnknownAttachments, $: BaseScope);\n get internal(): this;\n get \"~standard\"(): StandardSchemaV1.ArkTypeProps;\n as(): this;\n brand(name: string): this;\n readonly(): this;\n readonly branches: readonly nodeOfKind[];\n distribute(mapBranch: (branch: nodeOfKind, i: number, branches: array>) => mapOut, reduceMapped?: (mappedBranches: mapOut[]) => reduceOut): reduceOut;\n abstract get defaultShortDescription(): string;\n get shortDescription(): string;\n toJsonSchema(opts?: ToJsonSchema.Options): JsonSchema;\n toJsonSchemaRecurse(ctx: ToJsonSchema.Context): JsonSchema;\n get alwaysExpandJsonSchema(): boolean;\n protected toResolvedJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n protected abstract innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n intersect(r: unknown): BaseRoot | Disjoint;\n rawIntersect(r: BaseRoot): BaseRoot;\n toNeverIfDisjoint(): BaseRoot;\n and(r: unknown): BaseRoot;\n rawAnd(r: BaseRoot): BaseRoot;\n or(r: unknown): BaseRoot;\n rawOr(r: BaseRoot): BaseRoot;\n map(flatMapEntry: PropFlatMapper): BaseRoot;\n pick(...keys: KeyOrKeyNode[]): BaseRoot;\n omit(...keys: KeyOrKeyNode[]): BaseRoot;\n required(): BaseRoot;\n partial(): BaseRoot;\n private _keyof?;\n keyof(): BaseRoot;\n get props(): Prop.Node[];\n merge(r: unknown): BaseRoot;\n private applyStructuralOperation;\n get(...path: GettableKeyOrNode[]): BaseRoot;\n extract(r: unknown): BaseRoot;\n exclude(r: unknown): BaseRoot;\n array(): BaseRoot;\n overlaps(r: unknown): boolean;\n extends(r: unknown): boolean;\n ifExtends(r: unknown): BaseRoot | undefined;\n subsumes(r: unknown): boolean;\n configure(meta: TypeMeta.MappableInput, selector?: NodeSelector): this;\n describe(description: string, selector?: NodeSelector): this;\n optional(): [this, \"?\"];\n default(thunkableValue: unknown): [this, \"=\", unknown];\n from(input: unknown): unknown;\n protected _pipe(...morphs: Morph[]): BaseRoot;\n protected tryPipe(...morphs: Morph[]): BaseRoot;\n pipe: ((...morphs: Morph[]) => BaseRoot) & {\n try: (...morphs: Morph[]) => BaseRoot;\n };\n to(def: unknown): BaseRoot;\n private toNode;\n rawPipeOnce(morph: Morph): BaseRoot;\n narrow(predicate: Predicate): BaseRoot;\n constrain(kind: kind, schema: NodeSchema): BaseRoot;\n constrainIn(kind: kind, schema: NodeSchema): BaseRoot;\n constrainOut(kind: kind, schema: NodeSchema): BaseRoot;\n private _constrain;\n onUndeclaredKey(cfg: UndeclaredKeyBehavior | UndeclaredKeyConfig): BaseRoot;\n hasEqualMorphs(r: BaseRoot): boolean;\n onDeepUndeclaredKey(behavior: UndeclaredKeyBehavior): BaseRoot;\n filter(predicate: Predicate): BaseRoot;\n divisibleBy(schema: Divisor.Schema): BaseRoot;\n matching(schema: Pattern.Schema): BaseRoot;\n atLeast(schema: InclusiveNumericRangeSchema): BaseRoot;\n atMost(schema: InclusiveNumericRangeSchema): BaseRoot;\n moreThan(schema: ExclusiveNumericRangeSchema): BaseRoot;\n lessThan(schema: ExclusiveNumericRangeSchema): BaseRoot;\n atLeastLength(schema: InclusiveNumericRangeSchema): BaseRoot;\n atMostLength(schema: InclusiveNumericRangeSchema): BaseRoot;\n moreThanLength(schema: ExclusiveNumericRangeSchema): BaseRoot;\n lessThanLength(schema: ExclusiveNumericRangeSchema): BaseRoot;\n exactlyLength(schema: ExactLength.Schema): BaseRoot;\n atOrAfter(schema: InclusiveDateRangeSchema): BaseRoot;\n atOrBefore(schema: InclusiveDateRangeSchema): BaseRoot;\n laterThan(schema: ExclusiveDateRangeSchema): BaseRoot;\n earlierThan(schema: ExclusiveDateRangeSchema): BaseRoot;\n}\ntype UndeclaredKeyConfig = {\n rule: UndeclaredKeyBehavior;\n deep?: boolean;\n};\ndeclare const emptyBrandNameMessage = \"Expected a non-empty brand name after #\";\ntype emptyBrandNameMessage = typeof emptyBrandNameMessage;\ndeclare const exclusivizeRangeSchema: (schema: schema) => schema;\ntype exclusivizeRangeSchema = schema extends LimitSchemaValue ? {\n rule: schema;\n exclusive: true;\n} : schema;\ndeclare const typeOrTermExtends: (t: unknown, base: unknown) => boolean;\ntype intersectRoot = [\n l,\n r\n] extends [r, l] ? l : asymmetricIntersectionOf | asymmetricIntersectionOf;\ntype asymmetricIntersectionOf = l extends unknown ? r extends kindRightOf ? l | reducibleKindOf : never : never;\ntype schemaKindRightOf = Extract, RootKind>;\ntype schemaKindOrRightOf = kind | schemaKindRightOf;\ntype StructuralOperationBranchResultByName = {\n keyof: Union.ChildNode;\n pick: Union.ChildNode;\n omit: Union.ChildNode;\n get: Union.ChildNode;\n map: Union.ChildNode;\n required: Union.ChildNode;\n partial: Union.ChildNode;\n merge: Union.ChildNode;\n props: array;\n};\ntype StructuralOperationName = keyof StructuralOperationBranchResultByName;\ndeclare const writeLiteralUnionEntriesMessage: (expression: string) => string;\ndeclare const writeNonStructuralOperandMessage: (operation: operation, operand: operand) => writeNonStructuralOperandMessage;\ntype writeNonStructuralOperandMessage = `${operation} operand must be an object (was ${operand})`;\n\ndeclare class MorphNode extends BaseRoot {\n serializedMorphs: string[];\n compiledMorphs: string;\n lastMorph: BaseRoot | Morph | undefined;\n lastMorphIfNode: BaseRoot | undefined;\n introspectableIn: BaseRoot | undefined;\n introspectableOut: BaseRoot | undefined;\n get shallowMorphs(): array;\n get in(): BaseRoot;\n get out(): BaseRoot;\n declareIn(declaredIn: BaseRoot): MorphNode;\n declareOut(declaredOut: BaseRoot): MorphNode;\n expression: string;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n compile(js: NodeCompiler): void;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n /** Check if the morphs of r are equal to those of this node */\n hasEqualMorphs(r: MorphNode): boolean;\n}\ndeclare namespace Morph {\n interface Inner {\n readonly in?: BaseRoot;\n readonly morphs: array;\n readonly declaredIn?: BaseRoot;\n readonly declaredOut?: BaseRoot;\n }\n interface Schema extends BaseNormalizedSchema {\n readonly in?: RootSchema;\n readonly morphs: listable;\n readonly declaredIn?: BaseRoot;\n readonly declaredOut?: BaseRoot;\n }\n interface Declaration extends declareNode<{\n kind: \"morph\";\n schema: Schema;\n normalizedSchema: Schema;\n inner: Inner;\n childKind: RootKind;\n }> {\n }\n type Node = MorphNode;\n type In = morph extends Morph ? i : never;\n type Out = morph extends Morph ? o : never;\n type ContextFree = (In: i) => o;\n}\ntype Morph = (In: i, ctx: Traversal) => o;\ndeclare const Morph: {\n implementation: nodeImplementationOf;\n Node: typeof MorphNode;\n};\ndeclare const writeMorphIntersectionMessage: (lDescription: string, rDescription: string) => string;\n\ntype MorphsAtPath = {\n path: ReadonlyPath;\n morphs: array;\n};\ntype BranchTraversal = {\n error: ArkError | undefined;\n queuedMorphs: MorphsAtPath[];\n};\ntype InternalTraversal = Omit;\ndeclare class Traversal {\n /**\n * #### the path being validated or morphed\n *\n * ✅ array indices represented as numbers\n * ⚠️ mutated during traversal - use `path.slice(0)` to snapshot\n * 🔗 use {@link propString} for a stringified version\n */\n path: PropertyKey[];\n /**\n * #### {@link ArkErrors} that will be part of this traversal's finalized result\n *\n * ✅ will always be an empty array for a valid traversal\n */\n errors: ArkErrors;\n /**\n * #### the original value being traversed\n */\n root: unknown;\n /**\n * #### configuration for this traversal\n *\n * ✅ options can affect traversal results and error messages\n * ✅ defaults < global config < scope config\n * ✅ does not include options configured on individual types\n */\n config: ResolvedConfig;\n queuedMorphs: MorphsAtPath[];\n branches: BranchTraversal[];\n seen: {\n [id in string]?: unknown[];\n };\n constructor(root: unknown, config: ResolvedConfig);\n /**\n * #### the data being validated or morphed\n *\n * ✅ extracted from {@link root} at {@link path}\n */\n get data(): unknown;\n /**\n * #### a string representing {@link path}\n *\n * @propString\n */\n get propString(): string;\n /**\n * #### add an {@link ArkError} and return `false`\n *\n * ✅ useful for predicates like `.narrow`\n */\n reject(input: ArkErrorInput): false;\n /**\n * #### add an {@link ArkError} from a description and return `false`\n *\n * ✅ useful for predicates like `.narrow`\n * 🔗 equivalent to {@link reject}({ expected })\n */\n mustBe(expected: string): false;\n /**\n * #### add and return an {@link ArkError}\n *\n * ✅ useful for morphs like `.pipe`\n */\n error(input: input): ArkError;\n /**\n * #### whether {@link currentBranch} (or the traversal root, outside a union) has one or more errors\n */\n hasError(): boolean;\n get currentBranch(): BranchTraversal | undefined;\n queueMorphs(morphs: array): void;\n finalize(onFail?: ArkErrors.Handler | null): unknown;\n get currentErrorCount(): number;\n get failFast(): boolean;\n pushBranch(): void;\n popBranch(): BranchTraversal | undefined;\n private errorFromContext;\n private applyQueuedMorphs;\n private applyMorphsAtPath;\n}\ndeclare const traverseKey: (key: PropertyKey, fn: () => result, ctx: InternalTraversal | undefined) => result;\ntype TraversalMethodsByKind = {\n Allows: TraverseAllows;\n Apply: TraverseApply;\n};\ntype TraversalKind = keyof TraversalMethodsByKind;\ntype TraverseAllows = (data: data, ctx: InternalTraversal) => boolean;\ntype TraverseApply = (data: data, ctx: InternalTraversal) => void;\n\ntype CoercibleValue = string | number | boolean | null | undefined;\ndeclare class CompiledFunction unknown, args extends readonly string[] = readonly string[]> extends CastableBase<{\n [k in args[number]]: k;\n}> {\n readonly argNames: args;\n readonly body = \"\";\n constructor(...args: args);\n indentation: number;\n indent(): this;\n dedent(): this;\n prop(key: PropertyKey, optional?: boolean): string;\n index(key: string | number, optional?: boolean): string;\n line(statement: string): this;\n const(identifier: string, expression: CoercibleValue): this;\n let(identifier: string, expression: CoercibleValue): this;\n set(identifier: string, expression: CoercibleValue): this;\n if(condition: string, then: (self: this) => this): this;\n elseIf(condition: string, then: (self: this) => this): this;\n else(then: (self: this) => this): this;\n /** Current index is \"i\" */\n for(until: string, body: (self: this) => this, initialValue?: CoercibleValue): this;\n /** Current key is \"k\" */\n forIn(object: string, body: (self: this) => this): this;\n block(prefix: string, contents: (self: this) => this, suffix?: string): this;\n return(expression?: CoercibleValue): this;\n write(name?: string, indent?: number): string;\n compile(): compiledSignature;\n}\ndeclare const compileSerializedValue: (value: unknown) => string;\ndeclare const compileLiteralPropAccess: (key: PropertyKey, optional?: boolean) => string;\ndeclare const serializeLiteralKey: (key: PropertyKey) => string;\ndeclare const indexPropAccess: (key: string, optional?: boolean) => string;\ninterface InvokeOptions extends ReferenceOptions {\n arg?: string;\n}\ninterface ReferenceOptions {\n kind?: TraversalKind;\n bind?: string;\n}\ndeclare namespace NodeCompiler {\n interface Context {\n kind: TraversalKind;\n optimistic?: true;\n }\n}\ndeclare class NodeCompiler extends CompiledFunction {\n traversalKind: TraversalKind;\n optimistic: boolean;\n constructor(ctx: NodeCompiler.Context);\n invoke(node: BaseNode | NodeId, opts?: InvokeOptions): string;\n referenceToId(id: NodeId, opts?: ReferenceOptions): string;\n requiresContextFor(node: BaseNode): boolean;\n initializeErrorCount(): this;\n returnIfFail(): this;\n returnIfFailFast(): this;\n traverseKey(keyExpression: string, accessExpression: string, node: BaseNode): this;\n check(node: BaseNode, opts?: InvokeOptions): this;\n}\n\ndeclare class PredicateNode extends BaseConstraint {\n serializedPredicate: RegisteredReference;\n compiledCondition: string;\n compiledNegation: string;\n impliedBasis: null;\n expression: string;\n traverseAllows: TraverseAllows;\n errorContext: Predicate.ErrorContext;\n compiledErrorContext: string;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n reduceJsonSchema(base: JsonSchema.Constrainable, ctx: ToJsonSchema.Context): JsonSchema;\n}\ndeclare namespace Predicate {\n type Schema = NormalizedSchema | predicate;\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly predicate: predicate;\n }\n interface Inner {\n readonly predicate: predicate;\n }\n interface ErrorContext extends BaseErrorContext<\"predicate\"> {\n readonly predicate?: Predicate;\n }\n interface Declaration extends declareNode<{\n kind: \"predicate\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n intersectionIsOpen: true;\n errorContext: ErrorContext;\n }> {\n }\n type Node = PredicateNode;\n}\ndeclare const Predicate: {\n implementation: nodeImplementationOf;\n Node: typeof PredicateNode;\n};\ntype Predicate = (data: data, ctx: Traversal) => boolean;\ndeclare namespace Predicate {\n type Casted = (input: input, ctx: Traversal) => input is narrowed;\n type Castable = Predicate | Casted;\n}\n\ndeclare class ProtoNode extends InternalBasis {\n builtinName: BuiltinObjectKind | null;\n serializedConstructor: string;\n private readonly requiresInvalidDateCheck;\n traverseAllows: TraverseAllows;\n compiledCondition: string;\n compiledNegation: string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n expression: string;\n get nestableExpression(): string;\n readonly domain = \"object\";\n get defaultShortDescription(): string;\n}\ndeclare namespace Proto {\n type Reference = Constructor | BuiltinObjectKind;\n type Schema = proto | ExpandedSchema;\n interface NormalizedSchema extends BaseNormalizedSchema {\n readonly proto: proto;\n readonly dateAllowsInvalid?: boolean;\n }\n interface ExpandedSchema {\n readonly proto: proto;\n readonly dateAllowsInvalid?: boolean;\n }\n interface Inner {\n readonly proto: proto;\n readonly dateAllowsInvalid?: boolean;\n }\n interface ErrorContext extends BaseErrorContext<\"proto\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"proto\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n errorContext: ErrorContext;\n }> {\n }\n type Node = ProtoNode;\n}\ndeclare const Proto: {\n implementation: nodeImplementationOf;\n Node: typeof ProtoNode;\n writeBadInvalidDateMessage: (actual: Constructor) => string;\n writeInvalidSchemaMessage: (actual: unknown) => string;\n};\n\ndeclare class IntersectionNode extends BaseRoot {\n basis: nodeOfKind | null;\n refinements: array>;\n structure: Structure.Node | undefined;\n expression: string;\n get shallowMorphs(): array;\n get defaultShortDescription(): string;\n protected innerToJsonSchema(ctx: ToJsonSchema.Context): JsonSchema;\n traverseAllows: TraverseAllows;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n}\ndeclare namespace Intersection {\n type BasisKind = \"domain\" | \"proto\";\n type ChildKind = BasisKind | RefinementKind | \"predicate\" | \"structure\";\n type FlattenedChildKind = ChildKind | StructuralKind;\n type RefinementsInner = {\n [k in RefinementKind]?: intersectionChildInnerValueOf;\n };\n interface Inner extends RefinementsInner {\n domain?: Domain.Node;\n proto?: Proto.Node;\n structure?: Structure.Node;\n predicate?: array;\n }\n namespace Inner {\n type mutable = makeRootAndArrayPropertiesMutable;\n }\n type ConstraintsSchema = show>;\n type NormalizedSchema = Omit;\n type Schema = ConstraintsSchema;\n interface AstSchema extends BaseNormalizedSchema {\n intersection: readonly RootSchema[];\n }\n interface ErrorContext extends BaseErrorContext<\"intersection\">, Inner {\n errors: readonly ArkError[];\n }\n type Declaration = declareNode<{\n kind: \"intersection\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n reducibleTo: \"intersection\" | BasisKind;\n errorContext: ErrorContext;\n childKind: ChildKind;\n }>;\n type Node = IntersectionNode;\n}\ndeclare const Intersection: {\n implementation: nodeImplementationOf<{\n intersectionIsOpen: false;\n prerequisite: unknown;\n kind: \"intersection\";\n schema: Intersection.Schema;\n normalizedSchema: Intersection.NormalizedSchema;\n inner: Intersection.Inner;\n reducibleTo: \"intersection\" | Intersection.BasisKind;\n errorContext: Intersection.ErrorContext;\n childKind: Intersection.ChildKind;\n }>;\n Node: typeof IntersectionNode;\n};\ntype ConditionalTerminalIntersectionRoot = {\n undeclared?: UndeclaredKeyBehavior;\n};\ntype ConditionalTerminalIntersectionKey = keyof ConditionalTerminalIntersectionRoot;\ntype ConditionalIntersectionKey = ConstraintKind | ConditionalTerminalIntersectionKey;\ntype constraintKindOf = {\n [k in ConstraintKind]: t extends Prerequisite ? k : never;\n}[ConstraintKind];\ntype conditionalIntersectionKeyOf = constraintKindOf | (t extends object ? \"undeclared\" : never);\ntype intersectionChildSchemaValueOf = k extends OpenNodeKind ? listable> : NodeSchema;\ntype conditionalSchemaValueOfKey = k extends Intersection.FlattenedChildKind ? intersectionChildSchemaValueOf : ConditionalTerminalIntersectionRoot[k & ConditionalTerminalIntersectionKey];\ntype intersectionChildInnerValueOf = k extends OpenNodeKind ? readonly nodeOfKind[] : nodeOfKind;\ntype conditionalRootOf = {\n [k in conditionalIntersectionKeyOf]?: conditionalSchemaValueOfKey;\n};\n\ndeclare namespace Constraint {\n interface Declaration extends BaseNodeDeclaration {\n kind: ConstraintKind;\n }\n type ReductionResult = BaseRoot | Disjoint | Intersection.Inner.mutable;\n interface Attachments {\n impliedBasis: BaseRoot | null;\n impliedSiblings?: array | null;\n }\n type PrimitiveKind = Exclude;\n}\ndeclare abstract class BaseConstraint<\n/** @ts-ignore allow instantiation assignment to the base type */\nout d extends Constraint.Declaration = Constraint.Declaration> extends BaseNode {\n readonly [arkKind]: \"constraint\";\n constructor(attachments: UnknownAttachments, $: BaseScope);\n abstract readonly impliedBasis: BaseRoot | null;\n readonly impliedSiblings?: array;\n intersect(r: r): intersectConstraintKinds;\n}\ndeclare abstract class InternalPrimitiveConstraint extends BaseConstraint {\n abstract traverseAllows: TraverseAllows;\n abstract readonly compiledCondition: string;\n abstract readonly compiledNegation: string;\n abstract reduceJsonSchema(base: JsonSchema.Constrainable, ctx: ToJsonSchema.Context): JsonSchema.Constrainable;\n traverseApply: TraverseApply;\n compile(js: NodeCompiler): void;\n get errorContext(): d[\"errorContext\"];\n get compiledErrorContext(): string;\n}\ndeclare const constraintKeyParser: (kind: kind) => (schema: listable>, ctx: NodeParseContext) => innerAttachedAs | undefined;\ntype ConstraintGroupKind = satisfy;\ninterface ConstraintIntersectionState {\n kind: kind;\n baseInner: Record;\n l: BaseConstraint[];\n r: BaseConstraint[];\n roots: BaseRoot[];\n ctx: IntersectionContext;\n}\ndeclare const intersectConstraints: (s: ConstraintIntersectionState) => nodeOfKind> | Disjoint;\ndeclare const flattenConstraints: (inner: object) => BaseConstraint[];\ntype FlatIntersectionInner = Intersection.Inner & Structure.Inner;\ndeclare const unflattenConstraints: (constraints: array) => FlatIntersectionInner;\ntype constraintKindLeftOf = ConstraintKind & kindLeftOf;\ntype constraintKindOrLeftOf = kind | constraintKindLeftOf;\ntype intersectConstraintKinds = nodeOfKind | Disjoint | null;\ndeclare const throwInvalidOperandError: (...args: Parameters) => never;\ndeclare const writeInvalidOperandMessage: (kind: kind, expected: expected, actual: actual) => string;\ntype writeInvalidOperandMessage = `${Capitalize} operand must be ${describe>} (was ${describe>>})`;\n\ndeclare abstract class BaseNode<\n/** @ts-ignore allow instantiation assignment to the base type */\nout d extends BaseNodeDeclaration = BaseNodeDeclaration> extends Callable<(data: d[\"prerequisite\"], ctx?: Traversal, onFail?: ArkErrors.Handler | null) => unknown, attachmentsOf> {\n attachments: UnknownAttachments;\n $: BaseScope;\n onFail: ArkErrors.Handler | null;\n includesTransform: boolean;\n includesContextualPredicate: boolean;\n isCyclic: boolean;\n allowsRequiresContext: boolean;\n rootApplyStrategy: \"allows\" | \"contextual\" | \"optimistic\" | \"branchedOptimistic\";\n contextFreeMorph: ((data: unknown) => unknown) | undefined;\n rootApply: (data: unknown, onFail: ArkErrors.Handler | null) => unknown;\n referencesById: Record;\n shallowReferences: BaseNode[];\n flatRefs: FlatRef[];\n flatMorphs: FlatRef[];\n allows: (data: d[\"prerequisite\"]) => boolean;\n get shallowMorphs(): array;\n constructor(attachments: UnknownAttachments, $: BaseScope);\n protected createRootApply(): this[\"rootApply\"];\n abstract traverseAllows: TraverseAllows;\n abstract traverseApply: TraverseApply;\n abstract expression: string;\n abstract compile(js: NodeCompiler): void;\n readonly compiledMeta: string;\n protected cacheGetter(name: name, value: this[name]): this[name];\n get description(): string;\n get references(): BaseNode[];\n readonly precedence: number;\n precompilation: string | undefined;\n assert: (data: d[\"prerequisite\"], pipedFromCtx?: Traversal) => unknown;\n traverse(data: d[\"prerequisite\"], pipedFromCtx?: Traversal): ArkErrors | {} | null | undefined;\n get in(): this extends {\n [arkKind]: \"root\";\n } ? BaseRoot : BaseNode;\n get out(): this extends {\n [arkKind]: \"root\";\n } ? BaseRoot : BaseNode;\n getIo(ioKind: \"in\" | \"out\"): BaseNode;\n toJSON(): JsonStructure;\n toString(): string;\n equals(r: unknown): boolean;\n ifEquals(r: unknown): BaseNode | undefined;\n hasKind(kind: kind): this is nodeOfKind;\n assertHasKind(kind: kind): nodeOfKind;\n hasKindIn(...kinds: kinds): this is nodeOfKind;\n assertHasKindIn(...kinds: kinds): nodeOfKind;\n isBasis(): this is nodeOfKind;\n isConstraint(): this is BaseConstraint;\n isStructural(): this is nodeOfKind;\n isRefinement(): this is nodeOfKind;\n isRoot(): this is BaseRoot;\n isUnknown(): boolean;\n isNever(): boolean;\n hasUnit(value: unknown): this is Unit.Node & {\n unit: value;\n };\n hasOpenIntersection(): this is nodeOfKind;\n get nestableExpression(): string;\n select>>(selector: NodeSelector.validateComposite): NodeSelector.infer;\n select(selector: selector): NodeSelector.infer;\n private _select;\n transform(mapper: mapper, opts?: DeepNodeTransformOptions): nodeOfKind> | Extract, null>;\n protected _createTransformContext(opts: DeepNodeTransformOptions | undefined): DeepNodeTransformContext;\n protected _transform(mapper: DeepNodeTransformation, ctx: DeepNodeTransformContext): BaseNode | null;\n configureReferences(meta: TypeMeta.MappableInput.Internal, selector?: NodeSelector): this;\n}\n/** a literal key (named property) or a node (index signatures) representing part of a type structure */\ntype KeyOrKeyNode = Key | BaseRoot;\ntype GettableKeyOrNode = KeyOrKeyNode | number;\ntype FlatRef = {\n path: array;\n node: root;\n propString: string;\n};\ntype NodeSelector = NodeSelector.Single | NodeSelector.Composite;\ndeclare namespace NodeSelector {\n type SelectableFn = {\n >>(input: input, selector?: NodeSelector.validateComposite): returns;\n (input: input, selector?: selector): returns;\n };\n type Single = NodeSelector.Boundary | NodeSelector.Kind | GuardablePredicate;\n type Boundary = \"self\" | \"child\" | \"shallow\" | \"references\";\n type Kind = NodeKind;\n type Method = \"filter\" | \"assertFilter\" | \"find\" | \"assertFind\";\n interface Composite {\n method?: Method;\n boundary?: Boundary;\n kind?: Kind;\n where?: GuardablePredicate;\n }\n type Normalized = requireKeys;\n type CompositeInput = Omit;\n type BaseResult = BaseNode | BaseNode[] | undefined;\n type validateComposite = {\n [k in keyof selector]: k extends \"where\" ? predicate : conform;\n };\n type infer = applyMethod ? narrowed : NodeSelector.inferSelectKind, selector>;\n type BoundaryInput = b | {\n boundary: b;\n };\n type KindInput = k | {\n kind: k;\n };\n type WhereCastInput = ((In: kindNode) => In is narrowed) | {\n where: (In: kindNode) => In is narrowed;\n };\n type inferSelectKind = selectKind extends infer kind extends NodeKind ? NodeKind extends kind ? BaseNode : nodeOfKind : never;\n type selectKind = selector extends BoundaryInput<\"self\"> ? selfKind : selector extends KindInput ? kind : selector extends BoundaryInput<\"child\"> ? selfKind | childKindOf : NodeKind;\n type applyMethod = selector extends {\n method: infer method extends Method;\n } ? method extends \"filter\" ? t[] : method extends \"assertFilter\" ? [t, ...t[]] : method extends \"find\" ? t | undefined : method extends \"assertFind\" ? t : never : t[];\n}\ndeclare const typePathToPropString: (path: array) => string;\ndeclare const flatRef: (path: array, node: node) => FlatRef;\ndeclare const flatRefsAreEqual: (l: FlatRef, r: FlatRef) => boolean;\ndeclare const appendUniqueFlatRefs: (existing: FlatRef[] | undefined, refs: listable>) => FlatRef[];\ndeclare const appendUniqueNodes: (existing: node[] | undefined, refs: listable) => node[];\ntype DeepNodeTransformOptions = {\n shouldTransform?: ShouldTransformFn;\n bindScope?: BaseScope;\n prereduced?: boolean;\n selected?: readonly BaseNode[] | undefined;\n};\ntype ShouldTransformFn = (node: BaseNode, ctx: DeepNodeTransformContext) => boolean;\ninterface DeepNodeTransformContext extends DeepNodeTransformOptions {\n root: BaseNode;\n selected: readonly BaseNode[] | undefined;\n path: mutable>;\n seen: {\n [originalId: string]: (() => BaseNode | undefined) | undefined;\n };\n parseOptions: BaseParseOptions;\n undeclaredKeyHandling: UndeclaredKeyHandling | undefined;\n}\ntype DeepNodeTransformation = (kind: kind, innerWithMeta: Inner & {\n meta: NodeMeta;\n}, ctx: DeepNodeTransformContext) => NormalizedSchema | null;\n\ndeclare class AfterNode extends BaseRange {\n impliedBasis: BaseRoot;\n collapsibleLimitString: string;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(base: JsonSchema, ctx: ToJsonSchema.Context): JsonSchema;\n}\ndeclare namespace After {\n interface Inner extends BaseRangeInner {\n rule: Date;\n }\n interface NormalizedSchema extends UnknownNormalizedRangeSchema {\n rule: LimitSchemaValue;\n }\n interface ExpandedSchema extends UnknownExpandedRangeSchema {\n rule: LimitSchemaValue;\n }\n type Schema = ExpandedSchema | LimitSchemaValue;\n interface ErrorContext extends BaseErrorContext<\"after\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"after\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: Date;\n errorContext: ErrorContext;\n }> {\n }\n type Node = AfterNode;\n}\ndeclare const After: {\n implementation: nodeImplementationOf;\n Node: typeof AfterNode;\n};\n\ndeclare class BeforeNode extends BaseRange {\n collapsibleLimitString: string;\n traverseAllows: TraverseAllows;\n impliedBasis: BaseRoot;\n reduceJsonSchema(base: JsonSchema, ctx: ToJsonSchema.Context): JsonSchema;\n}\ndeclare namespace Before {\n interface Inner extends BaseRangeInner {\n rule: Date;\n }\n interface NormalizedSchema extends UnknownNormalizedRangeSchema {\n rule: LimitSchemaValue;\n }\n interface ExpandedSchema extends UnknownExpandedRangeSchema {\n rule: LimitSchemaValue;\n }\n type Schema = ExpandedSchema | LimitSchemaValue;\n interface ErrorContext extends BaseErrorContext<\"before\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"before\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: Date;\n errorContext: ErrorContext;\n }> {\n }\n type Node = BeforeNode;\n}\ndeclare const Before: {\n implementation: nodeImplementationOf;\n Node: typeof BeforeNode;\n};\n\ndeclare class MaxNode extends BaseRange {\n impliedBasis: BaseRoot;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(schema: JsonSchema.Numeric): JsonSchema.Numeric;\n}\ndeclare namespace Max {\n interface Inner extends BaseRangeInner {\n rule: number;\n exclusive?: true;\n }\n interface NormalizedSchema extends UnknownExpandedRangeSchema {\n rule: number;\n }\n type Schema = NormalizedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"max\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"max\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: number;\n errorContext: ErrorContext;\n }> {\n }\n type Node = MaxNode;\n}\ndeclare const Max: {\n implementation: nodeImplementationOf;\n Node: typeof MaxNode;\n};\n\ndeclare class MinNode extends BaseRange {\n readonly impliedBasis: BaseRoot;\n traverseAllows: TraverseAllows;\n reduceJsonSchema(schema: JsonSchema.Numeric): JsonSchema.Numeric;\n}\ndeclare namespace Min {\n interface Inner extends BaseRangeInner {\n rule: number;\n exclusive?: true;\n }\n interface NormalizedSchema extends UnknownExpandedRangeSchema {\n rule: number;\n }\n type Schema = NormalizedSchema | number;\n interface ErrorContext extends BaseErrorContext<\"min\">, Inner {\n }\n interface Declaration extends declareNode<{\n kind: \"min\";\n schema: Schema;\n normalizedSchema: NormalizedSchema;\n inner: Inner;\n prerequisite: number;\n errorContext: ErrorContext;\n }> {\n }\n type Node = MinNode;\n}\ndeclare const Min: {\n implementation: nodeImplementationOf;\n Node: typeof MinNode;\n};\n\ninterface BoundDeclarations {\n min: Min.Declaration;\n max: Max.Declaration;\n minLength: MinLength.Declaration;\n maxLength: MaxLength.Declaration;\n exactLength: ExactLength.Declaration;\n after: After.Declaration;\n before: Before.Declaration;\n}\ninterface BoundNodesByKind {\n min: Min.Node;\n max: Max.Node;\n minLength: MinLength.Node;\n maxLength: MaxLength.Node;\n exactLength: ExactLength.Node;\n after: After.Node;\n before: Before.Node;\n}\n\ninterface NodeDeclarationsByKind extends BoundDeclarations {\n alias: Alias.Declaration;\n domain: Domain.Declaration;\n unit: Unit.Declaration;\n proto: Proto.Declaration;\n union: Union.Declaration;\n morph: Morph.Declaration;\n intersection: Intersection.Declaration;\n sequence: Sequence.Declaration;\n divisor: Divisor.Declaration;\n required: Required$1.Declaration;\n optional: Optional.Declaration;\n index: Index.Declaration;\n pattern: Pattern.Declaration;\n predicate: Predicate.Declaration;\n structure: Structure.Declaration;\n}\ndeclare const nodeImplementationsByKind: Record;\ndeclare const nodeClassesByKind: Record BaseNode>;\ninterface NodesByKind extends BoundNodesByKind {\n alias: Alias.Node;\n union: Union.Node;\n morph: Morph.Node;\n intersection: Intersection.Node;\n unit: Unit.Node;\n proto: Proto.Node;\n domain: Domain.Node;\n divisor: Divisor.Node;\n pattern: Pattern.Node;\n predicate: Predicate.Node;\n required: Required$1.Node;\n optional: Optional.Node;\n index: Index.Node;\n sequence: Sequence.Node;\n structure: Structure.Node;\n}\ntype nodeOfKind = NodesByKind[kind];\ntype Declaration = NodeDeclarationsByKind[kind];\ntype NodeSchema = Declaration[\"schema\"];\ntype RootSchema = NodeSchema;\ntype NormalizedSchema = Declaration[\"normalizedSchema\"];\ntype childKindOf = Declaration[\"childKind\"];\ntype Prerequisite = Declaration[\"prerequisite\"];\ntype reducibleKindOf = Declaration[\"reducibleTo\"] extends NodeKind ? Declaration[\"reducibleTo\"] : kind;\ntype Inner = Declaration[\"inner\"];\ntype defAttachedAs = kind extends OpenNodeKind ? listable> : NodeSchema;\ntype innerAttachedAs = kind extends OpenNodeKind ? array> : nodeOfKind;\n/** make nested arrays mutable while keeping nested nodes immutable */\ntype mutableInnerOfKind = makeRootAndArrayPropertiesMutable>;\ntype mutableNormalizedRootOfKind = makeRootAndArrayPropertiesMutable>;\ntype errorContext = Declaration[\"errorContext\"];\n\ntype ContextualArgs = Record;\ntype BaseParseOptions = {\n alias?: string;\n prereduced?: prereduced;\n args?: ContextualArgs;\n id?: NodeId;\n};\ninterface BaseParseContextInput extends BaseParseOptions {\n prefix: string;\n def: unknown;\n}\ninterface AttachedParseContext {\n [arkKind]: \"context\";\n $: BaseScope;\n id: NodeId;\n phase: \"unresolved\" | \"resolving\" | \"resolved\";\n}\ninterface BaseParseContext extends BaseParseContextInput, AttachedParseContext {\n id: NodeId;\n}\ninterface NodeParseContextInput extends BaseParseContextInput {\n kind: kind;\n def: NormalizedSchema;\n}\ninterface NodeParseContext extends NodeParseContextInput, AttachedParseContext {\n id: NodeId;\n}\ndeclare const schemaKindOf: (schema: unknown, allowedKinds?: readonly kind[]) => kind;\ndeclare const writeInvalidSchemaMessage: (schema: unknown) => string;\ntype NodeId = Brand;\ntype NodeResolver = (id: NodeId) => BaseNode;\ndeclare const nodesByRegisteredId: Record;\ndeclare const registerNodeId: (prefix: string) => NodeId;\ndeclare const parseNode: (ctx: NodeParseContext) => BaseNode;\ntype CreateNodeInput = {\n id: NodeId;\n kind: NodeKind;\n inner: dict;\n meta: NodeMeta;\n $: BaseScope;\n ignoreCache?: true;\n};\ndeclare const createNode: ({ id, kind, inner, meta, $, ignoreCache }: CreateNodeInput) => BaseNode;\ndeclare const withId: (node: node, id: NodeId) => node;\ndeclare const withMeta: (node: node, meta: ArkEnv.meta, id?: NodeId) => node;\n\ninterface ArkSchemaRegistry extends ArkRegistry {\n intrinsic: typeof intrinsic;\n config: ArkSchemaConfig;\n defaultConfig: ResolvedConfig;\n resolvedConfig: ResolvedConfig;\n nodesByRegisteredId: typeof nodesByRegisteredId;\n}\ntype nodeConfigForKind = Readonly;\n} & (kind extends ArkErrorCode ? {\n expected?: ExpectedConfig;\n actual?: ActualConfig;\n problem?: ProblemConfig;\n message?: MessageConfig;\n} : {})>>;\ntype NodeConfigsByKind = {\n [kind in NodeKind]: nodeConfigForKind;\n};\ntype NodeConfig = NodeConfigsByKind[kind];\ninterface UnknownErrorConfigs {\n expected?: ExpectedConfig;\n actual?: ActualConfig;\n problem?: ProblemConfig;\n message?: MessageConfig;\n}\ninterface UnknownNodeConfig extends UnknownErrorConfigs {\n description?: DescriptionWriter;\n}\ntype ResolvedUnknownNodeConfig = requireKeys;\ndeclare const configureSchema: (config: ArkSchemaConfig) => ArkSchemaConfig;\ndeclare const mergeConfigs: (base: base, merged: ArkSchemaConfig | undefined) => base;\ntype MergeToJsonSchemaConfigs = (baseConfig: base, mergedConfig: ToJsonSchema.Options | undefined) => base extends ToJsonSchema.Context ? ToJsonSchema.Context : ToJsonSchema.Options;\ndeclare const mergeToJsonSchemaConfigs: MergeToJsonSchemaConfigs;\ntype CloneImplementation = (original: original) => original;\ninterface ArkSchemaConfig extends Partial> {\n readonly jitless?: boolean;\n readonly clone?: boolean | CloneImplementation;\n readonly onUndeclaredKey?: UndeclaredKeyBehavior;\n readonly numberAllowsNaN?: boolean;\n readonly dateAllowsInvalid?: boolean;\n readonly exactOptionalPropertyTypes?: boolean;\n readonly onFail?: ArkErrors.Handler | null;\n readonly keywords?: Record;\n readonly toJsonSchema?: ToJsonSchema.Options;\n}\ntype resolveConfig = show<{\n [k in keyof ArkSchemaConfig]-?: k extends NodeKind ? Required : k extends \"clone\" ? CloneImplementation | false : k extends \"keywords\" ? Record : k extends \"toJsonSchema\" ? ToJsonSchema.Context : config[k];\n} & Omit>;\ntype ResolvedConfig = resolveConfig;\n\ntype InternalNodeIntersection = (l: l, r: r, ctx: ctx) => l[\"kind\"] | r[\"kind\"] extends RootKind ? BaseRoot | Disjoint : BaseNode | Disjoint | null;\ndeclare const intersectNodesRoot: InternalNodeIntersection;\ndeclare const pipeNodesRoot: InternalNodeIntersection;\ndeclare const intersectOrPipeNodes: InternalNodeIntersection;\n\nexport { $ark, type ActualConfig, type ActualWriter, After, AfterNode, type AliasDefEntry, ArkError, type ArkErrorCode, type ArkErrorContextInput, type ArkErrorInput, type ArkErrorResult, ArkErrors, type ArkKind, type ArkKinds, type ArkSchemaConfig, type ArkSchemaRegistry, type ArkSchemaScopeConfig, type AttachedParseContext, BaseConstraint, type BaseErrorContext, type BaseMappedPropInner, BaseNode, type BaseNodeDeclaration, type BaseNormalizedSchema, type BaseParseContext, type BaseParseContextInput, type BaseParseOptions, BaseProp, BaseRange, type BaseRangeDeclaration, type BaseRangeInner, BaseRoot, BaseScope, type BasisKind, Before, BeforeNode, type BoundKind, type BoundOperandKind, type Boundable, type BranchTraversal, type CaseContext, type CaseDiscriminant, type CaseKey, type CloneImplementation, type ClosedNodeKind, type CoercibleValue, CompiledFunction, type CompositeKind, type ConditionalTerminalIntersectionRoot, Constraint, type ConstraintIntersection, type ConstraintIntersectionMap, type ConstraintKind, type ContextualArgs, type CreateNodeInput, type CustomErrorInput, type DateRangeKind, type Declaration, type DeepNodeTransformContext, type DeepNodeTransformOptions, type DeepNodeTransformation, type DefaultArkEnv, type DefaultableSequenceElement, type DerivableErrorContext, type DerivableErrorContextInput, type DescriptionWriter, type Discriminant, type DiscriminantKind, type DiscriminantKinds, type DiscriminatedCases, Disjoint, type DisjointEntry, type DisjointEntryContext, type DisjointKind, Divisor, DivisorNode, Domain, DomainNode, ExactLength, ExactLengthNode, type ExclusiveDateRangeSchema, type ExclusiveExpandedDateRangeSchema, type ExclusiveNormalizedNumericRangeSchema, type ExclusiveNumericRangeSchema, type ExpectedConfig, type ExpectedWriter, type FlatRef, type GenericArgResolutions, type GenericAst, type GenericParamAst, type GenericParamDef, GenericRoot, type GenericRootBodyParser, type GenericRootParser, type GettableKeyOrNode, type GlobalOnlyConfigOptionName, type InclusiveDateRangeSchema, type InclusiveExpandedDateRangeSchema, type InclusiveNormalizedNumericRangeSchema, type InclusiveNumericRangeSchema, Index, IndexNode, Inner, type InternalIntersectionOptions, type InternalModule, InternalPrimitiveConstraint, type InternalResolution, type InternalResolutions, type InternalRootDeclaration, type InternalSchemaParser, type InternalTraversal, Intersection, type IntersectionContext, type IntersectionMap, IntersectionNode, type InvokeOptions, JsonSchema, type JsonSchemaOrBoolean, type KeyOrKeyNode, LazyGenericBody, type LengthBoundKind, type LengthBoundableData, type LimitInnerValue, type LimitKind, type LimitSchemaValue, type LimitValue, type ListableJsonSchema, type LowerBoundKind, type LowerNode, type MappedPropInner, Max, MaxLength, MaxLengthNode, MaxNode, type MessageConfig, type MessageContext, type MessageWriter, Min, MinLength, MinLengthNode, MinNode, Morph, type MorphChildKind, MorphNode, type MorphsAtPath, type NarrowedAttachments, NodeCompiler, type NodeConfig, type NodeDeclarationsByKind, type NodeErrorContextInput, type NodeId, type NodeKeyImplementation, type NodeKind, type NodeMeta, type NodeParseContext, type NodeParseContextInput, type NodeResolver, type NodeSchema, NodeSelector, type NormalizedIndex, type NormalizedSchema, type NumericallyBoundable, type OpenNodeKind, Optional, type OptionalMappedPropInner, OptionalNode, type OptionalSequenceElement, type OrderedNodeKinds, Pattern, PatternNode, type PostfixSequenceElement, type PrecompiledReferences, Predicate, PredicateNode, type PrefixSequenceElement, type PreparsedNodeResolution, type Prerequisite, type PrevariadicSequenceElement, type PrimitiveKind, type PrivateDeclaration, type ProblemConfig, type ProblemContext, type ProblemWriter, Prop, type PropFlatMapper, Proto, ProtoNode, type RangeKind, type ReferenceOptions, type RefinementKind, type RegisteredReference, type RelativeComparator, Required$1 as Required, RequiredNode, type ResolvedConfig, type ResolvedScopeConfig, type ResolvedUnknownNodeConfig, type RootExportCache, type RootIntersection, type RootKind, RootModule, type RootSchema, SchemaModule, SchemaScope, type SchemaScopeParser, type ScopeOnlyConfigOptions, Sequence, type SequenceElement, type SequenceElementKind, SequenceNode, type SequenceTuple, type ShouldTransformFn, StandardSchemaV1, type StructuralKind, type StructuralOperationBranchResultByName, type StructuralOperationName, Structure, StructureNode, ToJsonSchema, Traversal, TraversalError, type TraversalKind, type TraversalMethodsByKind, type TraverseAllows, type TraverseApply, type TypeIntersectionMap, TypeMeta, type UndeclaredKeyBehavior, type UndeclaredKeyConfig, type UndeclaredKeyHandling, Union, type UnionChildKind, UnionNode, Unit, UnitNode, type UnknownAttachments, type UnknownErrorConfigs, type UnknownExpandedRangeSchema, type UnknownIntersectionMap, type UnknownIntersectionResult, type UnknownNodeImplementation, type UnknownNormalizedRangeSchema, type UnknownRangeSchema, type UpperBoundKind, type UpperNode, type VariadicSequenceElement, appendUniqueFlatRefs, appendUniqueNodes, arkKind, assertDefaultValueAssignability, assertNodeKind, type attachmentsOf, basisKinds, bindModule, boundKindPairsByLower, type childKindOf, compileComparator, compileLiteralPropAccess, compileObjectLiteral, compileSerializedValue, computeDefaultValueMorph, type conditionalRootOf, configureSchema, constraintKeyParser, constraintKeys, type constraintKindLeftOf, type constraintKindOf, type constraintKindOrLeftOf, constraintKinds, createDateSchemaNormalizer, createLengthRuleParser, createLengthSchemaNormalizer, createNode, dateLimitToString, type declareNode, type defAttachedAs, type defaultErrorContext, defaultValueSerializer, defineSchema, describeBranches, emptyBrandNameMessage, type errorContext, exclusivizeRangeSchema, type exportedNameOf, flatRef, flatRefsAreEqual, type flatResolutionsOf, flattenConstraints, type genericHktToConstraints, genericNode, type genericParamConstraints, type genericParamNames, type genericParamSchemasToAst, type getAssociatedDataForError, hasArkKind, implementNode, indexPropAccess, type innerAttachedAs, type instantiateRoot, type internalImplementationOf, intersectBranches, type intersectConstraintKinds, intersectConstraints, intersectNodesRoot, intersectOrPipeNodes, intersectProps, type intersectRoot, intrinsic, isNode, isNodeKind, type keySchemaDefinitions, type kindLeftOf, type kindOrLeftOf, type kindOrRightOf, type kindRightOf, makeRootAndArrayPropertiesMutable, mergeConfigs, mergeToJsonSchemaConfigs, morphChildKinds, type mutableInnerOfKind, type mutableNormalizedRootOfKind, node, nodeClassesByKind, type nodeImplementationInputOf, type nodeImplementationOf, nodeImplementationsByKind, nodeKinds, type nodeOfKind, nodesByRegisteredId, normalizeIndex, type ownIntersectionResult, type pairedRangeKind, parseAsSchema, parseDateLimit, parseExclusiveKey, parseGeneric, parseNode, pipeNodesRoot, postfixAfterOptionalOrDefaultableMessage, postfixWithoutVariadicMessage, precedenceByKind, precedenceOfKind, pruneDiscriminant, reduceBranches, type reducibleKindOf, reference, refinementKinds, registerNodeId, registeredReference, registryName, type resolvableReferenceIn, type resolveConfig, type resolveReference, rootKinds, rootSchema, rootSchemaScope, schemaKindOf, type schemaKindOrRightOf, type schemaKindRightOf, schemaKindsRightOf, schemaScope, serializeLiteralKey, structuralKinds, structureKeys, throwInvalidOperandError, type toInternalScope, traverseKey, typeKeyToString, typeOrTermExtends, typePathToPropString, unflattenConstraints, unionChildKinds, type unwrapDefault, withId, withMeta, writeDefaultIntersectionMessage, writeDuplicateAliasError, writeEnumerableIndexBranches, writeIndiscriminableMorphMessage, writeIndivisibleMessage, writeInvalidKeysMessage, writeInvalidLengthBoundMessage, writeInvalidOperandMessage, writeInvalidPropertyKeyMessage, writeInvalidSchemaMessage, writeLiteralUnionEntriesMessage, writeMissingSubmoduleAccessMessage, writeMorphIntersectionMessage, writeNonIntegerDivisorMessage, writeNonPrimitiveNonFunctionDefaultValueMessage, writeNonStructuralOperandMessage, writeNonSubmoduleDotMessage, writeNumberIndexMessage, writeOrderedIntersectionMessage, type writeUnassignableDefaultValueMessage, writeUnboundableMessage, writeUnresolvableMessage, writeUnsatisfiableExpressionError, writeUnsatisfiedParameterConstraintMessage };\n\n}" diff --git a/ark/docs/components/dts/util.ts b/ark/docs/components/dts/util.ts index f8e35981b9..2d243b1e10 100644 --- a/ark/docs/components/dts/util.ts +++ b/ark/docs/components/dts/util.ts @@ -1,3 +1,3 @@ /** THIS FILE IS AUTOGENERATED FROM ark/repo/dtsGen.ts **/ // prettier-ignore -export const utilDts = "declare module \"@ark/util\" {\n import * as buffer from 'buffer';\n\ntype Fn = (...args: args) => returns;\ndeclare const cached: (thunk: () => t) => (() => t);\ndeclare const isThunk: (value: value) => value is Extract extends never ? value & Thunk : Extract;\ntype Thunk = () => ret;\ntype thunkable = t | Thunk;\ndeclare const tryCatch: (fn: () => returns, onError?: (e: unknown) => onError) => returns | onError;\ndeclare const DynamicFunction: DynamicFunction;\ntype DynamicFunction = new (...args: ConstructorParameters) => fn & {\n apply(thisArg: null, args: Parameters): ReturnType;\n call(thisArg: null, ...args: Parameters): ReturnType;\n};\ntype CallableOptions = {\n attach?: attachments;\n bind?: object;\n};\n/** @ts-ignore required to cast function type */\ninterface Callable extends fn, attachments {\n}\ndeclare class Callable {\n constructor(fn: fn, ...[opts]: {} extends attachments ? [opts?: CallableOptions] : [opts: CallableOptions]);\n}\ntype GuardablePredicate = ((In: input) => In is narrowed) | ((In: input) => boolean);\ntype TypeGuard = (In: input) => In is narrowed;\n/**\n * Checks if the environment has Content Security Policy (CSP) enabled,\n * preventing JIT-optimized code from being compiled via new Function().\n *\n * @returns `true` if a function created using new Function() can be\n * successfully invoked in the environment, `false` otherwise.\n *\n * The result is cached for subsequent invocations.\n */\ndeclare const envHasCsp: () => boolean;\n\ndeclare const ecmascriptConstructors: {\n Array: ArrayConstructor;\n Boolean: BooleanConstructor;\n Date: DateConstructor;\n Error: ErrorConstructor;\n Function: FunctionConstructor;\n Map: MapConstructor;\n Number: NumberConstructor;\n Promise: PromiseConstructor;\n RegExp: RegExpConstructor;\n Set: SetConstructor;\n String: StringConstructor;\n WeakMap: WeakMapConstructor;\n WeakSet: WeakSetConstructor;\n};\ntype ecmascriptConstructors = typeof ecmascriptConstructors;\ntype EcmascriptObjects = satisfy, {\n Array: Array;\n Boolean: Boolean;\n Date: Date;\n Error: Error;\n Function: Function;\n Map: Map;\n Number: Number;\n RegExp: RegExp;\n Set: Set;\n String: String;\n WeakMap: WeakMap;\n WeakSet: WeakSet;\n Promise: Promise;\n}>;\n/** Node18 */\ndeclare const FileConstructor: typeof buffer.File;\ntype platformConstructors = {\n ArrayBuffer: ArrayBufferConstructor;\n Blob: typeof Blob;\n File: typeof File;\n FormData: typeof FormData;\n Headers: typeof Headers;\n Request: typeof Request;\n Response: typeof Response;\n URL: typeof URL;\n};\ndeclare const platformConstructors: platformConstructors;\ntype PlatformObjects = instantiateConstructors;\ndeclare const typedArrayConstructors: {\n Int8Array: Int8ArrayConstructor;\n Uint8Array: Uint8ArrayConstructor;\n Uint8ClampedArray: Uint8ClampedArrayConstructor;\n Int16Array: Int16ArrayConstructor;\n Uint16Array: Uint16ArrayConstructor;\n Int32Array: Int32ArrayConstructor;\n Uint32Array: Uint32ArrayConstructor;\n Float32Array: Float32ArrayConstructor;\n Float64Array: Float64ArrayConstructor;\n BigInt64Array: BigInt64ArrayConstructor;\n BigUint64Array: BigUint64ArrayConstructor;\n};\ntype typedArrayConstructors = typeof typedArrayConstructors;\ntype TypedArrayObjects = instantiateConstructors;\ndeclare const builtinConstructors: {\n String: StringConstructor;\n Number: NumberConstructor;\n Boolean: BooleanConstructor;\n Int8Array: Int8ArrayConstructor;\n Uint8Array: Uint8ArrayConstructor;\n Uint8ClampedArray: Uint8ClampedArrayConstructor;\n Int16Array: Int16ArrayConstructor;\n Uint16Array: Uint16ArrayConstructor;\n Int32Array: Int32ArrayConstructor;\n Uint32Array: Uint32ArrayConstructor;\n Float32Array: Float32ArrayConstructor;\n Float64Array: Float64ArrayConstructor;\n BigInt64Array: BigInt64ArrayConstructor;\n BigUint64Array: BigUint64ArrayConstructor;\n ArrayBuffer: ArrayBufferConstructor;\n Blob: typeof Blob;\n File: typeof File;\n FormData: typeof FormData;\n Headers: typeof Headers;\n Request: typeof Request;\n Response: typeof Response;\n URL: typeof URL;\n Array: ArrayConstructor;\n Date: DateConstructor;\n Error: ErrorConstructor;\n Function: FunctionConstructor;\n Map: MapConstructor;\n Promise: PromiseConstructor;\n RegExp: RegExpConstructor;\n Set: SetConstructor;\n WeakMap: WeakMapConstructor;\n WeakSet: WeakSetConstructor;\n};\ntype builtinConstructors = typeof builtinConstructors;\ntype BuiltinObjectKind = keyof builtinConstructors;\ntype GlobalName = keyof typeof globalThis;\ntype instantiateConstructors = {\n [k in kind]: k extends GlobalName ? InstanceType<(typeof globalThis)[k]> : `${k}Constructor` extends GlobalName ? InstanceType<(typeof globalThis)[`${k}Constructor`]> : never;\n};\ntype BuiltinObjects = instantiateConstructors;\ntype describeObject = objectKindOf extends string ? [\n opts[\"includeArticles\"]\n] extends [true] ? objectKindDescriptions[objectKindOf] : objectKindOf : [opts[\"includeArticles\"]] extends [true] ? domainDescriptions[\"object\"] : \"object\";\ntype instantiableObjectKind = {\n [kind in keyof builtinConstructors]: data extends (InstanceType) ? kind : never;\n}[keyof builtinConstructors];\ntype objectKindOf = object extends data ? keyof builtinConstructors | undefined : data extends Fn ? \"Function\" : instantiableObjectKind extends never ? undefined : instantiableObjectKind;\ndeclare const objectKindOf: (data: data) => objectKindOf | undefined;\ndeclare const objectKindOrDomainOf: (data: data) => (objectKindOf & {}) | domainOf;\ntype objectKindOrDomainOf = data extends object ? objectKindOf extends undefined ? \"object\" : objectKindOf : domainOf;\ndeclare const hasObjectKind: (data: object, kind: kind) => data is InstanceType;\ndeclare const isArray: (data: unknown) => data is readonly unknown[];\ndeclare const ecmascriptDescriptions: {\n readonly Array: \"an array\";\n readonly Function: \"a function\";\n readonly Date: \"a Date\";\n readonly RegExp: \"a RegExp\";\n readonly Error: \"an Error\";\n readonly Map: \"a Map\";\n readonly Set: \"a Set\";\n readonly String: \"a String object\";\n readonly Number: \"a Number object\";\n readonly Boolean: \"a Boolean object\";\n readonly Promise: \"a Promise\";\n readonly WeakMap: \"a WeakMap\";\n readonly WeakSet: \"a WeakSet\";\n};\ndeclare const platformDescriptions: {\n ArrayBuffer: string;\n Blob: string;\n File: string;\n FormData: string;\n Headers: string;\n Request: string;\n Response: string;\n URL: string;\n};\ndeclare const typedArrayDescriptions: {\n readonly Int8Array: \"an Int8Array\";\n readonly Uint8Array: \"a Uint8Array\";\n readonly Uint8ClampedArray: \"a Uint8ClampedArray\";\n readonly Int16Array: \"an Int16Array\";\n readonly Uint16Array: \"a Uint16Array\";\n readonly Int32Array: \"an Int32Array\";\n readonly Uint32Array: \"a Uint32Array\";\n readonly Float32Array: \"a Float32Array\";\n readonly Float64Array: \"a Float64Array\";\n readonly BigInt64Array: \"a BigInt64Array\";\n readonly BigUint64Array: \"a BigUint64Array\";\n};\n/** Each defaultObjectKind's completion for the phrase \"must be _____\" */\ndeclare const objectKindDescriptions: {\n readonly Int8Array: \"an Int8Array\";\n readonly Uint8Array: \"a Uint8Array\";\n readonly Uint8ClampedArray: \"a Uint8ClampedArray\";\n readonly Int16Array: \"an Int16Array\";\n readonly Uint16Array: \"a Uint16Array\";\n readonly Int32Array: \"an Int32Array\";\n readonly Uint32Array: \"a Uint32Array\";\n readonly Float32Array: \"a Float32Array\";\n readonly Float64Array: \"a Float64Array\";\n readonly BigInt64Array: \"a BigInt64Array\";\n readonly BigUint64Array: \"a BigUint64Array\";\n readonly ArrayBuffer: string;\n readonly Blob: string;\n readonly File: string;\n readonly FormData: string;\n readonly Headers: string;\n readonly Request: string;\n readonly Response: string;\n readonly URL: string;\n readonly Array: \"an array\";\n readonly Function: \"a function\";\n readonly Date: \"a Date\";\n readonly RegExp: \"a RegExp\";\n readonly Error: \"an Error\";\n readonly Map: \"a Map\";\n readonly Set: \"a Set\";\n readonly String: \"a String object\";\n readonly Number: \"a Number object\";\n readonly Boolean: \"a Boolean object\";\n readonly Promise: \"a Promise\";\n readonly WeakMap: \"a WeakMap\";\n readonly WeakSet: \"a WeakSet\";\n};\ntype objectKindDescriptions = typeof objectKindDescriptions;\n/**\n * this will only return an object kind if it's the root constructor\n * example TypeError would return null not 'Error'\n **/\ndeclare const getBuiltinNameOfConstructor: (ctor: Function) => BuiltinObjectKind | null;\ntype Constructor = abstract new (...args: never[]) => instance;\ntype instanceOf = constructor extends Constructor ? instance : never;\n/**\n * Returns an array of constructors for all ancestors (i.e., prototypes) of a given object.\n */\ndeclare const ancestorsOf: (o: object) => Function[];\ntype normalizedKeyOf = keyof t extends infer k ? k extends number ? `${k}` : k : never;\ndeclare const constructorExtends: (ctor: Constructor, base: Constructor) => boolean;\n\ntype stringifyUnion = join, delimiter>;\ntype unionToTuple = _unionToTuple extends infer result ? conform : never;\ntype _unionToTuple = getLastBranch extends infer current ? [\n t\n] extends [never] ? result : _unionToTuple, [current, ...result]> : never;\ntype getLastBranch = intersectUnion void : never> extends ((x: infer branch) => void) ? branch : never;\ntype intersectUnion = (t extends unknown ? (_: t) => void : never) extends ((_: infer intersection) => void) ? intersection : never;\ntype intersectOverloadReturns = intersectUnion>>;\ntype overloadOf = Exclude never) & fn, givenArgs, unknown>, fn extends () => never ? never : () => never>;\ntype collectSignatures = result & fn extends (...args: infer args) => infer returns ? result extends fn ? never : collectSignatures & result & ((...args: args) => returns)> | (args extends givenArgs ? (...args: args) => returns : never) : never;\n\ntype DescribeOptions = {\n includeArticles?: boolean;\n branchDelimiter?: string;\n};\ntype typeToString = stringifyUnion<[\n t\n] extends [anyOrNever] ? unknown extends t ? \"any\" : \"never\" : unknown extends t ? \"unknown\" : boolean extends t ? \"boolean\" | ([t] extends [boolean] ? never : typeToString, opts>) : t extends array ? arrayTypeToString : t extends object ? describeObject : t extends Stringifiable ? stringifiableToString : describeDomainOf, opts[\"branchDelimiter\"] extends string ? opts[\"branchDelimiter\"] : describeDefaults[\"branchDelimiter\"]>;\ntype stringifiableToString = inferDomain> extends t ? describeDomainOf : `${t}`;\ntype describe = typeToString;\ntype arrayTypeToString = typeToString extends infer element extends string ? opts[\"includeArticles\"] extends true ? describeArrayOf : includesDelimiter extends true ? `(${element})[]` : `${element}[]` : never;\ntype describeArrayOf = element extends \"unknown\" ? \"an array\" : `an array of ${element}`;\ntype includesDelimiter = s extends (`${string}${opts[\"branchDelimiter\"] extends string ? opts[\"branchDelimiter\"] : describeDefaults[\"branchDelimiter\"]}${string}`) ? true : false;\ntype describeDefaults = satisfy, {\n includeArticles: false;\n branchDelimiter: \" | \";\n}>;\n\ntype JsTypeOf = \"object\" | \"function\" | \"number\" | \"bigint\" | \"boolean\" | \"string\" | \"symbol\" | \"undefined\" | \"null\";\ndeclare const hasDomain: (data: data, kind: domain) => data is data & inferDomain;\ntype TypesByDomain = {\n bigint: bigint;\n boolean: boolean;\n number: number;\n object: object;\n string: string;\n symbol: symbol;\n undefined: undefined;\n null: null;\n};\ntype inferDomain = Domain extends kind ? unknown : TypesByDomain[kind];\ntype Domain = show;\ntype NullishDomain = \"undefined\" | \"null\";\ntype NonNullishDomain = Exclude;\ntype PrimitiveDomain = Exclude;\ntype Primitive = inferDomain;\ntype domainOf = unknown extends data ? Domain : data extends object ? \"object\" : data extends string ? \"string\" : data extends number ? \"number\" : data extends boolean ? \"boolean\" : data extends undefined ? \"undefined\" : data extends null ? \"null\" : data extends bigint ? \"bigint\" : data extends symbol ? \"symbol\" : never;\ndeclare const domainOf: (data: data) => domainOf;\ndeclare const jsTypeOfDescriptions: {\n readonly function: \"a function\";\n readonly boolean: \"boolean\";\n readonly null: \"null\";\n readonly undefined: \"undefined\";\n readonly bigint: \"a bigint\";\n readonly number: \"a number\";\n readonly object: \"an object\";\n readonly string: \"a string\";\n readonly symbol: \"a symbol\";\n};\n/** Each domain's completion for the phrase \"must be _____\" */\ndeclare const domainDescriptions: {\n readonly boolean: \"boolean\";\n readonly null: \"null\";\n readonly undefined: \"undefined\";\n readonly bigint: \"a bigint\";\n readonly number: \"a number\";\n readonly object: \"an object\";\n readonly string: \"a string\";\n readonly symbol: \"a symbol\";\n};\ntype domainDescriptions = typeof domainDescriptions;\ntype describeDomainOf = stringifyUnion] : domainOf, opts[\"branchDelimiter\"] extends string ? opts[\"branchDelimiter\"] : describeDefaults[\"branchDelimiter\"]>;\n\ndeclare class InternalArktypeError extends Error {\n}\ndeclare const throwInternalError: (message: string) => never;\ndeclare const throwError: (message: string, ctor?: new (message: string) => Error) => never;\ndeclare class ParseError extends Error {\n readonly name = \"ParseError\";\n}\ndeclare const throwParseError: (message: string) => never;\n/**\n * TypeScript won't suggest strings beginning with a space as properties.\n * Useful for symbol-like string properties.\n */\ndeclare const noSuggest: (s: s) => noSuggest;\n/**\n * TypeScript won't suggest strings beginning with a space as properties.\n * Useful for symbol-like string properties.\n */\ntype noSuggest = ` ${s}`;\n/** \"Hair Space\" character, used as a non-rendered sentinel for an error message string:\n * https://www.compart.com/en/unicode/U+200A\n */\ndeclare const zeroWidthSpace = \"\\u200A\";\n/** \"Hair Space\" character, used as a non-rendered sentinel for an error message string:\n * https://www.compart.com/en/unicode/U+200A\n */\ntype ZeroWidthSpace = typeof zeroWidthSpace;\ntype ErrorMessage = `${message}${ZeroWidthSpace}`;\ninterface ErrorType {\n [brand]: \"ErrorType\";\n message: message;\n ctx: ctx;\n}\ntype Completion = `${text}${ZeroWidthSpace}${ZeroWidthSpace}`;\n\ntype Stringifiable = string | boolean | number | bigint | null | undefined;\n/** Force an operation like `{ a: 0 } & { b: 1 }` to be computed so that it displays `{ a: 0; b: 1 }`. */\ntype show = {\n [k in keyof t]: t[k];\n} & unknown;\n/** @deprecated use \"show\" instead */\ntype evaluate = {\n [k in keyof t]: t[k];\n} & unknown;\ntype exact = {\n [k in keyof t]: k extends keyof u ? conform : never;\n};\ntype exactMessageOnError = {\n [k in keyof t]: k extends keyof u ? conform : ErrorMessage<`'${k & string}' is not a valid key`>;\n} & u;\ntype promisable = t | Promise;\ntype leftIfEqual = [l, r] extends [r, l] ? l : r;\ntype UnknownUnion = string | number | symbol | bigint | boolean | object | null | undefined;\n/**\n * Interesection (`&`) that avoids evaluating `unknown` to `{}`\n */\ntype andPreserveUnknown = unknown extends l & r ? unknown : show;\n/** Can be used to test for the universal subtypes, `any` and `never`, e.g.:\n *\n * ```ts\n * type isAnyOrNever = [t] extends [anyOrNever] ? true : false\n * ```\n *\n * The actual value is a string literal, but the only realistic subtypes\n * of that literal are `any` and `never`.\n */\ntype anyOrNever = \" anyOrNever\";\ntype conform = t extends base ? t : base;\ntype equals = [l, r] extends [r, l] ? true : false;\ntype exactEquals = (<_>() => _ extends l ? 1 : 2) extends <_>() => _ extends r ? 1 : 2 ? true : false;\ndeclare const brand: \" brand\";\ntype Brand = t & {\n readonly [brand]: [t, id];\n};\ntype unbrand = t extends Brand ? base : never;\ntype satisfy = t;\ntype defined = t & ({} | null);\ntype autocomplete = suggestions | (string & {});\ntype widen = collectWidenedType>;\ntype collectWidenedType = remaining extends [infer head, ...infer tail] ? collectWidenedType : result;\ntype narrowTuple = t extends readonly [infer head, ...infer tail] ? readonly [head, ...narrowTuple] : [];\ntype narrow = t extends Primitive ? t : t extends readonly unknown[] ? narrowTuple : {\n [k in keyof t]: narrow;\n};\ndeclare const narrow: (t: narrow) => t;\n/** primitive key used to represent an inferred type at compile-time */\ndeclare const inferred: \" arkInferred\";\n/** primitive key used to represent an inferred type at compile-time */\ntype inferred = typeof inferred;\n\ndeclare const args: \" args\";\ntype args = typeof args;\ndeclare abstract class Hkt {\n [args]: unknown[];\n constraints: constraints;\n args: this[args] extends infer args extends unknown[] ? args : never;\n 0: this[args] extends [infer arg, ...any] ? arg : never;\n 1: this[args] extends [any, infer arg, ...any] ? arg : never;\n 2: this[args] extends [any, any, infer arg, ...any] ? arg : never;\n 3: this[args] extends [any, any, any, infer arg, ...any] ? arg : never;\n abstract body: unknown;\n description?: string;\n constructor();\n}\n/** A small set of HKT utility types based on https://github.com/gvergnaud/hotscript\n * See https://github.com/gvergnaud/hotscript/blob/main/src/internals/core/Core.ts\n */\ndeclare namespace Hkt {\n type constructor = new () => Hkt;\n type args = typeof args;\n type apply = (hkt & {\n [args]: args;\n })[\"body\"];\n}\n\ntype Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;\ntype NumberLiteral = `${n}`;\ntype BigintLiteral = `${n}n`;\ntype IntegerLiteral = `${n}`;\ntype NonNegativeIntegerLiteral = `${Digit}` | (`${Exclude}${string}` & `${n}`);\n/**\n * Matches a well-formatted numeric expression according to the following rules:\n * 1. Must include an integer portion (i.e. '.321' must be written as '0.321')\n * 2. The first digit of the value must not be 0, unless the entire integer portion is 0\n * 3. If the value includes a decimal, its last digit may not be 0\n * 4. The value may not be \"-0\"\n */\ndeclare const wellFormedNumberMatcher: RegExp;\ndeclare const isWellFormedNumber: RegExp[\"test\"];\n/**\n * Similar to wellFormedNumber but more permissive in the following ways:\n *\n * - Allows numbers without an integer portion like \".5\" (well-formed equivalent is \"0.5\")\n * - Allows decimals with trailing zeroes like \"0.10\" (well-formed equivalent is \"0.1\")\n */\ndeclare const numericStringMatcher: RegExp;\ndeclare const isNumericString: (string: string) => boolean;\ndeclare const numberLikeMatcher: RegExp;\n/**\n * Matches a well-formatted integer according to the following rules:\n * 1. must begin with an integer, the first digit of which cannot be 0 unless the entire value is 0\n * 2. The value may not be \"-0\"\n */\ndeclare const wellFormedIntegerMatcher: RegExp;\ndeclare const isWellFormedInteger: RegExp[\"test\"];\ndeclare const integerLikeMatcher: RegExp;\ntype NumericLiteralKind = \"number\" | \"bigint\" | \"integer\";\ndeclare const numericLiteralDescriptions: {\n readonly number: \"a number\";\n readonly bigint: \"a bigint\";\n readonly integer: \"an integer\";\n};\ntype numericLiteralDescriptions = typeof numericLiteralDescriptions;\ntype writeMalformedNumericLiteralMessage = `'${def}' was parsed as ${numericLiteralDescriptions[kind]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`;\ndeclare const writeMalformedNumericLiteralMessage: (def: def, kind: kind) => writeMalformedNumericLiteralMessage;\ndeclare const tryParseWellFormedNumber: typeof tryParseNumber;\ndeclare const tryParseNumber: (token: string, options?: NumericParseOptions) => errorOnFail extends true | string ? number : number | undefined;\ntype tryParseNumber = token extends `${infer n extends number}` ? number extends n ? writeMalformedNumericLiteralMessage : n : messageOnFail;\ntype parseNumber = token extends `${infer n extends number}` ? n : never;\ndeclare const tryParseInteger: (token: string, options?: NumericParseOptions) => errorOnFail extends true | string ? number : number | undefined;\ntype tryParseInteger = token extends `${infer b extends bigint}` ? bigint extends b ? writeMalformedNumericLiteralMessage : token extends `${infer n extends number}` ? n : never : messageOnFail;\ntype parseInteger = token extends `${bigint}` ? token extends `${infer n extends number}` ? n : never : never;\ntype parseNonNegativeInteger = token extends `-${string}` ? never : parseInteger;\ntype NumericParseOptions = {\n errorOnFail?: errorOnFail;\n strict?: boolean;\n};\ndeclare const tryParseWellFormedBigint: (def: string) => bigint | undefined;\n/**\n * Returns the next or previous representable floating-point number after the given input.\n *\n * @param {\"+\" | \"-\"} [direction=\"+\"] - The direction to find the nearest float. \"+\" for the next float, \"-\" for the previous float.\n * @throws {Error} If the input is not a finite number.\n *\n * @example\n * console.log(nearestFloat(0)); // Smallest positive number\n * console.log(nearestFloat(2)); // 2.0000000000000004\n * console.log(nearestFloat(2.1)); // 2.1000000000000005\n * console.log(nearestFloat(2, \"-\")); // 1.9999999999999998\n * console.log(nearestFloat(2.1, \"-\")); // 2.0999999999999996\n * // as size of input increases, the increments become larger to stay within what\n * // JS can represent in a numeric value\n * console.log(nearestFloat(5555555555555555)); // 5555555555555556\n * console.log(nearestFloat(5555555555555555, \"-\")); // 5555555555555554\n */\ndeclare const nearestFloat: (n: number, direction?: \"+\" | \"-\") => number;\n\ntype Key = string | symbol;\ntype toArkKey = k extends number ? [\n o,\n number\n] extends [array, k] ? NonNegativeIntegerLiteral : `${k}` : k;\ntype arkIndexableOf = arkKeyOf extends infer k ? k extends `${infer index extends number}` ? index | k : k : never;\ntype arkKeyOf = [\n o\n] extends [object] ? [\n o\n] extends [array] ? arkArrayKeyOf : arkObjectLiteralKeyOf : never;\ntype arkArrayKeyOf = number extends a[\"length\"] ? NonNegativeIntegerLiteral : keyof a extends infer i ? i extends `${number}` ? i : never : never;\ntype arkObjectLiteralKeyOf = keyof o extends infer k ? k extends number ? `${k}` : k : never;\ntype arkGet> = o[k extends keyof o ? k : NonNegativeIntegerLiteral extends k ? number & keyof o : k extends number ? `${k}` & keyof o : never];\ntype writeInvalidKeysMessage> = `Key${keys[\"length\"] extends 1 ? \"\" : \"s\"} ${join} ${keys[\"length\"] extends 1 ? \"does\" : \"do\"} not exist on ${o}`;\n\ntype Dict = {\n readonly [_ in k]: v;\n};\ntype dict = {\n [_ in k]: v;\n};\n/** Either:\n * A, with all properties of B undefined\n * OR\n * B, with all properties of A undefined\n **/\ntype propwiseXor = show | show;\ntype unionToPropwiseXor> = props extends infer distributed ? show : never;\ntype requireKeys = o & {\n [requiredKey in key]-?: defined;\n};\ntype require = _require;\ntype _require = depth[\"length\"] extends maxDepth ? o : o extends object ? o extends Fn ? o : {\n [k in keyof o]-?: _require;\n} : o;\ntype PartialRecord = {\n [_ in k]?: v;\n};\n/** Returns true if a type can be homomorphically mapped without losing information.\n * Useful for avoiding e.g. classes with private properties while mapping.\n */\ntype isSafelyMappable = {\n [k in keyof t]: t[k];\n} extends t ? true : false;\ntype KeySet = {\n readonly [_ in key]?: 1;\n};\ntype keySetOf = KeySet>;\ntype mutable = _mutable;\ntype _mutable = depth[\"length\"] extends maxDepth ? o : o extends Primitive ? o : o extends Fn ? o : {\n -readonly [k in keyof o]: _mutable;\n};\n/**\n * extracts entries mimicking Object.entries, accounting for whether the\n * object is an array\n **/\ntype entryOf = {\n [k in keyof o]-?: [k, o[k] & ({} | null)];\n}[o extends readonly unknown[] ? keyof o & number : keyof o] & unknown;\ntype entriesOf = entryOf[];\n/**\n * Object.entries wrapper providing narrowed types for objects with known sets\n * of keys, e.g. those defined internally as configs\n */\ndeclare const entriesOf: (o: o) => entryOf[];\ntype Entry = readonly [key: key, value: value];\ntype fromEntries = show<{\n [entry in entries[number] as entry[0]]: entry[1];\n}>;\ndeclare const fromEntries: (entries: entries) => fromEntries;\n/** Mimics the result of Object.keys(...) */\ntype keyOf = o extends array ? number extends o[\"length\"] ? `${number}` : keyof o & `${number}` : keyof o extends infer k ? k extends string ? k : k extends number ? `${k}` : never : never;\ndeclare const keysOf: (o: o) => keyOf[];\ndeclare const isKeyOf: (k: k, o: o) => k is Extract;\n/** Coalesce keys that exist on one or more branches of a union */\ntype unionKeyOf = t extends unknown ? keyof t : never;\ntype extractKeyed> = Extract;\ndeclare const hasKey: >(o: o, k: k) => o is extractKeyed;\ntype extractDefinedKey> = show & {\n [_ in k]: {} | null;\n}>;\ndeclare const hasDefinedKey: >(o: o, k: k) => o is extractDefinedKey;\ntype requiredKeyOf = keyof o extends infer k ? k extends keyof o ? o extends {\n [_ in k]-?: o[k];\n} ? k : never : never : never;\ntype optionalKeyOf = Exclude>;\ntype merge = base extends unknown ? props extends unknown ? show & props> : never : never;\ntype mergeExact = base extends unknown ? props extends unknown ? show & props> : never : never;\ntype omitMerged = {\n [k in keyof base as excludeExactKeyOf]: base[k];\n};\ntype excludeExactKeyOf = Exclude>;\ntype extractExactKeyOf = keyof {\n [k in keyof base as [key, k] extends [k, key] ? key : never]: 1;\n};\ntype override = merge;\ntype propValueOf = o[keyof o];\ndeclare const InnerDynamicBase: new (base: t) => t;\n/** @ts-ignore (needed to extend `t`) **/\ninterface DynamicBase extends t {\n}\ndeclare class DynamicBase {\n constructor(properties: t);\n}\ndeclare const NoopBase: new () => t;\n/** @ts-ignore (needed to extend `t`) **/\ndeclare class CastableBase extends NoopBase {\n}\ndeclare const splitByKeys: >(o: o, leftKeys: leftKeys) => [show>, show>];\n/** Homomorphic implementation of the builtin Pick.\n *\n * Gives different results for certain union expressions like the following:\n *\n * @example\n * // flattens result to { a?: 1 | 2; b?: 1 | 2 }\n * type PickResult = Pick<{ a: 1; b?: 1 } | { a?: 2; b: 2 }, \"a\" | \"b\">\n *\n * @example\n * // preserves original type w/ modifier groupings\n * type pickResult = pick<{ a: 1; b?: 1 } | { a?: 2; b: 2 }, \"a\" | \"b\">\n */\ntype pick = o extends unknown ? {\n [k in keyof o as k extends key ? k : never]: o[k];\n} : never;\ndeclare const pick: >(o: o, keys: keys) => pick;\n/** Homomorphic implementation of the builtin Omit.\n *\n * Gives different results for many union expressions like the following:\n *\n * @example\n * // {}\n * type OmitResult = Omit<{ a: 1 } | { b: 2 }, never>\n *\n * @example\n * // preserves original type w/ modifier groupings\n * type omitResult = omit<{ a: 1 } | { b: 2 }, never>\n */\ntype omit = {\n [k in keyof o as k extends key ? never : k]: o[k];\n};\ndeclare const omit: >(o: o, keys: keys) => omit;\n/** Returns onTrue if the type is exactly `{}` and onFalse otherwise*/\ntype ifEmptyObjectLiteral = [\n unknown,\n t & (null | undefined)\n] extends [t | null | undefined, never] ? onTrue : onFalse;\ntype EmptyObject = Record;\ndeclare const isEmptyObject: (o: object) => o is EmptyObject;\ndeclare const stringAndSymbolicEntriesOf: (o: object) => Entry[];\n/** Like Object.assign, but it will preserve getters instead of evaluating them. */\ndeclare const defineProperties: (base: base, merged: merged) => merge;\n/** Copies enumerable keys of o to a new object in alphabetical order */\ndeclare const withAlphabetizedKeys: (o: o) => o;\ntype invert> = {\n [k in t[keyof t]]: {\n [k2 in keyof t]: t[k2] extends k ? k2 : never;\n }[keyof t];\n} & unknown;\ndeclare const invert: >(t: t) => invert;\ndeclare const unset: \" represents an uninitialized value\";\ntype unset = typeof unset;\n/**\n * For each keyof o that also exists on jsDocSource, add associated JsDoc annotations to o.\n * Does not preserve modifiers on o like optionality.\n */\ntype withJsDoc = show : Pick<_withJsDoc, keyof o & keyof jsDocSource> : Pick<_withJsDoc, keyof o & keyof jsDocSource> & {\n [k in Exclude]: o[k];\n}>;\ntype _withJsDoc = {\n [k in keyof jsDocSource]-?: o[k & keyof o];\n};\ntype propertyDescriptorsOf = {\n [k in keyof o]: TypedPropertyDescriptor;\n};\ntype keyWithValue = keyof t extends infer k ? k extends keyof t ? t[k] extends constraint ? k : never : never : never;\ndeclare const enumValues: (tsEnum: tsEnum) => tsEnum[keyof tsEnum][];\n\ninterface AndPreserveUnknown extends Hkt<[unknown, unknown]> {\n body: andPreserveUnknown;\n}\ntype SequenceIntersectionKind = \"array\" | \"parameters\";\ntype intersectArrays = intersectSequences;\ntype intersectParameters = intersectSequences;\ntype intersectSequences = l extends readonly [] ? kind extends \"array\" ? [\n] extends r ? [\n ...acc,\n ...postfix\n] : never : [...acc, ...r, ...postfix] : r extends readonly [] ? kind extends \"array\" ? [\n] extends l ? [\n ...acc,\n ...postfix\n] : never : [...acc, ...l, ...postfix] : [\n l,\n r\n] extends ([\n readonly [(infer lHead)?, ...infer lTail],\n readonly [(infer rHead)?, ...infer rTail]\n]) ? [\n \"0\",\n lHead,\n rHead\n] extends [keyof l | keyof r, l[0], r[0]] ? intersectSequences?\n] : [...acc, Hkt.apply], postfix, operation, kind> : l extends readonly [...infer lInit, infer lLast] ? r extends readonly [...infer rInit, infer rLast] ? intersectSequences,\n ...postfix\n], operation, kind> : intersectSequences,\n ...postfix\n], operation, kind> : r extends readonly [...infer rInit, infer rLast] ? intersectSequences,\n ...postfix\n], operation, kind> : [...acc, ...Hkt.apply[], ...postfix] : never;\ntype isDisjoint = overlaps extends true ? false : true;\ntype overlaps = l & r extends never ? false : domainOf & domainOf extends never ? false : [l, r] extends [object, object] ? false extends (propValueOf<{\n [k in Extract | requiredKeyOf>]: overlaps;\n}>) ? false : true : true;\n\ntype DuplicateData = {\n element: val;\n indices: number[];\n};\n/**\n * Extracts duplicated elements and their indices from an array, returning them.\n *\n * Note that given `a === b && b === c`, then `c === a` must be `true` for this to give accurate results.\n *\n * @param arr The array to extract duplicate elements from.\n */ declare const getDuplicatesOf: (arr: arr, opts?: ComparisonOptions) => DuplicateData[];\ntype pathToString = segments extends [] ? \"/\" : join;\ndeclare const join: , delimiter extends string>(segments: segments, delimiter: delimiter) => join;\ntype join, delimiter extends string, result extends string = \"\"> = segments extends (readonly [infer head extends string, ...infer tail extends string[]]) ? join : result;\ndeclare const getPath: (root: unknown, path: string[]) => unknown;\ndeclare const intersectUniqueLists: (l: readonly item[], r: readonly item[]) => item[];\ntype filter = t extends readonly [infer head, ...infer tail] ? filter : result;\ntype array = readonly t[];\ntype listable = t | readonly t[];\ntype flattenListable = t extends array ? element : t;\ntype minLengthArray = readonly [\n ...repeat<[t], minLength>,\n ...t[]\n];\ntype repeat = _repeat;\ntype _repeat = depth[\"length\"] extends maxDepth ? result : _repeat;\ntype CollapsingList = readonly [] | t | readonly [t, t, ...t[]];\ntype headOf = t[0];\ntype tailOf = t extends readonly [unknown, ...infer tail] ? tail : never;\ntype lastIndexOf = tailOf[\"length\"];\ntype lastOf = t[lastIndexOf];\ntype initOf = t extends readonly [...infer init, unknown] ? init : never;\ntype numericStringKeyOf = Extract;\ntype arrayIndexOf = keyof a extends infer k ? parseNonNegativeInteger : never;\ntype liftArray = t extends array ? [\n t\n] extends [anyOrNever] ? t[] : t : t[];\ndeclare const liftArray: (data: t) => liftArray;\n/**\n * Splits an array into two arrays based on the result of a predicate\n *\n * @param predicate - The guard function used to determine which items to include.\n * @returns A tuple containing two arrays:\n * \t\t\t\t- the first includes items for which `predicate` returns true\n * \t\t\t\t- the second includes items for which `predicate` returns false\n *\n * @example\n * const list = [1, \"2\", \"3\", 4, 5];\n * const [numbers, strings] = spliterate(list, (x) => typeof x === \"number\");\n * // Type: number[]\n * // Output: [1, 4, 5]\n * console.log(evens);\n * // Type: string[]\n * // Output: [\"2\", \"3\"]\n * console.log(odds);\n */\ndeclare const spliterate: (arr: readonly item[], predicate: GuardablePredicate) => [included: included[], excluded: [item] extends [included] ? item[] : Exclude[]];\ndeclare const ReadonlyArray: new (...args: ConstructorParameters>) => ReadonlyArray;\ndeclare const includes: (array: a, element: unknown) => element is a[number];\ndeclare const range: (length: number, offset?: number) => number[];\ntype AppendOptions = {\n /** If true, adds the element to the beginning of the array instead of the end */\n prepend?: boolean;\n};\n/**\n * Adds a value or array to an array, returning the concatenated result\n */\ndeclare const append: >(to: to, value: value, opts?: AppendOptions) => to & {};\ntype appendableValue = to extends array ? element extends array ? array : listable : never;\n/**\n * Concatenates an element or list with a readonly list\n */\ndeclare const conflatenate: (to: readonly element[] | undefined | null, elementOrList: appendableValue | undefined | null) => readonly element[];\n/**\n * Concatenates a variadic list of elements or lists with a readonly list\n */\ndeclare const conflatenateAll: (...elementsOrLists: (listable | undefined | null)[]) => readonly element[];\ninterface ComparisonOptions {\n isEqual?: (l: t, r: t) => boolean;\n}\n/**\n * Appends a value or concatenates an array to an array if it is not already included, returning the array\n */\ndeclare const appendUnique: (to: to | undefined, value: NoInfer | to[number]>, opts?: ComparisonOptions) => to;\ntype groupableKeyOf = keyof o extends infer k ? k extends keyof o ? o[k] extends PropertyKey ? k : never : never : never;\ntype groupBy> = {\n [k in element[discriminant] & PropertyKey]?: (element extends unknown ? isDisjoint extends true ? never : element : never)[];\n} & unknown;\ndeclare const groupBy: >(array: readonly element[], discriminant: discriminant) => groupBy;\ndeclare const arrayEquals: (l: array, r: array, opts?: ComparisonOptions) => boolean;\ntype validateExhaustiveKeys = keys extends readonly [infer head, ...infer tail extends PropertyKey[]] ? readonly [\n conform,\n ...validateExhaustiveKeys>\n] : [expectedKey] extends [never] ? [] : [expectedKey];\n\n/** Shallowly copy the properties of the object. */\ndeclare const shallowClone: (input: input) => input;\n/** Deeply copy the properties of the a non-subclassed Object, Array or Date.*/\ndeclare const deepClone: (input: input) => input;\n\ntype objectFromListableEntries = show>>;\ntype fromGroupableEntries = {\n [entry in entries[number] as entry extends GroupedEntry ? entry[0][\"group\"] : conform]: entry extends GroupedEntry ? entry[1][] : entry[1];\n};\ntype arrayFromListableEntries = Entry extends transformed ? transformed[1][] : _arrayFromListableEntries;\ntype _arrayFromListableEntries = [\n transformed\n] extends [never] ? result : Extract> extends (infer next extends Entry) ? Exclude extends infer remaining extends Entry ? [\n transformed\n] extends [remaining] ? [\n ...result,\n ...transformed[1][]\n] : _arrayFromListableEntries : never : [...result, ...transformed[1][]];\ntype extractEntrySets> = e extends readonly GroupableEntry[] ? e : [e];\ntype extractEntries> = e extends readonly Entry[] ? e[number] : e;\ntype entryArgsWithIndex = {\n [k in keyof o]-?: [k: k, v: Exclude, i: number];\n}[keyof o];\ntype numericArrayEntry = number extends a[\"length\"] ? [number, a[number]] : {\n [i in keyof a]: i extends `${infer n extends number}` ? [n, a[i]] : never;\n}[number];\ntype GroupedEntry = readonly [key: {\n group: Key;\n}, value: unknown];\ntype GroupableEntry = Entry | Entry | GroupedEntry;\ntype ListableEntry = listable;\ntype fromMappedEntries = [\n transformed\n] extends [listable>] ? arrayFromListableEntries> : objectFromListableEntries>;\ntype FlatMorph = {\n (o: o, flatMapEntry: (...args: numericArrayEntry) => transformed): fromMappedEntries;\n (o: o, flatMapEntry: (...args: entryOf) => transformed): fromMappedEntries;\n (o: o, flatMapEntry: (...args: entryArgsWithIndex) => transformed): fromMappedEntries;\n};\ndeclare const flatMorph: FlatMorph;\n\ndeclare const isomorphic: {\n fileName: () => string;\n env: Record, string | undefined>;\n};\n\ndeclare const lazily: (thunk: () => t) => t;\n\ntype SerializationOptions = {\n onCycle?: (value: object) => string;\n onSymbol?: (value: symbol) => string;\n onFunction?: (value: Function) => string;\n onUndefined?: string;\n onBigInt?: (value: bigint) => string;\n};\ntype JsonStructure = JsonObject | JsonArray;\ninterface JsonObject {\n [k: string]: Json;\n}\ntype JsonArray = Json[];\ntype JsonPrimitive = string | boolean | number | null;\ntype Json = JsonStructure | JsonPrimitive;\ndeclare const snapshot: (data: t, opts?: SerializationOptions) => snapshot;\ntype snapshot = unknown extends t ? unknown : t extends Primitive ? snapshotPrimitive : t extends {\n toJSON: () => infer serialized;\n} ? serialized : t extends Function ? `Function(${string})` : t extends Date ? string : depth[\"length\"] extends 10 ? unknown : t extends array ? array> : {\n [k in keyof t as snapshotPrimitive]: snapshot;\n};\ntype snapshotPrimitive = t extends symbol ? `Symbol(${string})` : t;\ntype PrintableOptions = {\n indent?: number;\n quoteKeys?: boolean;\n};\ndeclare const print: (data: unknown, opts?: PrintableOptions) => void;\ndeclare const printable: (data: unknown, opts?: PrintableOptions) => string;\n/**\n * Converts a Date instance to a human-readable description relative to its precision\n */\ndeclare const describeCollapsibleDate: (date: Date) => string;\n\ntype StringifyPathOptions = requireKeys<{\n stringifySymbol?: (s: symbol) => string;\n stringifyNonKey?: (o: Exclude) => string;\n}, stringifiable extends PropertyKey ? never : \"stringifyNonKey\">;\ntype StringifyPathFn = (path: array, ...[opts]: [stringifiable] extends [PropertyKey] ? [\n opts?: StringifyPathOptions\n] : NoInfer<[opts: StringifyPathOptions]>) => string;\ntype AppendStringifiedKeyFn = (path: string, prop: stringifiable, ...[opts]: [stringifiable] extends [PropertyKey] ? [\n opts?: StringifyPathOptions\n] : NoInfer<[opts: StringifyPathOptions]>) => string;\ndeclare const appendStringifiedKey: AppendStringifiedKeyFn;\ndeclare const stringifyPath: StringifyPathFn;\ndeclare class ReadonlyPath extends ReadonlyArray {\n private cache;\n constructor(...items: array);\n toJSON(): JsonArray;\n stringify(): string;\n stringifyAncestors(): readonly string[];\n}\n\ntype SerializedString = `\"${value}\"`;\ntype SerializedPrimitives = {\n string: SerializedString;\n number: `${number}`;\n bigint: BigintLiteral;\n boolean: \"true\" | \"false\";\n null: \"null\";\n undefined: \"undefined\";\n};\ntype SerializedPrimitive = SerializedPrimitives[keyof SerializedPrimitives];\ntype SerializablePrimitive = inferDomain;\ndeclare const serializePrimitive: (value: value) => serializePrimitive;\ntype serializePrimitive = value extends string ? `\"${value}\"` : value extends bigint ? `${value}n` : `${value}`;\n\ndeclare const arkUtilVersion = \"0.45.10\";\ndeclare const initialRegistryContents: {\n version: string;\n filename: string;\n FileConstructor: typeof buffer.File;\n};\ntype InitialRegistryContents = typeof initialRegistryContents;\ninterface ArkRegistry extends InitialRegistryContents {\n [k: string]: unknown;\n}\ndeclare const registry: ArkRegistry;\ndeclare global {\n export interface ArkEnv {\n prototypes(): never;\n }\n export namespace ArkEnv {\n type prototypes = ReturnType;\n }\n}\ndeclare const register: (value: object | symbol) => string;\ndeclare const isDotAccessible: (keyName: string) => boolean;\n\ndeclare class Scanner {\n chars: string[];\n i: number;\n def: string;\n constructor(def: string);\n /** Get lookahead and advance scanner by one */\n shift(): this[\"lookahead\"];\n get lookahead(): lookahead;\n get nextLookahead(): string;\n get length(): number;\n shiftUntil(condition: Scanner.UntilCondition): string;\n shiftUntilLookahead(charOrSet: string | KeySet): string;\n shiftUntilNonWhitespace(): string;\n jumpToIndex(i: number): void;\n jumpForward(count: number): void;\n get location(): number;\n get unscanned(): string;\n get scanned(): string;\n sliceChars(start: number, end?: number): string;\n lookaheadIs(char: char): this is Scanner;\n lookaheadIsIn(tokens: keySet): this is Scanner>;\n}\ndeclare namespace Scanner {\n type UntilCondition = (scanner: Scanner, shifted: string) => boolean;\n}\n\ndeclare const capitalize: (s: s) => Capitalize;\ndeclare const uncapitalize: (s: s) => Uncapitalize;\ntype firstChar = s extends `${infer head}${string}` ? head : \"\";\ntype charsAfterFirst = s extends `${string}${infer tail}` ? tail : \"\";\ntype lastChar = s extends `${infer head}${infer tail}` ? tail extends \"\" ? head : lastChar : s;\ntype charsBeforeLast = s extends `${infer head}${infer tail}` ? tail extends \"\" ? \"\" : `${head}${charsBeforeLast}` : \"\";\ndeclare const anchoredRegex: (regex: RegExp | string) => RegExp;\ndeclare const deanchoredRegex: (regex: RegExp | string) => RegExp;\ndeclare const anchoredSource: (regex: RegExp | string) => string;\ndeclare const deanchoredSource: (regex: RegExp | string) => string;\ndeclare const RegexPatterns: {\n negativeLookahead: (pattern: string) => `(?!${string})`;\n nonCapturingGroup: (pattern: string) => `(?:${string})`;\n};\ndeclare const escapeChar = \"\\\\\";\ntype EscapeChar = typeof escapeChar;\ndeclare const whitespaceChars: {\n readonly \" \": 1;\n readonly \"\\n\": 1;\n readonly \"\\t\": 1;\n};\ntype WhitespaceChar = keyof typeof whitespaceChars;\ntype trim = trimEnd>;\ntype trimStart = s extends `${WhitespaceChar}${infer tail}` ? trimEnd : s;\ntype trimEnd = s extends `${infer init}${WhitespaceChar}` ? trimEnd : s;\ntype isStringLiteral = [\n t\n] extends [string] ? [\n string\n] extends [t] ? false : Uppercase extends Uppercase> ? Lowercase extends Lowercase> ? true : false : false : false;\ndeclare const emojiToUnicode: (emoji: string) => string;\n\ntype TraitImplementation = , s extends CompositionState = composeTraits<[\n ...traits,\n implementation\n], \"implementation\">, cls extends TraitConstructor = TraitConstructor>(...args: [...traits, implementation & ThisType>]) => cls;\ntype TraitComposition = >(...traits: conform) => TraitConstructor;\ndeclare const hasTrait: (traitClass: Constructor) => (o: unknown) => boolean;\ntype TraitDeclaration = {\n abstractMethods?: object;\n abstractProps?: object;\n abstractStatics?: object;\n dynamicBase?: object;\n};\n/** @ts-ignore required to extend NoopBase */\ndeclare abstract class Trait extends NoopBase {\n abstractMethods: abstractMethods;\n abstractProps: abstractProps;\n abstractStatic: abstractStatics;\n static get [Symbol.hasInstance](): (o: unknown) => boolean;\n traitsOf(): readonly TraitConstructor[];\n}\ndeclare const compose: TraitComposition;\ndeclare const implement: TraitImplementation;\ntype TraitConstructor = statics & (new (...args: params) => Trait<{\n abstractMethods: abstractMethods;\n abstractProps: abstractProps;\n abstractStatics: abstractStatics;\n}> & instance);\ntype CompositionState = {\n validated: array;\n remaining: array;\n params: array;\n kind: TraitCompositionKind;\n implemented: object;\n abstractMethods: object;\n abstractProps: object;\n abstractStatics: object;\n statics: object;\n};\ntype TraitCompositionKind = \"abstract\" | \"implementation\";\ntype composeTraits = _compose<{\n validated: [];\n remaining: traits;\n kind: kind;\n params: [];\n implemented: {};\n abstractMethods: {};\n abstractProps: {};\n abstractStatics: {};\n statics: {};\n}>;\ntype intersectImplementations = {\n [k in keyof l]: k extends keyof r ? l[k] extends (...args: infer lArgs) => infer lReturn ? r[k] extends (...args: infer rArgs) => infer rReturn ? (...args: intersectParameters) => lReturn & rReturn : l[k] & r[k] : l[k] & r[k] : l[k];\n} & Omit;\ntype _compose = s[\"remaining\"] extends (readonly [\n TraitConstructor,\n ...infer tail\n]) ? _compose<{\n validated: [...s[\"validated\"], s[\"remaining\"][0]];\n remaining: tail;\n kind: s[\"kind\"];\n params: intersectParameters;\n implemented: intersectImplementations>;\n statics: intersectImplementations>;\n abstractMethods: intersectImplementations;\n abstractProps: intersectImplementations;\n abstractStatics: intersectImplementations;\n}> : finalizeState;\ntype finalizeState = satisfy;\n statics: show>;\n abstractMethods: show>;\n abstractProps: show>;\n abstractStatics: show>;\n}>;\ntype implementationOf = s[\"abstractMethods\"] & ({} extends s[\"abstractProps\"] ? {} : {\n construct: (...args: s[\"params\"]) => s[\"abstractProps\"];\n}) & ({} extends s[\"abstractStatics\"] ? {} : {\n statics: s[\"abstractStatics\"];\n});\n\nexport { type AndPreserveUnknown, type AppendOptions, type AppendStringifiedKeyFn, type ArkRegistry, type BigintLiteral, type Brand, type BuiltinObjectKind, type BuiltinObjects, Callable, type CallableOptions, CastableBase, type CollapsingList, type ComparisonOptions, type Completion, type Constructor, type DescribeOptions, type Dict, type Digit, type Domain, DynamicBase, DynamicFunction, type EcmascriptObjects, type EmptyObject, type Entry, type ErrorMessage, type ErrorType, type EscapeChar, FileConstructor, type FlatMorph, type Fn, type GlobalName, type GroupableEntry, type GroupedEntry, type GuardablePredicate, Hkt, type InitialRegistryContents, InnerDynamicBase, type IntegerLiteral, InternalArktypeError, type JsTypeOf, type Json, type JsonArray, type JsonObject, type JsonPrimitive, type JsonStructure, type Key, type KeySet, type ListableEntry, type NonNegativeIntegerLiteral, type NonNullishDomain, NoopBase, type NullishDomain, type NumberLiteral, type NumericParseOptions, ParseError, type PartialRecord, type PlatformObjects, type Primitive, type PrimitiveDomain, type PrintableOptions, ReadonlyArray, ReadonlyPath, RegexPatterns, Scanner, type SerializablePrimitive, type SerializationOptions, type SerializedPrimitive, type SerializedPrimitives, type Stringifiable, type StringifyPathFn, type StringifyPathOptions, type Thunk, Trait, type TraitComposition, type TraitCompositionKind, type TraitConstructor, type TraitDeclaration, type TraitImplementation, type TypeGuard, type TypedArrayObjects, type UnknownUnion, type WhitespaceChar, type ZeroWidthSpace, ancestorsOf, anchoredRegex, anchoredSource, type andPreserveUnknown, type anyOrNever, append, appendStringifiedKey, appendUnique, type appendableValue, type arkGet, type arkIndexableOf, type arkKeyOf, arkUtilVersion, type array, arrayEquals, type arrayIndexOf, type autocomplete, brand, builtinConstructors, cached, capitalize, type charsAfterFirst, type charsBeforeLast, compose, type composeTraits, conflatenate, conflatenateAll, type conform, constructorExtends, deanchoredRegex, deanchoredSource, deepClone, defineProperties, type defined, type describe, describeCollapsibleDate, type describeDefaults, type describeDomainOf, type describeObject, type dict, domainDescriptions, domainOf, ecmascriptConstructors, ecmascriptDescriptions, emojiToUnicode, entriesOf, type entryOf, enumValues, envHasCsp, type equals, escapeChar, type evaluate, type exact, type exactEquals, type exactMessageOnError, type extractDefinedKey, type extractKeyed, type filter, type firstChar, flatMorph, type flattenListable, fromEntries, type fromMappedEntries, getBuiltinNameOfConstructor, getDuplicatesOf, getPath, groupBy, type groupableKeyOf, hasDefinedKey, hasDomain, hasKey, hasObjectKind, hasTrait, type headOf, type ifEmptyObjectLiteral, implement, type implementationOf, includes, type inferDomain, inferred, type initOf, initialRegistryContents, type instanceOf, integerLikeMatcher, type intersectArrays, type intersectOverloadReturns, type intersectParameters, type intersectUnion, intersectUniqueLists, invert, isArray, type isDisjoint, isDotAccessible, isEmptyObject, isKeyOf, isNumericString, type isSafelyMappable, type isStringLiteral, isThunk, isWellFormedInteger, isWellFormedNumber, isomorphic, join, jsTypeOfDescriptions, type keyOf, type keySetOf, type keyWithValue, keysOf, type lastChar, type lastIndexOf, type lastOf, lazily, type leftIfEqual, liftArray, type listable, type merge, type mergeExact, type minLengthArray, type mutable, narrow, nearestFloat, noSuggest, type normalizedKeyOf, numberLikeMatcher, type numericStringKeyOf, numericStringMatcher, objectKindDescriptions, objectKindOf, objectKindOrDomainOf, omit, type optionalKeyOf, type overlaps, type overloadOf, type override, type parseInteger, type parseNonNegativeInteger, type parseNumber, type pathToString, pick, platformConstructors, platformDescriptions, print, printable, type promisable, type propValueOf, type propertyDescriptorsOf, type propwiseXor, range, register, registry, type repeat, type require, type requireKeys, type requiredKeyOf, type satisfy, serializePrimitive, shallowClone, type show, snapshot, splitByKeys, spliterate, stringAndSymbolicEntriesOf, stringifyPath, type stringifyUnion, type tailOf, throwError, throwInternalError, throwParseError, type thunkable, type toArkKey, type trim, type trimEnd, type trimStart, tryCatch, tryParseInteger, tryParseNumber, tryParseWellFormedBigint, tryParseWellFormedNumber, type typeToString, typedArrayConstructors, typedArrayDescriptions, type unbrand, uncapitalize, type unionKeyOf, type unionToPropwiseXor, type unionToTuple, unset, type validateExhaustiveKeys, wellFormedIntegerMatcher, wellFormedNumberMatcher, whitespaceChars, type widen, withAlphabetizedKeys, type withJsDoc, type writeInvalidKeysMessage, writeMalformedNumericLiteralMessage, zeroWidthSpace };\n\n}" +export const utilDts = "declare module \"@ark/util\" {\n import * as buffer from 'buffer';\n\ntype Fn = (...args: args) => returns;\ndeclare const cached: (thunk: () => t) => (() => t);\ndeclare const isThunk: (value: value) => value is Extract extends never ? value & Thunk : Extract;\ntype Thunk = () => ret;\ntype thunkable = t | Thunk;\ndeclare const tryCatch: (fn: () => returns, onError?: (e: unknown) => onError) => returns | onError;\ndeclare const DynamicFunction: DynamicFunction;\ntype DynamicFunction = new (...args: ConstructorParameters) => fn & {\n apply(thisArg: null, args: Parameters): ReturnType;\n call(thisArg: null, ...args: Parameters): ReturnType;\n};\ntype CallableOptions = {\n attach?: attachments;\n bind?: object;\n};\n/** @ts-ignore required to cast function type */\ninterface Callable extends fn, attachments {\n}\ndeclare class Callable {\n constructor(fn: fn, ...[opts]: {} extends attachments ? [opts?: CallableOptions] : [opts: CallableOptions]);\n}\ntype GuardablePredicate = ((In: input) => In is narrowed) | ((In: input) => boolean);\ntype TypeGuard = (In: input) => In is narrowed;\n/**\n * Checks if the environment has Content Security Policy (CSP) enabled,\n * preventing JIT-optimized code from being compiled via new Function().\n *\n * @returns `true` if a function created using new Function() can be\n * successfully invoked in the environment, `false` otherwise.\n *\n * The result is cached for subsequent invocations.\n */\ndeclare const envHasCsp: () => boolean;\n\ndeclare const ecmascriptConstructors: {\n Array: ArrayConstructor;\n Boolean: BooleanConstructor;\n Date: DateConstructor;\n Error: ErrorConstructor;\n Function: FunctionConstructor;\n Map: MapConstructor;\n Number: NumberConstructor;\n Promise: PromiseConstructor;\n RegExp: RegExpConstructor;\n Set: SetConstructor;\n String: StringConstructor;\n WeakMap: WeakMapConstructor;\n WeakSet: WeakSetConstructor;\n};\ntype ecmascriptConstructors = typeof ecmascriptConstructors;\ntype EcmascriptObjects = satisfy, {\n Array: Array;\n Boolean: Boolean;\n Date: Date;\n Error: Error;\n Function: Function;\n Map: Map;\n Number: Number;\n RegExp: RegExp;\n Set: Set;\n String: String;\n WeakMap: WeakMap;\n WeakSet: WeakSet;\n Promise: Promise;\n}>;\n/** Node18 */\ndeclare const FileConstructor: typeof buffer.File;\ntype platformConstructors = {\n ArrayBuffer: ArrayBufferConstructor;\n Blob: typeof Blob;\n File: typeof File;\n FormData: typeof FormData;\n Headers: typeof Headers;\n Request: typeof Request;\n Response: typeof Response;\n URL: typeof URL;\n};\ndeclare const platformConstructors: platformConstructors;\ntype PlatformObjects = instantiateConstructors;\ndeclare const typedArrayConstructors: {\n Int8Array: Int8ArrayConstructor;\n Uint8Array: Uint8ArrayConstructor;\n Uint8ClampedArray: Uint8ClampedArrayConstructor;\n Int16Array: Int16ArrayConstructor;\n Uint16Array: Uint16ArrayConstructor;\n Int32Array: Int32ArrayConstructor;\n Uint32Array: Uint32ArrayConstructor;\n Float32Array: Float32ArrayConstructor;\n Float64Array: Float64ArrayConstructor;\n BigInt64Array: BigInt64ArrayConstructor;\n BigUint64Array: BigUint64ArrayConstructor;\n};\ntype typedArrayConstructors = typeof typedArrayConstructors;\ntype TypedArrayObjects = instantiateConstructors;\ndeclare const builtinConstructors: {\n String: StringConstructor;\n Number: NumberConstructor;\n Boolean: BooleanConstructor;\n Int8Array: Int8ArrayConstructor;\n Uint8Array: Uint8ArrayConstructor;\n Uint8ClampedArray: Uint8ClampedArrayConstructor;\n Int16Array: Int16ArrayConstructor;\n Uint16Array: Uint16ArrayConstructor;\n Int32Array: Int32ArrayConstructor;\n Uint32Array: Uint32ArrayConstructor;\n Float32Array: Float32ArrayConstructor;\n Float64Array: Float64ArrayConstructor;\n BigInt64Array: BigInt64ArrayConstructor;\n BigUint64Array: BigUint64ArrayConstructor;\n ArrayBuffer: ArrayBufferConstructor;\n Blob: typeof Blob;\n File: typeof File;\n FormData: typeof FormData;\n Headers: typeof Headers;\n Request: typeof Request;\n Response: typeof Response;\n URL: typeof URL;\n Array: ArrayConstructor;\n Date: DateConstructor;\n Error: ErrorConstructor;\n Function: FunctionConstructor;\n Map: MapConstructor;\n Promise: PromiseConstructor;\n RegExp: RegExpConstructor;\n Set: SetConstructor;\n WeakMap: WeakMapConstructor;\n WeakSet: WeakSetConstructor;\n};\ntype builtinConstructors = typeof builtinConstructors;\ntype BuiltinObjectKind = keyof builtinConstructors;\ntype GlobalName = keyof typeof globalThis;\ntype instantiateConstructors = {\n [k in kind]: k extends GlobalName ? InstanceType<(typeof globalThis)[k]> : `${k}Constructor` extends GlobalName ? InstanceType<(typeof globalThis)[`${k}Constructor`]> : never;\n};\ntype BuiltinObjects = instantiateConstructors;\ntype describeObject = objectKindOf extends string ? [\n opts[\"includeArticles\"]\n] extends [true] ? objectKindDescriptions[objectKindOf] : objectKindOf : [opts[\"includeArticles\"]] extends [true] ? domainDescriptions[\"object\"] : \"object\";\ntype instantiableObjectKind = {\n [kind in keyof builtinConstructors]: data extends (InstanceType) ? kind : never;\n}[keyof builtinConstructors];\ntype objectKindOf = object extends data ? keyof builtinConstructors | undefined : data extends Fn ? \"Function\" : instantiableObjectKind extends never ? undefined : instantiableObjectKind;\ndeclare const objectKindOf: (data: data) => objectKindOf | undefined;\ndeclare const objectKindOrDomainOf: (data: data) => (objectKindOf & {}) | domainOf;\ntype objectKindOrDomainOf = data extends object ? objectKindOf extends undefined ? \"object\" : objectKindOf : domainOf;\ndeclare const hasObjectKind: (data: object, kind: kind) => data is InstanceType;\ndeclare const isArray: (data: unknown) => data is readonly unknown[];\ndeclare const ecmascriptDescriptions: {\n readonly Array: \"an array\";\n readonly Function: \"a function\";\n readonly Date: \"a Date\";\n readonly RegExp: \"a RegExp\";\n readonly Error: \"an Error\";\n readonly Map: \"a Map\";\n readonly Set: \"a Set\";\n readonly String: \"a String object\";\n readonly Number: \"a Number object\";\n readonly Boolean: \"a Boolean object\";\n readonly Promise: \"a Promise\";\n readonly WeakMap: \"a WeakMap\";\n readonly WeakSet: \"a WeakSet\";\n};\ndeclare const platformDescriptions: {\n ArrayBuffer: string;\n Blob: string;\n File: string;\n FormData: string;\n Headers: string;\n Request: string;\n Response: string;\n URL: string;\n};\ndeclare const typedArrayDescriptions: {\n readonly Int8Array: \"an Int8Array\";\n readonly Uint8Array: \"a Uint8Array\";\n readonly Uint8ClampedArray: \"a Uint8ClampedArray\";\n readonly Int16Array: \"an Int16Array\";\n readonly Uint16Array: \"a Uint16Array\";\n readonly Int32Array: \"an Int32Array\";\n readonly Uint32Array: \"a Uint32Array\";\n readonly Float32Array: \"a Float32Array\";\n readonly Float64Array: \"a Float64Array\";\n readonly BigInt64Array: \"a BigInt64Array\";\n readonly BigUint64Array: \"a BigUint64Array\";\n};\n/** Each defaultObjectKind's completion for the phrase \"must be _____\" */\ndeclare const objectKindDescriptions: {\n readonly Int8Array: \"an Int8Array\";\n readonly Uint8Array: \"a Uint8Array\";\n readonly Uint8ClampedArray: \"a Uint8ClampedArray\";\n readonly Int16Array: \"an Int16Array\";\n readonly Uint16Array: \"a Uint16Array\";\n readonly Int32Array: \"an Int32Array\";\n readonly Uint32Array: \"a Uint32Array\";\n readonly Float32Array: \"a Float32Array\";\n readonly Float64Array: \"a Float64Array\";\n readonly BigInt64Array: \"a BigInt64Array\";\n readonly BigUint64Array: \"a BigUint64Array\";\n readonly ArrayBuffer: string;\n readonly Blob: string;\n readonly File: string;\n readonly FormData: string;\n readonly Headers: string;\n readonly Request: string;\n readonly Response: string;\n readonly URL: string;\n readonly Array: \"an array\";\n readonly Function: \"a function\";\n readonly Date: \"a Date\";\n readonly RegExp: \"a RegExp\";\n readonly Error: \"an Error\";\n readonly Map: \"a Map\";\n readonly Set: \"a Set\";\n readonly String: \"a String object\";\n readonly Number: \"a Number object\";\n readonly Boolean: \"a Boolean object\";\n readonly Promise: \"a Promise\";\n readonly WeakMap: \"a WeakMap\";\n readonly WeakSet: \"a WeakSet\";\n};\ntype objectKindDescriptions = typeof objectKindDescriptions;\n/**\n * this will only return an object kind if it's the root constructor\n * example TypeError would return null not 'Error'\n **/\ndeclare const getBuiltinNameOfConstructor: (ctor: Function) => BuiltinObjectKind | null;\ntype Constructor = abstract new (...args: never[]) => instance;\ntype instanceOf = constructor extends Constructor ? instance : never;\n/**\n * Returns an array of constructors for all ancestors (i.e., prototypes) of a given object.\n */\ndeclare const ancestorsOf: (o: object) => Function[];\ntype normalizedKeyOf = keyof t extends infer k ? k extends number ? `${k}` : k : never;\ndeclare const constructorExtends: (ctor: Constructor, base: Constructor) => boolean;\n\ntype stringifyUnion = join, delimiter>;\ntype unionToTuple = _unionToTuple extends infer result ? conform : never;\ntype _unionToTuple = getLastBranch extends infer current ? [\n t\n] extends [never] ? result : _unionToTuple, [current, ...result]> : never;\ntype getLastBranch = intersectUnion void : never> extends ((x: infer branch) => void) ? branch : never;\ntype intersectUnion = (t extends unknown ? (_: t) => void : never) extends ((_: infer intersection) => void) ? intersection : never;\ntype intersectOverloadReturns = intersectUnion>>;\ntype overloadOf = Exclude never) & fn, givenArgs, unknown>, fn extends () => never ? never : () => never>;\ntype collectSignatures = result & fn extends (...args: infer args) => infer returns ? result extends fn ? never : collectSignatures & result & ((...args: args) => returns)> | (args extends givenArgs ? (...args: args) => returns : never) : never;\n\ntype DescribeOptions = {\n includeArticles?: boolean;\n branchDelimiter?: string;\n};\ntype typeToString = stringifyUnion<[\n t\n] extends [anyOrNever] ? unknown extends t ? \"any\" : \"never\" : unknown extends t ? \"unknown\" : boolean extends t ? \"boolean\" | ([t] extends [boolean] ? never : typeToString, opts>) : t extends array ? arrayTypeToString : t extends object ? describeObject : t extends Stringifiable ? stringifiableToString : describeDomainOf, opts[\"branchDelimiter\"] extends string ? opts[\"branchDelimiter\"] : describeDefaults[\"branchDelimiter\"]>;\ntype stringifiableToString = inferDomain> extends t ? describeDomainOf : `${t}`;\ntype describe = typeToString;\ntype arrayTypeToString = typeToString extends infer element extends string ? opts[\"includeArticles\"] extends true ? describeArrayOf : includesDelimiter extends true ? `(${element})[]` : `${element}[]` : never;\ntype describeArrayOf = element extends \"unknown\" ? \"an array\" : `an array of ${element}`;\ntype includesDelimiter = s extends (`${string}${opts[\"branchDelimiter\"] extends string ? opts[\"branchDelimiter\"] : describeDefaults[\"branchDelimiter\"]}${string}`) ? true : false;\ntype describeDefaults = satisfy, {\n includeArticles: false;\n branchDelimiter: \" | \";\n}>;\n\ntype JsTypeOf = \"object\" | \"function\" | \"number\" | \"bigint\" | \"boolean\" | \"string\" | \"symbol\" | \"undefined\" | \"null\";\ndeclare const hasDomain: (data: data, kind: domain) => data is data & inferDomain;\ntype TypesByDomain = {\n bigint: bigint;\n boolean: boolean;\n number: number;\n object: object;\n string: string;\n symbol: symbol;\n undefined: undefined;\n null: null;\n};\ntype inferDomain = Domain extends kind ? unknown : TypesByDomain[kind];\ntype Domain = show;\ntype NullishDomain = \"undefined\" | \"null\";\ntype NonNullishDomain = Exclude;\ntype PrimitiveDomain = Exclude;\ntype Primitive = inferDomain;\ntype domainOf = unknown extends data ? Domain : data extends object ? \"object\" : data extends string ? \"string\" : data extends number ? \"number\" : data extends boolean ? \"boolean\" : data extends undefined ? \"undefined\" : data extends null ? \"null\" : data extends bigint ? \"bigint\" : data extends symbol ? \"symbol\" : never;\ndeclare const domainOf: (data: data) => domainOf;\ndeclare const jsTypeOfDescriptions: {\n readonly function: \"a function\";\n readonly boolean: \"boolean\";\n readonly null: \"null\";\n readonly undefined: \"undefined\";\n readonly bigint: \"a bigint\";\n readonly number: \"a number\";\n readonly object: \"an object\";\n readonly string: \"a string\";\n readonly symbol: \"a symbol\";\n};\n/** Each domain's completion for the phrase \"must be _____\" */\ndeclare const domainDescriptions: {\n readonly boolean: \"boolean\";\n readonly null: \"null\";\n readonly undefined: \"undefined\";\n readonly bigint: \"a bigint\";\n readonly number: \"a number\";\n readonly object: \"an object\";\n readonly string: \"a string\";\n readonly symbol: \"a symbol\";\n};\ntype domainDescriptions = typeof domainDescriptions;\ntype describeDomainOf = stringifyUnion] : domainOf, opts[\"branchDelimiter\"] extends string ? opts[\"branchDelimiter\"] : describeDefaults[\"branchDelimiter\"]>;\n\ndeclare class InternalArktypeError extends Error {\n}\ndeclare const throwInternalError: (message: string) => never;\ndeclare const throwError: (message: string, ctor?: new (message: string) => Error) => never;\ndeclare class ParseError extends Error {\n readonly name = \"ParseError\";\n}\ndeclare const throwParseError: (message: string) => never;\n/**\n * TypeScript won't suggest strings beginning with a space as properties.\n * Useful for symbol-like string properties.\n */\ndeclare const noSuggest: (s: s) => noSuggest;\n/**\n * TypeScript won't suggest strings beginning with a space as properties.\n * Useful for symbol-like string properties.\n */\ntype noSuggest = ` ${s}`;\n/** \"Hair Space\" character, used as a non-rendered sentinel for an error message string:\n * https://www.compart.com/en/unicode/U+200A\n */\ndeclare const zeroWidthSpace = \"\\u200A\";\n/** \"Hair Space\" character, used as a non-rendered sentinel for an error message string:\n * https://www.compart.com/en/unicode/U+200A\n */\ntype ZeroWidthSpace = typeof zeroWidthSpace;\ntype ErrorMessage = `${message}${ZeroWidthSpace}`;\ninterface ErrorType {\n [brand]: \"ErrorType\";\n message: message;\n ctx: ctx;\n}\ntype Completion = `${text}${ZeroWidthSpace}${ZeroWidthSpace}`;\n\ntype Stringifiable = string | boolean | number | bigint | null | undefined;\n/** Force an operation like `{ a: 0 } & { b: 1 }` to be computed so that it displays `{ a: 0; b: 1 }`. */\ntype show = {\n [k in keyof t]: t[k];\n} & unknown;\n/** @deprecated use \"show\" instead */\ntype evaluate = {\n [k in keyof t]: t[k];\n} & unknown;\ntype exact = {\n [k in keyof t]: k extends keyof u ? conform : never;\n};\ntype exactMessageOnError = {\n [k in keyof t]: k extends keyof u ? conform : ErrorMessage<`'${k & string}' is not a valid key`>;\n} & u;\ntype promisable = t | Promise;\ntype leftIfEqual = [l, r] extends [r, l] ? l : r;\ntype UnknownUnion = string | number | symbol | bigint | boolean | object | null | undefined;\n/**\n * Interesection (`&`) that avoids evaluating `unknown` to `{}`\n */\ntype andPreserveUnknown = unknown extends l & r ? unknown : show;\n/** Can be used to test for the universal subtypes, `any` and `never`, e.g.:\n *\n * ```ts\n * type isAnyOrNever = [t] extends [anyOrNever] ? true : false\n * ```\n *\n * The actual value is a string literal, but the only realistic subtypes\n * of that literal are `any` and `never`.\n */\ntype anyOrNever = \" anyOrNever\";\ntype conform = t extends base ? t : base;\ntype equals = [l, r] extends [r, l] ? true : false;\ntype exactEquals = (<_>() => _ extends l ? 1 : 2) extends <_>() => _ extends r ? 1 : 2 ? true : false;\ndeclare const brand: \" brand\";\ntype Brand = t & {\n readonly [brand]: [t, id];\n};\ntype unbrand = t extends Brand ? base : never;\ntype satisfy = t;\ntype defined = t & ({} | null);\ntype autocomplete = suggestions | (string & {});\ntype widen = collectWidenedType>;\ntype collectWidenedType = remaining extends [infer head, ...infer tail] ? collectWidenedType : result;\ntype narrowTuple = t extends readonly [infer head, ...infer tail] ? readonly [head, ...narrowTuple] : [];\ntype narrow = t extends Primitive ? t : t extends readonly unknown[] ? narrowTuple : {\n [k in keyof t]: narrow;\n};\ndeclare const narrow: (t: narrow) => t;\n/** primitive key used to represent an inferred type at compile-time */\ndeclare const inferred: \" arkInferred\";\n/** primitive key used to represent an inferred type at compile-time */\ntype inferred = typeof inferred;\n\ndeclare const args: \" args\";\ntype args = typeof args;\ndeclare abstract class Hkt {\n [args]: unknown[];\n constraints: constraints;\n args: this[args] extends infer args extends unknown[] ? args : never;\n 0: this[args] extends [infer arg, ...any] ? arg : never;\n 1: this[args] extends [any, infer arg, ...any] ? arg : never;\n 2: this[args] extends [any, any, infer arg, ...any] ? arg : never;\n 3: this[args] extends [any, any, any, infer arg, ...any] ? arg : never;\n abstract body: unknown;\n description?: string;\n constructor();\n}\n/** A small set of HKT utility types based on https://github.com/gvergnaud/hotscript\n * See https://github.com/gvergnaud/hotscript/blob/main/src/internals/core/Core.ts\n */\ndeclare namespace Hkt {\n type constructor = new () => Hkt;\n type args = typeof args;\n type apply = (hkt & {\n [args]: args;\n })[\"body\"];\n}\n\ntype Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;\ntype NumberLiteral = `${n}`;\ntype BigintLiteral = `${n}n`;\ntype IntegerLiteral = `${n}`;\ntype NonNegativeIntegerLiteral = `${Digit}` | (`${Exclude}${string}` & `${n}`);\n/**\n * Matches a well-formatted numeric expression according to the following rules:\n * 1. Must include an integer portion (i.e. '.321' must be written as '0.321')\n * 2. The first digit of the value must not be 0, unless the entire integer portion is 0\n * 3. If the value includes a decimal, its last digit may not be 0\n * 4. The value may not be \"-0\"\n */\ndeclare const wellFormedNumberMatcher: RegExp;\ndeclare const isWellFormedNumber: RegExp[\"test\"];\n/**\n * Similar to wellFormedNumber but more permissive in the following ways:\n *\n * - Allows numbers without an integer portion like \".5\" (well-formed equivalent is \"0.5\")\n * - Allows decimals with trailing zeroes like \"0.10\" (well-formed equivalent is \"0.1\")\n */\ndeclare const numericStringMatcher: RegExp;\ndeclare const isNumericString: (string: string) => boolean;\ndeclare const numberLikeMatcher: RegExp;\n/**\n * Matches a well-formatted integer according to the following rules:\n * 1. must begin with an integer, the first digit of which cannot be 0 unless the entire value is 0\n * 2. The value may not be \"-0\"\n */\ndeclare const wellFormedIntegerMatcher: RegExp;\ndeclare const isWellFormedInteger: RegExp[\"test\"];\ndeclare const integerLikeMatcher: RegExp;\ntype NumericLiteralKind = \"number\" | \"bigint\" | \"integer\";\ndeclare const numericLiteralDescriptions: {\n readonly number: \"a number\";\n readonly bigint: \"a bigint\";\n readonly integer: \"an integer\";\n};\ntype numericLiteralDescriptions = typeof numericLiteralDescriptions;\ntype writeMalformedNumericLiteralMessage = `'${def}' was parsed as ${numericLiteralDescriptions[kind]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`;\ndeclare const writeMalformedNumericLiteralMessage: (def: def, kind: kind) => writeMalformedNumericLiteralMessage;\ndeclare const tryParseWellFormedNumber: typeof tryParseNumber;\ndeclare const tryParseNumber: (token: string, options?: NumericParseOptions) => errorOnFail extends true | string ? number : number | undefined;\ntype tryParseNumber = token extends `${infer n extends number}` ? number extends n ? writeMalformedNumericLiteralMessage : n : messageOnFail;\ntype parseNumber = token extends `${infer n extends number}` ? n : never;\ndeclare const tryParseInteger: (token: string, options?: NumericParseOptions) => errorOnFail extends true | string ? number : number | undefined;\ntype tryParseInteger = token extends `${infer b extends bigint}` ? bigint extends b ? writeMalformedNumericLiteralMessage : token extends `${infer n extends number}` ? n : never : messageOnFail;\ntype parseInteger = token extends `${bigint}` ? token extends `${infer n extends number}` ? n : never : never;\ntype parseNonNegativeInteger = token extends `-${string}` ? never : parseInteger;\ntype NumericParseOptions = {\n errorOnFail?: errorOnFail;\n strict?: boolean;\n};\ndeclare const tryParseWellFormedBigint: (def: string) => bigint | undefined;\n/**\n * Returns the next or previous representable floating-point number after the given input.\n *\n * @param {\"+\" | \"-\"} [direction=\"+\"] - The direction to find the nearest float. \"+\" for the next float, \"-\" for the previous float.\n * @throws {Error} If the input is not a finite number.\n *\n * @example\n * console.log(nearestFloat(0)); // Smallest positive number\n * console.log(nearestFloat(2)); // 2.0000000000000004\n * console.log(nearestFloat(2.1)); // 2.1000000000000005\n * console.log(nearestFloat(2, \"-\")); // 1.9999999999999998\n * console.log(nearestFloat(2.1, \"-\")); // 2.0999999999999996\n * // as size of input increases, the increments become larger to stay within what\n * // JS can represent in a numeric value\n * console.log(nearestFloat(5555555555555555)); // 5555555555555556\n * console.log(nearestFloat(5555555555555555, \"-\")); // 5555555555555554\n */\ndeclare const nearestFloat: (n: number, direction?: \"+\" | \"-\") => number;\n\ntype Key = string | symbol;\ntype toArkKey = k extends number ? [\n o,\n number\n] extends [array, k] ? NonNegativeIntegerLiteral : `${k}` : k;\ntype arkIndexableOf = arkKeyOf extends infer k ? k extends `${infer index extends number}` ? index | k : k : never;\ntype arkKeyOf = [\n o\n] extends [object] ? [\n o\n] extends [array] ? arkArrayKeyOf : arkObjectLiteralKeyOf : never;\ntype arkArrayKeyOf = number extends a[\"length\"] ? NonNegativeIntegerLiteral : keyof a extends infer i ? i extends `${number}` ? i : never : never;\ntype arkObjectLiteralKeyOf = keyof o extends infer k ? k extends number ? `${k}` : k : never;\ntype arkGet> = o[k extends keyof o ? k : NonNegativeIntegerLiteral extends k ? number & keyof o : k extends number ? `${k}` & keyof o : never];\ntype writeInvalidKeysMessage> = `Key${keys[\"length\"] extends 1 ? \"\" : \"s\"} ${join} ${keys[\"length\"] extends 1 ? \"does\" : \"do\"} not exist on ${o}`;\n\ntype Dict = {\n readonly [_ in k]: v;\n};\ntype dict = {\n [_ in k]: v;\n};\n/** Either:\n * A, with all properties of B undefined\n * OR\n * B, with all properties of A undefined\n **/\ntype propwiseXor = show | show;\ntype unionToPropwiseXor> = props extends infer distributed ? show : never;\ntype requireKeys = o & {\n [requiredKey in key]-?: defined;\n};\ntype require = _require;\ntype _require = depth[\"length\"] extends maxDepth ? o : o extends object ? o extends Fn ? o : {\n [k in keyof o]-?: _require;\n} : o;\ntype PartialRecord = {\n [_ in k]?: v;\n};\n/** Returns true if a type can be homomorphically mapped without losing information.\n * Useful for avoiding e.g. classes with private properties while mapping.\n */\ntype isSafelyMappable = {\n [k in keyof t]: t[k];\n} extends t ? true : false;\ntype KeySet = {\n readonly [_ in key]?: 1;\n};\ntype keySetOf = KeySet>;\ntype mutable = _mutable;\ntype _mutable = depth[\"length\"] extends maxDepth ? o : o extends Primitive ? o : o extends Fn ? o : {\n -readonly [k in keyof o]: _mutable;\n};\n/**\n * extracts entries mimicking Object.entries, accounting for whether the\n * object is an array\n **/\ntype entryOf = {\n [k in keyof o]-?: [k, o[k] & ({} | null)];\n}[o extends readonly unknown[] ? keyof o & number : keyof o] & unknown;\ntype entriesOf = entryOf[];\n/**\n * Object.entries wrapper providing narrowed types for objects with known sets\n * of keys, e.g. those defined internally as configs\n */\ndeclare const entriesOf: (o: o) => entryOf[];\ntype Entry = readonly [key: key, value: value];\ntype fromEntries = show<{\n [entry in entries[number] as entry[0]]: entry[1];\n}>;\ndeclare const fromEntries: (entries: entries) => fromEntries;\n/** Mimics the result of Object.keys(...) */\ntype keyOf = o extends array ? number extends o[\"length\"] ? `${number}` : keyof o & `${number}` : keyof o extends infer k ? k extends string ? k : k extends number ? `${k}` : never : never;\ndeclare const keysOf: (o: o) => keyOf[];\ndeclare const isKeyOf: (k: k, o: o) => k is Extract;\n/** Coalesce keys that exist on one or more branches of a union */\ntype unionKeyOf = t extends unknown ? keyof t : never;\ntype extractKeyed> = Extract;\ndeclare const hasKey: >(o: o, k: k) => o is extractKeyed;\ntype extractDefinedKey> = show & {\n [_ in k]: {} | null;\n}>;\ndeclare const hasDefinedKey: >(o: o, k: k) => o is extractDefinedKey;\ntype requiredKeyOf = keyof o extends infer k ? k extends keyof o ? o extends {\n [_ in k]-?: o[k];\n} ? k : never : never : never;\ntype optionalKeyOf = Exclude>;\ntype merge = base extends unknown ? props extends unknown ? show & props> : never : never;\ntype mergeExact = base extends unknown ? props extends unknown ? show & props> : never : never;\ntype omitMerged = {\n [k in keyof base as excludeExactKeyOf]: base[k];\n};\ntype excludeExactKeyOf = Exclude>;\ntype extractExactKeyOf = keyof {\n [k in keyof base as [key, k] extends [k, key] ? key : never]: 1;\n};\ntype override = merge;\ntype propValueOf = o[keyof o];\ndeclare const InnerDynamicBase: new (base: t) => t;\n/** @ts-ignore (needed to extend `t`) **/\ninterface DynamicBase extends t {\n}\ndeclare class DynamicBase {\n constructor(properties: t);\n}\ndeclare const NoopBase: new () => t;\n/** @ts-ignore (needed to extend `t`) **/\ndeclare class CastableBase extends NoopBase {\n}\ndeclare const splitByKeys: >(o: o, leftKeys: leftKeys) => [show>, show>];\n/** Homomorphic implementation of the builtin Pick.\n *\n * Gives different results for certain union expressions like the following:\n *\n * @example\n * // flattens result to { a?: 1 | 2; b?: 1 | 2 }\n * type PickResult = Pick<{ a: 1; b?: 1 } | { a?: 2; b: 2 }, \"a\" | \"b\">\n *\n * @example\n * // preserves original type w/ modifier groupings\n * type pickResult = pick<{ a: 1; b?: 1 } | { a?: 2; b: 2 }, \"a\" | \"b\">\n */\ntype pick = o extends unknown ? {\n [k in keyof o as k extends key ? k : never]: o[k];\n} : never;\ndeclare const pick: >(o: o, keys: keys) => pick;\n/** Homomorphic implementation of the builtin Omit.\n *\n * Gives different results for many union expressions like the following:\n *\n * @example\n * // {}\n * type OmitResult = Omit<{ a: 1 } | { b: 2 }, never>\n *\n * @example\n * // preserves original type w/ modifier groupings\n * type omitResult = omit<{ a: 1 } | { b: 2 }, never>\n */\ntype omit = {\n [k in keyof o as k extends key ? never : k]: o[k];\n};\ndeclare const omit: >(o: o, keys: keys) => omit;\n/** Returns onTrue if the type is exactly `{}` and onFalse otherwise*/\ntype ifEmptyObjectLiteral = [\n unknown,\n t & (null | undefined)\n] extends [t | null | undefined, never] ? onTrue : onFalse;\ntype EmptyObject = Record;\ndeclare const isEmptyObject: (o: object) => o is EmptyObject;\ndeclare const stringAndSymbolicEntriesOf: (o: object) => Entry[];\n/** Like Object.assign, but it will preserve getters instead of evaluating them. */\ndeclare const defineProperties: (base: base, merged: merged) => merge;\n/** Copies enumerable keys of o to a new object in alphabetical order */\ndeclare const withAlphabetizedKeys: (o: o) => o;\ntype invert> = {\n [k in t[keyof t]]: {\n [k2 in keyof t]: t[k2] extends k ? k2 : never;\n }[keyof t];\n} & unknown;\ndeclare const invert: >(t: t) => invert;\ndeclare const unset: \" represents an uninitialized value\";\ntype unset = typeof unset;\n/**\n * For each keyof o that also exists on jsDocSource, add associated JsDoc annotations to o.\n * Does not preserve modifiers on o like optionality.\n */\ntype withJsDoc = show : Pick<_withJsDoc, keyof o & keyof jsDocSource> : Pick<_withJsDoc, keyof o & keyof jsDocSource> & {\n [k in Exclude]: o[k];\n}>;\ntype _withJsDoc = {\n [k in keyof jsDocSource]-?: o[k & keyof o];\n};\ntype propertyDescriptorsOf = {\n [k in keyof o]: TypedPropertyDescriptor;\n};\ntype keyWithValue = keyof t extends infer k ? k extends keyof t ? t[k] extends constraint ? k : never : never : never;\ndeclare const enumValues: (tsEnum: tsEnum) => tsEnum[keyof tsEnum][];\n\ninterface AndPreserveUnknown extends Hkt<[unknown, unknown]> {\n body: andPreserveUnknown;\n}\ntype SequenceIntersectionKind = \"array\" | \"parameters\";\ntype intersectArrays = intersectSequences;\ntype intersectParameters = intersectSequences;\ntype intersectSequences = l extends readonly [] ? kind extends \"array\" ? [\n] extends r ? [\n ...acc,\n ...postfix\n] : never : [...acc, ...r, ...postfix] : r extends readonly [] ? kind extends \"array\" ? [\n] extends l ? [\n ...acc,\n ...postfix\n] : never : [...acc, ...l, ...postfix] : [\n l,\n r\n] extends ([\n readonly [(infer lHead)?, ...infer lTail],\n readonly [(infer rHead)?, ...infer rTail]\n]) ? [\n \"0\",\n lHead,\n rHead\n] extends [keyof l | keyof r, l[0], r[0]] ? intersectSequences?\n] : [...acc, Hkt.apply], postfix, operation, kind> : l extends readonly [...infer lInit, infer lLast] ? r extends readonly [...infer rInit, infer rLast] ? intersectSequences,\n ...postfix\n], operation, kind> : intersectSequences,\n ...postfix\n], operation, kind> : r extends readonly [...infer rInit, infer rLast] ? intersectSequences,\n ...postfix\n], operation, kind> : [...acc, ...Hkt.apply[], ...postfix] : never;\ntype isDisjoint = overlaps extends true ? false : true;\ntype overlaps = l & r extends never ? false : domainOf & domainOf extends never ? false : [l, r] extends [object, object] ? false extends (propValueOf<{\n [k in Extract | requiredKeyOf>]: overlaps;\n}>) ? false : true : true;\n\ntype DuplicateData = {\n element: val;\n indices: number[];\n};\n/**\n * Extracts duplicated elements and their indices from an array, returning them.\n *\n * Note that given `a === b && b === c`, then `c === a` must be `true` for this to give accurate results.\n *\n * @param arr The array to extract duplicate elements from.\n */ declare const getDuplicatesOf: (arr: arr, opts?: ComparisonOptions) => DuplicateData[];\ntype pathToString = segments extends [] ? \"/\" : join;\ndeclare const join: , delimiter extends string>(segments: segments, delimiter: delimiter) => join;\ntype join, delimiter extends string, result extends string = \"\"> = segments extends (readonly [infer head extends string, ...infer tail extends string[]]) ? join : result;\ndeclare const getPath: (root: unknown, path: string[]) => unknown;\ndeclare const intersectUniqueLists: (l: readonly item[], r: readonly item[]) => item[];\ntype filter = t extends readonly [infer head, ...infer tail] ? filter : result;\ntype array = readonly t[];\ntype listable = t | readonly t[];\ntype flattenListable = t extends array ? element : t;\ntype minLengthArray = readonly [\n ...repeat<[t], minLength>,\n ...t[]\n];\ntype repeat = _repeat;\ntype _repeat = depth[\"length\"] extends maxDepth ? result : _repeat;\ntype CollapsingList = readonly [] | t | readonly [t, t, ...t[]];\ntype headOf = t[0];\ntype tailOf = t extends readonly [unknown, ...infer tail] ? tail : never;\ntype lastIndexOf = tailOf[\"length\"];\ntype lastOf = t[lastIndexOf];\ntype initOf = t extends readonly [...infer init, unknown] ? init : never;\ntype numericStringKeyOf = Extract;\ntype arrayIndexOf = keyof a extends infer k ? parseNonNegativeInteger : never;\ntype liftArray = t extends array ? [\n t\n] extends [anyOrNever] ? t[] : t : t[];\ndeclare const liftArray: (data: t) => liftArray;\n/**\n * Splits an array into two arrays based on the result of a predicate\n *\n * @param predicate - The guard function used to determine which items to include.\n * @returns A tuple containing two arrays:\n * \t\t\t\t- the first includes items for which `predicate` returns true\n * \t\t\t\t- the second includes items for which `predicate` returns false\n *\n * @example\n * const list = [1, \"2\", \"3\", 4, 5];\n * const [numbers, strings] = spliterate(list, (x) => typeof x === \"number\");\n * // Type: number[]\n * // Output: [1, 4, 5]\n * console.log(evens);\n * // Type: string[]\n * // Output: [\"2\", \"3\"]\n * console.log(odds);\n */\ndeclare const spliterate: (arr: readonly item[], predicate: GuardablePredicate) => [included: included[], excluded: [item] extends [included] ? item[] : Exclude[]];\ndeclare const ReadonlyArray: new (...args: ConstructorParameters>) => ReadonlyArray;\ndeclare const includes: (array: a, element: unknown) => element is a[number];\ndeclare const range: (length: number, offset?: number) => number[];\ntype AppendOptions = {\n /** If true, adds the element to the beginning of the array instead of the end */\n prepend?: boolean;\n};\n/**\n * Adds a value or array to an array, returning the concatenated result\n */\ndeclare const append: >(to: to, value: value, opts?: AppendOptions) => to & {};\ntype appendableValue = to extends array ? element extends array ? array : listable : never;\n/**\n * Concatenates an element or list with a readonly list\n */\ndeclare const conflatenate: (to: readonly element[] | undefined | null, elementOrList: appendableValue | undefined | null) => readonly element[];\n/**\n * Concatenates a variadic list of elements or lists with a readonly list\n */\ndeclare const conflatenateAll: (...elementsOrLists: (listable | undefined | null)[]) => readonly element[];\ninterface ComparisonOptions {\n isEqual?: (l: t, r: t) => boolean;\n}\n/**\n * Appends a value or concatenates an array to an array if it is not already included, returning the array\n */\ndeclare const appendUnique: (to: to | undefined, value: NoInfer | to[number]>, opts?: ComparisonOptions) => to;\ntype groupableKeyOf = keyof o extends infer k ? k extends keyof o ? o[k] extends PropertyKey ? k : never : never : never;\ntype groupBy> = {\n [k in element[discriminant] & PropertyKey]?: (element extends unknown ? isDisjoint extends true ? never : element : never)[];\n} & unknown;\ndeclare const groupBy: >(array: readonly element[], discriminant: discriminant) => groupBy;\ndeclare const arrayEquals: (l: array, r: array, opts?: ComparisonOptions) => boolean;\ntype validateExhaustiveKeys = keys extends readonly [infer head, ...infer tail extends PropertyKey[]] ? readonly [\n conform,\n ...validateExhaustiveKeys>\n] : [expectedKey] extends [never] ? [] : [expectedKey];\n\n/** Shallowly copy the properties of the object. */\ndeclare const shallowClone: (input: input) => input;\n/** Deeply copy the properties of the a non-subclassed Object, Array or Date.*/\ndeclare const deepClone: (input: input) => input;\n\ntype objectFromListableEntries = show>>;\ntype fromGroupableEntries = {\n [entry in entries[number] as entry extends GroupedEntry ? entry[0][\"group\"] : conform]: entry extends GroupedEntry ? entry[1][] : entry[1];\n};\ntype arrayFromListableEntries = Entry extends transformed ? transformed[1][] : _arrayFromListableEntries;\ntype _arrayFromListableEntries = [\n transformed\n] extends [never] ? result : Extract> extends (infer next extends Entry) ? Exclude extends infer remaining extends Entry ? [\n transformed\n] extends [remaining] ? [\n ...result,\n ...transformed[1][]\n] : _arrayFromListableEntries : never : [...result, ...transformed[1][]];\ntype extractEntrySets> = e extends readonly GroupableEntry[] ? e : [e];\ntype extractEntries> = e extends readonly Entry[] ? e[number] : e;\ntype entryArgsWithIndex = {\n [k in keyof o]-?: [k: k, v: Exclude, i: number];\n}[keyof o];\ntype numericArrayEntry = number extends a[\"length\"] ? [number, a[number]] : {\n [i in keyof a]: i extends `${infer n extends number}` ? [n, a[i]] : never;\n}[number];\ntype GroupedEntry = readonly [key: {\n group: Key;\n}, value: unknown];\ntype GroupableEntry = Entry | Entry | GroupedEntry;\ntype ListableEntry = listable;\ntype fromMappedEntries = [\n transformed\n] extends [listable>] ? arrayFromListableEntries> : objectFromListableEntries>;\ntype FlatMorph = {\n (o: o, flatMapEntry: (...args: numericArrayEntry) => transformed): fromMappedEntries;\n (o: o, flatMapEntry: (...args: entryOf) => transformed): fromMappedEntries;\n (o: o, flatMapEntry: (...args: entryArgsWithIndex) => transformed): fromMappedEntries;\n};\ndeclare const flatMorph: FlatMorph;\n\ndeclare const isomorphic: {\n fileName: () => string;\n env: Record, string | undefined>;\n};\n\ndeclare const lazily: (thunk: () => t) => t;\n\ntype SerializationOptions = {\n onCycle?: (value: object) => string;\n onSymbol?: (value: symbol) => string;\n onFunction?: (value: Function) => string;\n onUndefined?: string;\n onBigInt?: (value: bigint) => string;\n};\ntype JsonStructure = JsonObject | JsonArray;\ninterface JsonObject {\n [k: string]: Json;\n}\ntype JsonArray = Json[];\ntype JsonPrimitive = string | boolean | number | null;\ntype Json = JsonStructure | JsonPrimitive;\ndeclare const snapshot: (data: t, opts?: SerializationOptions) => snapshot;\ntype snapshot = unknown extends t ? unknown : t extends Primitive ? snapshotPrimitive : t extends {\n toJSON: () => infer serialized;\n} ? serialized : t extends Function ? `Function(${string})` : t extends Date ? string : depth[\"length\"] extends 10 ? unknown : t extends array ? array> : {\n [k in keyof t as snapshotPrimitive]: snapshot;\n};\ntype snapshotPrimitive = t extends symbol ? `Symbol(${string})` : t;\ntype PrintableOptions = {\n indent?: number;\n quoteKeys?: boolean;\n};\ndeclare const print: (data: unknown, opts?: PrintableOptions) => void;\ndeclare const printable: (data: unknown, opts?: PrintableOptions) => string;\n/**\n * Converts a Date instance to a human-readable description relative to its precision\n */\ndeclare const describeCollapsibleDate: (date: Date) => string;\n\ntype StringifyPathOptions = requireKeys<{\n stringifySymbol?: (s: symbol) => string;\n stringifyNonKey?: (o: Exclude) => string;\n}, stringifiable extends PropertyKey ? never : \"stringifyNonKey\">;\ntype StringifyPathFn = (path: array, ...[opts]: [stringifiable] extends [PropertyKey] ? [\n opts?: StringifyPathOptions\n] : NoInfer<[opts: StringifyPathOptions]>) => string;\ntype AppendStringifiedKeyFn = (path: string, prop: stringifiable, ...[opts]: [stringifiable] extends [PropertyKey] ? [\n opts?: StringifyPathOptions\n] : NoInfer<[opts: StringifyPathOptions]>) => string;\ndeclare const appendStringifiedKey: AppendStringifiedKeyFn;\ndeclare const stringifyPath: StringifyPathFn;\ndeclare class ReadonlyPath extends ReadonlyArray {\n private cache;\n constructor(...items: array);\n toJSON(): JsonArray;\n stringify(): string;\n stringifyAncestors(): readonly string[];\n}\n\ntype SerializedString = `\"${value}\"`;\ntype SerializedPrimitives = {\n string: SerializedString;\n number: `${number}`;\n bigint: BigintLiteral;\n boolean: \"true\" | \"false\";\n null: \"null\";\n undefined: \"undefined\";\n};\ntype SerializedPrimitive = SerializedPrimitives[keyof SerializedPrimitives];\ntype SerializablePrimitive = inferDomain;\ndeclare const serializePrimitive: (value: value) => serializePrimitive;\ntype serializePrimitive = value extends string ? `\"${value}\"` : value extends bigint ? `${value}n` : `${value}`;\n\ndeclare const arkUtilVersion = \"0.46.0\";\ndeclare const initialRegistryContents: {\n version: string;\n filename: string;\n FileConstructor: typeof buffer.File;\n};\ntype InitialRegistryContents = typeof initialRegistryContents;\ninterface ArkRegistry extends InitialRegistryContents {\n [k: string]: unknown;\n}\ndeclare const registry: ArkRegistry;\ndeclare global {\n export interface ArkEnv {\n prototypes(): never;\n }\n export namespace ArkEnv {\n type prototypes = ReturnType;\n }\n}\ndeclare const register: (value: object | symbol) => string;\ndeclare const isDotAccessible: (keyName: string) => boolean;\n\ndeclare class Scanner {\n chars: string[];\n i: number;\n def: string;\n constructor(def: string);\n /** Get lookahead and advance scanner by one */\n shift(): this[\"lookahead\"];\n get lookahead(): lookahead;\n get nextLookahead(): string;\n get length(): number;\n shiftUntil(condition: Scanner.UntilCondition): string;\n shiftUntilLookahead(charOrSet: string | KeySet): string;\n shiftUntilNonWhitespace(): string;\n jumpToIndex(i: number): void;\n jumpForward(count: number): void;\n get location(): number;\n get unscanned(): string;\n get scanned(): string;\n sliceChars(start: number, end?: number): string;\n lookaheadIs(char: char): this is Scanner;\n lookaheadIsIn(tokens: keySet): this is Scanner>;\n}\ndeclare namespace Scanner {\n type UntilCondition = (scanner: Scanner, shifted: string) => boolean;\n}\n\ndeclare const capitalize: (s: s) => Capitalize;\ndeclare const uncapitalize: (s: s) => Uncapitalize;\ntype firstChar = s extends `${infer head}${string}` ? head : \"\";\ntype charsAfterFirst = s extends `${string}${infer tail}` ? tail : \"\";\ntype lastChar = s extends `${infer head}${infer tail}` ? tail extends \"\" ? head : lastChar : s;\ntype charsBeforeLast = s extends `${infer head}${infer tail}` ? tail extends \"\" ? \"\" : `${head}${charsBeforeLast}` : \"\";\ndeclare const anchoredRegex: (regex: RegExp | string) => RegExp;\ndeclare const deanchoredRegex: (regex: RegExp | string) => RegExp;\ndeclare const anchoredSource: (regex: RegExp | string) => string;\ndeclare const deanchoredSource: (regex: RegExp | string) => string;\ndeclare const RegexPatterns: {\n negativeLookahead: (pattern: string) => `(?!${string})`;\n nonCapturingGroup: (pattern: string) => `(?:${string})`;\n};\ndeclare const escapeChar = \"\\\\\";\ntype EscapeChar = typeof escapeChar;\ndeclare const whitespaceChars: {\n readonly \" \": 1;\n readonly \"\\n\": 1;\n readonly \"\\t\": 1;\n};\ntype WhitespaceChar = keyof typeof whitespaceChars;\ntype trim = trimEnd>;\ntype trimStart = s extends `${WhitespaceChar}${infer tail}` ? trimEnd : s;\ntype trimEnd = s extends `${infer init}${WhitespaceChar}` ? trimEnd : s;\ntype isStringLiteral = [\n t\n] extends [string] ? [\n string\n] extends [t] ? false : Uppercase extends Uppercase> ? Lowercase extends Lowercase> ? true : false : false : false;\ndeclare const emojiToUnicode: (emoji: string) => string;\n\ntype TraitImplementation = , s extends CompositionState = composeTraits<[\n ...traits,\n implementation\n], \"implementation\">, cls extends TraitConstructor = TraitConstructor>(...args: [...traits, implementation & ThisType>]) => cls;\ntype TraitComposition = >(...traits: conform) => TraitConstructor;\ndeclare const hasTrait: (traitClass: Constructor) => (o: unknown) => boolean;\ntype TraitDeclaration = {\n abstractMethods?: object;\n abstractProps?: object;\n abstractStatics?: object;\n dynamicBase?: object;\n};\n/** @ts-ignore required to extend NoopBase */\ndeclare abstract class Trait extends NoopBase {\n abstractMethods: abstractMethods;\n abstractProps: abstractProps;\n abstractStatic: abstractStatics;\n static get [Symbol.hasInstance](): (o: unknown) => boolean;\n traitsOf(): readonly TraitConstructor[];\n}\ndeclare const compose: TraitComposition;\ndeclare const implement: TraitImplementation;\ntype TraitConstructor = statics & (new (...args: params) => Trait<{\n abstractMethods: abstractMethods;\n abstractProps: abstractProps;\n abstractStatics: abstractStatics;\n}> & instance);\ntype CompositionState = {\n validated: array;\n remaining: array;\n params: array;\n kind: TraitCompositionKind;\n implemented: object;\n abstractMethods: object;\n abstractProps: object;\n abstractStatics: object;\n statics: object;\n};\ntype TraitCompositionKind = \"abstract\" | \"implementation\";\ntype composeTraits = _compose<{\n validated: [];\n remaining: traits;\n kind: kind;\n params: [];\n implemented: {};\n abstractMethods: {};\n abstractProps: {};\n abstractStatics: {};\n statics: {};\n}>;\ntype intersectImplementations = {\n [k in keyof l]: k extends keyof r ? l[k] extends (...args: infer lArgs) => infer lReturn ? r[k] extends (...args: infer rArgs) => infer rReturn ? (...args: intersectParameters) => lReturn & rReturn : l[k] & r[k] : l[k] & r[k] : l[k];\n} & Omit;\ntype _compose = s[\"remaining\"] extends (readonly [\n TraitConstructor,\n ...infer tail\n]) ? _compose<{\n validated: [...s[\"validated\"], s[\"remaining\"][0]];\n remaining: tail;\n kind: s[\"kind\"];\n params: intersectParameters;\n implemented: intersectImplementations>;\n statics: intersectImplementations>;\n abstractMethods: intersectImplementations;\n abstractProps: intersectImplementations;\n abstractStatics: intersectImplementations;\n}> : finalizeState;\ntype finalizeState = satisfy;\n statics: show>;\n abstractMethods: show>;\n abstractProps: show>;\n abstractStatics: show>;\n}>;\ntype implementationOf = s[\"abstractMethods\"] & ({} extends s[\"abstractProps\"] ? {} : {\n construct: (...args: s[\"params\"]) => s[\"abstractProps\"];\n}) & ({} extends s[\"abstractStatics\"] ? {} : {\n statics: s[\"abstractStatics\"];\n});\n\nexport { type AndPreserveUnknown, type AppendOptions, type AppendStringifiedKeyFn, type ArkRegistry, type BigintLiteral, type Brand, type BuiltinObjectKind, type BuiltinObjects, Callable, type CallableOptions, CastableBase, type CollapsingList, type ComparisonOptions, type Completion, type Constructor, type DescribeOptions, type Dict, type Digit, type Domain, DynamicBase, DynamicFunction, type EcmascriptObjects, type EmptyObject, type Entry, type ErrorMessage, type ErrorType, type EscapeChar, FileConstructor, type FlatMorph, type Fn, type GlobalName, type GroupableEntry, type GroupedEntry, type GuardablePredicate, Hkt, type InitialRegistryContents, InnerDynamicBase, type IntegerLiteral, InternalArktypeError, type JsTypeOf, type Json, type JsonArray, type JsonObject, type JsonPrimitive, type JsonStructure, type Key, type KeySet, type ListableEntry, type NonNegativeIntegerLiteral, type NonNullishDomain, NoopBase, type NullishDomain, type NumberLiteral, type NumericParseOptions, ParseError, type PartialRecord, type PlatformObjects, type Primitive, type PrimitiveDomain, type PrintableOptions, ReadonlyArray, ReadonlyPath, RegexPatterns, Scanner, type SerializablePrimitive, type SerializationOptions, type SerializedPrimitive, type SerializedPrimitives, type Stringifiable, type StringifyPathFn, type StringifyPathOptions, type Thunk, Trait, type TraitComposition, type TraitCompositionKind, type TraitConstructor, type TraitDeclaration, type TraitImplementation, type TypeGuard, type TypedArrayObjects, type UnknownUnion, type WhitespaceChar, type ZeroWidthSpace, ancestorsOf, anchoredRegex, anchoredSource, type andPreserveUnknown, type anyOrNever, append, appendStringifiedKey, appendUnique, type appendableValue, type arkGet, type arkIndexableOf, type arkKeyOf, arkUtilVersion, type array, arrayEquals, type arrayIndexOf, type autocomplete, brand, builtinConstructors, cached, capitalize, type charsAfterFirst, type charsBeforeLast, compose, type composeTraits, conflatenate, conflatenateAll, type conform, constructorExtends, deanchoredRegex, deanchoredSource, deepClone, defineProperties, type defined, type describe, describeCollapsibleDate, type describeDefaults, type describeDomainOf, type describeObject, type dict, domainDescriptions, domainOf, ecmascriptConstructors, ecmascriptDescriptions, emojiToUnicode, entriesOf, type entryOf, enumValues, envHasCsp, type equals, escapeChar, type evaluate, type exact, type exactEquals, type exactMessageOnError, type extractDefinedKey, type extractKeyed, type filter, type firstChar, flatMorph, type flattenListable, fromEntries, type fromMappedEntries, getBuiltinNameOfConstructor, getDuplicatesOf, getPath, groupBy, type groupableKeyOf, hasDefinedKey, hasDomain, hasKey, hasObjectKind, hasTrait, type headOf, type ifEmptyObjectLiteral, implement, type implementationOf, includes, type inferDomain, inferred, type initOf, initialRegistryContents, type instanceOf, integerLikeMatcher, type intersectArrays, type intersectOverloadReturns, type intersectParameters, type intersectUnion, intersectUniqueLists, invert, isArray, type isDisjoint, isDotAccessible, isEmptyObject, isKeyOf, isNumericString, type isSafelyMappable, type isStringLiteral, isThunk, isWellFormedInteger, isWellFormedNumber, isomorphic, join, jsTypeOfDescriptions, type keyOf, type keySetOf, type keyWithValue, keysOf, type lastChar, type lastIndexOf, type lastOf, lazily, type leftIfEqual, liftArray, type listable, type merge, type mergeExact, type minLengthArray, type mutable, narrow, nearestFloat, noSuggest, type normalizedKeyOf, numberLikeMatcher, type numericStringKeyOf, numericStringMatcher, objectKindDescriptions, objectKindOf, objectKindOrDomainOf, omit, type optionalKeyOf, type overlaps, type overloadOf, type override, type parseInteger, type parseNonNegativeInteger, type parseNumber, type pathToString, pick, platformConstructors, platformDescriptions, print, printable, type promisable, type propValueOf, type propertyDescriptorsOf, type propwiseXor, range, register, registry, type repeat, type require, type requireKeys, type requiredKeyOf, type satisfy, serializePrimitive, shallowClone, type show, snapshot, splitByKeys, spliterate, stringAndSymbolicEntriesOf, stringifyPath, type stringifyUnion, type tailOf, throwError, throwInternalError, throwParseError, type thunkable, type toArkKey, type trim, type trimEnd, type trimStart, tryCatch, tryParseInteger, tryParseNumber, tryParseWellFormedBigint, tryParseWellFormedNumber, type typeToString, typedArrayConstructors, typedArrayDescriptions, type unbrand, uncapitalize, type unionKeyOf, type unionToPropwiseXor, type unionToTuple, unset, type validateExhaustiveKeys, wellFormedIntegerMatcher, wellFormedNumberMatcher, whitespaceChars, type widen, withAlphabetizedKeys, type withJsDoc, type writeInvalidKeysMessage, writeMalformedNumericLiteralMessage, zeroWidthSpace };\n\n}" diff --git a/ark/schema/roots/root.ts b/ark/schema/roots/root.ts index 97ca2038e6..5a2dc752d3 100644 --- a/ark/schema/roots/root.ts +++ b/ark/schema/roots/root.ts @@ -156,8 +156,10 @@ export abstract class BaseRoot< } toJsonSchemaRecurse(ctx: ToJsonSchema.Context): JsonSchema { - if (ctx.useRefs && !this.alwaysExpandJsonSchema) - return { $ref: `#/$defs/${this.id}` } + if (ctx.useRefs && !this.alwaysExpandJsonSchema) { + const defId = this.meta.defId ?? this.id + return { $ref: `#/$defs/${defId}` } + } return this.toResolvedJsonSchema(ctx) } diff --git a/ark/schema/shared/declare.ts b/ark/schema/shared/declare.ts index 4c0db785aa..0010939fa3 100644 --- a/ark/schema/shared/declare.ts +++ b/ark/schema/shared/declare.ts @@ -19,6 +19,7 @@ export interface NodeMeta extends JsonSchema.UniversalMeta, UnknownErrorConfigs { alias?: string + defId?: string onFail?: ArkErrors.Handler }