Merge branches 't3chguy/wat/382.1' and 'main' of github.com:/element-hq/element-web-modules into t3chguy/wat/382.1
# Conflicts: # packages/element-web-module-api/element-web-module-api.api.md
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import { ComponentType } from 'react';
|
||||
import { JSX } from 'react';
|
||||
import { ModuleApi } from '@matrix-org/react-sdk-module-api';
|
||||
import { ReactNode } from 'react';
|
||||
import { Root } from 'react-dom/client';
|
||||
import { RuntimeModule } from '@matrix-org/react-sdk-module-api';
|
||||
|
||||
@@ -111,6 +112,7 @@ export interface ConfigApi {
|
||||
|
||||
// @alpha
|
||||
export interface CustomComponentsApi {
|
||||
registerLoginComponent(renderer: CustomLoginRenderFunction): void;
|
||||
registerMessageRenderer(eventTypeOrFilter: string | ((mxEvent: MatrixEvent) => boolean), renderer: CustomMessageRenderFunction, hints?: CustomMessageRenderHints): void;
|
||||
registerRoomPreviewBar(renderer: CustomRoomPreviewBarRenderFunction): void;
|
||||
}
|
||||
@@ -119,6 +121,25 @@ export interface CustomComponentsApi {
|
||||
export interface CustomisationsApi {
|
||||
registerShouldShowComponent(fn: (this: void, component: UIComponent) => boolean | void): void;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export type CustomLoginComponentProps = {
|
||||
serverConfig: CustomLoginComponentPropsServerConfig;
|
||||
fragmentAfterLogin?: string;
|
||||
children?: ReactNode;
|
||||
onLoggedIn(data: AccountAuthInfo): void;
|
||||
onServerConfigChange(config: CustomLoginComponentPropsServerConfig): void;
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export interface CustomLoginComponentPropsServerConfig {
|
||||
hsName: string;
|
||||
hsUrl: string;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export type CustomLoginRenderFunction = ExtendablePropsRenderFunction<CustomLoginComponentProps>;
|
||||
|
||||
// @alpha
|
||||
export type CustomMessageComponentProps = {
|
||||
mxEvent: MatrixEvent;
|
||||
@@ -177,6 +198,11 @@ export interface DirectoryCustomisations {
|
||||
requireCanonicalAliasAccessToPublish?(): boolean;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export type ExtendablePropsRenderFunction<BaseProps> = <P extends BaseProps>(
|
||||
props: P,
|
||||
originalComponent: (props: P) => JSX.Element) => JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export interface ExtrasApi {
|
||||
getVisibleRoomBySpaceKey(spaceKey: string, cb: () => string[]): void;
|
||||
|
||||
Reference in New Issue
Block a user