Update custom components API to have @alpha stability.

This commit is contained in:
Half-Shot
2025-06-17 14:07:06 +01:00
parent e2a89888c2
commit 0d4a45d447
3 changed files with 7 additions and 21 deletions
@@ -22,6 +22,7 @@ export interface AliasCustomisations {
export interface Api extends LegacyModuleApiExtension, LegacyCustomisationsApiExtension { export interface Api extends LegacyModuleApiExtension, LegacyCustomisationsApiExtension {
readonly config: ConfigApi; readonly config: ConfigApi;
createRoot(element: Element): Root; createRoot(element: Element): Root;
// @alpha
readonly customComponents: CustomComponentsApi; readonly customComponents: CustomComponentsApi;
readonly i18n: I18nApi; readonly i18n: I18nApi;
readonly rootNode: HTMLElement; readonly rootNode: HTMLElement;
@@ -59,11 +60,8 @@ export interface ConfigApi {
get<K extends keyof Config = never>(key?: K): Config | Config[K]; get<K extends keyof Config = never>(key?: K): Config | Config[K];
} }
// @public // @alpha
export interface CustomComponentsApi { export interface CustomComponentsApi {
// Warning: (ae-incompatible-release-tags) The symbol "registerMessageRenderer" is marked as @public, but its signature references "MatrixEvent" which is marked as @beta
// Warning: (ae-incompatible-release-tags) The symbol "registerMessageRenderer" is marked as @public, but its signature references "CustomMessageRenderFunction" which is marked as @alpha
// Warning: (ae-incompatible-release-tags) The symbol "registerMessageRenderer" is marked as @public, but its signature references "CustomMessageRenderHints" which is marked as @alpha
registerMessageRenderer(eventTypeOrFilter: string | ((mxEvent: MatrixEvent) => boolean), renderer: CustomMessageRenderFunction, hints?: CustomMessageRenderHints): void; registerMessageRenderer(eventTypeOrFilter: string | ((mxEvent: MatrixEvent) => boolean), renderer: CustomMessageRenderFunction, hints?: CustomMessageRenderHints): void;
} }
@@ -134,27 +132,15 @@ export interface LifecycleCustomisations {
onLoggedOutAndStorageCleared?(): void; onLoggedOutAndStorageCleared?(): void;
} }
// @beta // @alpha
export interface MatrixEvent { export interface MatrixEvent {
// (undocumented)
age?: number;
// (undocumented)
content: Record<string, unknown>; content: Record<string, unknown>;
// (undocumented)
eventId: string; eventId: string;
// (undocumented)
originServerTs: number; originServerTs: number;
// (undocumented) roomId: string;
redacts?: string;
// (undocumented)
roomId?: string;
// (undocumented)
sender: string; sender: string;
// (undocumented)
stateKey?: string; stateKey?: string;
// (undocumented)
type: string; type: string;
// (undocumented)
unsigned: Record<string, unknown>; unsigned: Record<string, unknown>;
} }
@@ -48,7 +48,7 @@ export type CustomMessageRenderHints = {
/** /**
* Function used to render a message component. * Function used to render a message component.
* @alpha Unlikely to change * @alpha Subject to change.
*/ */
export type CustomMessageRenderFunction = ( export type CustomMessageRenderFunction = (
/** /**
@@ -63,7 +63,7 @@ export type CustomMessageRenderFunction = (
/** /**
* API for inserting custom components into Element. * API for inserting custom components into Element.
* @public * @alpha Subject to change.
*/ */
export interface CustomComponentsApi { export interface CustomComponentsApi {
/** /**
@@ -90,7 +90,7 @@ export interface Api extends LegacyModuleApiExtension, LegacyCustomisationsApiEx
/** /**
* The custom message component API. * The custom message component API.
* @public * @alpha
*/ */
readonly customComponents: CustomComponentsApi; readonly customComponents: CustomComponentsApi;
/** /**