From 0d4a45d4472a493f25bf46f73afe49032797f3e2 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Tue, 17 Jun 2025 14:03:10 +0100 Subject: [PATCH] Update custom components API to have @alpha stability. --- .../element-web-module-api.api.md | 22 ++++--------------- .../src/api/custom-components.ts | 4 ++-- .../element-web-module-api/src/api/index.ts | 2 +- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/packages/element-web-module-api/element-web-module-api.api.md b/packages/element-web-module-api/element-web-module-api.api.md index b2bda29ab8..6d6403735e 100644 --- a/packages/element-web-module-api/element-web-module-api.api.md +++ b/packages/element-web-module-api/element-web-module-api.api.md @@ -22,6 +22,7 @@ export interface AliasCustomisations { export interface Api extends LegacyModuleApiExtension, LegacyCustomisationsApiExtension { readonly config: ConfigApi; createRoot(element: Element): Root; + // @alpha readonly customComponents: CustomComponentsApi; readonly i18n: I18nApi; readonly rootNode: HTMLElement; @@ -59,11 +60,8 @@ export interface ConfigApi { get(key?: K): Config | Config[K]; } -// @public +// @alpha 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; } @@ -134,27 +132,15 @@ export interface LifecycleCustomisations { onLoggedOutAndStorageCleared?(): void; } -// @beta +// @alpha export interface MatrixEvent { - // (undocumented) - age?: number; - // (undocumented) content: Record; - // (undocumented) eventId: string; - // (undocumented) originServerTs: number; - // (undocumented) - redacts?: string; - // (undocumented) - roomId?: string; - // (undocumented) + roomId: string; sender: string; - // (undocumented) stateKey?: string; - // (undocumented) type: string; - // (undocumented) unsigned: Record; } diff --git a/packages/element-web-module-api/src/api/custom-components.ts b/packages/element-web-module-api/src/api/custom-components.ts index 0c8a26712d..becc0f1992 100644 --- a/packages/element-web-module-api/src/api/custom-components.ts +++ b/packages/element-web-module-api/src/api/custom-components.ts @@ -48,7 +48,7 @@ export type CustomMessageRenderHints = { /** * Function used to render a message component. - * @alpha Unlikely to change + * @alpha Subject to change. */ export type CustomMessageRenderFunction = ( /** @@ -63,7 +63,7 @@ export type CustomMessageRenderFunction = ( /** * API for inserting custom components into Element. - * @public + * @alpha Subject to change. */ export interface CustomComponentsApi { /** diff --git a/packages/element-web-module-api/src/api/index.ts b/packages/element-web-module-api/src/api/index.ts index 3e9d4d072f..399d807a14 100644 --- a/packages/element-web-module-api/src/api/index.ts +++ b/packages/element-web-module-api/src/api/index.ts @@ -90,7 +90,7 @@ export interface Api extends LegacyModuleApiExtension, LegacyCustomisationsApiEx /** * The custom message component API. - * @public + * @alpha */ readonly customComponents: CustomComponentsApi; /**