import { EditorView } from '@codemirror/view'; /** * Ghost text content and placement. */ export interface IGhostText { /** * Offset in the editor where the ghost text should be placed */ from: number; /** * The content of the ghost text. */ content: string; /** * The identifier of the completion provider. */ providerId: string; /** * The tokens added in the last stream update, must be a suffix of the content. */ addedPart?: string; /** * Whether streaming is in progress. */ streaming?: boolean; /** * Maximum number of lines to show. */ maxLines?: number; /** * Minimum number of lines to reserve (to avoid frequent resizing). */ minLines?: number; /** * An error occurred in the request. */ error?: { /** * A message explaining the error. */ message?: string; }; /** * Callback to execute when pointer enters the boundary of the ghost text. */ onPointerOver?: () => void; /** * Callback to execute when pointer leaves the boundary of the ghost text. */ onPointerLeave?: () => void; } export declare class GhostTextManager { protected options: GhostTextManager.IOptions; constructor(options: GhostTextManager.IOptions); /** * Typing animation. */ static streamingAnimation: 'none' | 'uncover'; /** * Delay for removal of line spacer. */ static spacerRemovalDelay: number; /** * Duration for line spacer removal. */ static spacerRemovalDuration: number; /** * Place ghost text in an editor. */ placeGhost(view: EditorView, text: IGhostText): void; /** * Clear all ghost texts from the editor. */ clearGhosts(view: EditorView): void; } export declare namespace GhostTextManager { /** * The initialization options for ghost text manager. */ interface IOptions { /** * Callback for editor `blur` event. * Returning true will prevent the default action of removing current ghost. */ onBlur(event: FocusEvent): boolean; } }