Add hover and leave callbacks for linkprovider

Fixes #3056.
This commit is contained in:
ew
2021-02-03 10:25:33 +01:00
committed by Martin Sander
parent 36136a4c29
commit eec804dd7c
3 changed files with 41 additions and 5 deletions
+17
View File
@@ -352,6 +352,23 @@ declare module 'xterm' {
willLinkActivate?: (event: MouseEvent, uri: string) => boolean;
}
/**
* An object containing options for a link provider.
*/
export interface ILinkProviderOptions {
/**
* A callback that fires when the mouse hovers over a link for a period of
* time (defined by {@link ITerminalOptions.linkTooltipHoverDuration}).
*/
hover?(event: MouseEvent, text: string, location: IViewportRange): void;
/**
* A callback that fires when the mouse leaves a link. Note that this can
* happen even when tooltipCallback hasn't fired for the link yet.
*/
leave?(event: MouseEvent, text: string): void;
}
/**
* An object that can be disposed via a dispose function.
*/