Rindle

API index and search · Build metadata

Supporting declarations

packages/client/src/compare.ts. These declarations explain referenced types. Only package-page symbols are package exports.

Exact source

COMPARATOR_VERSION

/** The `compare_values` / `compare_rows` algorithm-contract version (=== the engine's
 *  `wire_schema::COMPARATOR_VERSION`). A remote subscriber hard-rejects a `hello` whose
 *  `comparatorVersion` differs — the total order is a code contract, not data, so a schema
 *  fingerprint can't cover it. Bump in lockstep with the Rust constant if the order changes.
 *
 *  v2 (design 226 Stage B): the engine's mixed Int/Float comparison became exact instead
 *  of f64-widening. No TS behavior change — every value a client can hold today is an f64
 *  `number`, on which v1 and v2 order identically (the §8 gate keeps int64 cells out of
 *  the browser until Stage E) — but the contract the version names is the engine's. */
export declare const COMPARATOR_VERSION = 2;

compareNumber

/** number compare with `f64::total_cmp` semantics (NaN deterministic & last; -0 < +0). */
export declare function compareNumber(a: number, b: number): -1 | 0 | 1;

compareString

/** UTF-8 bytewise string compare (=== SQLite `BINARY` / Rust `&str` Ord). Correct for
 *  supplementary-plane code points, where JS `<` / `localeCompare` (UTF-16) would disagree. */
export declare function compareString(a: string, b: string): -1 | 0 | 1;

compareValue

/** Compare two bare cells, dispatching on the runtime type (null sorts first). */
export declare function compareValue(a: WireValue, b: WireValue): -1 | 0 | 1;

compareRows

/** Compare two rows by a resolved sort (`[columnIndex, ascending]` pairs). First non-equal
 *  column wins; a descending column negates. */
export declare function compareRows(a: WireValue[], b: WireValue[], sort: [
    number,
    boolean
][]): -1 | 0 | 1;