UNPKG

@atlaskit/editor-plugin-code-block

Version:

Code block plugin for @atlaskit/editor-core

31 lines (30 loc) 1.55 kB
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types'; import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; import type { EditorView } from '@atlaskit/editor-prosemirror/view'; import type { CodeBlockPlugin } from '../codeBlockPluginType'; export declare class CodeBlockView { private cleanupEditorDisabledListener?; node: PMNode; dom: HTMLElement; contentDOM: HTMLElement; lineNumberGutter: HTMLElement; getPos: getPosHandlerNode; view: EditorView; formattedAriaLabel: string; api?: ExtractInjectionAPI<CodeBlockPlugin>; constructor(node: PMNode, view: EditorView, getPos: getPosHandlerNode, formattedAriaLabel: string, api?: ExtractInjectionAPI<CodeBlockPlugin>, cleanupEditorDisabledListener?: (() => void) | undefined); handleEditorDisabledChanged(): void; updateDOMAndSelection(savedInnerHTML: string, newCursorPosition: number): void; coalesceDOMElements(): void; /** * As the code block updates we get the maximum amount of digits in a line number and expand the number gutter to reflect this. */ private maintainDynamicGutterSize; update(node: PMNode): boolean; ignoreMutation(record: MutationRecord | { target: Node; type: 'selection'; }): boolean; destroy(): void; } export declare const codeBlockNodeView: (node: PMNode, view: EditorView, getPos: getPosHandler, formattedAriaLabel: string, api: ExtractInjectionAPI<CodeBlockPlugin> | undefined) => CodeBlockView;