import React from 'react'; import { ICommand, TextAreaCommandOrchestrator } from './commands'; import { MDEditorProps } from './Editor'; export type PreviewType = 'live' | 'edit' | 'preview'; export interface ContextStore { components?: MDEditorProps['components']; commands?: ICommand[]; extraCommands?: ICommand[]; markdown?: string; preview?: PreviewType; height?: React.CSSProperties['height']; fullscreen?: boolean; highlightEnable?: boolean; autoFocus?: boolean; textarea?: HTMLTextAreaElement; commandOrchestrator?: TextAreaCommandOrchestrator; textareaWarp?: HTMLDivElement; textareaPre?: HTMLPreElement; container?: HTMLDivElement | null; dispatch?: React.Dispatch; barPopup?: Record; scrollTop?: number; scrollTopPreview?: number; tabSize?: number; defaultTabEnable?: boolean; [key: string]: any; } export type ExecuteCommandState = Pick; export declare function reducer(state: ContextStore, action: ContextStore): { [x: string]: any; components?: { textarea?: ((props: React.HTMLAttributes | React.TextareaHTMLAttributes, opts: { dispatch: React.Dispatch | undefined; onChange?: React.ChangeEventHandler | undefined; useContext?: { commands: ICommand[] | undefined; extraCommands: ICommand[] | undefined; commandOrchestrator?: TextAreaCommandOrchestrator | undefined; } | undefined; shortcuts?: ((e: KeyboardEvent | React.KeyboardEvent, commands: ICommand[], commandOrchestrator?: TextAreaCommandOrchestrator | undefined, dispatch?: React.Dispatch | undefined, state?: ExecuteCommandState | undefined) => void) | undefined; }) => JSX.Element) | undefined; toolbar?: ((command: ICommand, disabled: boolean, executeCommand: (command: ICommand, name?: string | undefined) => void, index: number) => void | React.ReactElement> | null | undefined) | undefined; preview?: ((source: string, state: ContextStore, dispath: React.Dispatch) => JSX.Element) | undefined; } | undefined; commands?: ICommand[] | undefined; extraCommands?: ICommand[] | undefined; markdown?: string | undefined; preview?: PreviewType | undefined; height?: import("csstype").Property.Height | undefined; fullscreen?: boolean | undefined; highlightEnable?: boolean | undefined; autoFocus?: boolean | undefined; textarea?: HTMLTextAreaElement | undefined; commandOrchestrator?: TextAreaCommandOrchestrator | undefined; textareaWarp?: HTMLDivElement | undefined; textareaPre?: HTMLPreElement | undefined; container?: HTMLDivElement | null | undefined; dispatch?: React.Dispatch | undefined; barPopup?: Record | undefined; scrollTop?: number | undefined; scrollTopPreview?: number | undefined; tabSize?: number | undefined; defaultTabEnable?: boolean | undefined; }; export declare const EditorContext: React.Context;