import { CompositeDecorator , ContentBlock , DraftBlockRenderMap , DraftDecorator , DraftDragType , DraftEditorCommand , DraftHandleValue , DraftInlineStyle , DraftStyleMap , EditorState , SelectionState , } from 'draft-js' ; import { CSSProperties , KeyboardEvent , SyntheticEvent } from 'react' ; import createEditorStateWithTextFn from './utils/createEditorStateWithText' ; import composeDecoratorsFn from './utils/composeDecorators' ; export { default } from './Editor' ; export const createEditorStateWithText = createEditorStateWithTextFn ; export const composeDecorators = composeDecoratorsFn ; export type { PluginEditorProps } from './Editor' ; export type EditorCommand = DraftEditorCommand | string ; export interface GetSetEditorState { setEditorState ( editorState ) : void ; getEditorState ( ) : EditorState ; } export interface EditorRef { refs ? : { editor : HTMLElement ; } ; editor : HTMLElement ; } export interface PluginFunctions extends GetSetEditorState { getPlugins ( ) : EditorPlugin [ ] ; getProps ( ) : unknown ; getReadOnly ( ) : boolean ; setReadOnly ( readOnly ) : void ; getEditorRef ( ) : EditorRef ; } export interface AriaProps { ariaHasPopup ? : string ; ariaExpanded ? : boolean ; ariaOwneeID ? : string ; ariaActiveDescendantID ? : string ; } export interface EditorPlugin { decorators ? : Array < DraftDecorator | CompositeDecorator > ; getAccessibilityProps ? ( ) : AriaProps ; initialize ? : ( pluginFunctions : PluginFunctions ) => void ; onChange ? : ( editorState : EditorState , pluginFunctions : PluginFunctions ) => EditorState ; willUnmount ? : ( pluginFunctions : GetSetEditorState ) => void ; blockRenderMap ? : DraftBlockRenderMap ; blockRendererFn ? ( block , pluginFunctions ) : any ; blockStyleFn ? ( block , pluginFunctions ) : string | undefined | null ; customStyleFn ? : ( style : DraftInlineStyle , block : ContentBlock , pluginFunctions : PluginFunctions ) => CSSProperties ; customStyleMap ? : DraftStyleMap ; keyBindingFn ? ( event , pluginFunctions ) : EditorCommand | null | undefined ; handleReturn ? ( event , editorState , pluginFunctions ) : DraftHandleValue | undefined ; handleKeyCommand ? ( command , editorState , eventTimeStamp , pluginFunctions ) : DraftHandleValue ; handleBeforeInput ? ( chars , editorState , eventTimeStamp , pluginFunctions ) : DraftHandleValue ; handlePastedText ? ( text , html , editorState , pluginFunctions ) : DraftHandleValue ; handlePastedFiles ? ( files , pluginFunctions ) : DraftHandleValue ; handleDroppedFiles ? ( selection , files , pluginFunctions ) : DraftHandleValue ; handleDrop ? ( selection , dataTransfer , isInternal , pluginFunctions ) : DraftHandleValue ; onEscape ? ( event , pluginFunctions ) : void | true ; onTab ? ( event , pluginFunctions ) : void | true ; onUpArrow ? ( event , pluginFunctions ) : void | true ; onDownArrow ? ( event , pluginFunctions ) : void | true ; onRightArrow ? ( event , pluginFunctions ) : void | true ; onLeftArrow ? ( event , pluginFunctions ) : void | true ; onBlur ? ( event , pluginFunctions ) : void | true ; onFocus ? ( event , pluginFunctions ) : void | true ; }