1 | import { ITranslator } from '@jupyterlab/translation';
|
2 | import { Toolbar } from '@jupyterlab/ui-components';
|
3 | import { Message } from '@lumino/messaging';
|
4 | import { BoxPanel, Widget } from '@lumino/widgets';
|
5 | import { Printing } from './printing';
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare class MainAreaWidget<T extends Widget = Widget> extends Widget implements Printing.IPrintable {
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 | constructor(options: MainAreaWidget.IOptions<T>);
|
22 | /**
|
23 | * Print method. Deferred to content.
|
24 | */
|
25 | [Printing.symbol](): Printing.OptionalAsyncThunk;
|
26 | /**
|
27 | * The content hosted by the widget.
|
28 | */
|
29 | get content(): T;
|
30 | /**
|
31 | * The toolbar hosted by the widget.
|
32 | */
|
33 | get toolbar(): Toolbar;
|
34 | /**
|
35 | * A panel for widgets that sit between the toolbar and the content.
|
36 | * Imagine a formatting toolbar, notification headers, etc.
|
37 | */
|
38 | get contentHeader(): BoxPanel;
|
39 | /**
|
40 | * Whether the content widget or an error is revealed.
|
41 | */
|
42 | get isRevealed(): boolean;
|
43 | /**
|
44 | * A promise that resolves when the widget is revealed.
|
45 | */
|
46 | get revealed(): Promise<void>;
|
47 | /**
|
48 | * Handle `'activate-request'` messages.
|
49 | */
|
50 | protected onActivateRequest(msg: Message): void;
|
51 | /**
|
52 | * Handle `after-attach` messages for the widget.
|
53 | */
|
54 | protected onAfterAttach(msg: Message): void;
|
55 | /**
|
56 | * Handle `before-detach` messages for the widget.
|
57 | */
|
58 | protected onBeforeDetach(msg: Message): void;
|
59 | /**
|
60 | * Handle `'close-request'` messages.
|
61 | */
|
62 | protected onCloseRequest(msg: Message): void;
|
63 | /**
|
64 | * Handle `'update-request'` messages by forwarding them to the content.
|
65 | */
|
66 | protected onUpdateRequest(msg: Message): void;
|
67 | private _disposeSpinner;
|
68 | /**
|
69 | * Update the title based on the attributes of the child widget.
|
70 | */
|
71 | private _updateTitle;
|
72 | /**
|
73 | * Update the content title based on attributes of the main widget.
|
74 | */
|
75 | private _updateContentTitle;
|
76 | /**
|
77 | * Give focus to the content.
|
78 | */
|
79 | private _focusContent;
|
80 | private _content;
|
81 | private _toolbar;
|
82 | private _contentHeader;
|
83 | private _changeGuard;
|
84 | private _spinner;
|
85 | private _isRevealed;
|
86 | private _revealed;
|
87 | private _evtMouseDown;
|
88 | }
|
89 | /**
|
90 | * The namespace for the `MainAreaWidget` class statics.
|
91 | */
|
92 | export declare namespace MainAreaWidget {
|
93 | |
94 |
|
95 |
|
96 | interface IOptions<T extends Widget = Widget> extends Widget.IOptions {
|
97 | |
98 |
|
99 |
|
100 | content: T;
|
101 | |
102 |
|
103 |
|
104 | toolbar?: Toolbar;
|
105 | |
106 |
|
107 |
|
108 |
|
109 | contentHeader?: BoxPanel;
|
110 | |
111 |
|
112 |
|
113 | reveal?: Promise<any>;
|
114 | |
115 |
|
116 |
|
117 | translator?: ITranslator;
|
118 | }
|
119 | |
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 | interface IOptionsOptionalContent<T extends Widget = Widget> extends Widget.IOptions {
|
130 | |
131 |
|
132 |
|
133 | content?: T;
|
134 | |
135 |
|
136 |
|
137 | toolbar?: Toolbar;
|
138 | |
139 |
|
140 |
|
141 | reveal?: Promise<any>;
|
142 | }
|
143 | }
|