/** * What a type-parameter bound promises, and who is refused for not keeping it. * * The vocabulary itself — the three names and the `TypeParameterBound` type — * is declared in `model.ts`, because the `ValueType` union's callable kinds * carry `typeParameterBounds` and a union cannot import from a module that * imports it. Everything that *reads* the vocabulary is here: the grant table * (D41 item 61, D51 rule 110), the two questions asked of it, and the * violation collectors a generic call reports through. */ import { type CallableType, type TypeEnvironment, type TypeParameterBound, type ValueType } from "./model.ts"; /** The capabilities a bound unlocks inside the declaring body. */ export type BoundCapability = "text" | "order" | "data"; export declare function isTypeParameterBound(name: string): name is TypeParameterBound; /** Reads the grant table. An unbounded parameter (`null`) grants nothing. */ export declare function boundGrants(bound: TypeParameterBound | null | undefined, capability: BoundCapability): boolean; /** * A callable carrying `actual` bounds may stand where `expected` bounds are * declared only when it demands no capability the target does not promise — * decided by the same grant table, one capability at a time. */ export declare function boundAccepts(actual: TypeParameterBound | null, expected: TypeParameterBound | null): boolean; /** A type argument solved for a bounded parameter that the bound rejects. */ export interface GenericBoundViolation { readonly index: number; readonly name: string; readonly bound: TypeParameterBound; readonly solved: ValueType; } /** Every declared bound of `actual` must be promised by `expected`'s. */ export declare function typeParameterBoundsAccept(actual: CallableType, expected: CallableType): boolean; /** * Reports every solved binding its declared bound rejects. `satisfiesBound` is * the environment's decision procedure, so the three predicates that answer a * bound live in exactly one place (the analyzer). */ export declare function collectGenericBoundViolations(callable: CallableType, bindings: readonly (ValueType | null)[], satisfiesBound: (type: ValueType, bound: TypeParameterBound) => boolean, unknownParameters?: ReadonlySet): readonly GenericBoundViolation[]; /** * D55 rule 124: the same judgment for a declaration that is not a callable — * `type Box` applied to an argument. The callable form above is now a * thin caller, so a bound is decided in exactly one place no matter which * declaration form carries it. */ export declare function collectTypeArgumentBoundViolations(names: readonly string[] | undefined, bounds: readonly (TypeParameterBound | null)[] | undefined, bindings: readonly (ValueType | null)[], satisfiesBound: (type: ValueType, bound: TypeParameterBound) => boolean, unknownParameters?: ReadonlySet): readonly GenericBoundViolation[]; export declare function instantiateGenericCallable(actual: CallableType, expected: CallableType, environment: TypeEnvironment, violations?: GenericBoundViolation[]): CallableType; //# sourceMappingURL=bounds.d.ts.map