import type Runtype from "../Runtype.js"; import { type Static, type Parsed } from "../Runtype.js"; type Options = { receives?: Runtype.Core | undefined; returns?: Runtype.Core | undefined; }; type Function = (...args: readonly any[]) => any; type EnforcedParametersStatic = O["receives"] extends Runtype.Core ? Static : Parameters; type EnforcedReturnTypeStatic = O["returns"] extends Runtype.Core ? Static : ReturnType; type EnforcedParametersParsed = O["receives"] extends Runtype.Core ? Parsed : Parameters; type EnforcedReturnTypeParsed = O["returns"] extends Runtype.Core ? Parsed & ReturnType : ReturnType; type Contract = O & { enforce: ) => EnforcedReturnTypeStatic>(f: F) => (...args: EnforcedParametersStatic) => EnforcedReturnTypeParsed; }; /** * Creates an function contract. * * Possible failures: * * - `ARGUMENTS_INCORRECT` with `detail` reporting the inner failures * - `RETURN_INCORRECT` with `detail` reporting the inner failure */ declare const Contract: ({ receives, returns }: O) => Contract; export default Contract;