import { RootModule, type GenericAst, type PreparsedNodeResolution } from "@ark/schema"; import type { anyOrNever, inferred } from "@ark/util"; import type { Generic } from "./generic.ts"; import type { Type } from "./type.ts"; export declare const Module: new <$ extends {}>(exports: exportScope<$>) => Module<$>; export interface Module<$ extends {} = {}> extends RootModule> { } export type exportScope<$> = bindExportsToScope<$, $>; export declare const BoundModule: new (exports: bindExportsToScope, $: $) => BoundModule; export interface BoundModule extends RootModule> { } export type bindExportsToScope = { [k in keyof exports]: instantiateExport; } & unknown; export type Submodule = RootModule; export type instantiateExport = [ t ] extends [PreparsedNodeResolution] ? [ t ] extends [anyOrNever] ? Type : t extends GenericAst ? Generic : t extends Submodule ? BoundModule : never : Type;