json-joy
    Preparing search index...

    Class StrNode<T>

    Represents the str type in JSON CRDT. The str type is a RGA (Replicated Growable Array) of UTF-16 code units.

    Type Parameters

    • T extends string = string

    Hierarchy

    • AbstractRga<string>
      • StrNode

    Implements

    Index

    Constructors

    Properties

    count: number = 0

    Unique ID within a document.

    ids: undefined | Chunk<string> = undefined
    root: undefined | Chunk<string> = undefined

    Methods

    • Parameters

      • startChunk: undefined | Chunk<string>

        Chunk from which to start the range. If undefined, the chunk containing from will be used. This is an optimization to avoid a lookup.

      • from: ITimestampStruct

        ID of the first element in the range.

      • to: ITimestampStruct

        ID of the last element in the range.

      • callback: (chunk: Chunk<string>, off: number, len: number) => boolean | void

        Function to call for each chunk slice in the range. If it returns truthy value, the iteration will stop.

      Returns void | Chunk<string>

      Reference to the last chunk in the range.

      All ".rangeX()" method are not performance optimized. For hot paths it is better to hand craft the loop.