UNPKG

1.11 kBTypeScriptView Raw
1import { Disposable } from '../index';
2
3/**
4 * A container representing a panel on the edges of the editor window. You
5 * should not create a Panel directly, instead use Workspace::addTopPanel and
6 * friends to add panels.
7 */
8export interface Panel<T = object> {
9 /** Whether or not the Panel is visible. */
10 readonly visible: boolean;
11
12 // Construction and Destruction
13 /** Destroy and remove this panel from the UI. */
14 destroy(): void;
15
16 // Event Subscription
17 /** Invoke the given callback when the pane hidden or shown. */
18 onDidChangeVisible(callback: (visible: boolean) => void): Disposable;
19
20 /** Invoke the given callback when the pane is destroyed. */
21 onDidDestroy(callback: (panel: Panel<T>) => void): Disposable;
22
23 // Panel Details
24 /** Returns the panel's item. */
25 getItem(): T;
26
27 /** Returns a number indicating this panel's priority. */
28 getPriority(): number;
29
30 /** Returns a boolean true when the panel is visible. */
31 isVisible(): boolean;
32
33 /** Hide this panel. */
34 hide(): void;
35
36 /** Show this panel. */
37 show(): void;
38}