import { Node as ProseMirrorNode } from "prosemirror-model"; import { EditorView } from "prosemirror-view"; import { IExternalPluginProvider } from "../shared/editor-plugin"; import { BaseView, CommonViewOptions } from "../shared/view"; /** * Describes the callback for when an html preview should be rendered * @param content The plain text content of the codeblock * @param container The element that the content should be rendered into */ export type PreviewRenderer = (content: string, container: HTMLElement) => Promise; export interface CommonmarkOptions extends CommonViewOptions { /** Settings for showing a static rendered preview of the editor's contents */ preview?: { /** Whether the preview is enabled */ enabled: boolean; /** * Custom renderer method to use to render the markdown; * This method must handle rendering into the passed container itself */ renderer: (content: string, container: HTMLElement) => Promise; /** Whether the preview is shown on editor startup */ shownByDefault?: boolean; /** * Function to get the container to place the markdown preview; * defaults to returning this editor's target's parentNode */ parentContainer?: (view: EditorView) => Element; /** The number of milliseconds to delay rendering between updates */ renderDelayMs?: number; }; } export declare class CommonmarkEditor extends BaseView { private options; constructor(target: Node, content: string, pluginProvider: IExternalPluginProvider, options?: CommonmarkOptions); static get defaultOptions(): CommonmarkOptions; parseContent(content: string): ProseMirrorNode; serializeContent(): string; }