import * as React from "react"; import { UICustomization, CustomizationSchema, NativeComponents } from "./Customization.definitions"; import { ContentFragmentProps } from "./DynamicContentStore.definitions"; import { ComponentWrapper } from "./componentDecorating"; export interface NativeComponentIdentifier { nativeComponent: NativeComponents; } export interface RegisteredComponent { component: React.ReactElement; options?: ContentFragmentProps; } export declare class CustomizationInternal { private customizationVersion; private registeredNativeComponentsMap; private registeredCustomComponentsMap; private registeredWrappersMap; private registeredRemoveOptionsMap; init(customizationVersion: UICustomization): void; registerCustomComponent(identifier: Pick, component: React.ReactElement, options?: ContentFragmentProps): void; registerNativeComponent(identifier: NativeComponentIdentifier, component: React.ReactElement, options?: ContentFragmentProps): void; registerWrapper(identifier: Pick, wrapper: ComponentWrapper): void; registerRemove(identifier: Pick, options?: ContentFragmentProps): void; applyCustomizations(schema: CustomizationSchema): void; private getRegisteredComponent; private applyOperationToStore; private applyAddOperationToStore; private applyReplaceOperationToStore; private applyRemoveOperationToStore; private applyAddWrapperOperationToStore; } export declare const customizationInternal: CustomizationInternal; /** * The unique identifier for registering a custom component. * * @property {string} customComponent the unique key to identify the custom component that is being registered. * @property {string} componentHint a hint to give context about what this component customizes. Note that this does not define where the component is actually shown in the UI. * @property {"add" | "replace"} operationHint a hint to give context about what operation this component performs. * @private */ export interface CustomComponentIdentifier { customComponent: string; componentHint: string; operationHint: "add" | "replace"; } /** * The unique identifier for registering a custom component. * * @property {string} customComponent the unique key to identify the custom component that is being registered. * @property {string} componentHint a hint to give context about what this component customizes. Note that this does not define where the component is actually shown in the UI. * @private */ export interface CustomWrapperIdentifier { customComponent: string; componentHint: string; } /** * The unique identifier for registering a custom component. * * @property {string} ref the unique key to identify the remove operation to be registered. * @property {string} keyHint a hint to give context about the unique key to identify the child component that is targeted to be removed. * @property {string} componentHint a hint to give context about what this component customizes. Note that this does not define where the component is actually shown in the UI. * @private */ export interface RegisterRemoveIdentifier { ref: string; keyHint: string; componentHint: string; } export declare const Customization: { /** * Function for registering custom components to Flex UI. This should be used with the Flex UI Customization Service to * define where this customization appears in the UI. * * @param {CustomComponentIdentifier} identifier The unique identifier for registering a custom component * @param {React.ReactElement} component The UI component to register for the customization * @param {ContentFragmentProps} options Additional options to further customize the behaviour of the component. * @private * @example * Customization.registerComponent( * { customComponent: "my-suggestion-list", componentHint: "RootContainer.Content", operationHint: "add" }, * , * { sortOrder: -1 } * ); */ registerComponent(identifier: CustomComponentIdentifier, component: React.ReactElement, options?: ContentFragmentProps): void; /** * Function for registering custom component wrappers to Flex UI. This should be used with the Flex UI Customization Service to * define where this customization appears in the UI. * * @param {CustomWrapperIdentifier} identifier The unique identifier for registering a custom component wrapper * @param {ComponentWrapper} wrapper The wrapper UI component to register for customization * @private * @example * Customization.registerWrapper( * { customComponent: "my-suggestion-list", componentHint: "RootContainer.Content" }, * (RootContainer) => (props) => * ); */ registerWrapper(identifier: CustomWrapperIdentifier, wrapper: ComponentWrapper): void; /** * Function for registering remove operations to Flex UI. This should be used with the Flex UI Customization Service to * define where this customization appears in the UI. * * @param {RegisterRemoveIdentifier} identifier The unique identifier for registering a remove operation * @param {ContentFragmentProps} options options Additional options to further customize the behaviour of the component. * @private * @example * Customization.registerRemove( * { ref: "my-ref", keyHint: "header", componentHint: "RootContainer.Content" }, * { sortOrder: -1, if: () => fn() } * ); */ registerRemove(identifier: RegisterRemoveIdentifier, options?: ContentFragmentProps): void; };