mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 12:16:53 +02:00
Update element-web-module-api.api.md
This commit is contained in:
parent
5bb1d3d461
commit
a5ec21bd06
@ -55,6 +55,8 @@ export interface Api extends LegacyModuleApiExtension, LegacyCustomisationsApiEx
|
||||
readonly navigation: NavigationApi;
|
||||
readonly rootNode: HTMLElement;
|
||||
readonly stores: StoresApi;
|
||||
// @alpha
|
||||
readonly widgetLifecycle: WidgetLifecycleApi;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
@ -64,6 +66,9 @@ export interface BuiltinsApi {
|
||||
renderRoomView(roomId: string, props?: RoomViewProps): React.ReactNode;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export type CapabilitiesApprover = (widget: WidgetDescriptor, requestedCapabilities: Set<string>) => Set<string> | Promise<Set<string> | undefined> | undefined;
|
||||
|
||||
// @alpha @deprecated (undocumented)
|
||||
export interface ChatExportCustomisations<ExportFormat, ExportType> {
|
||||
getForceChatExportParameters(): {
|
||||
@ -180,6 +185,9 @@ export interface I18nApi {
|
||||
translate(key: keyof Translations, variables?: Variables): string;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export type IdentityApprover = (widget: WidgetDescriptor) => boolean | Promise<boolean> | undefined;
|
||||
|
||||
// @alpha @deprecated (undocumented)
|
||||
export type LegacyCustomisations<T extends object> = (customisations: T) => void;
|
||||
|
||||
@ -325,6 +333,9 @@ export type OriginalMessageComponentProps = {
|
||||
showUrlPreview?: boolean;
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export type PreloadApprover = (widget: WidgetDescriptor) => boolean | Promise<boolean> | undefined;
|
||||
|
||||
// @public
|
||||
export interface Profile {
|
||||
displayName?: string;
|
||||
@ -422,6 +433,27 @@ export class Watchable<T> {
|
||||
watch(listener: (value: T) => void): void;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export type WidgetDescriptor = {
|
||||
id: string;
|
||||
templateUrl: string;
|
||||
creatorUserId: string;
|
||||
type: string;
|
||||
origin: string;
|
||||
roomId?: string;
|
||||
kind: WidgetKind;
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export type WidgetKind = "room" | "account" | "modal";
|
||||
|
||||
// @alpha
|
||||
export interface WidgetLifecycleApi {
|
||||
registerCapabilitiesApprover(approver: CapabilitiesApprover): void;
|
||||
registerIdentityApprover(approver: IdentityApprover): void;
|
||||
registerPreloadApprover(approver: PreloadApprover): void;
|
||||
}
|
||||
|
||||
// @alpha @deprecated (undocumented)
|
||||
export interface WidgetPermissionsCustomisations<Widget, Capability> {
|
||||
preapproveCapabilities?(widget: Widget, requestedCapabilities: Set<Capability>): Promise<Set<Capability>>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user