import { EditorState, Transaction } from "../../state/src"; import { DocView, EditorViewport } from "./docview"; import { InputState, MouseSelectionUpdate } from "./input"; import { Rect } from "./dom"; import { DecorationSet } from "./decoration"; import { LineHeight } from "./heightmap"; export declare class EditorView { private _state; readonly state: EditorState; readonly dispatch: (tr: Transaction) => void; readonly dom: HTMLElement; readonly contentDOM: HTMLElement; inputState: InputState; readonly docView: DocView; readonly viewport: EditorViewport; private pluginViews; private scheduledDecoUpdate; private updatingState; constructor(state: EditorState, dispatch?: ((tr: Transaction) => void | null), ...plugins: PluginView[]); setState(state: EditorState, ...plugins: PluginView[]): void; updateState(transactions: Transaction[], state: EditorState): void; /** @internal */ someProp(propName: N, f: (value: NonNullable) => R | undefined): R | undefined; /** @internal */ getProp(propName: N): PluginView[N]; private withUpdating; private createPluginViews; private destroyPluginViews; domAtPos(pos: number): { node: Node; offset: number; } | null; heightAtPos(pos: number, top: boolean): number; lineAtHeight(height: number): LineHeight; readonly contentHeight: number; movePos(start: number, direction: "forward" | "backward" | "left" | "right", granularity?: "character" | "word" | "line" | "lineboundary", action?: "move" | "extend"): number; posAtCoords(coords: { x: number; y: number; }): number; coordsAtPos(pos: number): Rect | null; readonly defaultCharacterWidth: number; readonly defaultLineHeight: number; decorationUpdate(): void; startMouseSelection(event: MouseEvent, update: MouseSelectionUpdate): void; readonly root: DocumentOrShadowRoot; hasFocus(): boolean; focus(): void; destroy(): void; } export interface PluginView { updateState?: (view: EditorView, prevState: EditorState, transactions: Transaction[]) => void; updateDOM?: (view: EditorView) => void; updateViewport?: (view: EditorView) => void; handleDOMEvents?: { [key: string]: (view: EditorView, event: Event) => boolean; }; decorations?: DecorationSet; destroy?: () => void; }