/// import { RefObject, ReactNode } from 'react'; import { SyncHook, SyncWaterfallHook, SyncBailHook } from 'tapable'; import { EditorState, Editor } from 'draft-js'; import { DraftNodeDecoratorStrategy } from './draft-js'; export interface Hooks { setState: SyncHook; onChange: SyncWaterfallHook; stateFilter: SyncBailHook; toggleWaterfallBlockType: SyncWaterfallHook; toggleBlockType: SyncHook; toggleInlineStyleV2: SyncHook; toggleInlineStyle: SyncHook; afterInlineStyleApplied: SyncHook; createBlockRenderMap: SyncBailHook; createCustomStyleMap: SyncBailHook; blockStyleFn: SyncBailHook; handleKeyCommand: SyncBailHook; handleDroppedFiles: SyncHook; addImage: SyncHook; blockRendererFn: SyncBailHook; createPlaceholder: SyncHook; didUpdate: SyncHook; updatePlaceholder: SyncHook; compositeDecorator: SyncWaterfallHook; keyBindingFn: SyncBailHook; syncSelectionChange: SyncHook; selectionInitChange: SyncHook; selectionCollapsedChange: SyncHook; selectionFocusChange: SyncHook; selectionMoveInnerBlock: SyncHook; selectionMoveOuterBlock: SyncHook; selectionRangeChange: SyncHook; selectionRangeSizeChange: SyncHook; selectionRangeContentChange: SyncHook; inlineBarChange: SyncHook; hideInlineToolbar: SyncHook; afterClickLinkButton: SyncHook; cleanUpLinkClickState: SyncHook; toggleImageToolbarVisible: SyncHook; updateDecorator: SyncWaterfallHook; updateDragSubscription: SyncHook; syncBlockKeys: SyncHook; prepareDragStart: SyncHook; teardownDragDrop: SyncHook; afterMounted: SyncHook; finalNewLine: SyncBailHook; updateBlockDepthData: SyncBailHook; } export interface PluginState { editorState: EditorState; } export interface PluginEditorProps { plugins: any[]; } export interface PluginEditorState { editorState: EditorState; } export interface GetEditor { (): { hooks: Hooks; editorState: EditorState; editorRef: RefObject; inlineToolbarRef: RefObject; imageToolbarRef: RefObject; sidebarRef: RefObject; }; } declare global { interface FileList { forEach(callback: (f: File) => void): void; } } export interface TimeoutHandler { (callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; } export interface DecoratorPair { strategy: DraftNodeDecoratorStrategy; component: ReactNode; }