fraci
    Preparing search index...

    Interface Fraci<B, X>

    Fractional indexing utility that provides methods for generating ordered keys.

    interface Fraci<B extends FractionalIndexBase, X> {
        base: B;
        brand?: X;
        generateKeyBetween(
            a: null | FractionalIndex<B, X>,
            b: null | FractionalIndex<B, X>,
            skip?: number,
        ): Generator<FractionalIndex<B, X>, void, unknown>;
        generateNKeysBetween(
            a: null | FractionalIndex<B, X>,
            b: null | FractionalIndex<B, X>,
            n: number,
            skip?: number,
        ): Generator<FractionalIndex<B, X>[], void, unknown>;
    }

    Type Parameters

    • B extends FractionalIndexBase

      The type of the base characters

    • X

      The brand type for the fractional index

    Index

    Properties

    base: B

    The character sets used for representing digits in the fractional index.

    brand?: X

    The brand type for the fractional index. Does not exist at runtime.

    Methods

    • Generates a key between two existing keys. Returns a generator that yields new unique keys between the provided bounds.

      Parameters

      • a: null | FractionalIndex<B, X>

        The lower bound key, or null if there is no lower bound

      • b: null | FractionalIndex<B, X>

        The upper bound key, or null if there is no upper bound

      • Optionalskip: number

        Number of conflict avoidance iterations to skip (default: 0)

      Returns Generator<FractionalIndex<B, X>, void, unknown>

      A generator yielding fractional index keys

      When invalid input is provided

      When the generated key exceeds the maximum length

    • Generates multiple keys evenly distributed between two existing keys. Returns a generator that yields arrays of new unique keys.

      Parameters

      • a: null | FractionalIndex<B, X>

        The lower bound key, or null if there is no lower bound

      • b: null | FractionalIndex<B, X>

        The upper bound key, or null if there is no upper bound

      • n: number

        Number of keys to generate

      • Optionalskip: number

        Number of conflict avoidance iterations to skip (default: 0)

      Returns Generator<FractionalIndex<B, X>[], void, unknown>

      A generator yielding arrays of fractional index keys

      When invalid input is provided

      When the generated keys would exceed the maximum length