import type { HyperlinkToolTip } from './HyperlinkToolTip'; import type { EditorPlugin, IEditor, PluginEvent } from 'roosterjs-content-model-types'; /** * Hyperlink plugin does the following jobs for a hyperlink in editor: * 1. When hover on a link, show a tool tip * 2. When Ctrl+Click on a link, open a new window with the link * 3. When type directly on a link whose text matches its link url, update the link url with the link text */ export declare class HyperlinkPlugin implements EditorPlugin { private tooltip; private target?; private onLinkClick?; private editor; private domHelper; private isMac; private disposer; private currentNode; private currentLink; /** * Create a new instance of HyperLink class * @param tooltip Tooltip to show when mouse hover over a link * Default value is to return the href itself. If null, there will be no tooltip text. * @param target (Optional) Target window name for hyperlink. If null, will use "_blank" * @param onLinkClick (Optional) Open link callback (return false to use default behavior) */ constructor(tooltip?: HyperlinkToolTip, target?: string | undefined, onLinkClick?: ((anchor: HTMLAnchorElement, mouseEvent: MouseEvent) => boolean | void) | undefined); /** * Get a friendly name of this plugin */ getName(): string; /** * Initialize this plugin * @param editor The editor instance */ initialize(editor: IEditor): void; /** * Dispose this plugin */ dispose(): void; /** * Handle events triggered from editor * @param event PluginEvent object */ onPluginEvent(event: PluginEvent): void; protected onMouse: (e: Event) => void; private runWithHyperlink; private isCtrlOrMetaPressed; }