/** * @packageDocumentation This package provides a MUI theme that fits to * the default Element theme. */ import { AvatarProps } from '@mui/material'; import { BackendModule } from 'i18next'; import { Capability } from 'matrix-widget-api'; import { ForwardRefExoticComponent } from 'react'; import LanguageDetector from 'i18next-browser-languagedetector'; import { PropsWithChildren } from 'react'; import { ReactElement } from 'react'; import { RefAttributes } from 'react'; import { WidgetApi } from '@matrix-widget-toolkit/api'; import { WidgetEventCapability } from 'matrix-widget-api'; import { WidgetRegistration } from '@matrix-widget-toolkit/api'; /** * A component to display user and room avatars in the style of Element. * @param param0 - {@link ElementAvatarProps} */ export declare const ElementAvatar: ForwardRefExoticComponent & RefAttributes>; /** * Props for the {@link ElementAvatar} component. */ export declare type ElementAvatarProps = { /** * The id of the user. * Even though the field is called userId, it can also be used to display * avatars for rooms. */ userId: string; /** * The display name of the user. * If not provided, the userId is used instead. */ displayName?: string; /** * The url of the avatar. * If not provided, the initial letter based on the display name or userId is used instead. */ avatarUrl?: string; } & AvatarProps; /** * Reads environment variables starting with `REACT_APP_` from a global variable * at runtime and falls back to `process.env` build time variables. * * @param name - The name of the environment variable, should start with * `REACT_APP_`. */ export declare function getEnvironment(name: string): string | undefined; /** * Reads environment variables starting with `REACT_APP_` from a global variable * at runtime and falls back to `process.env` build time variables. * * @param name - The name of the environment variable, should start with * `REACT_APP_`. * @param defaultValue - The default value to return if the environment variable * is not provided. */ export declare function getEnvironment(name: string, defaultValue: string): string; /** * Retrieve the nonce passed by our Docker base image. * @returns A nonce that can be used to perform operations that are disabled in * our CSP by default. */ export declare function getNonce(): string | undefined; /** * A guard that ask the user for capabilities and only shows the `children` * if all capabilities were accepted. * If capabilities are denied, a message and a button to retry is displayed * instead. * @param param0 - {@link MuiCapabilitiesGuardProps} */ export declare function MuiCapabilitiesGuard({ capabilities, children, }: MuiCapabilitiesGuardProps): ReactElement; /** * Props for the {@link MuiCapabilitiesGuard} component. */ export declare type MuiCapabilitiesGuardProps = PropsWithChildren<{ /** * Required capabilities to display the `children`. */ capabilities: Array; }>; /** * Provide a semantic UI based theme to the child components. * @param param0 - {@link MuiThemeProviderProps} */ export declare function MuiThemeProvider({ children, }: MuiThemeProviderProps): ReactElement; /** * Props for the {@link MuiThemeProvider} component. */ export declare type MuiThemeProviderProps = PropsWithChildren; /** * Provides the `WidgetApi` in the React context once it's fully * initialized without errors. * Use `useWidgetApi` to access it. * @param param0 - {@link MuiWidgetApiProviderProps} */ export declare function MuiWidgetApiProvider({ widgetRegistration, widgetApiPromise, children, }: MuiWidgetApiProviderProps): ReactElement; /** * Props for the {@link (MuiWidgetApiProvider:function)} component. */ export declare type MuiWidgetApiProviderProps = PropsWithChildren<{ /** * Configuration to set during Widget registration. */ widgetRegistration?: WidgetRegistration; /** * Result from a call to `WidgetApiImpl.create`. */ widgetApiPromise: Promise; }>; /** * A language detector that reads the language from the widget url. */ export declare class WidgetApiLanguageDetector extends LanguageDetector { constructor(); } /** * Backend for usage with `i18n-next` that provides translations for internal * messages. */ export declare const WidgetToolkitI18nBackend: BackendModule; export { }