import { CSSProperties } from 'vue'; import { EditorCommentMark, EditorOverlay, EditorPeerMark, EditorRangeMark, OverlayBox } from './editor-overlay'; import { RichSurface } from './rich-surface'; /** * Comment highlights and peers' carets over whichever view shows the * document: decorations in the source mode, boxes over the rendered blocks * otherwise. * * Boxes are measured, so they are laid out once per frame however many * changes, selections and loaded images asked for it. */ export interface MarkdownOverlayOptions { /** The rich surface or the preview, when one of them is the active view. */ surface: () => RichSurface | null; /** The element the boxes are positioned in; it scrolls with the text. */ page: () => HTMLElement | null; /** The source view, when it is the active one. */ source: () => { setOverlay: (overlay: EditorOverlay) => void; } | null; comments: () => EditorCommentMark[]; peers: () => EditorPeerMark[]; /** Marks for the rich surface alone. */ marks: () => EditorRangeMark[]; } export interface MarkdownBox { left: number; top: number; width: number; height: number; } export declare function useMarkdownOverlay(options: MarkdownOverlayOptions): { under: import('vue').ComputedRef; carets: import('vue').ComputedRef; schedule: () => void; clear: () => void; }; export declare function boxStyle(box: OverlayBox): CSSProperties; /** A client rect in the coordinates of `page`, so it moves when the page scrolls. */ export declare function boxIn(page: HTMLElement, rect: { left: number; top: number; right: number; bottom: number; }): MarkdownBox; /** A floating panel's reference: `box` in `page`, measured again whenever the panel repositions. */ export declare function virtualReference(page: () => HTMLElement | null, box: () => MarkdownBox | null): import('vue').Raw<{ getBoundingClientRect: () => DOMRect; }>;