UNPKG

2.51 kBTypeScriptView Raw
1import { ITranslator, TranslationBundle } from '@jupyterlab/translation';
2import { AccordionPanel, Panel, Widget } from '@lumino/widgets';
3import { Toolbar } from './toolbar';
4/**
5 * A widget meant to be contained in sidebars.
6 *
7 * #### Note
8 * By default the content widget is an accordion panel that supports widget with
9 * associated toolbar to be displayed in the widget title.
10 */
11export declare class SidePanel extends Widget {
12 constructor(options?: SidePanel.IOptions);
13 /**
14 * The content hosted by the widget.
15 */
16 get content(): Panel;
17 /**
18 * A panel for widgets that sit on top of the widget.
19 */
20 get header(): Panel;
21 /**
22 * The toolbar hosted by the widget.
23 *
24 * It sits between the header and the content
25 */
26 get toolbar(): Toolbar;
27 /**
28 * A read-only array of the widgets in the content panel.
29 */
30 get widgets(): ReadonlyArray<Widget>;
31 /**
32 * Add a widget to the content panel bottom.
33 *
34 * @param widget Widget to add
35 */
36 addWidget(widget: Toolbar.IWidgetToolbar): void;
37 /**
38 * Insert a widget at the given position in the content panel.
39 *
40 * @param index Position
41 * @param widget Widget to insert
42 */
43 insertWidget(index: number, widget: Toolbar.IWidgetToolbar): void;
44 private addHeader;
45 private addToolbar;
46 protected _content: Panel;
47 protected _header: Panel;
48 protected _toolbar: Toolbar;
49 protected _trans: TranslationBundle;
50}
51/**
52 * The namespace for the `SidePanel` class statics.
53 */
54export declare namespace SidePanel {
55 /**
56 * An options object for creating a side panel widget.
57 */
58 interface IOptions extends AccordionPanel.IOptions {
59 /**
60 * The main child of the side panel
61 *
62 * If nothing is provided it fallback to an AccordionToolbar panel.
63 */
64 content?: Panel;
65 /**
66 * The header is at the top of the SidePanel,
67 * and that extensions can populate.
68 *
69 * Defaults to an empty Panel if requested otherwise it won't be created.
70 */
71 header?: Panel;
72 /**
73 * The toolbar to use for the widget.
74 * It sits between the header and the content
75 *
76 * Defaults to an empty toolbar if requested otherwise it won't be created.
77 */
78 toolbar?: Toolbar;
79 /**
80 * The application language translator.
81 */
82 translator?: ITranslator;
83 }
84}