import { BlockView } from './block-view'; /** * What the editor draws over the text that is not part of it: comment * highlights, other people's carets and selections, and the text an AI * rewrite is working on or has just written. The source mode turns * these into CodeMirror decorations; the rich surface and the preview lay them * out as boxes over the rendered blocks, because marking up a contenteditable * would make the marks part of what the user edits. */ export interface EditorCommentMark { id: string; from: number; to: number; active: boolean; } export interface EditorPeerMark { id: string; name: string; color: string; anchor: number; head: number; /** Show the name tag: the peer moved or typed a moment ago. */ labelled: boolean; } /** Text an AI rewrite is on (`ai`), or has just written (`ai-done`). */ export interface EditorRangeMark { id: string; from: number; to: number; kind: 'ai' | 'ai-done'; /** The answer is on its way. */ active?: boolean; } export interface EditorOverlay { comments: EditorCommentMark[]; peers: EditorPeerMark[]; /** Rich surface only. */ marks?: EditorRangeMark[]; } export interface OverlayBox { key: string; kind: 'comment' | 'selection' | 'caret' | EditorRangeMark['kind']; left: number; top: number; width: number; height: number; active?: boolean; color?: string; /** Ranges: the box's line among the range's, the first few apart, for an entrance in turn. */ order?: number; /** Carets: the name tag. */ label?: string; labelled?: boolean; } export declare const EMPTY_OVERLAY: EditorOverlay; /** A stable colour for a user without one. */ export declare function peerColor(id: string): string; /** Boxes for `overlay` over `view`, in the coordinates of `pane` (an ancestor that scrolls with the text). */ export declare function layoutOverlay(view: BlockView, pane: HTMLElement, overlay: EditorOverlay): OverlayBox[];