import { ContentView } from "./contentview"; import { WidgetType, DecorationSet, Decoration, RangeDecoration, LineDecoration } from "./decoration"; import { LineWidget } from "./lineview"; import { Text, TextIterator } from "../../doc/src"; import { RangeIterator } from "../../rangeset/src/rangeset"; import { Rect } from "./dom"; export declare abstract class InlineView extends ContentView { abstract merge(other: InlineView, from?: number, to?: number): boolean; readonly children: any[]; finish(parent: ContentView): void; cut(from: number, to?: number): void; abstract slice(from: number, to?: number): InlineView; getSide(): number; static appendInline(a: InlineView[], b: InlineView[]): InlineView[]; } export declare class TextView extends InlineView { text: string; tagName: string | null; attrs: { [key: string]: string; } | null; textDOM: Node | null; class: string | null; constructor(text: string, tagName: string | null, clss: string | null, attrs: { [key: string]: string; } | null); finish(parent: ContentView): void; readonly length: number; sync(): void; merge(other: InlineView, from?: number, to?: number): boolean; cut(from: number, to?: number): void; slice(from: number, to?: number): TextView; localPosFromDOM(node: Node, offset: number): number; domFromPos(pos: number): { node: Node; offset: number; }; domBoundsAround(from: number, to: number, offset: number): { from: number; to: number; startDOM: Node; endDOM: Node; }; coordsAt(pos: number): Rect; } export declare class WidgetView extends InlineView { length: number; readonly widget: WidgetType | null; readonly side: number; dom: HTMLElement | null; constructor(length: number, widget: WidgetType | null, side: number); finish(parent: ContentView): void; cut(from: number, to?: number): void; slice(from: number, to?: number): WidgetView; sync(): void; getSide(): number; merge(other: InlineView, from?: number, to?: number): boolean; ignoreMutation(): boolean; ignoreEvent(event: Event): boolean; readonly overrideDOMText: ReadonlyArray; domBoundsAround(): any; coordsAt(pos: number): Rect | null; } export declare class LineContent { atStart: boolean; elements: InlineView[]; attrs: null | { [attr: string]: string; }; widgets: LineWidget[]; constructor(atStart?: boolean); add(inline: InlineView): void; addLineDeco(deco: LineDecoration): void; } export declare class InlineBuilder implements RangeIterator { pos: number; lines: LineContent[]; cursor: TextIterator; text: string; skip: number; textOff: number; constructor(text: Text, pos: number); buildText(length: number, tagName: string | null, clss: string | null, attrs: { [key: string]: string; } | null, ranges: Decoration[]): void; advance(pos: number, active: Decoration[]): void; advanceCollapsed(pos: number, deco: Decoration): void; point(deco: Decoration): void; readonly curLine: LineContent; ignoreRange(deco: RangeDecoration): boolean; ignorePoint(deco: Decoration): boolean; static build(text: Text, from: number, to: number, decorations: ReadonlyArray): LineContent[]; }