mv element-web-module-api module-api
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import type { Room } from "../models/Room";
|
||||
import { type Watchable } from "./watchable";
|
||||
|
||||
/**
|
||||
* Modify account data stored on the homeserver.
|
||||
* @public
|
||||
*/
|
||||
export interface AccountDataApi {
|
||||
/**
|
||||
* Returns a watchable with account data for this event type.
|
||||
*/
|
||||
get(eventType: string): Watchable<unknown>;
|
||||
/**
|
||||
* Set account data on the homeserver.
|
||||
*/
|
||||
set(eventType: string, content: unknown): Promise<void>;
|
||||
/**
|
||||
* Changes the content of this event to be empty.
|
||||
*/
|
||||
delete(eventType: string): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access some limited functionality from the SDK.
|
||||
* @public
|
||||
*/
|
||||
export interface ClientApi {
|
||||
/**
|
||||
* Use this to modify account data on the homeserver.
|
||||
*/
|
||||
accountData: AccountDataApi;
|
||||
|
||||
/**
|
||||
* Fetch room by id from SDK.
|
||||
* @param id - Id of the room to get
|
||||
* @returns Room object from SDK
|
||||
*/
|
||||
getRoom: (id: string) => Room | null;
|
||||
}
|
||||
Reference in New Issue
Block a user