Added support for a basic link parser
This commit is contained in:
Vendored
+31
@@ -5,6 +5,7 @@
|
||||
|
||||
import { IEvent } from 'common/EventEmitter';
|
||||
import { IDisposable } from 'common/Types';
|
||||
import { IMouseService } from './services/Services';
|
||||
|
||||
export interface IColorManager {
|
||||
colors: IColorSet;
|
||||
@@ -93,6 +94,14 @@ export interface ILinkifier {
|
||||
deregisterLinkMatcher(matcherId: number): boolean;
|
||||
}
|
||||
|
||||
export interface ILinkifier2 {
|
||||
onShowTooltip: IEvent<ILinkifierEvent>;
|
||||
onHideTooltip: IEvent<ILinkifierEvent>;
|
||||
|
||||
attachToDom(element: HTMLElement, mouseService: IMouseService): void
|
||||
registerLinkProvider(linkProvider: ILinkProvider): IDisposable;
|
||||
}
|
||||
|
||||
export interface ILinkMatcherOptions {
|
||||
/**
|
||||
* The index of the link from the regex.match(text) call. This defaults to 0
|
||||
@@ -143,3 +152,25 @@ export interface IMouseZone {
|
||||
leaveCallback: () => any | undefined;
|
||||
willLinkActivate: (e: MouseEvent) => boolean;
|
||||
}
|
||||
|
||||
interface ILinkProvider {
|
||||
provideLink(position: IBufferCellPosition, callback: (link: ILink | undefined) => void): void;
|
||||
}
|
||||
|
||||
interface ILink {
|
||||
range: IBufferRange;
|
||||
url: string;
|
||||
showTooltip(event: MouseEvent, link: string): void;
|
||||
hideTooltip(event: MouseEvent, link: string): void;
|
||||
handle(event: MouseEvent, link: string): void;
|
||||
}
|
||||
|
||||
interface IBufferRange {
|
||||
start: IBufferCellPosition;
|
||||
end: IBufferCellPosition;
|
||||
}
|
||||
|
||||
interface IBufferCellPosition {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user