/** * Runtime contracts checked against a literal or a proved scalar constant. * * `"ab".repeat(-1)`, `"abc".char(1.5)` and `Text.findMatch(value, "([")` are * decided the moment they are written: the argument is known, the contract * is the compiler's own, and the only thing running the program adds is the * delay. Nothing here changes what a program means — every message is the * sentence the runtime guard would raise, and a non-literal argument is left to * that guard, which still runs. * * The analyzer supplies its bounded lexical constant reader. A call, mutable * value or unproved expression remains the runtime guard's responsibility. * The sentences are quoted from `packages/compiler/runtime/text.js` and * `packages/core/src/index.ts`; the pattern failure asks the same engine the * runtime asks, so the reason clause is the engine's own. */ import { type Expression } from "../ast.ts"; import type { ConstantValue } from "./constant-values.ts"; /** `String.`'s own count and index contracts, for a literal argument. */ export declare function stringMemberLiteralFailure(member: string, arguments_: readonly (Expression | undefined)[], read?: (expression: Expression) => ConstantValue | undefined): { readonly message: string; readonly argument: Expression; } | null; /** `Text.`'s pattern contract, for a literal pattern. */ export declare function textPatternLiteralFailure(member: string, arguments_: readonly Expression[], read?: (expression: Expression) => ConstantValue | undefined, argumentNames?: readonly (string | null)[]): { readonly message: string; readonly argument: Expression; } | null; //# sourceMappingURL=literal-contracts.d.ts.map