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

      • position: number

      Returns undefined | [chunk: Chunk<string>, offset: number]

    • Parameters

      • chunk: Chunk<string>
      • after: Chunk<string>

      Returns void

    • Parameters

      • chunk: Chunk<string>
      • before: Chunk<string>

      Returns void

    • Parameters

      • chunk: Chunk<string>
      • at: Chunk<string>
      • offset: number

      Returns void

    • Parameters

      • ch1: Chunk<string>
      • ch2: Chunk<string>

      Returns boolean

    • Parameters

      • start: Chunk<string>
      • end: Chunk<string>

      Returns void

    • Parameters

      • curr: Chunk<string>

      Returns undefined | Chunk<string>

      Or better remove this method completely, as it does not require "this".

    • Returns the position of the first element in the chunk.

      Parameters

      • chunk: Chunk<string>

      Returns number

    • Parameters

      • curr: Chunk<string>

      Returns undefined | Chunk<string>

      Or better remove this method completely, as it does not require "this".

    • 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.