proposit-core
    Preparing search index...

    Type Alias TCodePointIndex

    A reusable code-point↔UTF-16 offset map for one document.

    Build it once per document and reuse it across that document's anchors; resolving N anchors with sliceByCodePoints instead costs a full scan per anchor.

    type TCodePointIndex = {
        offsets: readonly number[];
        text: string;
    }
    Index

    Properties

    Properties

    offsets: readonly number[]

    UTF-16 offset of each code point, with one extra entry for the end of the string.

    text: string