UNPKG

5.48 kBTypeScriptView Raw
1import { ISignal } from '@lumino/signaling';
2import { VirtualElement } from '@lumino/virtualdom';
3/**
4 * An object which holds data related to an object's title.
5 *
6 * #### Notes
7 * A title object is intended to hold the data necessary to display a
8 * header for a particular object. A common example is the `TabPanel`,
9 * which uses the widget title to populate the tab for a child widget.
10 */
11export declare class Title<T> {
12 /**
13 * Construct a new title.
14 *
15 * @param options - The options for initializing the title.
16 */
17 constructor(options: Title.IOptions<T>);
18 /**
19 * A signal emitted when the state of the title changes.
20 */
21 readonly changed: ISignal<this, void>;
22 /**
23 * The object which owns the title.
24 */
25 readonly owner: T;
26 /**
27 * Get the label for the title.
28 *
29 * #### Notes
30 * The default value is an empty string.
31 */
32 /**
33 * Set the label for the title.
34 */
35 label: string;
36 /**
37 * Get the mnemonic index for the title.
38 *
39 * #### Notes
40 * The default value is `-1`.
41 */
42 /**
43 * Set the mnemonic index for the title.
44 */
45 mnemonic: number;
46 /**
47 * Get the icon renderer for the title.
48 *
49 * #### Notes
50 * The default value is undefined.
51 *
52 * DEPRECATED: if set to a string value, the .icon field will function as
53 * an alias for the .iconClass field, for backwards compatibility
54 */
55 /**
56 * Set the icon renderer for the title.
57 *
58 * #### Notes
59 * A renderer is an object that supplies a render and unrender function.
60 *
61 * DEPRECATED: if set to a string value, the .icon field will function as
62 * an alias for the .iconClass field, for backwards compatibility
63 */
64 icon: VirtualElement.IRenderer | undefined | string;
65 /**
66 * Get the icon class name for the title.
67 *
68 * #### Notes
69 * The default value is an empty string.
70 */
71 /**
72 * Set the icon class name for the title.
73 *
74 * #### Notes
75 * Multiple class names can be separated with whitespace.
76 */
77 iconClass: string;
78 /**
79 * Get the icon label for the title.
80 *
81 * #### Notes
82 * The default value is an empty string.
83 */
84 /**
85 * Set the icon label for the title.
86 *
87 * #### Notes
88 * Multiple class names can be separated with whitespace.
89 */
90 iconLabel: string;
91 /**
92 * @deprecated Use `icon` instead.
93 */
94 /**
95 * @deprecated Use `icon` instead.
96 */
97 iconRenderer: VirtualElement.IRenderer | undefined;
98 /**
99 * Get the caption for the title.
100 *
101 * #### Notes
102 * The default value is an empty string.
103 */
104 /**
105 * Set the caption for the title.
106 */
107 caption: string;
108 /**
109 * Get the extra class name for the title.
110 *
111 * #### Notes
112 * The default value is an empty string.
113 */
114 /**
115 * Set the extra class name for the title.
116 *
117 * #### Notes
118 * Multiple class names can be separated with whitespace.
119 */
120 className: string;
121 /**
122 * Get the closable state for the title.
123 *
124 * #### Notes
125 * The default value is `false`.
126 */
127 /**
128 * Set the closable state for the title.
129 *
130 * #### Notes
131 * This controls the presence of a close icon when applicable.
132 */
133 closable: boolean;
134 /**
135 * Get the dataset for the title.
136 *
137 * #### Notes
138 * The default value is an empty dataset.
139 */
140 /**
141 * Set the dataset for the title.
142 *
143 * #### Notes
144 * This controls the data attributes when applicable.
145 */
146 dataset: Title.Dataset;
147 private _label;
148 private _caption;
149 private _mnemonic;
150 private _icon;
151 private _iconClass;
152 private _iconLabel;
153 private _className;
154 private _closable;
155 private _dataset;
156 private _changed;
157}
158/**
159 * The namespace for the `Title` class statics.
160 */
161export declare namespace Title {
162 /**
163 * A type alias for a simple immutable string dataset.
164 */
165 type Dataset = {
166 readonly [key: string]: string;
167 };
168 /**
169 * An options object for initializing a title.
170 */
171 interface IOptions<T> {
172 /**
173 * The object which owns the title.
174 */
175 owner: T;
176 /**
177 * The label for the title.
178 */
179 label?: string;
180 /**
181 * The mnemonic index for the title.
182 */
183 mnemonic?: number;
184 /**
185 * The icon renderer for the title.
186 *
187 * DEPRECATED: if set to a string value, the .icon field will function as
188 * an alias for the .iconClass field, for backwards compatibility
189 */
190 icon?: VirtualElement.IRenderer | string;
191 /**
192 * The icon class name for the title.
193 */
194 iconClass?: string;
195 /**
196 * The icon label for the title.
197 */
198 iconLabel?: string;
199 /**
200 * @deprecated Use `icon` instead.
201 */
202 iconRenderer?: VirtualElement.IRenderer;
203 /**
204 * The caption for the title.
205 */
206 caption?: string;
207 /**
208 * The extra class name for the title.
209 */
210 className?: string;
211 /**
212 * The closable state for the title.
213 */
214 closable?: boolean;
215 /**
216 * The dataset for the title.
217 */
218 dataset?: Dataset;
219 }
220}
221//# sourceMappingURL=title.d.ts.map
\No newline at end of file