import type { ArkErrors, arkKind, flatResolutionsOf } from "@ark/schema"; import type { Brand, inferred } from "@ark/util"; import type { distill, InferredMorph, Out, To } from "../attributes.ts"; import type { DeclarationParser } from "../declare.ts"; import type { FnParser } from "../fn.ts"; import type { GenericParser } from "../generic.ts"; import type { MatchParser } from "../match.ts"; import type { BoundModule, Module } from "../module.ts"; import type { inferDefinition, validateDefinition } from "../parser/definition.ts"; import { type bindThis, type Scope } from "../scope.ts"; import type { DefinitionParser, SchemaParser, Type, TypeParser } from "../type.ts"; import type { BaseType } from "../variants/base.ts"; import type { instantiateType } from "../variants/instantiate.ts"; import { arkBuiltins } from "./builtins.ts"; import { arkPrototypes } from "./constructors.ts"; import { number } from "./number.ts"; import { string } from "./string.ts"; import { arkTsGenerics, arkTsKeywords, object, unknown } from "./ts.ts"; export interface Ark extends Omit, Ark.wrapped { } export declare namespace Ark { interface keywords extends arkTsKeywords.$, arkTsGenerics.$, arkPrototypes.keywords, arkBuiltins.$ { } interface wrapped extends arkPrototypes.wrapped { string: string.submodule; number: number.submodule; object: object.submodule; unknown: unknown.submodule; } type flat = flatResolutionsOf; interface typeAttachments extends arkTsKeywords.$ { arrayIndex: arkPrototypes.$["Array"]["index"]; Key: arkBuiltins.$["Key"]; Record: arkTsGenerics.$["Record"]; Date: arkPrototypes.$["Date"]; Array: arkPrototypes.$["Array"]["root"]; } interface boundTypeAttachments<$> extends Omit, arkKind> { } } export declare const ark: Scope; export declare const keywords: Module; export declare const type: TypeParser<{}>; export declare namespace type { interface cast { [inferred]?: to; } type errors = ArkErrors; type validate> = validateDefinition; type instantiate> = instantiateType, $>; type infer> = inferDefinition; namespace infer { type In = distill.In>; type Out = distill.Out>; namespace introspectable { type Out = distill.introspectable.Out>; } } type brand = t extends InferredMorph ? o["introspectable"] extends true ? (In: i) => To> : (In: i) => Out> : Brand; /** @ts-ignore cast variance */ interface Any extends BaseType { } } export type type = Type; export declare const match: MatchParser<{}>; export declare const fn: FnParser<{}>; export declare const generic: GenericParser<{}>; export declare const schema: SchemaParser<{}>; export declare const define: DefinitionParser<{}>; export declare const declare: DeclarationParser<{}>;