import { ContractInput, ContractOutput, ContractSchema } from "./contract.mjs"; import { ErrorContract, ErrorDefinitions } from "./errors.mjs"; //#region src/modules/contracts/domain.d.ts /** Schema-only domain vocabulary; implementations and host policies live in registries. */ export type DomainOperationContract = { readonly input: ContractSchema; readonly result: ContractSchema; readonly classification?: string; readonly wire?: { readonly schema: ContractSchema; readonly project: Function; }; }; export type DomainCommandContract = DomainOperationContract & { readonly classification: string; readonly replayResult?: ContractSchema; }; export type DomainQueryContract = DomainOperationContract & { readonly replayResult?: never; }; export type DomainContract = { readonly errors?: Pick, 'project'>; readonly commands?: Readonly>; readonly queries?: Readonly>; }; type CheckedEntry = { readonly handler?: never; readonly audit?: never; readonly prepare?: never; readonly guard?: never; readonly middleware?: never; readonly context?: never; readonly wire?: Entry extends { wire: { schema: infer Wire; }; } ? { readonly schema: Wire; readonly project: (value: ContractOutput) => ContractInput; } : never; } & (Entry extends { replayResult: infer Replay; } ? { readonly replayResult: ContractOutput extends ContractOutput ? Replay : never; } : {}); type CheckedSection
= { readonly [Key in keyof Section]: Section[Key] extends DomainOperationContract ? CheckedEntry : never; }; type CheckedDomain = { readonly [Section in Extract]: CheckedSection; }; /** Preserve the declaration's literal keys and opaque validator/error-contract identities. */ export declare function defineDomainContract(definition: (Definition & NoInfer>) | (() => Definition & NoInfer>)): Definition; /** Exactness applies to variables as well as fresh object literals. */ export type ExactOperationKeys = Exclude extends never ? Exclude extends never ? string extends keyof Contracts ? never : unknown : never : never; /** Correlated callback envelope for registry-level command audit. */ export type DomainAuditInput = { [Key in Extract]: Commands[Key] extends DomainOperationContract ? { operation: Key; input: ContractOutput; result: ContractOutput; } : never; }[Extract]; //#endregion //# sourceMappingURL=domain.d.mts.map