import type { IChatWidget } from "./chat.js"; import { IChatResponseViewModel } from "../common/model/chatViewModel.js"; export interface IResolvedResponseSelection extends IResolvedResponseSelectionFocus { readonly response: IChatResponseViewModel; readonly text: string; /** Live selected range, used to re-paint the affordance and recover its focus endpoint after DOM changes. */ readonly range: Range; /** Direction from the selection anchor to its active focus endpoint. */ readonly direction: "forward" | "backward"; } export interface IResolvedResponseSelectionFocus { readonly focusRange: Range; readonly focusEdge: "left" | "right"; } export declare function resolveResponseSelectionFocus(range: Range, direction: IResolvedResponseSelection["direction"], widgetDomNode?: HTMLElement): IResolvedResponseSelectionFocus | undefined; /** * Resolves the widget's current native DOM selection to the single assistant * response it lies entirely within, scoped to rendered markdown only (embedded * code editors and tool-invocation UI are excluded). Returns `undefined` for an * empty/collapsed selection, a selection spanning more than one response, or * one that touches non-markdown content. */ export declare function resolveResponseSelection(widget: Pick): IResolvedResponseSelection | undefined;