/** * The Aggregate API uses keys and IDs, where the keys are for sorting and * IDs are for tie-breaking uniqueness. The component's BTree API uses * positions, which are unique keys. */ import type { Key } from "../component/btree.js"; export type Bound = { key: K; id?: ID; inclusive: boolean; }; export type SideBounds = { lower?: Bound; upper?: Bound; }; export type TuplePrefix = P["length"] extends K["length"] ? P : P | TuplePrefix; export type Bounds = SideBounds | (K extends unknown[] ? { prefix: TuplePrefix>; } : never) | { eq: K; }; export type Position = [Key, string | null | never[], "" | null | never[]]; export declare function keyToPosition(key: K, id: ID): Position; export declare function positionToKey(position: Position): { key: K; id: ID; }; export declare function boundsToPositions(bounds?: Bounds): { k1?: Position; k2?: Position; }; export declare function boundToPosition(direction: "lower" | "upper", bound: Bound): Position; export declare function boundToPosition(direction: "lower" | "upper"): undefined; export declare function boundToPosition(direction: "lower" | "upper", bound?: Bound): Position | undefined; //# sourceMappingURL=positions.d.ts.map