2025-05-16 15:49:07 +01:00
## API Report File for "@element-hq/element-web-module-api"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
``` ts
2025-06-23 09:32:26 +01:00
import { ComponentType } from 'react' ;
2025-05-16 15:49:07 +01:00
import { JSX } from 'react' ;
import { ModuleApi } from '@matrix-org/react-sdk-module-api' ;
import { Root } from 'react-dom/client' ;
import { RuntimeModule } from '@matrix-org/react-sdk-module-api' ;
2025-06-23 09:32:26 +01:00
// @public
export interface AccountAuthApiExtension {
overwriteAccountAuth ( accountInfo : AccountAuthInfo ) : Promise < void > ;
}
// @public
export interface AccountAuthInfo {
accessToken : string ;
deviceId : string ;
homeserverUrl : string ;
refreshToken? : string ;
userId : string ;
}
2025-10-23 12:22:39 +05:30
// @public
export interface AccountDataApi {
delete ( eventType : string ) : Promise < void > ;
2025-10-23 23:45:36 +05:30
get ( eventType : string ) : Watchable < unknown > ;
2025-10-23 12:22:39 +05:30
set ( eventType : string , content : unknown ) : Promise < void > ;
}
2025-05-16 15:49:07 +01:00
// @alpha @deprecated (undocumented)
export interface AliasCustomisations {
// (undocumented)
getDisplayAliasForAliasSet ? ( canonicalAlias : string | null , altAliases : string [ ] ) : string | null ;
}
// Warning: (ae-incompatible-release-tags) The symbol "Api" is marked as @public, but its signature references "LegacyModuleApiExtension" which is marked as @alpha
// Warning: (ae-incompatible-release-tags) The symbol "Api" is marked as @public, but its signature references "LegacyCustomisationsApiExtension" which is marked as @alpha
//
// @public
2025-06-23 09:32:26 +01:00
export interface Api extends LegacyModuleApiExtension , LegacyCustomisationsApiExtension , DialogApiExtension , AccountAuthApiExtension , ProfileApiExtension {
2025-09-24 16:07:31 +01:00
// @alpha
readonly builtins : BuiltinsApi ;
2025-10-23 12:22:39 +05:30
readonly client : ClientApi ;
2025-05-16 15:49:07 +01:00
readonly config : ConfigApi ;
createRoot ( element : Element ) : Root ;
2025-06-17 14:03:10 +01:00
// @alpha
2025-05-16 15:49:07 +01:00
readonly customComponents : CustomComponentsApi ;
2025-09-24 16:07:31 +01:00
// @alpha
readonly extras : ExtrasApi ;
2025-05-16 15:49:07 +01:00
readonly i18n : I18nApi ;
2025-06-23 09:32:26 +01:00
readonly navigation : NavigationApi ;
2025-05-16 15:49:07 +01:00
readonly rootNode : HTMLElement ;
2025-10-23 12:32:48 +05:30
readonly stores : StoresApi ;
2025-05-16 15:49:07 +01:00
}
2025-09-24 16:07:31 +01:00
// @alpha
export interface BuiltinsApi {
2025-12-02 13:59:21 +05:30
renderNotificationDecoration ( roomId : string ) : React . ReactNode ;
2025-10-23 12:43:10 +05:30
renderRoomAvatar ( roomId : string , size? : string ) : React . ReactNode ;
2025-10-29 10:36:55 +01:00
renderRoomView ( roomId : string , props? : RoomViewProps ) : React . ReactNode ;
2025-09-24 16:07:31 +01:00
}
2025-05-16 15:49:07 +01:00
// @alpha @deprecated (undocumented)
export interface ChatExportCustomisations < ExportFormat , ExportType > {
getForceChatExportParameters ( ) : {
format? : ExportFormat ;
range? : ExportType ;
numberOfMessages? : number ;
includeAttachments? : boolean ;
sizeMb? : number ;
} ;
}
2025-10-23 12:22:39 +05:30
// @public
export interface ClientApi {
2025-10-23 23:45:36 +05:30
accountData : AccountDataApi ;
2025-10-23 12:22:39 +05:30
getRoom : ( id : string ) = > Room | null ;
}
2025-05-16 15:49:07 +01:00
// @alpha @deprecated (undocumented)
export interface ComponentVisibilityCustomisations {
shouldShowComponent ? ( component : "UIComponent.sendInvites" | "UIComponent.roomCreation" | "UIComponent.spaceCreation" | "UIComponent.exploreRooms" | "UIComponent.addIntegrations" | "UIComponent.filterContainer" | "UIComponent.roomOptionsMenu" ) : boolean ;
}
// @public
export interface Config {
// (undocumented)
brand : string ;
}
// @public
export interface ConfigApi {
// (undocumented)
get ( ) : Config ;
// (undocumented)
get < K extends keyof Config > ( key : K ) : Config [ K ] ;
// (undocumented)
get < K extends keyof Config = never > ( key? : K ) : Config | Config [ K ] ;
}
2025-06-17 14:03:10 +01:00
// @alpha
2025-05-16 15:49:07 +01:00
export interface CustomComponentsApi {
2025-06-12 10:58:45 +01:00
registerMessageRenderer ( eventTypeOrFilter : string | ( ( mxEvent : MatrixEvent ) = > boolean ) , renderer : CustomMessageRenderFunction , hints? : CustomMessageRenderHints ) : void ;
2025-06-23 09:32:26 +01:00
registerRoomPreviewBar ( renderer : CustomRoomPreviewBarRenderFunction ) : void ;
2025-05-16 15:49:07 +01:00
}
2025-05-30 14:51:28 +01:00
// @alpha
export type CustomMessageComponentProps = {
mxEvent : MatrixEvent ;
} ;
2025-06-09 15:41:53 +01:00
// @alpha
2025-05-30 14:51:28 +01:00
export type CustomMessageRenderFunction = (
props : CustomMessageComponentProps ,
2025-06-23 09:32:26 +01:00
originalComponent ? : ( props? : OriginalMessageComponentProps ) = > React . JSX . Element ) = > JSX . Element ;
2025-06-09 15:41:53 +01:00
// @alpha
export type CustomMessageRenderHints = {
allowEditingEvent? : boolean ;
2025-07-03 13:06:26 +01:00
allowDownloadingMedia ? : ( mxEvent : MatrixEvent ) = > Promise < boolean > ;
2025-06-09 15:41:53 +01:00
} ;
2025-05-16 15:49:07 +01:00
2025-06-23 09:32:26 +01:00
// @alpha
export type CustomRoomPreviewBarComponentProps = {
roomId? : string ;
roomAlias? : string ;
} ;
// @alpha
export type CustomRoomPreviewBarRenderFunction = (
props : CustomRoomPreviewBarComponentProps ,
originalComponent : ( props : CustomRoomPreviewBarComponentProps ) = > JSX . Element ) = > JSX . Element ;
// @public
export interface DialogApiExtension {
2025-06-24 09:50:02 +01:00
openDialog < M , P extends object > ( initialOptions : DialogOptions , dialog : ComponentType < P & DialogProps < M > > , props : P ) : DialogHandle < M > ;
2025-06-23 09:32:26 +01:00
}
// @public
export type DialogHandle < M > = {
finished : Promise < {
ok : boolean ;
2025-06-24 09:50:02 +01:00
model : M | null ;
2025-06-23 09:32:26 +01:00
} > ;
close ( ) : void ;
} ;
// @public
export interface DialogOptions {
title : string ;
}
// @public
export type DialogProps < M > = {
onSubmit ( model : M ) : void ;
2025-06-24 09:50:02 +01:00
onCancel ( ) : void ;
2025-06-23 09:32:26 +01:00
} ;
2025-05-16 15:49:07 +01:00
// @alpha @deprecated (undocumented)
export interface DirectoryCustomisations {
// (undocumented)
requireCanonicalAliasAccessToPublish ? ( ) : boolean ;
}
2025-09-24 16:07:31 +01:00
// @alpha
export interface ExtrasApi {
2025-11-21 15:31:17 +01:00
getVisibleRoomBySpaceKey ( spaceKey : string , cb : ( ) = > string [ ] ) : void ;
2025-09-25 17:33:53 +01:00
setSpacePanelItem ( spaceKey : string , props : SpacePanelItemProps ) : void ;
2025-09-24 16:07:31 +01:00
}
2025-05-16 15:49:07 +01:00
// @public
export interface I18nApi {
2025-11-26 16:47:58 +00:00
humanizeTime ( timeMillis : number ) : string ;
2025-05-16 15:49:07 +01:00
get language ( ) : string ;
register ( translations : Partial < Translations > ) : void ;
translate ( key : keyof Translations , variables? : Variables ) : string ;
}
// @alpha @deprecated (undocumented)
export type LegacyCustomisations < T extends object > = ( customisations : T ) = > void ;
// @alpha @deprecated (undocumented)
export interface LegacyCustomisationsApiExtension {
// @deprecated (undocumented)
readonly _registerLegacyAliasCustomisations : LegacyCustomisations < AliasCustomisations > ;
// @deprecated (undocumented)
readonly _registerLegacyChatExportCustomisations : LegacyCustomisations < ChatExportCustomisations < never , never > > ;
// @deprecated (undocumented)
readonly _registerLegacyComponentVisibilityCustomisations : LegacyCustomisations < ComponentVisibilityCustomisations > ;
// @deprecated (undocumented)
readonly _registerLegacyDirectoryCustomisations : LegacyCustomisations < DirectoryCustomisations > ;
// @deprecated (undocumented)
readonly _registerLegacyLifecycleCustomisations : LegacyCustomisations < LifecycleCustomisations > ;
// @deprecated (undocumented)
readonly _registerLegacyMediaCustomisations : LegacyCustomisations < MediaCustomisations < never , never , never > > ;
// @deprecated (undocumented)
readonly _registerLegacyRoomListCustomisations : LegacyCustomisations < RoomListCustomisations < never > > ;
// @deprecated (undocumented)
readonly _registerLegacyUserIdentifierCustomisations : LegacyCustomisations < UserIdentifierCustomisations > ;
// @deprecated (undocumented)
readonly _registerLegacyWidgetPermissionsCustomisations : LegacyCustomisations < WidgetPermissionsCustomisations < never , never > > ;
// @deprecated (undocumented)
readonly _registerLegacyWidgetVariablesCustomisations : LegacyCustomisations < WidgetVariablesCustomisations > ;
}
// @alpha @deprecated (undocumented)
export interface LegacyModuleApiExtension {
// @deprecated
_registerLegacyModule ( LegacyModule : RuntimeModuleConstructor ) : Promise < void > ;
}
// @alpha @deprecated (undocumented)
export interface LifecycleCustomisations {
// (undocumented)
onLoggedOutAndStorageCleared ? ( ) : void ;
}
2025-09-24 16:07:31 +01:00
// @alpha
export type LocationRenderFunction = ( ) = > JSX . Element ;
2025-06-17 14:03:10 +01:00
// @alpha
2025-06-17 13:30:47 +01:00
export interface MatrixEvent {
content : Record < string , unknown > ;
eventId : string ;
originServerTs : number ;
2025-06-17 14:03:10 +01:00
roomId : string ;
2025-06-17 13:30:47 +01:00
sender : string ;
stateKey? : string ;
type : string ;
unsigned : Record < string , unknown > ;
}
2025-05-16 15:49:07 +01:00
// @alpha @deprecated (undocumented)
export interface Media {
// (undocumented)
downloadSource ( ) : Promise < Response > ;
// (undocumented)
getSquareThumbnailHttp ( dim : number ) : string | null ;
// (undocumented)
getThumbnailHttp ( width : number , height : number , mode ? : "scale" | "crop" ) : string | null ;
// (undocumented)
getThumbnailOfSourceHttp ( width : number , height : number , mode ? : "scale" | "crop" ) : string | null ;
// (undocumented)
readonly hasThumbnail : boolean ;
// (undocumented)
readonly isEncrypted : boolean ;
// (undocumented)
readonly srcHttp : string | null ;
// (undocumented)
readonly srcMxc : string ;
// (undocumented)
readonly thumbnailHttp : string | null ;
// (undocumented)
readonly thumbnailMxc : string | null | undefined ;
}
// @alpha @deprecated (undocumented)
export interface MediaContructable < PreparedMedia > {
// (undocumented)
new ( prepared : PreparedMedia ) : Media ;
}
// @alpha @deprecated (undocumented)
export interface MediaCustomisations < Content , Client , PreparedMedia > {
// (undocumented)
readonly Media : MediaContructable < PreparedMedia > ;
// (undocumented)
mediaFromContent ( content : Content , client? : Client ) : Media ;
// (undocumented)
mediaFromMxc ( mxc? : string , client? : Client ) : Media ;
}
// @public
export interface Module {
// (undocumented)
load ( ) : Promise < void > ;
}
// @public
export interface ModuleFactory {
// (undocumented)
new ( api : Api ) : Module ;
// (undocumented)
readonly moduleApiVersion : string ;
// (undocumented)
readonly prototype : Module ;
}
// @public
export class ModuleIncompatibleError extends Error {
constructor ( pluginVersion : string ) ;
}
// @public
export class ModuleLoader {
constructor ( api : Api ) ;
// Warning: (ae-forgotten-export) The symbol "ModuleExport" needs to be exported by the entry point index.d.ts
//
// (undocumented)
load ( moduleExport : ModuleExport ) : Promise < void > ;
// (undocumented)
start ( ) : Promise < void > ;
}
2025-10-17 12:14:20 +01:00
// @public
2025-06-23 09:32:26 +01:00
export interface NavigationApi {
2025-10-28 16:36:39 +05:30
openRoom ( roomIdOrAlias : string , opts? : OpenRoomOptions ) : void ;
2025-10-17 12:14:20 +01:00
// @alpha
2025-09-24 16:07:31 +01:00
registerLocationRenderer ( path : string , renderer : LocationRenderFunction ) : void ;
2025-06-23 09:32:26 +01:00
toMatrixToLink ( link : string , join? : boolean ) : Promise < void > ;
}
2025-10-28 16:36:39 +05:30
// @public
export interface OpenRoomOptions {
autoJoin? : boolean ;
viaServers? : string [ ] ;
}
2025-06-05 09:58:51 +01:00
// @alpha
2025-06-23 09:32:26 +01:00
export type OriginalMessageComponentProps = {
2025-06-05 09:58:51 +01:00
showUrlPreview? : boolean ;
} ;
2025-06-23 09:32:26 +01:00
// @public
export interface Profile {
displayName? : string ;
2025-07-24 16:27:09 +01:00
isGuest? : boolean ;
2025-06-23 09:32:26 +01:00
userId? : string ;
}
// @public
export interface ProfileApiExtension {
readonly profile : Watchable < Profile > ;
}
2025-10-23 12:22:39 +05:30
// @public
export interface Room {
getLastActiveTimestamp : ( ) = > number ;
id : string ;
name : Watchable < string > ;
}
2025-05-16 15:49:07 +01:00
// @alpha @deprecated (undocumented)
export interface RoomListCustomisations < Room > {
isRoomVisible ? ( room : Room ) : boolean ;
}
2025-10-23 12:32:48 +05:30
// @public
export interface RoomListStoreApi {
2025-10-24 00:30:01 +05:30
getRooms ( ) : Watchable < Room [ ] > ;
2025-10-23 12:32:48 +05:30
waitForReady ( ) : Promise < void > ;
}
2025-09-24 16:07:31 +01:00
// @alpha
export interface RoomViewProps {
2025-12-04 12:22:45 +01:00
enableReadReceiptsAndMarkersOnActivity? : boolean ;
2025-10-28 16:18:10 +01:00
hideComposer? : boolean ;
hideHeader? : boolean ;
2025-11-21 15:38:33 +01:00
hidePinnedMessageBanner? : boolean ;
2025-11-17 15:57:28 +01:00
hideRightPanel? : boolean ;
2025-12-03 09:54:33 +00:00
hideWidgets? : boolean ;
2025-09-24 16:07:31 +01:00
}
2025-05-16 15:49:07 +01:00
// @alpha @deprecated (undocumented)
export type RuntimeModuleConstructor = new ( api : ModuleApi ) = > RuntimeModule ;
2025-09-24 16:07:31 +01:00
// @alpha
2025-09-25 17:33:53 +01:00
export interface SpacePanelItemProps {
className? : string ;
icon? : JSX.Element ;
label : string ;
2025-10-20 17:44:15 +01:00
onSelected : ( ) = > void ;
2025-09-25 17:33:53 +01:00
style? : React.CSSProperties ;
2025-10-20 16:36:48 +01:00
tooltip? : string ;
2025-09-25 17:33:53 +01:00
}
2025-09-24 16:07:31 +01:00
2025-10-23 12:32:48 +05:30
// @public
export interface StoresApi {
2025-10-24 00:30:01 +05:30
roomListStore : RoomListStoreApi ;
2025-10-23 12:32:48 +05:30
}
2025-05-16 15:49:07 +01:00
// @public
export type Translations = Record < string , {
[ ietfLanguageTag : string ] : string ;
} > ;
// @alpha @deprecated (undocumented)
export interface UserIdentifierCustomisations {
getDisplayUserIdentifier ( userId : string , opts : {
roomId? : string ;
withDisplayName? : boolean ;
} ) : string | null ;
}
2025-07-24 16:27:09 +01:00
// @public
export function useWatchable < T > ( watchable : Watchable < T > ) : T ;
2025-05-16 15:49:07 +01:00
// @public
export type Variables = {
count? : number ;
[ key : string ] : number | string | undefined ;
} ;
2025-06-24 09:50:02 +01:00
// @public
export class Watchable < T > {
constructor ( currentValue : T ) ;
2025-10-23 12:22:39 +05:30
// Warning: (ae-forgotten-export) The symbol "WatchFn" needs to be exported by the entry point index.d.ts
//
2025-06-24 09:50:02 +01:00
// (undocumented)
2025-10-23 12:22:39 +05:30
protected readonly listeners : Set < WatchFn < T > > ;
2025-10-23 23:45:36 +05:30
protected onFirstWatch ( ) : void ;
protected onLastWatch ( ) : void ;
2025-06-24 09:50:02 +01:00
// (undocumented)
unwatch ( listener : ( value : T ) = > void ) : void ;
get value ( ) : T ;
set value ( value : T ) ;
// (undocumented)
watch ( listener : ( value : T ) = > void ) : void ;
}
2025-05-16 15:49:07 +01:00
// @alpha @deprecated (undocumented)
export interface WidgetPermissionsCustomisations < Widget , Capability > {
preapproveCapabilities ? ( widget : Widget , requestedCapabilities : Set < Capability > ) : Promise < Set < Capability > > ;
}
// @alpha @deprecated (undocumented)
export interface WidgetVariablesCustomisations {
isReady ? ( ) : Promise < void > ;
provideVariables ? ( ) : {
currentUserId : string ;
userDisplayName? : string ;
userHttpAvatarUrl? : string ;
clientId? : string ;
clientTheme? : string ;
clientLanguage? : string ;
deviceId? : string ;
baseUrl? : string ;
} ;
}
// (No @packageDocumentation comment for this package)
```