import { type BaseRoot, type BoundKind } from "@ark/schema"; import { type KeySet, type Scanner } from "@ark/util"; import type { DateLiteral } from "../../../attributes.ts"; import type { InferredAst } from "../../ast/infer.ts"; import type { astToString } from "../../ast/utils.ts"; import type { RootedRuntimeState, RuntimeState } from "../../reduce/dynamic.ts"; import { writeUnpairableComparatorMessage, type Comparator, type InvertedComparators, type MaxComparator } from "../../reduce/shared.ts"; import type { s, StaticState } from "../../reduce/static.ts"; import type { parseOperand } from "../operand/operand.ts"; export declare const parseBound: (s: RootedRuntimeState, start: ComparatorStartChar) => void; export type parseBound = shiftComparator extends infer shiftResultOrError ? shiftResultOrError extends (Scanner.shiftResult) ? s["root"] extends (InferredAst) ? s.reduceLeftBound : parseRightBound, comparator, $, args> : shiftResultOrError : never; type OneCharComparator = ">" | "<"; export type ComparatorStartChar = Comparator extends `${infer char}${string}` ? char : never; export declare const comparatorStartChars: KeySet; declare const shiftComparator: (s: RuntimeState, start: ComparatorStartChar) => Comparator; type shiftComparator = unscanned extends `=${infer nextUnscanned}` ? [`${start}=`, nextUnscanned] : [start & OneCharComparator, unscanned]; export declare const writeIncompatibleRangeMessage: (l: BoundKind, r: BoundKind) => string; export declare const getBoundKinds: (comparator: Comparator, limit: number | DateLiteral, root: BaseRoot, boundKind: BoundExpressionKind) => BoundKind[]; export declare const parseRightBound: (s: RootedRuntimeState, comparator: Comparator) => void; export type parseRightBound = parseOperand extends infer nextState extends StaticState ? nextState["root"] extends (InferredAst) ? s["branches"]["leftBound"] extends {} ? comparator extends MaxComparator ? s.reduceRange : s.error> : s.reduceSingleBound : s.error, "right">> : never; export declare const writeInvalidLimitMessage: (comparator: comparator, limit: limit, boundKind: boundKind) => writeInvalidLimitMessage; export type writeInvalidLimitMessage = `Comparator ${boundKind extends "left" ? InvertedComparators[comparator] : comparator} must be ${boundKind extends "left" ? "preceded" : "followed"} by a corresponding literal (was ${limit})`; export type BoundExpressionKind = "left" | "right"; export {};