Datalayer VS Code Extension - v0.0.17
    Preparing search index...

    Adapter that wraps Loro's EphemeralStore to provide awareness functionality.

    Implements

    • AwarenessProvider
    Index

    Constructors

    Methods

    • Decode and apply remote ephemeral state from bytes (uses Loro's native decoding).

      Parameters

      • bytes: Uint8Array

        Encoded ephemeral state from remote peer.

      Returns void

    • Encode all ephemeral state to bytes for transmission (uses Loro's native encoding).

      Returns Uint8Array

      Encoded ephemeral state as byte array.

    • Get the local user's awareness state.

      Returns UserState

      Current local awareness state or null.

    • Get all awareness states from all users.

      Returns Map<number, UserState>

      Map of client IDs to their awareness states.

    • Unregister update listener.

      Parameters

      • type: "update"

        Event type, must be 'update'.

      • cb: () => void

        Callback to remove from listeners.

      Returns void

    • Register update listener.

      Parameters

      • type: "update"

        Event type, must be 'update'.

      • cb: () => void

        Callback invoked when awareness state updates.

      Returns void

    • Set the entire local state.

      Parameters

      • state: UserState

        New awareness state for the local user.

      Returns void

    • Update a specific field in the local state.

      Parameters

      • field: string

        Name of the state field to update.

      • value: unknown

        New value for the field.

      Returns void