import type { CSSProperties } from 'react'; import type { FileComponentData, ImageComponentData, UpdateEntityFunc, VideoComponentData } from 'ricos-content'; import type { RichContent } from 'ricos-schema'; import type { BICallbacks, ComponentData, EditorCommands, FocusPosition, ToolbarType } from '.'; import type { OnPluginAction } from './pluginsBiCallbacksTypes'; export interface Helpers extends BICallbacksForHelpers { openModal?: (modalProps: Record) => void; closeModal?: () => void; handleFileUpload?: (file: File, updateEntity: UpdateEntityFunc) => void; handleFileSelection?: (index: number | undefined, multiple: boolean, updateEntity: UpdateEntityFunc, removeEntity?: undefined, componentData?: ComponentData) => void; /** * @description Used to update metadata for external videos (youtube/vimeo, etc.) */ onVideoSelected?: (url: string, updateEntity: (data: { oembed: { thumbnail_url?: string; thumbnail_height?: number; thumbnail_width?: number; video_url?: string; title?: string; } | null; }) => void) => void; getImageUrl?: ({ file_name }: { file_name: string; }) => string; [propName: string]: ((...args: any[]) => any) | undefined; } interface BICallbacksForHelpers extends BICallbacks { onPluginAdd?(pluginId: string, entryPoint: string, version?: string, contentId?: string): void; onPluginAddSuccess?(pluginId: string, entryPoint: string, params: any, version?: string, contentId?: string): void; isPreview?: () => boolean; onPluginAction?: OnPluginAction; } export type OnErrorFunction = (error: string) => void; export type CustomStyleFn = (styles: CSSProperties) => CSSProperties; export type TextToolbarType = 'inline' | 'static'; export interface EditorStyleClasses { editorClassName?: string; containerClassName?: string; } export declare const DOC_STYLE_TYPES: { P: string; H1: string; H2: string; H3: string; H4: string; H5: string; H6: string; }; export declare const DRAFT_TO_DOC_TYPE: { "header-one": string; "header-two": string; "header-three": string; "header-four": string; "header-five": string; "header-six": string; unstyled: string; }; export declare const DRAFT_TO_DOC_TYPE_WITH_LISTS: { 'ordered-list-item': string; 'unordered-list-item': string; "header-one": string; "header-two": string; "header-three": string; "header-four": string; "header-five": string; "header-six": string; unstyled: string; }; type GetContentPromiseProps = { flush?: boolean | undefined; publishId?: string | undefined; } | undefined; export interface RicosEditorAPI { focus(focusPosition?: FocusPosition): void; blur(): void; getContent(postId?: string, forPublish?: boolean, shouldRemoveErrorBlocks?: boolean): Promise; getContentPromise(props: GetContentPromiseProps): Promise; getContentTraits(): { isEmpty: boolean; isContentChanged: boolean; isLastChangeEdit: boolean; }; getToolbarProps(type: ToolbarType): { buttons: any; }; getEditorCommands(): EditorCommands; } export {}; //# sourceMappingURL=editorTypes.d.ts.map