import { EditorState, Transaction, ChangeSet, Facet, Extension } from "@codemirror/next/state"; import { StyleModule } from "style-mod"; import { DecorationSet } from "./decoration"; import { EditorView, DOMEventHandlers } from "./editorview"; import { Attrs } from "./attributes"; import { Rect } from "./dom"; import { MakeSelectionStyle } from "./input"; export declare type Command = (target: EditorView) => boolean; export declare const clickAddsSelectionRange: Facet<(event: MouseEvent) => boolean, readonly ((event: MouseEvent) => boolean)[]>; export declare const dragMovesSelection: Facet<(event: MouseEvent) => boolean, readonly ((event: MouseEvent) => boolean)[]>; export declare const mouseSelectionStyle: Facet; export declare const exceptionSink: Facet<(exception: any) => void, readonly ((exception: any) => void)[]>; export declare const updateListener: Facet<(update: ViewUpdate) => void, readonly ((update: ViewUpdate) => void)[]>; export declare const inputHandler: Facet<(view: EditorView, from: number, to: number, text: string) => boolean, readonly ((view: EditorView, from: number, to: number, text: string) => boolean)[]>; export declare function logException(state: EditorState, exception: any, context?: string): void; export declare const editable: Facet; export interface PluginValue { update?(_update: ViewUpdate): void; destroy?(): void; } declare const isFieldProvider: unique symbol; export declare class PluginFieldProvider { private [isFieldProvider]; } export declare class PluginField { from(get: (value: V) => T): PluginFieldProvider; static define(): PluginField; static decorations: PluginField; static scrollMargins: PluginField | null>; } export declare const viewPlugin: Facet, readonly ViewPlugin[]>; export interface PluginSpec { eventHandlers?: DOMEventHandlers; decorations?: (value: V) => DecorationSet; provide?: PluginFieldProvider | readonly PluginFieldProvider[]; } export declare class ViewPlugin { extension: Extension; private constructor(); static define(create: (view: EditorView) => V, spec?: PluginSpec): ViewPlugin; static fromClass(cls: { new (view: EditorView): V; }, spec?: PluginSpec): ViewPlugin; } export declare const domEventHandlers: PluginField<{ plugin: PluginValue; handlers: DOMEventHandlers; }>; export declare class PluginInstance { readonly spec: ViewPlugin; mustUpdate: ViewUpdate | null; value: PluginValue | null; constructor(spec: ViewPlugin); takeField(type: PluginField, target: T[]): void; update(view: EditorView): PluginInstance; destroy(view: EditorView): void; static dummy: PluginInstance; } export interface MeasureRequest { read(view: EditorView): T; write(measure: T, view: EditorView): void; key?: any; } export declare const editorAttributes: Facet; export declare const contentAttributes: Facet; export declare const decorations: Facet; export declare const styleModule: Facet; export declare const enum UpdateFlag { Focus = 1, Height = 2, Viewport = 4, LineGaps = 8, Geometry = 16 } export declare class ChangedRange { readonly fromA: number; readonly toA: number; readonly fromB: number; readonly toB: number; constructor(fromA: number, toA: number, fromB: number, toB: number); join(other: ChangedRange): ChangedRange; addToSet(set: ChangedRange[]): ChangedRange[]; static extendWithRanges(diff: readonly ChangedRange[], ranges: number[]): readonly ChangedRange[]; } export declare class ViewUpdate { readonly view: EditorView; readonly state: EditorState; readonly transactions: readonly Transaction[]; readonly changes: ChangeSet; readonly startState: EditorState; get viewportChanged(): boolean; get heightChanged(): boolean; get geometryChanged(): boolean; get focusChanged(): boolean; get docChanged(): boolean; get selectionSet(): boolean; } export {}; //# sourceMappingURL=extension.d.ts.map