import Runtype, { type Static, type Parsed } from "./Runtype.js"; /** * Adds a constraint to a runtype, narrowing its inferred static type. * * Possible failures: * * - Failures of the inner runtype * - `CONSTRAINT_FAILED` with `thrown` reporting the thrown value from the constraint function */ interface Constraint = Parsed> extends Runtype<[Static, Parsed] extends [Parsed, Static] ? T : Static, T> { tag: "constraint"; underlying: R; constraint: (x: Parsed) => asserts x is T; } declare const Constraint: >(underlying: R, constraint: (x: Parsed) => asserts x is T) => Constraint; export default Constraint;