import type { writeUnboundableMessage } from "@ark/schema"; import type { ErrorMessage, array, typeToString } from "@ark/util"; import type { InferredMorph, LimitLiteral } from "../../attributes.ts"; import type { Comparator } from "../reduce/shared.ts"; import type { BoundExpressionKind, writeInvalidLimitMessage } from "../shift/operator/bounds.ts"; import type { inferAstRoot } from "./infer.ts"; import type { astToString, writeConstrainedMorphMessage } from "./utils.ts"; import type { validateAst } from "./validate.ts"; export type validateRange = [ l ] extends [LimitLiteral] ? validateBound : [l] extends [[infer leftAst, Comparator, unknown]] ? ErrorMessage>> : validateBound; export type validateBound = inferAstRoot extends infer bounded ? isNumericallyBoundable extends true ? limit extends number ? validateAst : ErrorMessage> : [bounded] extends [Date] ? validateAst : [bounded] extends [InferredMorph] ? ErrorMessage> : ErrorMessage>> : never; type isNumericallyBoundable = [ bounded ] extends [number] ? true : [bounded] extends [string] ? true : [bounded] extends [array] ? true : false; export declare const writeDoubleRightBoundMessage: (root: root) => writeDoubleRightBoundMessage; type writeDoubleRightBoundMessage = `Expression ${root} must have at most one right bound`; export {};