import { DefineIconParameters } from 'froala-editor'; import { DraggableProvidedDragHandleProps } from '@hello-pangea/dnd'; import { FroalaOptions } from 'froala-editor'; import { JSX as JSX_2 } from 'react/jsx-runtime'; import { MutableRefObject } from 'react'; import { default as React_2 } from 'react'; import { RefObject } from 'react'; import { RegisterCommandParameters } from 'froala-editor'; declare interface Action { /** * Type of the action. */ readonly type: ActionType; /** * Action parameter. */ readonly parameter: string; /** * Display name of the action. */ readonly label: string; /** * Icon of the action. */ readonly icon?: IconName; /** * Indicates whether action is disabled. */ readonly disabled: boolean; /** * Gets or sets the tooltip of a button. */ readonly title?: string; /** * Indicates whether action is destructive. */ readonly destructive: boolean; /** * Gets or sets the confirmation dialog configuration. */ readonly confirmationDialog?: ConfirmationConfiguration; /** * Identifier of the action. */ readonly identifier: string; /** * Fires on click handler. */ readonly onClick?: () => Promise; /** * Link parameters. */ readonly linkParameters?: LinkParameters; /** * Action button color. */ readonly buttonColor: ButtonColor.Primary | ButtonColor.Secondary | ButtonColor.Tertiary; /** * Component properties to be used for the action. */ readonly componentProperties?: ActionComponentProps; /** * Nested actions. */ readonly actions?: (Action | ActionDivider)[]; } /** * Configuration representing props of the component. */ export declare interface ActionComponentProps { /** * Name of the rendered component. */ readonly componentName: string; /** * Function called to unload Component. */ readonly unloadComponent: () => void; /** * The data for the component. */ readonly componentData: T; /** * Notifies that the action has been executed. */ readonly onActionExecuted: () => void; /** * Rest of action data. */ readonly action?: Omit; } declare interface ActionDivider { /** * Indicates the object is a placeholder for divider instead of an action. */ isDivider: true; } /** * Type of an action. */ declare enum ActionType { /** * Action which redirects to a link. */ Link = "link", /** * Action which executes a page command. */ Command = "command", /** * Action which executes onClick function. */ Client = "client", /** * Action which renders a custom component. */ CustomComponent = "customComponent" } /** * Represents basic set of additional action properties. */ declare interface AdditionalActionProps { readonly identifier: string; readonly componentName?: string; } /** * Represents RTE dropdown option component for inserting assets. */ export declare const AssetPanelRichTextEditorNestedComponent: React_2.ForwardRefExoticComponent>; export declare interface AssetRichTextEditorDropdownOption { /** * Option to be contained in dropdown. */ readonly linkOption: string; } export declare const AssetRichTextEditorPlugin: ({ inputRef, froalaEditorConfigurator, froalaEditorRef, pluginOptions }: AssetRichTextEditorPluginProps) => JSX_2.Element; export declare interface AssetRichTextEditorPluginOptions extends RichTextEditorPluginOptionsBase { /** * Dropdown options for a dropdown used in the plugin. */ readonly dropdownOptions: AssetRichTextEditorDropdownOption[]; /** * Configuration for smart inline asset upload. */ readonly assetUploadConfiguration: SmartInlineAssetUploadConfiguration; /** * Indicates if insert image should be available. */ readonly isInsertImageAvailable: boolean; } export declare interface AssetRichTextEditorPluginProps extends RichTextEditorPluginProps { } export declare interface AssetUploadPlaceholderData { /** * The file associated with the placeholder. */ readonly file: File; /** * The placeholder ID. */ readonly placeholderId: string; /** * The placeholder text. */ readonly placeholderText: string; } declare interface BaseButtonProps extends UITestProps { readonly renderComponent: (props: InjectedProps) => React.ReactNode; readonly size?: ButtonSize; readonly color?: ButtonColor; readonly label?: string; readonly icon?: IconName; readonly trailingIcon?: IconName; readonly active?: boolean; readonly badge?: boolean; readonly fillContainer?: boolean; readonly destructive?: boolean; readonly inProgress?: boolean; readonly disabled?: boolean; readonly borderless?: boolean; readonly tabIndex?: number; readonly dragHandleProps?: DraggableProvidedDragHandleProps | null; readonly className?: string; } declare enum ButtonColor { Primary = 'primary', Secondary = 'secondary', Tertiary = 'tertiary', Quinary = 'quinary' } declare interface ButtonProps extends HTMLButtonProps, Omit { readonly type?: ButtonType; readonly buttonRef?: RefObject; readonly tooltipAppendTo?: Element; } declare enum ButtonSize { XS = 'XS', S = 'S', M = 'M', L = 'L' } declare enum ButtonType { Button = 'button', Submit = 'submit', Reset = 'reset' } /** * Command result interface. */ export declare interface Command { /** * Invocation callback. */ execute: CommandExecutor; } /** * Defines a command context type. */ declare interface CommandContextType { /** * Executes page command. * @param name Name of the command to be executed. * @param data Data passed to the command. * @param files Files to be uploaded by the command. * @param abortController Abort controller which can abort the command request. */ executeCommand: (name: CommandName, data?: TData, files?: FileList, abortController?: AbortController, onUploadProgress?: (event: ProgressEvent) => void, onDownloadProgress?: (event: ProgressEvent) => void) => Promise; /** * Registers command into the current provider. * @param name Name of the command to be registered. * @param execute Callback that executes the command. */ registerCommand: (name: CommandName, execute: (data: T, files?: FileList) => Promise) => void; } /** * Command invocation callback. */ export declare type CommandExecutor = (data?: TData, files?: FileList, abortController?: AbortController) => Promise; declare type CommandName = string; declare interface ComponentContent { /** * Name of the rendered component. */ readonly componentName: string; /** * Configuration representing props of the component. */ readonly componentConfiguration: object; } declare interface ConfirmationConfiguration { /** * Confirmation title shown in prompt dialog. */ readonly title?: string; /** * Confirmation text shown in prompt dialog. */ readonly detail?: string | null; /** * Indicates whether the detail text should be rendered as HTML. */ readonly detailAsHtml?: boolean; /** * Confirmation content shown in prompt dialog. */ readonly content?: ComponentContent; /** * Text of the confirmation button on the prompt dialog. */ readonly button: string; /** * Icon of the confirmation button on the prompt dialog. */ readonly icon?: IconName; /** * Form items representing confirmation form. */ readonly formItems?: FormItems; /** * Indicates whether the confirmation button of the dialog is shown as destructive. */ readonly destructive?: boolean; /** * Represents a customized form name for the dialog. */ readonly formName?: string; /** * Represents a command name used to change the form items. */ readonly changeCommandName?: string; /** * List of fields that if any of them were modified will result in showing the confirmation dialog. * If list is empty, dialog will be shown allways even if no record was modified. */ readonly dependentFieldNames?: string[]; } declare interface DialogAction extends Omit {} declare interface DialogFooterActionProps extends Pick, UITestProps { readonly label: string; readonly tooltipText?: string; } /** * Represents dialog handlers exposing submit action. */ declare interface DialogHandlers { readonly submitAction: DialogAction; readonly cancelAction?: DialogAction; } /** * Represents information about form field. */ export declare interface FieldInfo { readonly name: string; readonly fieldValues: FieldInfoValueType; } /** * Collection of field values. */ export declare type FieldInfoValueType = Record; declare interface FormCategoryProps { readonly title: string; readonly collapsible?: boolean; readonly isCollapsed?: boolean; readonly tooltip?: string; readonly componentName: string; } /** * Represents basic set of form component properties. */ export declare interface FormComponentProps extends FieldInfo { /** * Name of the component. */ readonly componentName: string; /** * Indicates whether evaluation of a visibility condition of some other component depends on this component's value. */ readonly hasDependencies: boolean; /** * Label of the form component. */ readonly label?: string; /** * Status text of the form component. */ readonly statusText?: string; /** * Explanation text of the form component. */ readonly explanationText?: string; /** * Tooltip of the form component. */ readonly tooltip?: string; /** * @deprecated Property is deprecated and will be removed in the next version. Use `editMode` set to `FormEditMode.Disabled` instead. */ readonly disabled?: boolean; /** * Edit mode of the form component. */ readonly editMode?: FormEditMode; /** * Value of the form component. */ readonly value?: any; /** * Indicates if the form component is in invalid state. */ readonly invalid?: boolean; /** * Validation message displayed when the form component is in invalid state. */ readonly validationMessage?: string; /** * Form component's validation rules. */ readonly validationRules?: ValidationRuleProps[]; /** * Additional actions associated with the form component. */ readonly additionalActions?: AdditionalActionProps[]; /** * Action element to be displayed in the label of the form component. */ readonly labelActionsElement?: React.ReactNode; /** * The callback function called when the value of the form component changes. * * @argument value changed value of the form component. */ readonly onChange?: (value: OnChangeValueType) => void; /** * Indicates whether the value of the form component is required. */ readonly required?: boolean; /** * Tooltip message displayed when the form component is disabled. */ readonly inactiveMessage?: string; /** * GUID of the form component. */ readonly guid: string; /** * Dangerously sets tooltip as inner HTML. */ readonly tooltipAsHtml?: boolean; /** * Dangerously sets explanation as inner HTML. */ readonly explanationTextAsHtml?: boolean; } declare enum FormEditMode { /** * Element is editable. */ Default = 'default', /** * Element is disabled. */ Disabled = 'disabled', /** * Element is read-only. */ ReadOnly = 'readOnly' } /** * Array of form components and their categories. */ declare type FormItems = Array; /** Configurator enables custom Froala Typescript plugins to use global Froala configuration methods, which would be unavailable due to different module context. */ declare interface FroalaEditorConfigurator { readonly defineIcon: (iconName: string, parameters: Partial) => void; readonly registerCommand: (buttonName: string, parameters: Partial) => void; readonly disableButton: (buttonName: string, buttonTitle?: string) => void; readonly enableButton: (buttonName: string, buttonTitle?: string) => void; /** * Allows to modify Froala editor options before initialization through callback. * @note If the options returned from the callback contain any events, they will be combined with the default events or those provided by other plugins. */ readonly configureOptions?: (callback: (currentOptions: Partial) => Partial) => void; } /** * Type representing the globalization state, containing the globalization culture. */ export declare type GlobalizationType = { /** * The currently selected UI language code (e.g., 'en-us'). */ uiLanguage: UICultureCode_2; /** * The currently selected UI locale code for date formatting (e.g., 'en-us'). */ uiLocale: UICultureCode_2; }; declare type HTMLButtonProps = Pick, 'title' | 'onClick'>; declare type IconName = IconNameMap[keyof typeof KXIconSets]; declare type IconNameMap = { [K in IconSet]: keyof (typeof KXIconSets)[K]; }; declare type IconSet = keyof typeof KXIconSets; export declare enum ImageType { Select = "select", Upload = "upload" } declare interface InjectedProps { readonly classes: string; readonly children: React.ReactNode; } declare const KXIconSets = { 'xp-default-icon-set': Icons, 'xp-flags-icon-set': Flags }; declare interface LinkParameters { /** * Opens a link using window.open(). * Conflicts with {@link useAnchor}. */ readonly useWindowOpen?: boolean; /** * Opens a link using shadow anchor element. * Conflicts with {@link useWindowOpen}. */ readonly useAnchor?: boolean; /** * Name of the browsing context the resource is being loaded into. */ readonly target: string; /** * Parameters used when link is opened using window.open(). */ readonly windowOpenLinkParameters?: WindowOpenLinkParameters; } /** * Describes options and configuration of a link plugin added to Rich text editor. */ export declare interface LinkRichTextEditorPluginOptions extends RichTextEditorPluginOptionsBase { /** * Dropdown options for a dropdown used in the plugin. */ readonly dropdownOptions: RichTextEditorDropdownOption[]; } /** * LinkRichTextEditorPlugin properties. */ export declare interface LinkRichTextEditorPluginProps extends RichTextEditorPluginProps { } export declare enum LinkType { Asset = "asset", External = "external", WebPage = "webpage" } /** * Represents configuration for mass asset upload feature. */ declare interface MassAssetUploadConfiguration { /** * File extensions allowed to be uploaded. */ readonly allowedExtensions?: string[]; /** * Maximum allowed size of uploaded chunk. */ readonly chunkSize: number; /** * Maximum allowed size of uploaded file. */ readonly maxFileSize: number; /** * Indicates if mass asset upload feature is disabled. */ readonly disabled: boolean; /** * Title for the mass asset upload button. */ readonly title: string; /** * Maximum number of files that can be uploaded concurrently to server. */ readonly maxConcurrentUploads: number; } declare interface NotificationMessage { readonly id?: string | number; readonly message: string; readonly type: NotificationMessageType; readonly messageAsHtml?: boolean; readonly autoHide?: boolean; } declare enum NotificationMessageType { Success = "success", Error = "error", Warning = "warning", Info = "info" } /** * Untyped alias for value used on change. */ declare type OnChangeValueType = Object | null; /** * Describes single dropdown option configuration. */ export declare interface RichTextEditorDropdownOption { /** * Option to be contained in dropdown. */ readonly linkOption: string; /** * Corresponding component of an option. */ readonly componentName?: string; } export declare const RichTextEditorNestedComponentLoader: { ({ onLoad, ...props }: RichTextEditorNestedComponentLoaderProps): JSX_2.Element; displayName: string; }; export declare interface RichTextEditorNestedComponentLoaderProps extends RichTextEditorNestedComponentProps { /** Function called after load of the plugin. */ readonly onLoad: (inputRef: RichTextEditorNestedComponentRef) => void; } export declare interface RichTextEditorNestedComponentProps { readonly componentName: string; /** Reference to RichTextEditor providing higher-scope functions (i.e. inserting link/image or executing a command). */ readonly inputRef?: RefObject; /** General low-level reference to Froala editor. */ readonly froalaEditorRef?: MutableRefObject; /** Configurator is used to access Froala configuration methods usually available in global JS scope and unavailable for a plugin in different JS module. */ readonly froalaEditorConfigurator: FroalaEditorConfigurator; } /** * Ref to provide rich text editor's nested component methods. */ export declare interface RichTextEditorNestedComponentRef { /** * Runs rich text editor nested component. */ readonly execute: () => void; } /** * Describes options and configuration of a custom plugin added to Rich text editor. */ declare interface RichTextEditorPluginOptionsBase {} declare interface RichTextEditorPluginProps { readonly componentName: string; /** Reference to RichTextEditor providing higher-scope functions (i.e. inserting link/image or executing a command). */ readonly inputRef?: RefObject; /** General low-level reference to Froala editor. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly froalaEditorRef?: MutableRefObject; /** Configurator is used to access Froala configuration methods usually available in global JS scope and unavailable for a plugin in different JS module. */ readonly froalaEditorConfigurator: FroalaEditorConfigurator; /** Options and configuration of RTE plugins. */ readonly pluginOptions?: RichTextEditorPluginOptionsBase; } /** * Ref to provide rich text editor's methods. */ declare interface RichTextEditorRef { /** * Insert image into the text on current caret position (required). */ readonly insertImage: (imageUrl: string, imageAttributes: { [key: string]: string }) => void; /** * Replace image with a different one. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly replaceImage: (imageUrl: string, imageAttributes: { [key: string]: string }, imageToReplace: any) => void; /** * Insert link into the text on current caret position (required). */ readonly insertLink: (linkUrl: string, linkTitle: string, linkAttributes?: { [key: string]: string }) => void; /** * Executes registered command by its name. */ readonly executeCommand: (commandName: string) => void; /** * Insert html content into the text on current caret position (required). */ readonly insertHtml?: (htmlContent: string) => void; /** * Ensure onChange event. */ readonly ensureChange?: () => void; /** * Indicates if the rich text editor is disabled. */ readonly isDisabled?: () => boolean; } export declare const RoutingContentPlaceholder: ({ children }: RoutingContentPlaceholderProps) => JSX_2.Element; /** * Represents properties for RoutingContentPlaceholder component. */ export declare interface RoutingContentPlaceholderProps { children?: React_2.ReactNode; } /** * Represents configuration for smart inline asset upload feature in the content item selector. */ declare interface SmartInlineAssetUploadConfiguration extends MassAssetUploadConfiguration { /** * Indicates if side panel for folder and/or workspace selection should be used. */ readonly useSelectionSidePanel: boolean; /** * Workspace id for smart inline asset upload when side panel is not open and user has only single workspace access. */ readonly workspaceId?: number; } /** * Represents properties for Dialog context component. */ export declare interface TemplateDialogContextProps { /** * Indicates whether the dialog is displayed. */ readonly isInDialog: boolean; /** * Title of the dialog. */ readonly title: string; /** * Sets the title of the dialog. */ readonly setTitle: (title: string) => void; /** * Minimal width of the dialog. */ readonly minWidth?: string | number; /** * Sets minimal width of the dialog. */ readonly setMinWidth: (width: string | number) => void; /** * Width of the dialog. */ readonly width?: string | number; /** * Sets width of the dialog. */ readonly setWidth: (width: string | number) => void; /** * Maximal width of the dialog. */ readonly maxWidth?: string | number; /** * Sets maximal width of the dialog. */ readonly setMaxWidth: (width: string | number) => void; /** * Minimal height of the dialog. */ readonly minHeight?: string | number; /** * Sets minimal height of the dialog. */ readonly setMinHeight: (height: string | number) => void; /** * Height of the dialog. */ readonly height?: string | number; /** * Sets height of the dialog. */ readonly setHeight: (height: string | number) => void; /** * Maximal height of the dialog. */ readonly maxHeight?: string | number; /** * Sets maximal height of the dialog. */ readonly setMaxHeight: (height: string | number) => void; /** * Indicates whether the dialog is displayed in fullscreen view. */ readonly isFullscreen: boolean; /** * Sets whether the dialog has dimensions of the fullscreen. */ readonly setIsFullscreen: (isFullscreen: boolean) => void; /** * Represents handlers for dialog actions. */ readonly dialogHandlers: DialogHandlers; /** * @deprecated Property is deprecated and will be removed in the next version. * * Dialog messages. */ readonly messages: NotificationMessage[]; /** * @deprecated Property is deprecated and will be removed in the next version. * * Adds dialog message. */ readonly addDialogMessage: (message: NotificationMessage) => void; /** * @deprecated Property is deprecated and will be removed in the next version. * * Removes dialog message. */ readonly removeDialogMessage: (id: string | number) => void; /** * @deprecated Property is deprecated and will be removed in the next version. * * Determines whether message should be displayed inside of the dialog instead of the standard snackbar. */ readonly canProcessMessageType: (messageVariant: NotificationMessageType) => boolean; /** * Closes the dialog. */ readonly closeDialog: () => void; /** * Indicates whether dialog action is currently in progress. */ readonly actionInProgress: boolean; /** * Sets whether dialog action is currently in progress. */ readonly setActionInProgress: (prevent: boolean) => void; } /** * Unified test ID map used in both components and tests. * Combines UI-defined IDs and test-only generated ones. * * Intended for internal use only. * Shared `data-testid` values used across tests and UI. * May change over time. */ // eslint-disable-next-line @typescript-eslint/naming-convention declare type TestId = string & { readonly __type: 'TestId' }; /** * Represents a culture code used for localization in the UI. */ declare type UICultureCode = string & { readonly __type: 'UICultureCode'; }; /** * Represents a culture code used for localization in the UI. */ // eslint-disable-next-line @typescript-eslint/naming-convention declare type UICultureCode_2 = string & { readonly __type: 'UICultureCode' }; declare interface UITestProps { /** * Test id data attribute. */ readonly dataTestId?: TestId; } /** * Command execution configuration. */ export declare type UseCommandConfig = { /** * Command data. */ data?: TCommandData; /** * Indicates whether command should be invoked automatically on component mount. * Defaults to `false`. */ executeOnMount?: boolean; /** * Custom action executed before the command execution. * If the function returns `false` the command will not be executed. */ before?: () => boolean | void; /** * Custom action executed after the command execution. */ after?: (commandResult: TCommandResult | undefined) => void; }; /** * Registers command into the current command provider and returns its invocation callback. * * @param fieldInfo Related form field info * @param commandName Name of the command. * @param config Command options. * @param dependencies If present, command will only activate if the values in the list change. * @returns Invocation callback to be executed manually. */ export declare const useFormComponentCommand: (fieldInfo: FieldInfo, commandName: string, config?: UseCommandConfig, dependencies?: React_2.DependencyList) => Command; /** * Returns the form command provider for the current page. */ export declare const useFormComponentCommandProvider: () => { executeCommand: (fieldInfo: FieldInfo, name: string, data?: TData, files?: FileList, abortController?: AbortController, onUploadProgress?: (event: ProgressEvent) => void, onDownloadProgress?: (event: ProgressEvent) => void) => Promise; }; export declare const useGlobalization: () => { uiLanguage: UICultureCode; uiLocale: UICultureCode; }; /** * Registers command into the current command provider and returns its invocation callback. * * @param commandName Name of the command. * @param config Command options. * @param dependencies If present, command will only activate if the values in the list change. * @returns Invocation callback to be executed manually. */ export declare function usePageCommand(commandName: CommandName, config?: UseCommandConfig, dependencies?: React_2.DependencyList): Command; /** * Returns the command provider for the current page. */ export declare const usePageCommandProvider: () => CommandContextType; /** * Allows access to dialog properties. * * @returns Members to customize the dialog. */ export declare const useTemplateDialog: () => TemplateDialogContextProps; /** * Validation rule result type. */ export declare interface ValidationResult { readonly isValid: boolean; readonly errorMessage: string | null; hasChanged?: boolean; } /** * Base type used by validation rules. */ export declare interface ValidationRule

{ (props: P, value: T, fieldValues: Record): ValidationResult; } /** * Represents basic set of validation rule properties. */ export declare interface ValidationRuleProps { readonly ruleName: string; readonly isValid: boolean; readonly errorMessage: string | null; } declare interface WindowOpenLinkParameters { /** * Target window features. */ readonly features: string; } export { }