UNPKG

1.73 kBTypeScriptView Raw
1import { PanelLayout } from './panellayout';
2import { Widget } from './widget';
3/**
4 * A simple and convenient panel widget class.
5 *
6 * #### Notes
7 * This class is suitable as a base class for implementing a variety of
8 * convenience panel widgets, but can also be used directly with CSS to
9 * arrange a collection of widgets.
10 *
11 * This class provides a convenience wrapper around a [[PanelLayout]].
12 */
13export declare class Panel extends Widget {
14 /**
15 * Construct a new panel.
16 *
17 * @param options - The options for initializing the panel.
18 */
19 constructor(options?: Panel.IOptions);
20 /**
21 * A read-only array of the widgets in the panel.
22 */
23 readonly widgets: ReadonlyArray<Widget>;
24 /**
25 * Add a widget to the end of the panel.
26 *
27 * @param widget - The widget to add to the panel.
28 *
29 * #### Notes
30 * If the widget is already contained in the panel, it will be moved.
31 */
32 addWidget(widget: Widget): void;
33 /**
34 * Insert a widget at the specified index.
35 *
36 * @param index - The index at which to insert the widget.
37 *
38 * @param widget - The widget to insert into to the panel.
39 *
40 * #### Notes
41 * If the widget is already contained in the panel, it will be moved.
42 */
43 insertWidget(index: number, widget: Widget): void;
44}
45/**
46 * The namespace for the `Panel` class statics.
47 */
48export declare namespace Panel {
49 /**
50 * An options object for creating a panel.
51 */
52 interface IOptions {
53 /**
54 * The panel layout to use for the panel.
55 *
56 * The default is a new `PanelLayout`.
57 */
58 layout?: PanelLayout;
59 }
60}
61//# sourceMappingURL=panel.d.ts.map
\No newline at end of file