gpui-bridge 0.0.0-stage → 0.3.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.
@@ -0,0 +1,1586 @@
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" | "Canvas" | "Command" | "Settings" | "Toggle" | "DropdownButton" | "Label" | "Empty" | "Shimmer" | "InputGroup" | "Clipboard" | "AlertDialog" | "Sheet" | "Popover" | "HoverCard" | "DatePicker" | "TimeField" | "ColorPicker" | "Combobox" | "Bubble" | "Message" | "MessageHeader" | "MessageFooter" | "Marker" | "Attachment" | "MessageScroller" | "Questionnaire" | "List" | "ListItem" | "Dock" | "DockPanel" | "AccordionItem" | "DialogFooter" | "StatusBarLeft" | "StatusBarRight";
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 | string[] | TableSort | DiffSelection | CanvasPoint | SettingsChange | QuestionnaireAnswer | QuestionnaireAnswer[];
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. A `DialogFooter` child replaces both buttons. */
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
+ /** An `items` entry 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
+ /** Ignored when the Accordion has `AccordionItem` children. */
510
+ items?: AccordionItem[];
511
+ /** Several sections open at once; default false. */
512
+ multiple?: boolean;
513
+ /** Default true. */
514
+ bordered?: boolean;
515
+ disabled?: boolean;
516
+ /** The host only reports toggles; the client confirms them with `items`. */
517
+ controlled?: boolean;
518
+ class?: string;
519
+ }
520
+ export interface CollapsibleProps {
521
+ open?: boolean;
522
+ class?: string;
523
+ }
524
+ export interface AvatarProps {
525
+ /** Shown as its initial when there is no `src`. */
526
+ name?: string;
527
+ /** An image file. */
528
+ src?: string;
529
+ class?: string;
530
+ }
531
+ export interface StepperProps {
532
+ /** The steps, as `{value, label}`; `disabled` skips one. */
533
+ items?: Option[];
534
+ /** The current step's `value`. */
535
+ value?: string;
536
+ vertical?: boolean;
537
+ disabled?: boolean;
538
+ /** The host only reports choices; the client confirms them with `value`. */
539
+ controlled?: boolean;
540
+ class?: string;
541
+ }
542
+ export interface NumberInputProps {
543
+ value?: string;
544
+ placeholder?: string;
545
+ disabled?: boolean;
546
+ /** The host only reports edits; the client confirms them with `value`. */
547
+ controlled?: boolean;
548
+ class?: string;
549
+ }
550
+ export interface OtpInputProps {
551
+ /** The number of cells; default 6. */
552
+ length?: number;
553
+ value?: string;
554
+ masked?: boolean;
555
+ disabled?: boolean;
556
+ /** The host only reports edits; the client confirms them with `value`. */
557
+ controlled?: boolean;
558
+ class?: string;
559
+ }
560
+ export interface FormProps {
561
+ /** Default "vertical". */
562
+ direction?: "vertical" | "horizontal";
563
+ class?: string;
564
+ }
565
+ export interface FieldProps {
566
+ label?: string;
567
+ description?: string;
568
+ required?: boolean;
569
+ class?: string;
570
+ }
571
+ export interface GroupBoxProps {
572
+ title?: string;
573
+ /** Default "normal". */
574
+ variant?: "normal" | "fill" | "outline";
575
+ class?: string;
576
+ }
577
+ /** One row of a `DescriptionList`. */
578
+ export interface DescriptionItem {
579
+ label: string;
580
+ value: string;
581
+ /** How many columns the row spans; default 1. */
582
+ span?: number;
583
+ }
584
+ export interface DescriptionListProps {
585
+ items?: DescriptionItem[];
586
+ /** Default 1. */
587
+ columns?: number;
588
+ bordered?: boolean;
589
+ /** Label and value side by side; default stacked. */
590
+ horizontal?: boolean;
591
+ class?: string;
592
+ }
593
+ export interface StatusBarProps {
594
+ /** Replaced by a `StatusBarLeft` child. */
595
+ left?: string;
596
+ /** Replaced by a `StatusBarRight` child. */
597
+ right?: string;
598
+ class?: string;
599
+ }
600
+ export type ToolbarProps = {
601
+ class?: string;
602
+ };
603
+ /** Panels side by side (default) or stacked; one child per panel. */
604
+ export interface ResizableProps {
605
+ axis?: "horizontal" | "vertical";
606
+ /** The initial size in pixels of each panel, in order; the others share what is left. */
607
+ sizes?: number[];
608
+ class?: string;
609
+ }
610
+ export interface CalendarProps {
611
+ /** The chosen day, `YYYY-MM-DD`. */
612
+ value?: string;
613
+ /** How many months to show, 1 to 3; default 1. */
614
+ months?: number;
615
+ /** Default "sunday". */
616
+ weekStartsOn?: "sunday" | "monday";
617
+ disabled?: boolean;
618
+ /** The host only reports choices; the client confirms them with `value`. */
619
+ controlled?: boolean;
620
+ class?: string;
621
+ }
622
+ /** One item of a `Tree`; `children` nests them. */
623
+ export interface TreeNode {
624
+ /** Unique within the whole `items` list. */
625
+ id: string;
626
+ label: string;
627
+ children?: TreeNode[];
628
+ /** Open when the tree first shows it; the user can expand or collapse it. */
629
+ expanded?: boolean;
630
+ disabled?: boolean;
631
+ }
632
+ export interface TreeProps {
633
+ items?: TreeNode[];
634
+ /** The selected item's `id`; one that is not in `items` selects nothing. */
635
+ value?: string;
636
+ /** The host only reports clicks; the client confirms them with `value`. */
637
+ controlled?: boolean;
638
+ /** Give the tree a bounded height (`h-64`, `flex-1`): it scrolls itself. */
639
+ class?: string;
640
+ }
641
+ /** The selected source lines of a `Diff`, reported with `change`. */
642
+ export interface DiffSelection {
643
+ path: string;
644
+ side: "original" | "modified";
645
+ start: number;
646
+ end: number;
647
+ endSide: "original" | "modified";
648
+ }
649
+ export interface DiffProps {
650
+ /** A unified or Git diff; a malformed patch is `invalid_props`. */
651
+ patch?: string;
652
+ /** Default "unified". */
653
+ mode?: "unified" | "split";
654
+ /** Default true. */
655
+ lineNumbers?: boolean;
656
+ /** Default false: long lines scroll horizontally. */
657
+ softWrap?: boolean;
658
+ /** Shows a header above each file; default true. */
659
+ header?: boolean;
660
+ /** Give it a bounded height (`h-96`, `flex-1`): it scrolls itself. */
661
+ class?: string;
662
+ }
663
+ /** A carousel; each child is one slide. */
664
+ export interface CarouselProps {
665
+ /** The selected slide index; one past the last slide selects the last one. */
666
+ value?: number;
667
+ /** Default "horizontal". */
668
+ axis?: "horizontal" | "vertical";
669
+ /** Wrap from the last slide to the first; default false. */
670
+ looping?: boolean;
671
+ /** Previous and next buttons; default true. */
672
+ controls?: boolean;
673
+ /** One dot per slide; default false. */
674
+ pagination?: boolean;
675
+ /** The host only reports slides; the client confirms them with `value`. */
676
+ controlled?: boolean;
677
+ class?: string;
678
+ }
679
+ /** One entry of a `Sidebar`; `children` is its submenu. */
680
+ export interface SidebarEntry {
681
+ /** Unique across the whole sidebar: it is the `value` and what `change` reports. */
682
+ id: string;
683
+ label: string;
684
+ /** A bundled icon name; collapsed, it is all the entry shows. */
685
+ icon?: string;
686
+ disabled?: boolean;
687
+ /** The submenu starts open; default false. */
688
+ open?: boolean;
689
+ children?: SidebarEntry[];
690
+ }
691
+ /** A group of entries with a heading (`label`); without one the entries have no heading. */
692
+ export interface SidebarSection {
693
+ label?: string;
694
+ items: SidebarEntry[];
695
+ }
696
+ export interface SidebarProps {
697
+ /** The sections: the sidebar takes no children. */
698
+ items?: SidebarSection[];
699
+ /** The active entry's `id`; one that is not in `items` leaves none active. */
700
+ value?: string;
701
+ /** Icon width (48px) instead of the full width. */
702
+ collapsed?: boolean;
703
+ /** What collapsing does: `icon` (default), `offcanvas` or `none`. */
704
+ collapsible?: "icon" | "offcanvas" | "none";
705
+ /** Default `left`. */
706
+ side?: "left" | "right";
707
+ /** The host only reports clicks; the client confirms them with `value`. */
708
+ controlled?: boolean;
709
+ class?: string;
710
+ }
711
+ /** A theme color of a chart series (PROTOCOL.md section 19). */
712
+ export type ChartColor = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "primary" | "secondary" | "muted" | "accent" | "danger" | "success" | "warning" | "info";
713
+ /** One point of a `Chart`: the category of a line or a bar, or the name of a slice. */
714
+ export interface ChartDatum {
715
+ label: string;
716
+ value: number;
717
+ }
718
+ export interface ChartProps {
719
+ /** The plot: `line` (default), `bar` or `pie`. */
720
+ chart?: "line" | "bar" | "pie";
721
+ /** The points, in order. */
722
+ data?: ChartDatum[];
723
+ /** A line's or the bars' color; default `chart-1`. A pie cycles `chart-1` to `chart-5`. */
724
+ color?: ChartColor;
725
+ /** The series name the hover tooltip shows. */
726
+ name?: string;
727
+ /** A line's curve between points; default `linear`. */
728
+ curve?: "linear" | "natural" | "step";
729
+ /** A line: a dot on each point; default false. */
730
+ dot?: boolean;
731
+ /** Bars grow from the left instead of the bottom; default false. */
732
+ horizontal?: boolean;
733
+ /** The category axis (of a line or the bars); default true. */
734
+ xAxis?: boolean;
735
+ /** How many category labels, spread evenly; default 12, 0 none. */
736
+ xTicks?: number;
737
+ /** The value axis; default false. */
738
+ yAxis?: boolean;
739
+ /** Ticks on the value axis, both ends included; default 5, below 2 counts as 2. */
740
+ yTicks?: number;
741
+ /** The grid lines; default true. */
742
+ grid?: boolean;
743
+ /** A line: pin the value axis; both are needed, in order. */
744
+ yMin?: number;
745
+ yMax?: number;
746
+ /** A pie: the hole in the middle, in pixels; default 0. */
747
+ innerRadius?: number;
748
+ /** A pie: the gap between slices, in radians (0.03 is a thin gap); default 0. */
749
+ padAngle?: number;
750
+ /** The hover crosshair, the dots and the tooltip; default true. */
751
+ interactive?: boolean;
752
+ /** Give it a bounded box (`h-64`, `flex-1 w-full`): the plot fills it. */
753
+ class?: string;
754
+ }
755
+ /** One drawing command of a `Canvas` (PROTOCOL.md section 20), in logical pixels from its top-left corner. */
756
+ export type CanvasCommand = {
757
+ op: "rect";
758
+ x: number;
759
+ y: number;
760
+ w: number;
761
+ h: number;
762
+ color?: ChartColor;
763
+ corner_radius?: number;
764
+ } | {
765
+ op: "line";
766
+ x1: number;
767
+ y1: number;
768
+ x2: number;
769
+ y2: number;
770
+ color?: ChartColor;
771
+ width?: number;
772
+ }
773
+ /** `d` takes absolute `M x y`, `L x y` and `Z` only. */
774
+ | {
775
+ op: "path";
776
+ d: string;
777
+ color?: ChartColor;
778
+ width?: number;
779
+ };
780
+ /** A point local to a `Canvas`, in the same coordinates as its commands. */
781
+ export interface CanvasPoint {
782
+ x: number;
783
+ y: number;
784
+ }
785
+ export interface CanvasProps {
786
+ /** Painted in order; `setProps` replaces the whole list. */
787
+ commands?: CanvasCommand[];
788
+ /** Give it a bounded box (`h-64 w-full`). */
789
+ class?: string;
790
+ }
791
+ /** One entry of a `Command` palette. */
792
+ export interface CommandEntry {
793
+ /** Unique across the whole palette: it is what `confirm` reports. */
794
+ id: string;
795
+ label: string;
796
+ /** A bundled icon name. */
797
+ icon?: string;
798
+ /** Extra terms the search matches, besides `label`. */
799
+ keywords?: string[];
800
+ /** Draws a check at the end of the row. */
801
+ checked?: boolean;
802
+ disabled?: boolean;
803
+ }
804
+ /** A group of entries with a heading (`label`); without one the entries have no heading. */
805
+ export interface CommandSection {
806
+ label?: string;
807
+ items: CommandEntry[];
808
+ }
809
+ export interface CommandProps {
810
+ /** The sections: the palette takes no children and filters them by the query itself. */
811
+ items?: CommandSection[];
812
+ /** The search field's placeholder. */
813
+ placeholder?: string;
814
+ class?: string;
815
+ }
816
+ /** One field of a `Settings` page; `value` fits `type` (a dropdown's is one of its `options`). */
817
+ export type SettingsItem = {
818
+ /** Unique across all pages: it is what `change` reports. */
819
+ key: string;
820
+ label: string;
821
+ description?: string;
822
+ disabled?: boolean;
823
+ } & ({
824
+ type: "switch" | "checkbox";
825
+ value: boolean;
826
+ } | {
827
+ type: "input";
828
+ value: string;
829
+ } | {
830
+ type: "dropdown";
831
+ value: string;
832
+ options: {
833
+ value: string;
834
+ label: string;
835
+ }[];
836
+ } | {
837
+ type: "number";
838
+ value: number;
839
+ min?: number;
840
+ max?: number;
841
+ step?: number;
842
+ });
843
+ /** A group of fields, with an optional heading. */
844
+ export interface SettingsGroup {
845
+ title?: string;
846
+ items: SettingsItem[];
847
+ }
848
+ /** A sidebar entry and the groups shown when it is selected. */
849
+ export interface SettingsPage {
850
+ title: string;
851
+ /** A bundled icon name. */
852
+ icon?: string;
853
+ groups: SettingsGroup[];
854
+ }
855
+ /** What `change` reports: the field the user set and its new value. */
856
+ export interface SettingsChange {
857
+ key: string;
858
+ value: boolean | string | number;
859
+ }
860
+ export interface SettingsProps {
861
+ /** The pages: the host keeps each value the user sets (no `controlled` mode). */
862
+ pages?: SettingsPage[];
863
+ /** Give it a size (`size-full`, `h-96`): the sidebar and the page split the box. */
864
+ class?: string;
865
+ }
866
+ export interface ToggleProps {
867
+ checked?: boolean;
868
+ label?: string;
869
+ /** A bundled icon name, drawn before the label. */
870
+ icon?: string;
871
+ /** Default "ghost". */
872
+ variant?: "ghost" | "outline";
873
+ /** A hint; it is also the name a screen reader reads. */
874
+ tooltip?: string;
875
+ disabled?: boolean;
876
+ /** The host only reports clicks; the client confirms them with `checked`. */
877
+ controlled?: boolean;
878
+ class?: string;
879
+ }
880
+ export interface DropdownButtonProps {
881
+ label?: string;
882
+ /** A bundled icon name, drawn before the label. */
883
+ icon?: string;
884
+ /** Default: gpui-component's own look. */
885
+ variant?: "primary" | "secondary" | "ghost" | "danger";
886
+ outline?: boolean;
887
+ disabled?: boolean;
888
+ /** The menu, in the format of `contextMenu` (`PROTOCOL.md` section 10). */
889
+ items?: MenuItem[];
890
+ /** The name a screen reader reads for the caret; default: a translated "More options". */
891
+ menuLabel?: string;
892
+ /** A hint on the left half. */
893
+ tooltip?: string;
894
+ class?: string;
895
+ }
896
+ export interface LabelProps {
897
+ content?: string;
898
+ /** A muted text after the content. */
899
+ secondary?: string;
900
+ /** Dots instead of the characters. */
901
+ masked?: boolean;
902
+ /** Marks every occurrence of this substring, ignoring case. */
903
+ highlight?: string;
904
+ class?: string;
905
+ }
906
+ export interface EmptyProps {
907
+ /** A bundled icon name, in a muted box above the title. */
908
+ icon?: string;
909
+ title?: string;
910
+ description?: string;
911
+ /** It fills its box (`flex-1`), so size the parent. */
912
+ class?: string;
913
+ }
914
+ export interface ShimmerProps {
915
+ content?: string;
916
+ /** One sweep, in seconds; default 2. */
917
+ duration?: number;
918
+ /** The highlight half-width; default 0.3, kept within 0.05–1. */
919
+ spread?: number;
920
+ reverse?: boolean;
921
+ /** One sweep instead of a loop. */
922
+ once?: boolean;
923
+ class?: string;
924
+ }
925
+ export interface InputGroupProps {
926
+ value?: string;
927
+ placeholder?: string;
928
+ /** Text on the left of the field. */
929
+ prefix?: string;
930
+ /** Text on the right. */
931
+ suffix?: string;
932
+ /** A bundled icon name on the left. */
933
+ prefixIcon?: string;
934
+ /** A bundled icon name on the right. */
935
+ suffixIcon?: string;
936
+ disabled?: boolean;
937
+ readonly?: boolean;
938
+ /** The caller's validation result; it does not reject edits. */
939
+ invalid?: boolean;
940
+ /** The host only reports edits; the client confirms them with `value`. */
941
+ controlled?: boolean;
942
+ class?: string;
943
+ }
944
+ export interface ClipboardProps {
945
+ /** The text copied on click. */
946
+ value?: string;
947
+ /** A hint; `a11y.label` is the button's name. */
948
+ tooltip?: string;
949
+ class?: string;
950
+ }
951
+ /** The eight corners a `Popover` or a `HoverCard` can open from. */
952
+ export type OverlayAnchor = "top-left" | "top-center" | "top-right" | "left-center" | "right-center" | "bottom-left" | "bottom-center" | "bottom-right";
953
+ export interface AlertDialogProps {
954
+ /** Shown while true; the host sets it to false when the user answers. */
955
+ open?: boolean;
956
+ title?: string;
957
+ description?: string;
958
+ /** A bundled icon name, before the title. */
959
+ icon?: string;
960
+ /** Default "OK". */
961
+ okText?: string;
962
+ /** Adds the Cancel button. A `DialogFooter` child replaces both buttons. */
963
+ cancelText?: string;
964
+ /** Classes of the body that holds the children. */
965
+ class?: string;
966
+ }
967
+ export interface SheetProps {
968
+ /** Shown while true; the host sets it to false when the panel closes. */
969
+ open?: boolean;
970
+ /** The edge it slides in from. Default "right". */
971
+ side?: "left" | "right" | "top" | "bottom";
972
+ title?: string;
973
+ /** Pixels: the width on the sides, the height above and below. Default 350. */
974
+ size?: number;
975
+ /** Classes of the body that holds the children. */
976
+ class?: string;
977
+ }
978
+ export interface PopoverProps {
979
+ /**
980
+ * The panel's state, kept in the host as a synced `Checkbox`'s `checked`: the user opening or
981
+ * closing it reports `change` and updates it, and a `setProps` with another `open` wins.
982
+ */
983
+ open?: boolean;
984
+ /** Where the panel goes. Default "top-left" (below the trigger, left-aligned). */
985
+ anchor?: OverlayAnchor;
986
+ /** A triangle pointing at the trigger. */
987
+ arrow?: boolean;
988
+ /** Classes of the trigger's slot (the first child), not of the panel. */
989
+ class?: string;
990
+ }
991
+ export interface HoverCardProps {
992
+ /** Milliseconds before it opens. Default 600. */
993
+ openDelay?: number;
994
+ /** Milliseconds before it closes. Default 300. */
995
+ closeDelay?: number;
996
+ /** Where the card goes. Default "top-center". */
997
+ anchor?: OverlayAnchor;
998
+ /** Classes of the trigger's slot (the first child), not of the card. */
999
+ class?: string;
1000
+ }
1001
+ export interface DatePickerProps {
1002
+ /** The chosen day, `YYYY-MM-DD`; with `range: true`, an ISO interval `YYYY-MM-DD/YYYY-MM-DD`. `null` clears it. */
1003
+ value?: string | null;
1004
+ /** A start-to-end range; the form of `value` is fixed by this (the picker rebuilds when it changes). */
1005
+ range?: boolean;
1006
+ /** Shown while the field is empty. */
1007
+ placeholder?: string;
1008
+ disabled?: boolean;
1009
+ /** The host only reports picks; the client confirms them with `value`. */
1010
+ controlled?: boolean;
1011
+ class?: string;
1012
+ }
1013
+ export interface TimeFieldProps {
1014
+ /** The time shown, `HH:MM`; with `seconds: true`, `HH:MM:SS`. It has no empty state: without `value` the field shows `00:00`. */
1015
+ value?: string;
1016
+ /** Include seconds; the form of `value` is fixed by this (the field rebuilds when it changes). */
1017
+ seconds?: boolean;
1018
+ disabled?: boolean;
1019
+ /** The host only reports edits; the client confirms them with `value`. */
1020
+ controlled?: boolean;
1021
+ class?: string;
1022
+ }
1023
+ export interface ColorPickerProps {
1024
+ /** `#RRGGBB` or `#RRGGBBAA`; the `#` is required. `null` clears it. It has no `disabled`: gpui-component cannot disable its color pickers. */
1025
+ value?: string | null;
1026
+ /** Colors shown first, in the same form. */
1027
+ palette?: string[];
1028
+ /** The host only reports picks; the client confirms them with `value`. */
1029
+ controlled?: boolean;
1030
+ class?: string;
1031
+ }
1032
+ export interface ComboboxProps {
1033
+ /** The choices, as in a `Select`. */
1034
+ options?: Option[];
1035
+ /** The chosen options' values; always a list. */
1036
+ value?: string[];
1037
+ /** Shown while nothing is chosen. */
1038
+ placeholder?: string;
1039
+ /** A search box at the top of the list. */
1040
+ searchable?: boolean;
1041
+ disabled?: boolean;
1042
+ /** The host only reports toggles; the client confirms them with `value`. */
1043
+ controlled?: boolean;
1044
+ class?: string;
1045
+ }
1046
+ export interface BubbleProps {
1047
+ /** The surface; default `filled`. `ghost` has no surface or padding and takes the whole width. */
1048
+ variant?: "filled" | "secondary" | "muted" | "tinted" | "outline" | "ghost" | "destructive";
1049
+ /** Unset, it follows the `Message` that holds it. */
1050
+ alignment?: "start" | "end";
1051
+ class?: string;
1052
+ }
1053
+ export interface MessageProps {
1054
+ /** Default `start`; `end` moves the avatar to that side too. */
1055
+ alignment?: "start" | "end";
1056
+ /** An `Avatar`'s `name` and `src`; without either there is no avatar. */
1057
+ avatarName?: string;
1058
+ avatarSrc?: string;
1059
+ class?: string;
1060
+ }
1061
+ /** A `MessageHeader`/`MessageFooter` lays out its children in a row; outside a `Message` it draws nothing. */
1062
+ export interface MessagePartProps {
1063
+ class?: string;
1064
+ }
1065
+ export interface MarkerProps {
1066
+ content?: string;
1067
+ /** A bundled icon before the text; it replaces the loading spinner. */
1068
+ icon?: string;
1069
+ /** Default `plain`. */
1070
+ variant?: "plain" | "separator" | "border";
1071
+ alignment?: "start" | "center" | "end";
1072
+ loading?: boolean;
1073
+ /** Default `spinner`; `shimmer` moves a highlight over `content`. */
1074
+ loadingStyle?: "spinner" | "shimmer";
1075
+ class?: string;
1076
+ }
1077
+ export interface AttachmentProps {
1078
+ /** Default `complete`. */
1079
+ status?: "pending" | "uploading" | "processing" | "failed" | "complete";
1080
+ /** 0–100, shown only while `uploading`. */
1081
+ progress?: number;
1082
+ title?: string;
1083
+ description?: string;
1084
+ /** Shown while the card is hovered. */
1085
+ tooltip?: string;
1086
+ /** The picture, as in an `Image`; `data` (standard base64) wins over `src`. */
1087
+ src?: string;
1088
+ data?: string;
1089
+ /** Default `horizontal`; `vertical` puts the picture on top. */
1090
+ axis?: "horizontal" | "vertical";
1091
+ class?: string;
1092
+ }
1093
+ export interface MessageScrollerProps {
1094
+ /** Default true. */
1095
+ scrollbar?: boolean;
1096
+ /** The round button that goes back to the end; default true. */
1097
+ jumpButton?: boolean;
1098
+ /** That button's tooltip and name; the crate's default is "Jump to latest". */
1099
+ jumpLabel?: string;
1100
+ class?: string;
1101
+ }
1102
+ export interface QuestionnaireChoice {
1103
+ /** Unique within its question. */
1104
+ value: string;
1105
+ label: string;
1106
+ description?: string;
1107
+ disabled?: boolean;
1108
+ /** An answer from the start; at most one without `multiple`. */
1109
+ selected?: boolean;
1110
+ }
1111
+ export interface QuestionnaireItem {
1112
+ /** Unique; it names the answer. */
1113
+ name: string;
1114
+ label: string;
1115
+ description?: string;
1116
+ /** It cannot be skipped. */
1117
+ required?: boolean;
1118
+ /** Checkboxes instead of radio buttons. */
1119
+ multiple?: boolean;
1120
+ disabled?: boolean;
1121
+ /** A free-text field. */
1122
+ input?: boolean;
1123
+ choices?: QuestionnaireChoice[];
1124
+ }
1125
+ /** One answer, as `change` and `submit` report it. */
1126
+ export interface QuestionnaireAnswer {
1127
+ name: string;
1128
+ /** `unanswered` when it was cleared. */
1129
+ status: "answered" | "skipped" | "unanswered";
1130
+ choices: string[];
1131
+ text: string | null;
1132
+ }
1133
+ export interface QuestionnaireProps {
1134
+ /** Setting different `items` starts over; the same ones again keep the answers. */
1135
+ items?: QuestionnaireItem[];
1136
+ class?: string;
1137
+ }
1138
+ export interface ListProps {
1139
+ /** The selected row's `value`; one that is not among the rows selects nothing. */
1140
+ value?: string;
1141
+ /** The host only reports selections; the client confirms them with `value`. */
1142
+ controlled?: boolean;
1143
+ /** A search field above the rows: each edit sends `query`, and the client sends the matching rows. */
1144
+ searchable?: boolean;
1145
+ placeholder?: string;
1146
+ /** Near the end, the list sends `loadMore` (once per row count). */
1147
+ hasMore?: boolean;
1148
+ /** How many rows before the end `loadMore` is sent; default 20. */
1149
+ loadMoreThreshold?: number;
1150
+ /** Shows a skeleton instead of the rows. */
1151
+ loading?: boolean;
1152
+ class?: string;
1153
+ }
1154
+ /** A screen reader reads a row by its `a11y.label` (PROTOCOL.md section 27). */
1155
+ export interface ListItemProps {
1156
+ /** What the List's events report. Required: the host rejects a `ListItem` without it. */
1157
+ value?: string;
1158
+ /** Neither selected nor confirmed; the arrow keys pass over it. */
1159
+ disabled?: boolean;
1160
+ }
1161
+ export interface DockProps {
1162
+ class?: string;
1163
+ }
1164
+ export interface DockPanelProps {
1165
+ /** The tab's text. */
1166
+ title?: string;
1167
+ /** Where the panel starts; read only when it is added (the layout is the user's after that). */
1168
+ placement?: "center" | "left" | "right" | "bottom";
1169
+ /** The tab offers to close it: `close` is sent, and the app removes the node. */
1170
+ closable?: boolean;
1171
+ }
1172
+ /** A section of an `Accordion`; its children are the content. */
1173
+ export interface AccordionItemProps {
1174
+ /** What the Accordion's `change` reports. Required: the host rejects an `AccordionItem` without it. */
1175
+ id?: string;
1176
+ title?: string;
1177
+ /** The host keeps it in synced mode. */
1178
+ open?: boolean;
1179
+ disabled?: boolean;
1180
+ class?: string;
1181
+ }
1182
+ /** A `Dialog`'s or `AlertDialog`'s footer instead of OK/Cancel; outside one it draws nothing. */
1183
+ export interface SlotProps {
1184
+ class?: string;
1185
+ }
1186
+ export interface NodeProps {
1187
+ div: DivProps & SharedProps;
1188
+ text: TextProps & SharedProps;
1189
+ Button: ButtonProps & SharedProps;
1190
+ Input: InputProps & SharedProps;
1191
+ Checkbox: CheckboxProps & SharedProps;
1192
+ Icon: IconProps & SharedProps;
1193
+ Image: ImageProps & SharedProps;
1194
+ MenuBar: MenuBarProps & SharedProps;
1195
+ Switch: SwitchProps & SharedProps;
1196
+ RadioGroup: RadioGroupProps & SharedProps;
1197
+ Select: SelectProps & SharedProps;
1198
+ Slider: SliderProps & SharedProps;
1199
+ Textarea: TextareaProps & SharedProps;
1200
+ Dialog: DialogProps & SharedProps;
1201
+ VirtualList: VirtualListProps & SharedProps;
1202
+ Table: TableProps & SharedProps;
1203
+ Tabs: TabsProps & SharedProps;
1204
+ Tab: TabProps & SharedProps;
1205
+ Alert: AlertProps & SharedProps;
1206
+ Badge: BadgeProps & SharedProps;
1207
+ Tag: TagProps & SharedProps;
1208
+ Kbd: KbdProps & SharedProps;
1209
+ Progress: ProgressProps & SharedProps;
1210
+ Spinner: SpinnerProps & SharedProps;
1211
+ Skeleton: SkeletonProps & SharedProps;
1212
+ Rating: RatingProps & SharedProps;
1213
+ Pagination: PaginationProps & SharedProps;
1214
+ Collapsible: CollapsibleProps & SharedProps;
1215
+ Accordion: AccordionProps & SharedProps;
1216
+ Avatar: AvatarProps & SharedProps;
1217
+ Stepper: StepperProps & SharedProps;
1218
+ NumberInput: NumberInputProps & SharedProps;
1219
+ OtpInput: OtpInputProps & SharedProps;
1220
+ Form: FormProps & SharedProps;
1221
+ Field: FieldProps & SharedProps;
1222
+ GroupBox: GroupBoxProps & SharedProps;
1223
+ DescriptionList: DescriptionListProps & SharedProps;
1224
+ StatusBar: StatusBarProps & SharedProps;
1225
+ Toolbar: ToolbarProps & SharedProps;
1226
+ Resizable: ResizableProps & SharedProps;
1227
+ Calendar: CalendarProps & SharedProps;
1228
+ Tree: TreeProps & SharedProps;
1229
+ Diff: DiffProps & SharedProps;
1230
+ Carousel: CarouselProps & SharedProps;
1231
+ Sidebar: SidebarProps & SharedProps;
1232
+ Chart: ChartProps & SharedProps;
1233
+ Canvas: CanvasProps & SharedProps;
1234
+ Command: CommandProps & SharedProps;
1235
+ Settings: SettingsProps & SharedProps;
1236
+ Toggle: ToggleProps & SharedProps;
1237
+ DropdownButton: DropdownButtonProps & SharedProps;
1238
+ Label: LabelProps & SharedProps;
1239
+ Empty: EmptyProps & SharedProps;
1240
+ Shimmer: ShimmerProps & SharedProps;
1241
+ InputGroup: InputGroupProps & SharedProps;
1242
+ Clipboard: ClipboardProps & SharedProps;
1243
+ AlertDialog: AlertDialogProps & SharedProps;
1244
+ Sheet: SheetProps & SharedProps;
1245
+ Popover: PopoverProps & SharedProps;
1246
+ HoverCard: HoverCardProps & SharedProps;
1247
+ DatePicker: DatePickerProps & SharedProps;
1248
+ TimeField: TimeFieldProps & SharedProps;
1249
+ ColorPicker: ColorPickerProps & SharedProps;
1250
+ Combobox: ComboboxProps & SharedProps;
1251
+ Bubble: BubbleProps & SharedProps;
1252
+ Message: MessageProps & SharedProps;
1253
+ MessageHeader: MessagePartProps & SharedProps;
1254
+ MessageFooter: MessagePartProps & SharedProps;
1255
+ Marker: MarkerProps & SharedProps;
1256
+ Attachment: AttachmentProps & SharedProps;
1257
+ MessageScroller: MessageScrollerProps & SharedProps;
1258
+ Questionnaire: QuestionnaireProps & SharedProps;
1259
+ List: ListProps & SharedProps;
1260
+ ListItem: ListItemProps & SharedProps;
1261
+ Dock: DockProps & SharedProps;
1262
+ DockPanel: DockPanelProps & SharedProps;
1263
+ AccordionItem: AccordionItemProps & SharedProps;
1264
+ DialogFooter: SlotProps & SharedProps;
1265
+ StatusBarLeft: SlotProps & SharedProps;
1266
+ StatusBarRight: SlotProps & SharedProps;
1267
+ }
1268
+ export interface NodeEvents {
1269
+ div: {
1270
+ click: {};
1271
+ doubleClick: {};
1272
+ menu: {
1273
+ item: string;
1274
+ };
1275
+ keyDown: {
1276
+ key: string;
1277
+ };
1278
+ drop: {
1279
+ paths: string[];
1280
+ };
1281
+ };
1282
+ text: {};
1283
+ Button: {
1284
+ click: {};
1285
+ };
1286
+ Input: {
1287
+ change: {
1288
+ value: string;
1289
+ };
1290
+ submit: {
1291
+ value: string;
1292
+ };
1293
+ keyDown: {
1294
+ key: string;
1295
+ };
1296
+ };
1297
+ Checkbox: {
1298
+ change: {
1299
+ checked: boolean;
1300
+ };
1301
+ };
1302
+ Icon: {};
1303
+ Image: {};
1304
+ MenuBar: {
1305
+ menu: {
1306
+ item: string;
1307
+ };
1308
+ };
1309
+ Switch: {
1310
+ change: {
1311
+ checked: boolean;
1312
+ };
1313
+ };
1314
+ RadioGroup: {
1315
+ change: {
1316
+ value: string;
1317
+ };
1318
+ };
1319
+ Select: {
1320
+ change: {
1321
+ value: string;
1322
+ };
1323
+ };
1324
+ Slider: {
1325
+ change: {
1326
+ value: number;
1327
+ };
1328
+ };
1329
+ Textarea: {
1330
+ change: {
1331
+ value: string;
1332
+ };
1333
+ };
1334
+ Dialog: {
1335
+ ok: {};
1336
+ cancel: {};
1337
+ };
1338
+ VirtualList: {};
1339
+ /** `value` is a row index; `null` when Escape clears the selection. */
1340
+ Table: {
1341
+ change: {
1342
+ value: number | null;
1343
+ };
1344
+ doubleClick: {
1345
+ value: number;
1346
+ };
1347
+ sort: TableSort;
1348
+ };
1349
+ Tabs: {
1350
+ change: {
1351
+ value: string;
1352
+ };
1353
+ };
1354
+ /** A `Tab` reports nothing: its `Tabs` sends the `change`. */
1355
+ Tab: {};
1356
+ Alert: {
1357
+ close: {};
1358
+ };
1359
+ Badge: {};
1360
+ Tag: {};
1361
+ Kbd: {};
1362
+ Progress: {};
1363
+ Spinner: {};
1364
+ Skeleton: {};
1365
+ Rating: {
1366
+ change: {
1367
+ value: number;
1368
+ };
1369
+ };
1370
+ Pagination: {
1371
+ change: {
1372
+ value: number;
1373
+ };
1374
+ };
1375
+ Collapsible: {};
1376
+ /** `value` is the `id` of the section opened or closed. */
1377
+ Accordion: {
1378
+ change: {
1379
+ value: string;
1380
+ };
1381
+ };
1382
+ Avatar: {};
1383
+ /** `value` is the chosen step's `value`. */
1384
+ Stepper: {
1385
+ change: {
1386
+ value: string;
1387
+ };
1388
+ };
1389
+ NumberInput: {
1390
+ change: {
1391
+ value: string;
1392
+ };
1393
+ submit: {
1394
+ value: string;
1395
+ };
1396
+ keyDown: {
1397
+ key: string;
1398
+ };
1399
+ };
1400
+ OtpInput: {
1401
+ change: {
1402
+ value: string;
1403
+ };
1404
+ };
1405
+ Form: {};
1406
+ Field: {};
1407
+ GroupBox: {};
1408
+ DescriptionList: {};
1409
+ StatusBar: {};
1410
+ Toolbar: {};
1411
+ Resizable: {};
1412
+ /** `value` is the chosen day, `YYYY-MM-DD`. */
1413
+ Calendar: {
1414
+ change: {
1415
+ value: string;
1416
+ };
1417
+ };
1418
+ /** `value` is the selected item's `id`; `expand`/`collapse` report a folder's `id`. */
1419
+ Tree: {
1420
+ change: {
1421
+ value: string;
1422
+ };
1423
+ expand: {
1424
+ value: string;
1425
+ };
1426
+ collapse: {
1427
+ value: string;
1428
+ };
1429
+ };
1430
+ /** `value` is the selected range, `null` when the selection is cleared. */
1431
+ Diff: {
1432
+ change: {
1433
+ value: DiffSelection | null;
1434
+ };
1435
+ };
1436
+ /** `value` is the selected slide index. */
1437
+ Carousel: {
1438
+ change: {
1439
+ value: number;
1440
+ };
1441
+ };
1442
+ /** `value` is the `id` of the entry clicked. */
1443
+ Sidebar: {
1444
+ change: {
1445
+ value: string;
1446
+ };
1447
+ };
1448
+ /** A chart has no events: the hover tooltip is the component's own. */
1449
+ Chart: {};
1450
+ /** `value` is the point pressed, local to the canvas. */
1451
+ Canvas: {
1452
+ pointerDown: {
1453
+ value: CanvasPoint;
1454
+ };
1455
+ };
1456
+ /** `value` is the `id` of the entry confirmed (Enter or a click). */
1457
+ Command: {
1458
+ confirm: {
1459
+ value: string;
1460
+ };
1461
+ };
1462
+ /** `value` is the field set by the user and its new value. */
1463
+ Settings: {
1464
+ change: {
1465
+ value: SettingsChange;
1466
+ };
1467
+ };
1468
+ Toggle: {
1469
+ change: {
1470
+ checked: boolean;
1471
+ };
1472
+ };
1473
+ /** `value` is the chosen item's `id`. */
1474
+ DropdownButton: {
1475
+ click: {};
1476
+ menu: {
1477
+ item: string;
1478
+ };
1479
+ };
1480
+ Label: {};
1481
+ Empty: {};
1482
+ Shimmer: {};
1483
+ InputGroup: {
1484
+ change: {
1485
+ value: string;
1486
+ };
1487
+ submit: {
1488
+ value: string;
1489
+ };
1490
+ };
1491
+ /** `value` is the text that was copied. */
1492
+ Clipboard: {
1493
+ copied: {
1494
+ value: string;
1495
+ };
1496
+ };
1497
+ /** OK and Cancel close it, as in a `Dialog`; it shows over an open one. */
1498
+ AlertDialog: {
1499
+ ok: {};
1500
+ cancel: {};
1501
+ };
1502
+ /** The user closed the panel with its X, Escape or a click on the overlay. */
1503
+ Sheet: {
1504
+ close: {};
1505
+ };
1506
+ /** `checked` is true when it opened, false when it closed. */
1507
+ Popover: {
1508
+ change: {
1509
+ checked: boolean;
1510
+ };
1511
+ };
1512
+ /** The mouse is the only way in: no `open` and no `simulate`. */
1513
+ HoverCard: {
1514
+ change: {
1515
+ checked: boolean;
1516
+ };
1517
+ };
1518
+ /** `value` is the chosen day, `null` when cleared. */
1519
+ DatePicker: {
1520
+ change: {
1521
+ value: string | null;
1522
+ };
1523
+ };
1524
+ /** `value` is the time, `HH:MM[:SS]`; it has no empty state. */
1525
+ TimeField: {
1526
+ change: {
1527
+ value: string;
1528
+ };
1529
+ };
1530
+ /** `value` is the color, `null` when cleared. */
1531
+ ColorPicker: {
1532
+ change: {
1533
+ value: string | null;
1534
+ };
1535
+ };
1536
+ /** `value` is the whole selection: toggling one sends the full list. */
1537
+ Combobox: {
1538
+ change: {
1539
+ value: string[];
1540
+ };
1541
+ };
1542
+ Bubble: {};
1543
+ Message: {};
1544
+ MessageHeader: {};
1545
+ MessageFooter: {};
1546
+ Marker: {};
1547
+ /** The card's controls exist only while their event is subscribed; `retry` only while `failed`. */
1548
+ Attachment: {
1549
+ click: {};
1550
+ remove: {};
1551
+ retry: {};
1552
+ };
1553
+ MessageScroller: {};
1554
+ /** `change` sends one answer; `submit` all of them, in question order. */
1555
+ Questionnaire: {
1556
+ change: {
1557
+ value: QuestionnaireAnswer;
1558
+ };
1559
+ submit: {
1560
+ value: QuestionnaireAnswer[];
1561
+ };
1562
+ };
1563
+ /** `change` sends the selected row's `value` (`null`: Escape); `query` the search text; `loadMore` nothing. */
1564
+ List: {
1565
+ change: {
1566
+ value: string | null;
1567
+ };
1568
+ confirm: {
1569
+ value: string;
1570
+ };
1571
+ query: {
1572
+ value: string;
1573
+ };
1574
+ loadMore: {};
1575
+ };
1576
+ ListItem: {};
1577
+ Dock: {};
1578
+ /** `close`: the user closed the panel; it has left the layout. */
1579
+ DockPanel: {
1580
+ close: {};
1581
+ };
1582
+ AccordionItem: {};
1583
+ DialogFooter: {};
1584
+ StatusBarLeft: {};
1585
+ StatusBarRight: {};
1586
+ }