Interface IStore

A store for most of the data js-sdk needs to store, apart from crypto data

Hierarchy

  • IStore

Implemented by

Properties

accountData: Record<string, MatrixEvent>
on?: ((event: EventEmitterEvents | "degraded", handler: ((...args: any[]) => void)) => void)

Type declaration

    • (event: EventEmitterEvents | "degraded", handler: ((...args: any[]) => void)): void
    • Parameters

      • event: EventEmitterEvents | "degraded"
      • handler: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns void

Methods

  • Parameters

    • roomId: string

    Returns Promise<void>

  • Delete all data from this store. Does nothing since this store doesn't store anything.

    Returns

    An immediately resolved promise.

    Returns Promise<void>

  • Get account data event by event type

    Parameters

    • eventType: string

      The event type being queried

    Returns undefined | MatrixEvent

  • Retrieve a filter.

    Returns

    A filter or null.

    Parameters

    • userId: string
    • filterId: string

    Returns null | Filter

  • Retrieve a filter ID with the given name.

    Returns

    The filter ID or null.

    Parameters

    • filterName: string

      The filter name.

    Returns null | string

  • Returns the out-of-band membership events for this room that were previously loaded.

    Returns

    the events, potentially an empty array if OOB loading didn't yield any new members

    Returns

    in case the members for this room haven't been stored yet

    Parameters

    • roomId: string

    Returns Promise<null | IStateEventWithRoomId[]>

  • Retrieve a room by its' room ID.

    Returns

    The room or null.

    Parameters

    • roomId: string

      The room ID.

    Returns null | Room

  • Returns

    Resolves with a sync response to restore the client state to where it was at the last save, or null if there is no saved sync data.

    Returns Promise<null | ISavedSync>

  • Returns

    If there is a saved sync, the nextBatch token for this sync, otherwise null.

    Returns Promise<null | string>

  • Get the sync token.

    Returns

    Returns null | string

  • Retrieve a User by its' user ID.

    Returns

    The user or null.

    Parameters

    • userId: string

      The user ID.

    Returns null | User

  • Returns

    whether or not the database was newly created in this session.

    Returns Promise<boolean>

  • Permanently delete a room.

    Parameters

    • roomId: string

    Returns void

  • Removes a specific batch of to-device messages from the queue

    Parameters

    • id: number

    Returns Promise<void>

  • Save does nothing as there is no backing data store.

    Parameters

    • Optional force: boolean

    Returns void

  • Retrieve scrollback for this room.

    Returns

    An array of objects which will be at most 'limit' length and at least 0. The objects are the raw event JSON.

    Parameters

    • room: Room

      The matrix room

    • limit: number

      The max number of old events to retrieve.

    Returns MatrixEvent[]

  • Set a filter name to ID mapping.

    Parameters

    • filterName: string
    • Optional filterId: string

    Returns void

  • Stores the out-of-band membership events for this room. Note that it still makes sense to store an empty array as the OOB status for the room is marked as fetched, and getOutOfBandMembers will return an empty array instead of null

    Returns

    when all members have been stored

    Parameters

    Returns Promise<void>

  • Parameters

    • roomId: string
    • events: Partial<IEvent>[]

    Returns Promise<void>

  • setSyncData does nothing as there is no backing data store.

    Returns

    An immediately resolved promise.

    Parameters

    Returns Promise<void>

  • Set the sync token.

    Parameters

    • token: string

    Returns void

  • Startup does nothing.

    Returns

    An immediately resolved promise.

    Returns Promise<void>

  • Store events for a room.

    Parameters

    • room: Room

      The room to store events for.

    • events: MatrixEvent[]

      The events to store.

    • token: string

      The token associated with these events.

    • toStart: boolean

      True if these are paginated results.

    Returns void

  • Store the given room.

    Parameters

    • room: Room

      The room to be stored. All properties must be stored.

    Returns void

  • We never want to save because we have nothing to save to.

    Returns

    If the store wants to save

    Returns boolean

Generated using TypeDoc