import { Ctx } from '@milkdown/kit/ctx'; import { Mark } from '@milkdown/kit/prose/model'; import { EditorView } from '@milkdown/kit/prose/view'; export interface LinkInfo { from: number; to: number; mark: Mark; href: string; } /** * Find link mark at current cursor position or within selection */ export declare function getLinkAtCursor(view: EditorView, ctx: Ctx): LinkInfo | null; /** * Add or update a link mark on the current selection. * Adds CONFIRM_LINK_META to prevent tentative link cleanup. */ export declare function applyLinkMark(ctx: Ctx, href: string, from: number, to: number): void; /** * Remove link mark from the specified range */ export declare function removeLinkMark(ctx: Ctx, from: number, to: number): void; /** * Get current text selection range */ export declare function getSelectionBounds(ctx: Ctx): { from: number; to: number; isEmpty: boolean; }; /** * Set text selection in the editor */ export declare function setSelectionBounds(ctx: Ctx, from: number, to?: number): void; /** * Request cleanup of tentative (empty) links. Call when the user dismisses the link tooltip * without confirming (Escape or click away). The tentative-link plugin will remove empty link marks. */ export declare function requestTentativeLinkCleanup(ctx: Ctx): void; /** * Toggle link mark on current selection. * If selection has link → remove it. Otherwise → add empty link (tooltip will show for editing). * Marks empty link creation as tentative so plugin can clean it up if abandoned. * No-op if selection is empty. */ export declare function toggleLinkMark(ctx: Ctx): void;