import React, { CSSProperties } from 'react'; import { ControlType } from 'braft-editor'; import 'braft-editor/dist/index.css'; import './BlockTextEditor.css'; export declare type BlockTextEditorState = { toHTML(option?: Record): string; toText(): string; isEmpty(): boolean; }; declare type Heading = 'header-one' | 'header-two' | 'header-three' | 'header-four' | 'header-five' | 'header-six' | 'unstyled'; declare type ImageControl = 'float-left' | 'float-right' | 'align-left' | 'align-center' | 'align-right' | 'link' | 'size' | 'remove'; interface MediaUploadParam { file: File; progress: (progress: number) => void; libraryId: string; success: (res: { url: string; meta: { id: string; title: string; alt: string; loop: boolean; autoPlay: boolean; controls: boolean; poster: string; }; }) => void; error: (err: { msg: string; }) => void; } export interface BlockTextEditorProps { /** * Default inner HTML string * * <@default=`''`> */ defaultValue?: string; placeholder?: string; className?: string; contentStyle?: CSSProperties; /** * <@default=`['headings', 'separator', 'text-color', 'bold', 'italic', 'underline', 'strike-through', 'separator', 'list-ol', 'list-ul', 'blockquote', 'separator', 'link', 'separator', 'emoji', 'remove-styles', 'separator', 'fullscreen']`> */ toolbarOptions?: ControlType[]; headings?: Heading[]; /** * <@default=`['align-left', 'align-center', 'align-right', 'remove']`> */ imageControls?: ImageControl[]; onChange?: (newValue: string) => void; onReady?: (editorState: BlockTextEditorState) => void; onMediaUpload?: (mediaUploadParam: MediaUploadParam) => void; } export declare const BlockTextEditor: React.NamedExoticComponent; export {};