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

interface IStore {
    accountData: Map<string, MatrixEvent>;
    on?: ((event, handler) => void);
    clearOutOfBandMembers(roomId): Promise<void>;
    deleteAllData(): Promise<void>;
    destroy(): Promise<void>;
    getAccountData(eventType): undefined | MatrixEvent;
    getClientOptions(): Promise<undefined | IStartClientOpts>;
    getFilter(userId, filterId): null | Filter;
    getFilterIdByName(filterName): null | string;
    getOldestToDeviceBatch(): Promise<null | IndexedToDeviceBatch>;
    getOutOfBandMembers(roomId): Promise<null | IStateEventWithRoomId[]>;
    getPendingEvents(roomId): Promise<Partial<IEvent>[]>;
    getRoom(roomId): null | Room;
    getRoomSummaries(): RoomSummary[];
    getRooms(): Room[];
    getSavedSync(): Promise<null | ISavedSync>;
    getSavedSyncToken(): Promise<null | string>;
    getSyncToken(): null | string;
    getUser(userId): null | User;
    getUsers(): User[];
    isNewlyCreated(): Promise<boolean>;
    removeRoom(roomId): void;
    removeToDeviceBatch(id): Promise<void>;
    save(force?): Promise<void>;
    saveToDeviceBatches(batch): Promise<void>;
    scrollback(room, limit): MatrixEvent[];
    setFilterIdByName(filterName, filterId?): void;
    setOutOfBandMembers(roomId, membershipEvents): Promise<void>;
    setPendingEvents(roomId, events): Promise<void>;
    setSyncData(syncData): Promise<void>;
    setSyncToken(token): void;
    setUserCreator(creator): void;
    startup(): Promise<void>;
    storeAccountDataEvents(events): void;
    storeClientOptions(options): Promise<void>;
    storeEvents(room, events, token, toStart): void;
    storeFilter(filter): void;
    storeRoom(room): void;
    storeUser(user): void;
    wantsSave(): boolean;
}

Implemented by

Properties

accountData: Map<string, MatrixEvent>
on?: ((event, handler) => void)

Type declaration

    • (event, handler): void
    • Parameters

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

            • Rest ...args: any[]

            Returns void

      Returns void

Methods

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

    Returns Promise<void>

    An immediately resolved promise.

  • Retrieve a filter.

    Parameters

    • userId: string
    • filterId: string

    Returns null | Filter

    A filter or null.

  • Retrieve a filter ID with the given name.

    Parameters

    • filterName: string

      The filter name.

    Returns null | string

    The filter ID or null.

  • Retrieve a room by its' room ID.

    Parameters

    • roomId: string

      The room ID.

    Returns null | Room

    The room or null.

  • Returns Promise<null | string>

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

  • Retrieve a User by its' user ID.

    Parameters

    • userId: string

      The user ID.

    Returns null | User

    The user or null.

  • Permanently delete a room.

    Parameters

    • roomId: string

    Returns void

  • Retrieve scrollback for this room.

    Parameters

    • room: Room

      The matrix room

    • limit: number

      The max number of old events to retrieve.

    Returns MatrixEvent[]

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

  • 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

    Parameters

    Returns Promise<void>

    when all members have been stored

  • Set the sync token.

    Parameters

    • token: string

    Returns void

  • Set the user creator which is used for creating User objects

    Parameters

    • creator: UserCreator

      A callback that accepts an user-id and returns an User object

    Returns void

  • Store user-scoped account data events

    Parameters

    Returns void

  • Store events for a room.

    Parameters

    • room: Room

      The room to store events for.

    • events: MatrixEvent[]

      The events to store.

    • token: null | 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 boolean

    If the store wants to save

Generated using TypeDoc