UNPKG

2.06 kBTypeScriptView Raw
1import { Disposable, DisposableCollection } from '../common';
2import { MarkdownString } from '../common/markdown-rendering/markdown-string';
3import { MarkdownRenderer, MarkdownRendererFactory } from './markdown-rendering/markdown-renderer';
4import { PreferenceService } from './preferences';
5import '../../src/browser/style/hover-service.css';
6export declare type HoverPosition = 'left' | 'right' | 'top' | 'bottom';
7export declare namespace HoverPosition {
8 function invertIfNecessary(position: HoverPosition, target: DOMRect, host: DOMRect, totalWidth: number, totalHeight: number): HoverPosition;
9}
10export interface HoverRequest {
11 content: string | MarkdownString | HTMLElement;
12 target: HTMLElement;
13 /**
14 * The position where the hover should appear.
15 * Note that the hover service will try to invert the position (i.e. right -> left)
16 * if the specified content does not fit in the window next to the target element
17 */
18 position: HoverPosition;
19}
20export declare class HoverService {
21 protected static hostClassName: string;
22 protected static styleSheetId: string;
23 protected readonly preferences: PreferenceService;
24 protected readonly markdownRendererFactory: MarkdownRendererFactory;
25 protected _markdownRenderer: MarkdownRenderer | undefined;
26 protected get markdownRenderer(): MarkdownRenderer;
27 protected _hoverHost: HTMLElement | undefined;
28 protected get hoverHost(): HTMLElement;
29 protected pendingTimeout: Disposable | undefined;
30 protected hoverTarget: HTMLElement | undefined;
31 protected lastHidHover: number;
32 protected readonly disposeOnHide: DisposableCollection;
33 requestHover(request: HoverRequest): void;
34 protected getHoverDelay(): number;
35 protected renderHover(request: HoverRequest): Promise<void>;
36 protected setHostPosition(target: HTMLElement, host: HTMLElement, position: HoverPosition): HoverPosition;
37 protected listenForMouseOut(): void;
38 cancelHover(): void;
39 protected unRenderHover(): void;
40}
41//# sourceMappingURL=hover-service.d.ts.map
\No newline at end of file