/// import { AnalyticsHandler, ContextName, Node, ProseMirror } from 'ak-editor-core'; import { PureComponent } from 'react'; import { MentionResource, MentionSource } from './mention-resource'; export declare type ImageUploadHandler = (e: any, insertImageFn: any) => void; export interface Props { context?: ContextName; isExpandedByDefault?: boolean; defaultValue?: string; onCancel?: (editor?: Editor) => void; onChange?: (editor?: Editor) => void; onSave?: (editor?: Editor) => void; onExpanded?: (editor?: Editor) => void; placeholder?: string; analyticsHandler?: AnalyticsHandler; imageUploadHandler?: ImageUploadHandler; mentionSource?: MentionSource; } export interface State { pm?: ProseMirror; isExpanded?: boolean; } export default class Editor extends PureComponent { state: State; mentionsResourceProvider: MentionResource; constructor(props: Props); /** * Focus the content region of the editor. */ focus(): void; /** * Expand the editor chrome */ expand: () => void; /** * Collapse the editor chrome */ collapse: () => void; /** * Clear the content of the editor, making it an empty document. */ clear(): void; /** * Check if the user has entered any significant content. * (i.e. text) */ isEmpty(): boolean; /** * Set value from HTML string */ setFromHtml(html: string): void; /** * Return the current python-markdown value from the editor. */ readonly value: string | undefined; /** * Return the current ProseMirror doc value from the editor; */ readonly doc: Node | undefined; render(): JSX.Element; private handleCancel; private handleChange; private handleSave; private handleRef; }