import { RangeValue, Range, RangeSet } from "@codemirror/next/rangeset"; import { Attrs } from "./attributes"; import { EditorView } from "./editorview"; interface MarkDecorationSpec { inclusive?: boolean; inclusiveStart?: boolean; inclusiveEnd?: boolean; attributes?: { [key: string]: string; }; class?: string; tagName?: string; [other: string]: any; } interface WidgetDecorationSpec { widget: WidgetType; side?: number; block?: boolean; [other: string]: any; } interface ReplaceDecorationSpec { widget?: WidgetType; inclusive?: boolean; inclusiveStart?: boolean; inclusiveEnd?: boolean; block?: boolean; [other: string]: any; } interface LineDecorationSpec { attributes?: { [key: string]: string; }; [other: string]: any; } export declare abstract class WidgetType { abstract toDOM(view: EditorView): HTMLElement; eq(_widget: WidgetType): boolean; updateDOM(_dom: HTMLElement): boolean; get estimatedHeight(): number; ignoreEvent(_event: Event): boolean; } export declare type DecorationSet = RangeSet; export declare enum BlockType { Text = 0, WidgetBefore = 1, WidgetAfter = 2, WidgetRange = 3 } export declare abstract class Decoration extends RangeValue { readonly spec: any; abstract eq(other: Decoration): boolean; static mark(spec: MarkDecorationSpec): Decoration; static widget(spec: WidgetDecorationSpec): Decoration; static replace(spec: ReplaceDecorationSpec): Decoration; static line(spec: LineDecorationSpec): Decoration; static set(of: Range | readonly Range[], sort?: boolean): DecorationSet; static none: DecorationSet; } export declare class MarkDecoration extends Decoration { tagName: string; class: string; attrs: Attrs | null; constructor(spec: MarkDecorationSpec); eq(other: Decoration): boolean; range(from: number, to?: number): Range; } export declare class LineDecoration extends Decoration { constructor(spec: LineDecorationSpec); eq(other: Decoration): boolean; range(from: number, to?: number): Range; } export declare class PointDecoration extends Decoration { block: boolean; readonly isReplace: boolean; constructor(spec: any, startSide: number, endSide: number, block: boolean, widget: WidgetType | null, isReplace: boolean); get type(): BlockType.WidgetBefore | BlockType.WidgetAfter | BlockType.WidgetRange; get heightRelevant(): boolean; eq(other: Decoration): boolean; range(from: number, to?: number): Range; } export declare function addRange(from: number, to: number, ranges: number[], margin?: number): void; export {}; //# sourceMappingURL=decoration.d.ts.map