Prelude API
    Preparing search index...

    Type Alias Key<T>

    Defines operations for range boundaries (keys).

    type Key<T> = {
        cmp: (a: T, b: T) => number;
        next: (a: T) => T;
        prev: (a: T) => T;
    }

    Type Parameters

    • T

      The type of keys

    Index
    cmp: (a: T, b: T) => number

    Compares two keys, returns negative if a < b, 0 if equal, positive if a > b

    next: (a: T) => T

    Returns the next key value after the given key. For half-open ranges use identity function. For closed ranges use ie. a + 1. For non continuous ranges, ie. date encoded as number 2025_06_30 use next day ie. 2025_07_01.

    prev: (a: T) => T

    Returns the previous key value before the given key. See next.