gpui-bridge 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +56 -2
- package/dist/app.d.ts +329 -0
- package/dist/app.js +587 -0
- package/dist/host-process.d.ts +18 -0
- package/dist/host-process.js +56 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +58 -0
- package/dist/protocol.d.ts +982 -0
- package/dist/protocol.js +3 -0
- package/dist/tree.d.ts +19 -0
- package/dist/tree.js +70 -0
- package/dist/txiki.d.ts +10 -0
- package/dist/txiki.js +90 -0
- package/package.json +44 -3
|
@@ -0,0 +1,982 @@
|
|
|
1
|
+
export declare const PROTOCOL_VERSION = 1;
|
|
2
|
+
export type NodeId = number;
|
|
3
|
+
/** Client-assigned window id; `window` without `id` is window 1. */
|
|
4
|
+
export type WindowId = number;
|
|
5
|
+
export type NodeType = "div" | "text" | "Button" | "Input" | "Checkbox" | "Icon" | "Image" | "MenuBar" | "Switch" | "RadioGroup" | "Select" | "Slider" | "Textarea" | "Dialog" | "VirtualList" | "Table" | "Tabs" | "Tab" | "Alert" | "Badge" | "Tag" | "Kbd" | "Progress" | "Spinner" | "Skeleton" | "Rating" | "Pagination" | "Collapsible" | "Accordion" | "Avatar" | "Stepper" | "NumberInput" | "OtpInput" | "Form" | "Field" | "GroupBox" | "DescriptionList" | "StatusBar" | "Toolbar" | "Resizable" | "Calendar" | "Tree" | "Diff" | "Carousel" | "Sidebar" | "Chart";
|
|
6
|
+
export type WindowTheme = "light" | "dark";
|
|
7
|
+
/** Events a window can report (PROTOCOL.md section 3); `window.events` opts in. */
|
|
8
|
+
export type WindowEventName = "focus" | "blur" | "resize" | "move" | "visibility";
|
|
9
|
+
/**
|
|
10
|
+
* A gpui-component theme file (PROTOCOL.md section 3). Field names are the file's own
|
|
11
|
+
* (snake_case, dotted color keys such as `"primary.background"`).
|
|
12
|
+
*/
|
|
13
|
+
export interface ThemeSet {
|
|
14
|
+
name?: string;
|
|
15
|
+
themes: ThemeConfig[];
|
|
16
|
+
}
|
|
17
|
+
export interface ThemeConfig {
|
|
18
|
+
name?: string;
|
|
19
|
+
mode?: WindowTheme;
|
|
20
|
+
font_size?: number;
|
|
21
|
+
font_family?: string;
|
|
22
|
+
radius?: number;
|
|
23
|
+
colors?: Record<string, string>;
|
|
24
|
+
[field: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
/** Node props on the wire. In `setProps`, a `null` value removes the prop. */
|
|
27
|
+
export type Props = Record<string, unknown>;
|
|
28
|
+
/** Messages from the client (host stdin). */
|
|
29
|
+
export type ClientMessage = {
|
|
30
|
+
op: "hello";
|
|
31
|
+
protocol: number;
|
|
32
|
+
} | {
|
|
33
|
+
op: "window";
|
|
34
|
+
id?: WindowId;
|
|
35
|
+
title?: string;
|
|
36
|
+
width?: number;
|
|
37
|
+
height?: number;
|
|
38
|
+
/** Initial position; read when the window opens. */
|
|
39
|
+
x?: number;
|
|
40
|
+
y?: number;
|
|
41
|
+
/** Minimum size the user can resize to; read when the window opens. */
|
|
42
|
+
minWidth?: number;
|
|
43
|
+
minHeight?: number;
|
|
44
|
+
root?: NodeId;
|
|
45
|
+
theme?: WindowTheme;
|
|
46
|
+
themeSet?: ThemeSet;
|
|
47
|
+
frameless?: boolean;
|
|
48
|
+
/** Minimizes (`true`) or restores (`false`) on commit; an action, not a remembered state. */
|
|
49
|
+
minimized?: boolean;
|
|
50
|
+
/** Window events the client wants; replaces the previous list. */
|
|
51
|
+
events?: WindowEventName[];
|
|
52
|
+
} | {
|
|
53
|
+
op: "create";
|
|
54
|
+
id: NodeId;
|
|
55
|
+
type: NodeType;
|
|
56
|
+
props?: Props;
|
|
57
|
+
events?: string[];
|
|
58
|
+
} | {
|
|
59
|
+
op: "append";
|
|
60
|
+
parent: NodeId;
|
|
61
|
+
child: NodeId;
|
|
62
|
+
} | {
|
|
63
|
+
op: "insertBefore";
|
|
64
|
+
parent: NodeId;
|
|
65
|
+
child: NodeId;
|
|
66
|
+
before: NodeId;
|
|
67
|
+
} | {
|
|
68
|
+
op: "setProps";
|
|
69
|
+
id: NodeId;
|
|
70
|
+
props: Props;
|
|
71
|
+
} | {
|
|
72
|
+
op: "setEvents";
|
|
73
|
+
id: NodeId;
|
|
74
|
+
events: string[];
|
|
75
|
+
} | {
|
|
76
|
+
op: "remove";
|
|
77
|
+
id: NodeId;
|
|
78
|
+
} | {
|
|
79
|
+
op: "closeWindow";
|
|
80
|
+
id: WindowId;
|
|
81
|
+
} | {
|
|
82
|
+
op: "tray";
|
|
83
|
+
icon?: string;
|
|
84
|
+
tooltip?: string;
|
|
85
|
+
menu?: MenuItem[];
|
|
86
|
+
} | {
|
|
87
|
+
op: "removeTray";
|
|
88
|
+
} | {
|
|
89
|
+
op: "shortcuts";
|
|
90
|
+
keys: string[];
|
|
91
|
+
} | {
|
|
92
|
+
op: "focus";
|
|
93
|
+
id: NodeId;
|
|
94
|
+
} | {
|
|
95
|
+
op: "openDialog";
|
|
96
|
+
request: number;
|
|
97
|
+
files?: boolean;
|
|
98
|
+
directories?: boolean;
|
|
99
|
+
multiple?: boolean;
|
|
100
|
+
prompt?: string;
|
|
101
|
+
} | {
|
|
102
|
+
op: "saveDialog";
|
|
103
|
+
request: number;
|
|
104
|
+
directory?: string;
|
|
105
|
+
name?: string;
|
|
106
|
+
} | {
|
|
107
|
+
op: "readClipboard";
|
|
108
|
+
request: number;
|
|
109
|
+
} | {
|
|
110
|
+
op: "writeClipboard";
|
|
111
|
+
text: string;
|
|
112
|
+
} | {
|
|
113
|
+
op: "openUrl";
|
|
114
|
+
url: string;
|
|
115
|
+
} | {
|
|
116
|
+
op: "openPath";
|
|
117
|
+
path: string;
|
|
118
|
+
} | {
|
|
119
|
+
op: "notify";
|
|
120
|
+
window?: WindowId;
|
|
121
|
+
id?: string;
|
|
122
|
+
type?: "info" | "success" | "warning" | "error";
|
|
123
|
+
title?: string;
|
|
124
|
+
message: string;
|
|
125
|
+
autohide?: boolean;
|
|
126
|
+
system?: boolean;
|
|
127
|
+
} | {
|
|
128
|
+
op: "commit";
|
|
129
|
+
};
|
|
130
|
+
export type ErrorCode = "invalid_json" | "unknown_op" | "unknown_node" | "unknown_type" | "invalid_props" | "invalid_operation" | "protocol_mismatch";
|
|
131
|
+
/** Messages from the host (host stdout). */
|
|
132
|
+
export type HostMessage = {
|
|
133
|
+
type: "ready";
|
|
134
|
+
protocol: number;
|
|
135
|
+
} | {
|
|
136
|
+
type: "event";
|
|
137
|
+
id: NodeId;
|
|
138
|
+
event: string;
|
|
139
|
+
value?: string | number | null | TableSort | DiffSelection;
|
|
140
|
+
checked?: boolean;
|
|
141
|
+
paths?: string[];
|
|
142
|
+
} | {
|
|
143
|
+
type: "windowClosed";
|
|
144
|
+
id: WindowId;
|
|
145
|
+
}
|
|
146
|
+
/** A window event the client opted into with `window.events`; `move`/`resize` carry bounds. */
|
|
147
|
+
| {
|
|
148
|
+
type: "windowEvent";
|
|
149
|
+
id: WindowId;
|
|
150
|
+
event: WindowEventName;
|
|
151
|
+
x?: number;
|
|
152
|
+
y?: number;
|
|
153
|
+
width?: number;
|
|
154
|
+
height?: number;
|
|
155
|
+
visible?: boolean;
|
|
156
|
+
} | {
|
|
157
|
+
type: "tray";
|
|
158
|
+
event: "click" | "menu";
|
|
159
|
+
value?: string;
|
|
160
|
+
} | {
|
|
161
|
+
type: "shortcut";
|
|
162
|
+
keys: string;
|
|
163
|
+
window: WindowId;
|
|
164
|
+
} | {
|
|
165
|
+
type: "notification";
|
|
166
|
+
id: string;
|
|
167
|
+
window: WindowId;
|
|
168
|
+
} | {
|
|
169
|
+
type: "result";
|
|
170
|
+
request: number;
|
|
171
|
+
paths?: string[] | null;
|
|
172
|
+
path?: string | null;
|
|
173
|
+
text?: string | null;
|
|
174
|
+
} | {
|
|
175
|
+
type: "error";
|
|
176
|
+
code: ErrorCode;
|
|
177
|
+
message: string;
|
|
178
|
+
op?: string;
|
|
179
|
+
request?: number;
|
|
180
|
+
};
|
|
181
|
+
/** A window title bar part, handled by the system (PROTOCOL.md section 5). */
|
|
182
|
+
export type WindowControl = "drag" | "minimize" | "maximize" | "close";
|
|
183
|
+
/**
|
|
184
|
+
* A menu entry (PROTOCOL.md section 10): an item with an `id`, a submenu with `items`, or a separator.
|
|
185
|
+
* Choosing an item sends the node's `menu` event with its `id`.
|
|
186
|
+
*/
|
|
187
|
+
export type MenuItem = {
|
|
188
|
+
id: string;
|
|
189
|
+
label: string;
|
|
190
|
+
icon?: string;
|
|
191
|
+
disabled?: boolean;
|
|
192
|
+
checked?: boolean;
|
|
193
|
+
/** A key such as `ctrl-s`: shown next to the label; in a `MenuBar` it also chooses the item. */
|
|
194
|
+
shortcut?: string;
|
|
195
|
+
} | {
|
|
196
|
+
label: string;
|
|
197
|
+
items: MenuItem[];
|
|
198
|
+
icon?: string;
|
|
199
|
+
disabled?: boolean;
|
|
200
|
+
} | {
|
|
201
|
+
separator: true;
|
|
202
|
+
};
|
|
203
|
+
/** A top-level menu of a `MenuBar`. */
|
|
204
|
+
export interface Menu {
|
|
205
|
+
label: string;
|
|
206
|
+
items: MenuItem[];
|
|
207
|
+
}
|
|
208
|
+
/** The roles a node may name (PROTOCOL.md section 16), in ARIA's names. */
|
|
209
|
+
export type A11yRole = "alert" | "alertdialog" | "article" | "banner" | "button" | "cell" | "checkbox" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "dialog" | "document" | "form" | "grid" | "gridcell" | "group" | "heading" | "img" | "label" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "menu" | "menubar" | "menuitem" | "navigation" | "note" | "paragraph" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowheader" | "scrollbar" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "textbox" | "time" | "toolbar" | "tooltip" | "tree" | "treeitem" | "window";
|
|
210
|
+
/**
|
|
211
|
+
* Accessibility for a node (PROTOCOL.md section 16). GPUI reports to assistive technology only
|
|
212
|
+
* the elements that have both an id and a role, so a `div` that acts as a button needs this.
|
|
213
|
+
*/
|
|
214
|
+
export interface A11y {
|
|
215
|
+
/** A stable identifier, visible to assistive technology (UIA `AutomationId` on Windows). */
|
|
216
|
+
id?: string;
|
|
217
|
+
role?: A11yRole;
|
|
218
|
+
label?: string;
|
|
219
|
+
/** Supplementary text, read after the label. */
|
|
220
|
+
description?: string;
|
|
221
|
+
/** The keys that activate the element (`ctrl-s`). */
|
|
222
|
+
keyshortcuts?: string;
|
|
223
|
+
checked?: boolean | "mixed";
|
|
224
|
+
selected?: boolean;
|
|
225
|
+
expanded?: boolean;
|
|
226
|
+
disabled?: boolean;
|
|
227
|
+
/** Also reported as a number when `min`, `max` or `step` is given. */
|
|
228
|
+
value?: string;
|
|
229
|
+
min?: number;
|
|
230
|
+
max?: number;
|
|
231
|
+
step?: number;
|
|
232
|
+
/** A heading's level, from 1. */
|
|
233
|
+
level?: number;
|
|
234
|
+
orientation?: "horizontal" | "vertical";
|
|
235
|
+
}
|
|
236
|
+
/** Props every node accepts (PROTOCOL.md section 16). */
|
|
237
|
+
export interface SharedProps {
|
|
238
|
+
/** Nothing about the node is reported to assistive technology without it. */
|
|
239
|
+
a11y?: A11y;
|
|
240
|
+
}
|
|
241
|
+
export interface DivProps {
|
|
242
|
+
class?: string;
|
|
243
|
+
windowControl?: WindowControl;
|
|
244
|
+
/** Opens on right-click. */
|
|
245
|
+
contextMenu?: MenuItem[];
|
|
246
|
+
/** Shown when the pointer rests on the div. */
|
|
247
|
+
tooltip?: string;
|
|
248
|
+
}
|
|
249
|
+
export interface TextProps {
|
|
250
|
+
content?: string;
|
|
251
|
+
class?: string;
|
|
252
|
+
}
|
|
253
|
+
export interface ButtonProps {
|
|
254
|
+
label?: string;
|
|
255
|
+
variant?: "primary" | "secondary" | "ghost" | "danger";
|
|
256
|
+
disabled?: boolean;
|
|
257
|
+
tooltip?: string;
|
|
258
|
+
class?: string;
|
|
259
|
+
}
|
|
260
|
+
export interface InputProps {
|
|
261
|
+
value?: string;
|
|
262
|
+
placeholder?: string;
|
|
263
|
+
disabled?: boolean;
|
|
264
|
+
/** The host only reports edits; the client confirms them with `value`. */
|
|
265
|
+
controlled?: boolean;
|
|
266
|
+
class?: string;
|
|
267
|
+
}
|
|
268
|
+
export interface CheckboxProps {
|
|
269
|
+
checked?: boolean;
|
|
270
|
+
label?: string;
|
|
271
|
+
disabled?: boolean;
|
|
272
|
+
/** The host only reports clicks; the client confirms them with `checked`. */
|
|
273
|
+
controlled?: boolean;
|
|
274
|
+
class?: string;
|
|
275
|
+
}
|
|
276
|
+
export interface IconProps {
|
|
277
|
+
/** A bundled icon, by its Lucide name (`folder`, `file-text`…; PROTOCOL.md section 5). */
|
|
278
|
+
name?: string;
|
|
279
|
+
class?: string;
|
|
280
|
+
}
|
|
281
|
+
export interface ImageProps {
|
|
282
|
+
/** A local image file (PNG, JPG, GIF, WebP, SVG…); a relative path is resolved against the host's working directory. */
|
|
283
|
+
src?: string;
|
|
284
|
+
/**
|
|
285
|
+
* The image bytes as standard base64, without a `data:` prefix: for images the client downloads
|
|
286
|
+
* itself (the host does no HTTP). While non-empty it wins over `src`; `null` goes back to `src`.
|
|
287
|
+
* Re-sending it makes the host read the bytes again.
|
|
288
|
+
*/
|
|
289
|
+
data?: string;
|
|
290
|
+
/** How the image fills the node's box. Default `contain`. */
|
|
291
|
+
fit?: "contain" | "cover" | "fill" | "scale-down" | "none";
|
|
292
|
+
class?: string;
|
|
293
|
+
}
|
|
294
|
+
export interface SwitchProps {
|
|
295
|
+
checked?: boolean;
|
|
296
|
+
label?: string;
|
|
297
|
+
disabled?: boolean;
|
|
298
|
+
/** The host only reports clicks; the client confirms them with `checked`. */
|
|
299
|
+
controlled?: boolean;
|
|
300
|
+
class?: string;
|
|
301
|
+
}
|
|
302
|
+
/** A choice of a `RadioGroup` or `Select`. */
|
|
303
|
+
export interface Option {
|
|
304
|
+
value: string;
|
|
305
|
+
label: string;
|
|
306
|
+
disabled?: boolean;
|
|
307
|
+
}
|
|
308
|
+
export interface RadioGroupProps {
|
|
309
|
+
options?: Option[];
|
|
310
|
+
/** The selected option's `value`; one that is not an option selects nothing. */
|
|
311
|
+
value?: string;
|
|
312
|
+
direction?: "vertical" | "horizontal";
|
|
313
|
+
disabled?: boolean;
|
|
314
|
+
/** The host only reports choices; the client confirms them with `value`. */
|
|
315
|
+
controlled?: boolean;
|
|
316
|
+
class?: string;
|
|
317
|
+
}
|
|
318
|
+
export interface SelectProps {
|
|
319
|
+
options?: Option[];
|
|
320
|
+
/** The selected option's `value`; one that is not an option shows the placeholder. */
|
|
321
|
+
value?: string;
|
|
322
|
+
placeholder?: string;
|
|
323
|
+
/** A search box at the top of the list. */
|
|
324
|
+
searchable?: boolean;
|
|
325
|
+
disabled?: boolean;
|
|
326
|
+
/** The host only reports choices; the client confirms them with `value`. */
|
|
327
|
+
controlled?: boolean;
|
|
328
|
+
class?: string;
|
|
329
|
+
}
|
|
330
|
+
export interface SliderProps {
|
|
331
|
+
value?: number;
|
|
332
|
+
/** Default 0. */
|
|
333
|
+
min?: number;
|
|
334
|
+
/** Default 100. */
|
|
335
|
+
max?: number;
|
|
336
|
+
/** Above 0; default 1. */
|
|
337
|
+
step?: number;
|
|
338
|
+
disabled?: boolean;
|
|
339
|
+
/** The host only reports drags; the client confirms them with `value`. */
|
|
340
|
+
controlled?: boolean;
|
|
341
|
+
class?: string;
|
|
342
|
+
}
|
|
343
|
+
export interface TextareaProps {
|
|
344
|
+
value?: string;
|
|
345
|
+
placeholder?: string;
|
|
346
|
+
disabled?: boolean;
|
|
347
|
+
class?: string;
|
|
348
|
+
}
|
|
349
|
+
/** A modal dialog; its children are its body (PROTOCOL.md section 14). */
|
|
350
|
+
export interface DialogProps {
|
|
351
|
+
/** Shown while true; the host sets it to false when the user answers. */
|
|
352
|
+
open?: boolean;
|
|
353
|
+
title?: string;
|
|
354
|
+
/** Default "OK". */
|
|
355
|
+
okText?: string;
|
|
356
|
+
/** Adds a cancel button. */
|
|
357
|
+
cancelText?: string;
|
|
358
|
+
/** In pixels. */
|
|
359
|
+
width?: number;
|
|
360
|
+
/** Classes of the body that holds the children. */
|
|
361
|
+
class?: string;
|
|
362
|
+
}
|
|
363
|
+
/** A list that builds only the rows in view; each child is one row (PROTOCOL.md section 15). */
|
|
364
|
+
export interface VirtualListProps {
|
|
365
|
+
/** Every row's height in pixels; default 32. */
|
|
366
|
+
rowHeight?: number;
|
|
367
|
+
/** Give the list a height (`flex-1`, `h-64`...): it fills its container. */
|
|
368
|
+
class?: string;
|
|
369
|
+
}
|
|
370
|
+
/** A `Table` column; `key` names the cell in each row. */
|
|
371
|
+
export interface TableColumn {
|
|
372
|
+
key: string;
|
|
373
|
+
name: string;
|
|
374
|
+
/** In pixels; default 100. */
|
|
375
|
+
width?: number;
|
|
376
|
+
align?: "left" | "center" | "right";
|
|
377
|
+
/** Shows a sort button; the app sorts `rows` on `sort`. */
|
|
378
|
+
sortable?: boolean;
|
|
379
|
+
}
|
|
380
|
+
export type TableCell = string | number | boolean | null;
|
|
381
|
+
export interface TableProps {
|
|
382
|
+
columns?: TableColumn[];
|
|
383
|
+
/** One object per row, with a cell per column `key`. */
|
|
384
|
+
rows?: Record<string, TableCell>[];
|
|
385
|
+
/** Index of the selected row in `rows`. */
|
|
386
|
+
selected?: number;
|
|
387
|
+
stripe?: boolean;
|
|
388
|
+
/** Default true. */
|
|
389
|
+
bordered?: boolean;
|
|
390
|
+
/** The host only reports selections; the client confirms them with `selected`. */
|
|
391
|
+
controlled?: boolean;
|
|
392
|
+
class?: string;
|
|
393
|
+
}
|
|
394
|
+
/** A `sort` event: the column clicked and the direction to sort `rows` in. */
|
|
395
|
+
export interface TableSort {
|
|
396
|
+
column: string;
|
|
397
|
+
direction: "asc" | "desc" | "none";
|
|
398
|
+
}
|
|
399
|
+
/** A tab bar; the app shows the chosen tab's content itself. */
|
|
400
|
+
export interface TabsProps {
|
|
401
|
+
tabs?: Option[];
|
|
402
|
+
/** The selected tab's `value`. */
|
|
403
|
+
value?: string;
|
|
404
|
+
/** Default "tab". */
|
|
405
|
+
variant?: "tab" | "outline" | "pill" | "segmented" | "underline";
|
|
406
|
+
/** The host only reports choices; the client confirms them with `value`. */
|
|
407
|
+
controlled?: boolean;
|
|
408
|
+
class?: string;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* One tab of a `Tabs`: append children to build its chip (an `Icon`, a `text`, a `Tag`…; a
|
|
412
|
+
* last `Button`, `Checkbox` or `Switch` is drawn after them, at its own size).
|
|
413
|
+
* A `Tabs` with `Tab` children uses them and ignores its `tabs`, and the `Tab` reports nothing:
|
|
414
|
+
* its `Tabs` sends the `change`.
|
|
415
|
+
*/
|
|
416
|
+
export interface TabProps {
|
|
417
|
+
/** What `change` reports for this tab. Required: the host rejects a `Tab` without it. */
|
|
418
|
+
value?: string;
|
|
419
|
+
/** The tab's text, drawn before its children. A chip of nodes names itself with `a11y.label`. */
|
|
420
|
+
label?: string;
|
|
421
|
+
disabled?: boolean;
|
|
422
|
+
/** Styles the chip itself: `flex-1` makes the tabs share the bar's width. */
|
|
423
|
+
class?: string;
|
|
424
|
+
}
|
|
425
|
+
export interface MenuBarProps {
|
|
426
|
+
menus?: Menu[];
|
|
427
|
+
class?: string;
|
|
428
|
+
}
|
|
429
|
+
export interface AlertProps {
|
|
430
|
+
/** The text of the message. */
|
|
431
|
+
message?: string;
|
|
432
|
+
title?: string;
|
|
433
|
+
/** Default "default". */
|
|
434
|
+
variant?: "default" | "info" | "success" | "warning" | "error";
|
|
435
|
+
/** A full-width band instead of a rounded box. */
|
|
436
|
+
banner?: boolean;
|
|
437
|
+
/** Shows a close button; a click sends `close`. */
|
|
438
|
+
closable?: boolean;
|
|
439
|
+
class?: string;
|
|
440
|
+
}
|
|
441
|
+
export interface BadgeProps {
|
|
442
|
+
/** Default 0; a count of 0 hides the badge. */
|
|
443
|
+
count?: number;
|
|
444
|
+
/** Default 99: a bigger count shows `max+`. */
|
|
445
|
+
max?: number;
|
|
446
|
+
/** A dot instead of a count. */
|
|
447
|
+
dot?: boolean;
|
|
448
|
+
/** A bundled icon instead of a count. */
|
|
449
|
+
icon?: string;
|
|
450
|
+
class?: string;
|
|
451
|
+
}
|
|
452
|
+
export interface TagProps {
|
|
453
|
+
label?: string;
|
|
454
|
+
/** Default "secondary". */
|
|
455
|
+
variant?: "primary" | "secondary" | "danger" | "success" | "warning" | "info";
|
|
456
|
+
outline?: boolean;
|
|
457
|
+
icon?: string;
|
|
458
|
+
class?: string;
|
|
459
|
+
}
|
|
460
|
+
export interface KbdProps {
|
|
461
|
+
/** A key such as `ctrl-s`. */
|
|
462
|
+
keys?: string;
|
|
463
|
+
outline?: boolean;
|
|
464
|
+
class?: string;
|
|
465
|
+
}
|
|
466
|
+
export interface ProgressProps {
|
|
467
|
+
/** From 0 to 100. */
|
|
468
|
+
value?: number;
|
|
469
|
+
loading?: boolean;
|
|
470
|
+
class?: string;
|
|
471
|
+
}
|
|
472
|
+
export type SpinnerProps = {
|
|
473
|
+
class?: string;
|
|
474
|
+
};
|
|
475
|
+
export interface SkeletonProps {
|
|
476
|
+
secondary?: boolean;
|
|
477
|
+
class?: string;
|
|
478
|
+
}
|
|
479
|
+
export interface RatingProps {
|
|
480
|
+
/** Default 0. */
|
|
481
|
+
value?: number;
|
|
482
|
+
/** Default 5. */
|
|
483
|
+
max?: number;
|
|
484
|
+
disabled?: boolean;
|
|
485
|
+
/** The host only reports choices; the client confirms them with `value`. */
|
|
486
|
+
controlled?: boolean;
|
|
487
|
+
class?: string;
|
|
488
|
+
}
|
|
489
|
+
export interface PaginationProps {
|
|
490
|
+
/** 1-based; default 1. */
|
|
491
|
+
page?: number;
|
|
492
|
+
/** Default 1. */
|
|
493
|
+
total?: number;
|
|
494
|
+
compact?: boolean;
|
|
495
|
+
disabled?: boolean;
|
|
496
|
+
/** The host only reports choices; the client confirms them with `page`. */
|
|
497
|
+
controlled?: boolean;
|
|
498
|
+
class?: string;
|
|
499
|
+
}
|
|
500
|
+
/** A section of an `Accordion`; its content is text. */
|
|
501
|
+
export interface AccordionItem {
|
|
502
|
+
id: string;
|
|
503
|
+
title: string;
|
|
504
|
+
content?: string;
|
|
505
|
+
open?: boolean;
|
|
506
|
+
disabled?: boolean;
|
|
507
|
+
}
|
|
508
|
+
export interface AccordionProps {
|
|
509
|
+
items?: AccordionItem[];
|
|
510
|
+
/** Several sections open at once; default false. */
|
|
511
|
+
multiple?: boolean;
|
|
512
|
+
/** Default true. */
|
|
513
|
+
bordered?: boolean;
|
|
514
|
+
disabled?: boolean;
|
|
515
|
+
/** The host only reports toggles; the client confirms them with `items`. */
|
|
516
|
+
controlled?: boolean;
|
|
517
|
+
class?: string;
|
|
518
|
+
}
|
|
519
|
+
export interface CollapsibleProps {
|
|
520
|
+
open?: boolean;
|
|
521
|
+
class?: string;
|
|
522
|
+
}
|
|
523
|
+
export interface AvatarProps {
|
|
524
|
+
/** Shown as its initial when there is no `src`. */
|
|
525
|
+
name?: string;
|
|
526
|
+
/** An image file. */
|
|
527
|
+
src?: string;
|
|
528
|
+
class?: string;
|
|
529
|
+
}
|
|
530
|
+
export interface StepperProps {
|
|
531
|
+
/** The steps, as `{value, label}`; `disabled` skips one. */
|
|
532
|
+
items?: Option[];
|
|
533
|
+
/** The current step's `value`. */
|
|
534
|
+
value?: string;
|
|
535
|
+
vertical?: boolean;
|
|
536
|
+
disabled?: boolean;
|
|
537
|
+
/** The host only reports choices; the client confirms them with `value`. */
|
|
538
|
+
controlled?: boolean;
|
|
539
|
+
class?: string;
|
|
540
|
+
}
|
|
541
|
+
export interface NumberInputProps {
|
|
542
|
+
value?: string;
|
|
543
|
+
placeholder?: string;
|
|
544
|
+
disabled?: boolean;
|
|
545
|
+
/** The host only reports edits; the client confirms them with `value`. */
|
|
546
|
+
controlled?: boolean;
|
|
547
|
+
class?: string;
|
|
548
|
+
}
|
|
549
|
+
export interface OtpInputProps {
|
|
550
|
+
/** The number of cells; default 6. */
|
|
551
|
+
length?: number;
|
|
552
|
+
value?: string;
|
|
553
|
+
masked?: boolean;
|
|
554
|
+
disabled?: boolean;
|
|
555
|
+
/** The host only reports edits; the client confirms them with `value`. */
|
|
556
|
+
controlled?: boolean;
|
|
557
|
+
class?: string;
|
|
558
|
+
}
|
|
559
|
+
export interface FormProps {
|
|
560
|
+
/** Default "vertical". */
|
|
561
|
+
direction?: "vertical" | "horizontal";
|
|
562
|
+
class?: string;
|
|
563
|
+
}
|
|
564
|
+
export interface FieldProps {
|
|
565
|
+
label?: string;
|
|
566
|
+
description?: string;
|
|
567
|
+
required?: boolean;
|
|
568
|
+
class?: string;
|
|
569
|
+
}
|
|
570
|
+
export interface GroupBoxProps {
|
|
571
|
+
title?: string;
|
|
572
|
+
/** Default "normal". */
|
|
573
|
+
variant?: "normal" | "fill" | "outline";
|
|
574
|
+
class?: string;
|
|
575
|
+
}
|
|
576
|
+
/** One row of a `DescriptionList`. */
|
|
577
|
+
export interface DescriptionItem {
|
|
578
|
+
label: string;
|
|
579
|
+
value: string;
|
|
580
|
+
/** How many columns the row spans; default 1. */
|
|
581
|
+
span?: number;
|
|
582
|
+
}
|
|
583
|
+
export interface DescriptionListProps {
|
|
584
|
+
items?: DescriptionItem[];
|
|
585
|
+
/** Default 1. */
|
|
586
|
+
columns?: number;
|
|
587
|
+
bordered?: boolean;
|
|
588
|
+
/** Label and value side by side; default stacked. */
|
|
589
|
+
horizontal?: boolean;
|
|
590
|
+
class?: string;
|
|
591
|
+
}
|
|
592
|
+
export interface StatusBarProps {
|
|
593
|
+
left?: string;
|
|
594
|
+
right?: string;
|
|
595
|
+
class?: string;
|
|
596
|
+
}
|
|
597
|
+
export type ToolbarProps = {
|
|
598
|
+
class?: string;
|
|
599
|
+
};
|
|
600
|
+
/** Panels side by side (default) or stacked; one child per panel. */
|
|
601
|
+
export interface ResizableProps {
|
|
602
|
+
axis?: "horizontal" | "vertical";
|
|
603
|
+
/** The initial size in pixels of each panel, in order; the others share what is left. */
|
|
604
|
+
sizes?: number[];
|
|
605
|
+
class?: string;
|
|
606
|
+
}
|
|
607
|
+
export interface CalendarProps {
|
|
608
|
+
/** The chosen day, `YYYY-MM-DD`. */
|
|
609
|
+
value?: string;
|
|
610
|
+
/** How many months to show, 1 to 3; default 1. */
|
|
611
|
+
months?: number;
|
|
612
|
+
/** Default "sunday". */
|
|
613
|
+
weekStartsOn?: "sunday" | "monday";
|
|
614
|
+
disabled?: boolean;
|
|
615
|
+
/** The host only reports choices; the client confirms them with `value`. */
|
|
616
|
+
controlled?: boolean;
|
|
617
|
+
class?: string;
|
|
618
|
+
}
|
|
619
|
+
/** One item of a `Tree`; `children` nests them. */
|
|
620
|
+
export interface TreeNode {
|
|
621
|
+
/** Unique within the whole `items` list. */
|
|
622
|
+
id: string;
|
|
623
|
+
label: string;
|
|
624
|
+
children?: TreeNode[];
|
|
625
|
+
/** Open when the tree first shows it; the user can expand or collapse it. */
|
|
626
|
+
expanded?: boolean;
|
|
627
|
+
disabled?: boolean;
|
|
628
|
+
}
|
|
629
|
+
export interface TreeProps {
|
|
630
|
+
items?: TreeNode[];
|
|
631
|
+
/** The selected item's `id`; one that is not in `items` selects nothing. */
|
|
632
|
+
value?: string;
|
|
633
|
+
/** The host only reports clicks; the client confirms them with `value`. */
|
|
634
|
+
controlled?: boolean;
|
|
635
|
+
/** Give the tree a bounded height (`h-64`, `flex-1`): it scrolls itself. */
|
|
636
|
+
class?: string;
|
|
637
|
+
}
|
|
638
|
+
/** The selected source lines of a `Diff`, reported with `change`. */
|
|
639
|
+
export interface DiffSelection {
|
|
640
|
+
path: string;
|
|
641
|
+
side: "original" | "modified";
|
|
642
|
+
start: number;
|
|
643
|
+
end: number;
|
|
644
|
+
endSide: "original" | "modified";
|
|
645
|
+
}
|
|
646
|
+
export interface DiffProps {
|
|
647
|
+
/** A unified or Git diff; a malformed patch is `invalid_props`. */
|
|
648
|
+
patch?: string;
|
|
649
|
+
/** Default "unified". */
|
|
650
|
+
mode?: "unified" | "split";
|
|
651
|
+
/** Default true. */
|
|
652
|
+
lineNumbers?: boolean;
|
|
653
|
+
/** Default false: long lines scroll horizontally. */
|
|
654
|
+
softWrap?: boolean;
|
|
655
|
+
/** Shows a header above each file; default true. */
|
|
656
|
+
header?: boolean;
|
|
657
|
+
/** Give it a bounded height (`h-96`, `flex-1`): it scrolls itself. */
|
|
658
|
+
class?: string;
|
|
659
|
+
}
|
|
660
|
+
/** A carousel; each child is one slide. */
|
|
661
|
+
export interface CarouselProps {
|
|
662
|
+
/** The selected slide index; one past the last slide selects the last one. */
|
|
663
|
+
value?: number;
|
|
664
|
+
/** Default "horizontal". */
|
|
665
|
+
axis?: "horizontal" | "vertical";
|
|
666
|
+
/** Wrap from the last slide to the first; default false. */
|
|
667
|
+
looping?: boolean;
|
|
668
|
+
/** Previous and next buttons; default true. */
|
|
669
|
+
controls?: boolean;
|
|
670
|
+
/** One dot per slide; default false. */
|
|
671
|
+
pagination?: boolean;
|
|
672
|
+
/** The host only reports slides; the client confirms them with `value`. */
|
|
673
|
+
controlled?: boolean;
|
|
674
|
+
class?: string;
|
|
675
|
+
}
|
|
676
|
+
/** One entry of a `Sidebar`; `children` is its submenu. */
|
|
677
|
+
export interface SidebarEntry {
|
|
678
|
+
/** Unique across the whole sidebar: it is the `value` and what `change` reports. */
|
|
679
|
+
id: string;
|
|
680
|
+
label: string;
|
|
681
|
+
/** A bundled icon name; collapsed, it is all the entry shows. */
|
|
682
|
+
icon?: string;
|
|
683
|
+
disabled?: boolean;
|
|
684
|
+
/** The submenu starts open; default false. */
|
|
685
|
+
open?: boolean;
|
|
686
|
+
children?: SidebarEntry[];
|
|
687
|
+
}
|
|
688
|
+
/** A group of entries with a heading (`label`); without one the entries have no heading. */
|
|
689
|
+
export interface SidebarSection {
|
|
690
|
+
label?: string;
|
|
691
|
+
items: SidebarEntry[];
|
|
692
|
+
}
|
|
693
|
+
export interface SidebarProps {
|
|
694
|
+
/** The sections: the sidebar takes no children. */
|
|
695
|
+
items?: SidebarSection[];
|
|
696
|
+
/** The active entry's `id`; one that is not in `items` leaves none active. */
|
|
697
|
+
value?: string;
|
|
698
|
+
/** Icon width (48px) instead of the full width. */
|
|
699
|
+
collapsed?: boolean;
|
|
700
|
+
/** What collapsing does: `icon` (default), `offcanvas` or `none`. */
|
|
701
|
+
collapsible?: "icon" | "offcanvas" | "none";
|
|
702
|
+
/** Default `left`. */
|
|
703
|
+
side?: "left" | "right";
|
|
704
|
+
/** The host only reports clicks; the client confirms them with `value`. */
|
|
705
|
+
controlled?: boolean;
|
|
706
|
+
class?: string;
|
|
707
|
+
}
|
|
708
|
+
/** A theme color of a chart series (PROTOCOL.md section 19). */
|
|
709
|
+
export type ChartColor = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "primary" | "secondary" | "muted" | "accent" | "danger" | "success" | "warning" | "info";
|
|
710
|
+
/** One point of a `Chart`: the category of a line or a bar, or the name of a slice. */
|
|
711
|
+
export interface ChartDatum {
|
|
712
|
+
label: string;
|
|
713
|
+
value: number;
|
|
714
|
+
}
|
|
715
|
+
export interface ChartProps {
|
|
716
|
+
/** The plot: `line` (default), `bar` or `pie`. */
|
|
717
|
+
chart?: "line" | "bar" | "pie";
|
|
718
|
+
/** The points, in order. */
|
|
719
|
+
data?: ChartDatum[];
|
|
720
|
+
/** A line's or the bars' color; default `chart-1`. A pie cycles `chart-1` to `chart-5`. */
|
|
721
|
+
color?: ChartColor;
|
|
722
|
+
/** The series name the hover tooltip shows. */
|
|
723
|
+
name?: string;
|
|
724
|
+
/** A line's curve between points; default `linear`. */
|
|
725
|
+
curve?: "linear" | "natural" | "step";
|
|
726
|
+
/** A line: a dot on each point; default false. */
|
|
727
|
+
dot?: boolean;
|
|
728
|
+
/** Bars grow from the left instead of the bottom; default false. */
|
|
729
|
+
horizontal?: boolean;
|
|
730
|
+
/** The category axis (of a line or the bars); default true. */
|
|
731
|
+
xAxis?: boolean;
|
|
732
|
+
/** How many category labels, spread evenly; default 12, 0 none. */
|
|
733
|
+
xTicks?: number;
|
|
734
|
+
/** The value axis; default false. */
|
|
735
|
+
yAxis?: boolean;
|
|
736
|
+
/** Ticks on the value axis, both ends included; default 5, below 2 counts as 2. */
|
|
737
|
+
yTicks?: number;
|
|
738
|
+
/** The grid lines; default true. */
|
|
739
|
+
grid?: boolean;
|
|
740
|
+
/** A line: pin the value axis; both are needed, in order. */
|
|
741
|
+
yMin?: number;
|
|
742
|
+
yMax?: number;
|
|
743
|
+
/** A pie: the hole in the middle, in pixels; default 0. */
|
|
744
|
+
innerRadius?: number;
|
|
745
|
+
/** A pie: the gap between slices, in radians (0.03 is a thin gap); default 0. */
|
|
746
|
+
padAngle?: number;
|
|
747
|
+
/** The hover crosshair, the dots and the tooltip; default true. */
|
|
748
|
+
interactive?: boolean;
|
|
749
|
+
/** Give it a bounded box (`h-64`, `flex-1 w-full`): the plot fills it. */
|
|
750
|
+
class?: string;
|
|
751
|
+
}
|
|
752
|
+
export interface NodeProps {
|
|
753
|
+
div: DivProps & SharedProps;
|
|
754
|
+
text: TextProps & SharedProps;
|
|
755
|
+
Button: ButtonProps & SharedProps;
|
|
756
|
+
Input: InputProps & SharedProps;
|
|
757
|
+
Checkbox: CheckboxProps & SharedProps;
|
|
758
|
+
Icon: IconProps & SharedProps;
|
|
759
|
+
Image: ImageProps & SharedProps;
|
|
760
|
+
MenuBar: MenuBarProps & SharedProps;
|
|
761
|
+
Switch: SwitchProps & SharedProps;
|
|
762
|
+
RadioGroup: RadioGroupProps & SharedProps;
|
|
763
|
+
Select: SelectProps & SharedProps;
|
|
764
|
+
Slider: SliderProps & SharedProps;
|
|
765
|
+
Textarea: TextareaProps & SharedProps;
|
|
766
|
+
Dialog: DialogProps & SharedProps;
|
|
767
|
+
VirtualList: VirtualListProps & SharedProps;
|
|
768
|
+
Table: TableProps & SharedProps;
|
|
769
|
+
Tabs: TabsProps & SharedProps;
|
|
770
|
+
Tab: TabProps & SharedProps;
|
|
771
|
+
Alert: AlertProps & SharedProps;
|
|
772
|
+
Badge: BadgeProps & SharedProps;
|
|
773
|
+
Tag: TagProps & SharedProps;
|
|
774
|
+
Kbd: KbdProps & SharedProps;
|
|
775
|
+
Progress: ProgressProps & SharedProps;
|
|
776
|
+
Spinner: SpinnerProps & SharedProps;
|
|
777
|
+
Skeleton: SkeletonProps & SharedProps;
|
|
778
|
+
Rating: RatingProps & SharedProps;
|
|
779
|
+
Pagination: PaginationProps & SharedProps;
|
|
780
|
+
Collapsible: CollapsibleProps & SharedProps;
|
|
781
|
+
Accordion: AccordionProps & SharedProps;
|
|
782
|
+
Avatar: AvatarProps & SharedProps;
|
|
783
|
+
Stepper: StepperProps & SharedProps;
|
|
784
|
+
NumberInput: NumberInputProps & SharedProps;
|
|
785
|
+
OtpInput: OtpInputProps & SharedProps;
|
|
786
|
+
Form: FormProps & SharedProps;
|
|
787
|
+
Field: FieldProps & SharedProps;
|
|
788
|
+
GroupBox: GroupBoxProps & SharedProps;
|
|
789
|
+
DescriptionList: DescriptionListProps & SharedProps;
|
|
790
|
+
StatusBar: StatusBarProps & SharedProps;
|
|
791
|
+
Toolbar: ToolbarProps & SharedProps;
|
|
792
|
+
Resizable: ResizableProps & SharedProps;
|
|
793
|
+
Calendar: CalendarProps & SharedProps;
|
|
794
|
+
Tree: TreeProps & SharedProps;
|
|
795
|
+
Diff: DiffProps & SharedProps;
|
|
796
|
+
Carousel: CarouselProps & SharedProps;
|
|
797
|
+
Sidebar: SidebarProps & SharedProps;
|
|
798
|
+
Chart: ChartProps & SharedProps;
|
|
799
|
+
}
|
|
800
|
+
export interface NodeEvents {
|
|
801
|
+
div: {
|
|
802
|
+
click: {};
|
|
803
|
+
doubleClick: {};
|
|
804
|
+
menu: {
|
|
805
|
+
item: string;
|
|
806
|
+
};
|
|
807
|
+
keyDown: {
|
|
808
|
+
key: string;
|
|
809
|
+
};
|
|
810
|
+
drop: {
|
|
811
|
+
paths: string[];
|
|
812
|
+
};
|
|
813
|
+
};
|
|
814
|
+
text: {};
|
|
815
|
+
Button: {
|
|
816
|
+
click: {};
|
|
817
|
+
};
|
|
818
|
+
Input: {
|
|
819
|
+
change: {
|
|
820
|
+
value: string;
|
|
821
|
+
};
|
|
822
|
+
submit: {
|
|
823
|
+
value: string;
|
|
824
|
+
};
|
|
825
|
+
keyDown: {
|
|
826
|
+
key: string;
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
Checkbox: {
|
|
830
|
+
change: {
|
|
831
|
+
checked: boolean;
|
|
832
|
+
};
|
|
833
|
+
};
|
|
834
|
+
Icon: {};
|
|
835
|
+
Image: {};
|
|
836
|
+
MenuBar: {
|
|
837
|
+
menu: {
|
|
838
|
+
item: string;
|
|
839
|
+
};
|
|
840
|
+
};
|
|
841
|
+
Switch: {
|
|
842
|
+
change: {
|
|
843
|
+
checked: boolean;
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
RadioGroup: {
|
|
847
|
+
change: {
|
|
848
|
+
value: string;
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
Select: {
|
|
852
|
+
change: {
|
|
853
|
+
value: string;
|
|
854
|
+
};
|
|
855
|
+
};
|
|
856
|
+
Slider: {
|
|
857
|
+
change: {
|
|
858
|
+
value: number;
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
Textarea: {
|
|
862
|
+
change: {
|
|
863
|
+
value: string;
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
Dialog: {
|
|
867
|
+
ok: {};
|
|
868
|
+
cancel: {};
|
|
869
|
+
};
|
|
870
|
+
VirtualList: {};
|
|
871
|
+
/** `value` is a row index; `null` when Escape clears the selection. */
|
|
872
|
+
Table: {
|
|
873
|
+
change: {
|
|
874
|
+
value: number | null;
|
|
875
|
+
};
|
|
876
|
+
doubleClick: {
|
|
877
|
+
value: number;
|
|
878
|
+
};
|
|
879
|
+
sort: TableSort;
|
|
880
|
+
};
|
|
881
|
+
Tabs: {
|
|
882
|
+
change: {
|
|
883
|
+
value: string;
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
/** A `Tab` reports nothing: its `Tabs` sends the `change`. */
|
|
887
|
+
Tab: {};
|
|
888
|
+
Alert: {
|
|
889
|
+
close: {};
|
|
890
|
+
};
|
|
891
|
+
Badge: {};
|
|
892
|
+
Tag: {};
|
|
893
|
+
Kbd: {};
|
|
894
|
+
Progress: {};
|
|
895
|
+
Spinner: {};
|
|
896
|
+
Skeleton: {};
|
|
897
|
+
Rating: {
|
|
898
|
+
change: {
|
|
899
|
+
value: number;
|
|
900
|
+
};
|
|
901
|
+
};
|
|
902
|
+
Pagination: {
|
|
903
|
+
change: {
|
|
904
|
+
value: number;
|
|
905
|
+
};
|
|
906
|
+
};
|
|
907
|
+
Collapsible: {};
|
|
908
|
+
/** `value` is the `id` of the section opened or closed. */
|
|
909
|
+
Accordion: {
|
|
910
|
+
change: {
|
|
911
|
+
value: string;
|
|
912
|
+
};
|
|
913
|
+
};
|
|
914
|
+
Avatar: {};
|
|
915
|
+
/** `value` is the chosen step's `value`. */
|
|
916
|
+
Stepper: {
|
|
917
|
+
change: {
|
|
918
|
+
value: string;
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
NumberInput: {
|
|
922
|
+
change: {
|
|
923
|
+
value: string;
|
|
924
|
+
};
|
|
925
|
+
submit: {
|
|
926
|
+
value: string;
|
|
927
|
+
};
|
|
928
|
+
keyDown: {
|
|
929
|
+
key: string;
|
|
930
|
+
};
|
|
931
|
+
};
|
|
932
|
+
OtpInput: {
|
|
933
|
+
change: {
|
|
934
|
+
value: string;
|
|
935
|
+
};
|
|
936
|
+
};
|
|
937
|
+
Form: {};
|
|
938
|
+
Field: {};
|
|
939
|
+
GroupBox: {};
|
|
940
|
+
DescriptionList: {};
|
|
941
|
+
StatusBar: {};
|
|
942
|
+
Toolbar: {};
|
|
943
|
+
Resizable: {};
|
|
944
|
+
/** `value` is the chosen day, `YYYY-MM-DD`. */
|
|
945
|
+
Calendar: {
|
|
946
|
+
change: {
|
|
947
|
+
value: string;
|
|
948
|
+
};
|
|
949
|
+
};
|
|
950
|
+
/** `value` is the selected item's `id`; `expand`/`collapse` report a folder's `id`. */
|
|
951
|
+
Tree: {
|
|
952
|
+
change: {
|
|
953
|
+
value: string;
|
|
954
|
+
};
|
|
955
|
+
expand: {
|
|
956
|
+
value: string;
|
|
957
|
+
};
|
|
958
|
+
collapse: {
|
|
959
|
+
value: string;
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
/** `value` is the selected range, `null` when the selection is cleared. */
|
|
963
|
+
Diff: {
|
|
964
|
+
change: {
|
|
965
|
+
value: DiffSelection | null;
|
|
966
|
+
};
|
|
967
|
+
};
|
|
968
|
+
/** `value` is the selected slide index. */
|
|
969
|
+
Carousel: {
|
|
970
|
+
change: {
|
|
971
|
+
value: number;
|
|
972
|
+
};
|
|
973
|
+
};
|
|
974
|
+
/** `value` is the `id` of the entry clicked. */
|
|
975
|
+
Sidebar: {
|
|
976
|
+
change: {
|
|
977
|
+
value: string;
|
|
978
|
+
};
|
|
979
|
+
};
|
|
980
|
+
/** A chart has no events: the hover tooltip is the component's own. */
|
|
981
|
+
Chart: {};
|
|
982
|
+
}
|