import type { FC } from 'react'; import type { RichContent } from 'ricos-schema'; import type { CommandDescriptor } from './commands'; import type { AnchorTarget, AvailableExperiments, CustomAnchorScroll, FocusPosition, Link_Rel, onAtomicBlockFocus, RelValue, TextAlignment } from './commonTypes'; import type { DebugMode } from './debug-mode'; import type { OnErrorFunction } from './editorTypes'; import type { EditorPlugin, LinkPanelSettings } from './pluginTypes'; import type { CustomizableKeyboardShortcut } from './shortcuts'; import type { RicosTheme } from './themeTypes'; import type { GetToolbarSettings } from './toolbarSettingsTypes'; export type Environment = 'businessManager' | 'liveSite'; export interface CommonProps { isMobile?: boolean; linkSettings?: LinkSettings; locale?: string; localeContent?: string; mediaSettings?: MediaSettings; onError?: OnErrorFunction; theme?: RicosTheme; textAlignment?: TextAlignment; onAtomicBlockFocus?: onAtomicBlockFocus; experiments?: AvailableExperiments; iframeSandboxDomain?: string; textWrap?: boolean; environment?: Environment; debugMode?: DebugMode[]; } interface EditorEvents { subscribe: (event: string, callback: () => Promise<{ type: string; data: unknown; }>) => (event: string, callback: () => Promise<{ type: string; data: unknown; }>) => void; unsubscribe: (event: string, callback: () => Promise<{ type: string; data: unknown; }>) => void; dispatch: (event: string) => Promise; publish: () => Promise; } export interface EditorProps extends CommonProps { plugins?: EditorPlugin[]; linkPanelSettings?: LinkPanelSettings; modalSettings?: ModalSettings; onChange?: OnContentChangeFunction; placeholder?: string; toolbarSettings?: ToolbarSettings; onBusyChange?: OnBusyChangeFunction; injectedContent?: RichContent; maxTextLength?: number; editorEvents?: EditorEvents; sideBlockComponent?: FC<{ id: string; }>; commands?: CommandDescriptor[]; onLoad?: (editor: any) => void; autofocus?: FocusPosition; container?: HTMLElement | (() => HTMLElement | null); content?: RichContent; keyboardShortcuts?: CustomizableKeyboardShortcut[]; /** * The placeholder to be displayed while the editor is loading. */ loadingPlaceholder?: React.ReactNode; } export type OnContentChangeFunction = (content: RichContent) => void; export type OnBusyChangeFunction = (isBusy: boolean) => void; export type ModalSettings = { onModalOpen?: () => void; onModalClose?: () => void; } & ModalSettingsDeprecated; /** * @deprecated */ type ModalSettingsDeprecated = { openModal?: (data: Record) => void; closeModal?: () => void; ariaHiddenId?: string; container?: HTMLElement; }; export type MegaToolbarSettings = { type: 'dynamic' | 'static'; position?: 'top' | 'bottom'; orientation?: 'formatting' | 'plugins'; switchButton?: boolean; undoRedoButtons?: boolean; }; export interface ToolbarSettings { getToolbarSettings?: GetToolbarSettings; textToolbarContainer?: HTMLElement; useStaticTextToolbar?: boolean | { disabled: boolean; }; staticToolbarAlignment?: 'left' | 'center' | 'right'; } export type FullscreenProps = { backgroundColor?: string; foregroundColor?: string; container?: HTMLElement | (() => HTMLElement | null); }; export interface MediaSettings { pauseMedia?: boolean; disableRightClick?: boolean; fullscreenProps?: FullscreenProps; /** * @deprecated */ disableDownload?: boolean; } export interface LinkSettings { anchorTarget?: AnchorTarget; relValue?: RelValue; rel?: Link_Rel; customAnchorScroll?: CustomAnchorScroll; } export type RicosPortal = HTMLDivElement; export {}; //# sourceMappingURL=RicosTypes.d.ts.map