json-joy
    Preparing search index...

    Class BinNode

    Represents the bin type in JSON CRDT. The bin is a blob of binary data, powered by a Replicated Growable Array (RGA) algorithm.

    Hierarchy

    • AbstractRga<Uint8Array>
      • BinNode

    Implements

    Index

    Constructors

    Properties

    count: number = 0

    Unique ID within a document.

    ids: undefined | Chunk<Uint8Array<ArrayBufferLike>> = undefined
    root: undefined | Chunk<Uint8Array<ArrayBufferLike>> = undefined

    Methods

    • Parameters

      • chunk: Chunk<Uint8Array<ArrayBufferLike>>

      Returns void

    • Parameters

      • position: number

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

    • Parameters

      • chunk: Chunk<Uint8Array<ArrayBufferLike>>

      Returns string

    • Parameters

      • size: number
      • next: () => Chunk<Uint8Array<ArrayBufferLike>>

      Returns void

    • Parameters

      • chunk: Chunk<Uint8Array<ArrayBufferLike>>
      • after: Chunk<Uint8Array<ArrayBufferLike>>

      Returns void

    • Parameters

      • chunk: Chunk<Uint8Array<ArrayBufferLike>>
      • before: Chunk<Uint8Array<ArrayBufferLike>>

      Returns void

    • Parameters

      • chunk: Chunk<Uint8Array<ArrayBufferLike>>

      Returns void

    • Parameters

      • chunk: Chunk<Uint8Array<ArrayBufferLike>>
      • at: Chunk<Uint8Array<ArrayBufferLike>>
      • offset: number

      Returns void

    • Returns () => undefined | Chunk<Uint8Array<ArrayBufferLike>>

    • Parameters

      • chunk: Chunk<Uint8Array<ArrayBufferLike>>
      • content: Uint8Array

      Returns void

    • Parameters

      • ch1: Chunk<Uint8Array<ArrayBufferLike>>
      • ch2: Chunk<Uint8Array<ArrayBufferLike>>

      Returns boolean

    • Parameters

      • start: Chunk<Uint8Array<ArrayBufferLike>>
      • end: Chunk<Uint8Array<ArrayBufferLike>>

      Returns void

    • Parameters

      • curr: Chunk<Uint8Array<ArrayBufferLike>>

      Returns undefined | Chunk<Uint8Array<ArrayBufferLike>>

      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<Uint8Array<ArrayBufferLike>>

      Returns number

    • Parameters

      • curr: Chunk<Uint8Array<ArrayBufferLike>>

      Returns undefined | Chunk<Uint8Array<ArrayBufferLike>>

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

    • Parameters

      • tab: string
      • chunk: Chunk<Uint8Array<ArrayBufferLike>>

      Returns string

    • Parameters

      • startChunk: undefined | Chunk<Uint8Array<ArrayBufferLike>>

        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<Uint8Array<ArrayBufferLike>>,
            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<Uint8Array<ArrayBufferLike>>

      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.

    • Parameters

      • chunk: Chunk<Uint8Array<ArrayBufferLike>>
      • ticks: number

      Returns Chunk<Uint8Array<ArrayBufferLike>>