-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtokens.ts
67 lines (58 loc) · 1.6 KB
/
tokens.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import { Token } from '@lumino/coreutils';
import { IDisposable } from '@lumino/disposable';
import { ISignal } from '@lumino/signaling';
import { Widget } from '@lumino/widgets';
// tslint:disable-next-line:variable-name
export const IStatusBar = new Token<IStatusBar>(
'@jupyterlab/statusbar:IStatusBar'
);
/**
* Main status bar object which contains all widgets.
*/
export interface IStatusBar {
/**
* Register a new status item.
*
* @param id - a unique id for the status item.
*
* @param options - The options for how to add the status item.
*
* @returns an `IDisposable` that can be disposed to remove the item.
*/
registerStatusItem(id: string, statusItem: IStatusBar.IItem): IDisposable;
}
/**
* A namespace for status bar statics.
*/
export namespace IStatusBar {
export type Alignment = 'right' | 'left' | 'middle';
/**
* Options for status bar items.
*/
export interface IItem {
/**
* The item to add to the status bar.
*/
item: Widget;
/**
* Which side to place item.
* Permanent items are intended for the right and left side,
* with more transient items in the middle.
*/
align?: Alignment;
/**
* Ordering of Items -- higher rank items are closer to the middle.
*/
rank?: number;
/**
* Whether the item is shown or hidden.
*/
isActive?: () => boolean;
/**
* A signal that is fired when the item active state changes.
*/
activeStateChanged?: ISignal<any, void>;
}
}