import { SurfaceManager } from '../core/surface-manager.js'; import { DocumentMode, Editor, HyperlinkActivationHandler, LinkPopoverResolver } from '../core/types/index.js'; import { BorrowedSuperDocUI } from '../public/ui/types.js'; /** * The `v2-link-click` payload the shell relays from the v2 host's * `onLinkClick` callback. */ interface LinkClickPayload { href: string; target: string | null; rel: string | null; tooltip: string | null; element: HTMLAnchorElement; clientX: number; clientY: number; documentMode: DocumentMode; editableText?: boolean; } interface UseLinkPopoverOptions { getSurfaceManager: () => Pick | null | undefined; getActiveEditor: () => Editor | null | undefined; getUi: () => BorrowedSuperDocUI | null | undefined; getActivationHandler: () => HyperlinkActivationHandler | LinkPopoverResolver | null | undefined; getActivationHandlerSource?: () => 'hyperlinks.onActivate' | 'compatibility' | null | undefined; getBuiltInEditorDisabled?: () => boolean; shouldInterceptNavigationOnlyHyperlinks?: () => boolean; getLayerElement: () => HTMLElement | null | undefined; emitException: (payload: { error: Error; source: string; }) => void; } export declare function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivationHandler, getActivationHandlerSource, getBuiltInEditorDisabled, shouldInterceptNavigationOnlyHyperlinks, getLayerElement, emitException, }: UseLinkPopoverOptions): { handleLinkClick: (payload: LinkClickPayload | null | undefined) => void; closeCurrentPopover: (reason?: string) => void; destroy: () => void; }; export {};