glimpse-sdk 0.2.0 → 0.5.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.
@@ -1,7 +1,11 @@
1
- import { Icon, MenuItem } from "./protocol.js";
1
+ import { Icon } from "./protocol.js";
2
2
  export type Align = "fill" | "start" | "end" | "center" | "baseline";
3
3
  export type Orientation = "horizontal" | "vertical";
4
4
  export type Variant = "normal" | "muted" | "accent" | "success" | "warning" | "danger";
5
+ export type ButtonVariant = "primary" | "secondary" | "compact" | "flat" | "danger";
6
+ export type PagerAppearance = "dots" | "numbers";
7
+ export type ContentFit = "fill" | "contain" | "cover" | "scale_down";
8
+ export type LevelBarMode = "continuous" | "discrete";
5
9
  export interface WidgetNode {
6
10
  toProtocol(): Record<string, unknown>;
7
11
  }
@@ -39,30 +43,80 @@ export declare class Image extends WidgetBase {
39
43
  });
40
44
  toProtocol(): Record<string, unknown>;
41
45
  }
42
- export declare class IconWidget extends WidgetBase {
43
- readonly icon: Icon;
46
+ export declare class Progress extends WidgetBase {
44
47
  private readonly options;
45
- constructor(icon: Icon, options?: CommonProps & {
46
- pixel_size?: number;
48
+ constructor(options: CommonProps & {
49
+ value: number;
50
+ max?: number;
51
+ show_text?: boolean;
52
+ text?: string;
47
53
  });
48
54
  toProtocol(): Record<string, unknown>;
49
55
  }
50
- export declare class Progress extends WidgetBase {
56
+ export declare class LevelBar extends WidgetBase {
51
57
  private readonly options;
52
58
  constructor(options: CommonProps & {
53
59
  value: number;
60
+ min?: number;
54
61
  max?: number;
55
- show_text?: boolean;
56
- text?: string;
62
+ mode?: LevelBarMode;
63
+ });
64
+ toProtocol(): Record<string, unknown>;
65
+ }
66
+ export declare class Picture extends WidgetBase {
67
+ readonly options: CommonProps & {
68
+ path: string;
69
+ content_fit?: ContentFit;
70
+ };
71
+ constructor(options: CommonProps & {
72
+ path: string;
73
+ content_fit?: ContentFit;
57
74
  });
58
75
  toProtocol(): Record<string, unknown>;
59
76
  }
60
77
  export declare class Button extends WidgetBase {
61
78
  private readonly options;
62
- constructor(options?: CommonProps & {
79
+ constructor(options?: Omit<CommonProps, "variant"> & {
63
80
  label?: string;
64
- icon?: Icon;
65
- child?: TreeNode;
81
+ icon?: string;
82
+ enabled?: boolean;
83
+ variant?: ButtonVariant;
84
+ });
85
+ toProtocol(): Record<string, unknown>;
86
+ }
87
+ export declare class LinkButton extends WidgetBase {
88
+ private readonly options;
89
+ constructor(options: CommonProps & {
90
+ uri: string;
91
+ label?: string;
92
+ });
93
+ toProtocol(): Record<string, unknown>;
94
+ }
95
+ export declare class Expander extends WidgetBase {
96
+ private readonly options;
97
+ constructor(options: CommonProps & {
98
+ label: string;
99
+ child: TreeNode;
100
+ expanded?: boolean;
101
+ });
102
+ toProtocol(): Record<string, unknown>;
103
+ }
104
+ export declare class TreeExpander extends WidgetBase {
105
+ private readonly options;
106
+ constructor(options: CommonProps & {
107
+ child: TreeNode;
108
+ hide_expander?: boolean;
109
+ indent_for_depth?: boolean;
110
+ indent_for_icon?: boolean;
111
+ });
112
+ toProtocol(): Record<string, unknown>;
113
+ }
114
+ export declare class MenuButton extends WidgetBase {
115
+ private readonly options;
116
+ constructor(options: CommonProps & {
117
+ label?: string;
118
+ icon?: string;
119
+ popover: TreeNode;
66
120
  });
67
121
  toProtocol(): Record<string, unknown>;
68
122
  }
@@ -74,7 +128,15 @@ export declare class Switch extends WidgetBase {
74
128
  });
75
129
  toProtocol(): Record<string, unknown>;
76
130
  }
77
- export declare class Scale extends WidgetBase {
131
+ export declare class ToggleButton extends WidgetBase {
132
+ private readonly options;
133
+ constructor(options?: CommonProps & {
134
+ label?: string;
135
+ active?: boolean;
136
+ });
137
+ toProtocol(): Record<string, unknown>;
138
+ }
139
+ export declare class Slider extends WidgetBase {
78
140
  private readonly options;
79
141
  constructor(options?: CommonProps & {
80
142
  min?: number;
@@ -94,16 +156,16 @@ export declare class Checkbox extends WidgetBase {
94
156
  });
95
157
  toProtocol(): Record<string, unknown>;
96
158
  }
97
- export declare class DropdownItem {
159
+ export declare class SelectOption {
98
160
  readonly id: string;
99
161
  readonly label: string;
100
162
  constructor(id: string, label: string);
101
163
  toProtocol(): Record<string, unknown>;
102
164
  }
103
- export declare class Dropdown extends WidgetBase {
165
+ export declare class Select extends WidgetBase {
104
166
  private readonly options;
105
167
  constructor(options?: CommonProps & {
106
- items?: DropdownItem[];
168
+ items?: SelectOption[];
107
169
  selected?: number;
108
170
  });
109
171
  toProtocol(): Record<string, unknown>;
@@ -120,6 +182,21 @@ export declare class Scroll extends WidgetBase {
120
182
  constructor(child: TreeNode, options?: CommonProps);
121
183
  toProtocol(): Record<string, unknown>;
122
184
  }
185
+ export declare class Overlay extends WidgetBase {
186
+ private readonly options;
187
+ constructor(options: CommonProps & {
188
+ child: TreeNode;
189
+ overlays?: TreeNode[];
190
+ });
191
+ toProtocol(): Record<string, unknown>;
192
+ }
193
+ export declare class ListBox extends WidgetBase {
194
+ private readonly options;
195
+ constructor(options?: CommonProps & {
196
+ children?: TreeNode[];
197
+ });
198
+ toProtocol(): Record<string, unknown>;
199
+ }
123
200
  export declare class GridChild {
124
201
  readonly row: number;
125
202
  readonly column: number;
@@ -154,54 +231,11 @@ export declare class Card extends WidgetBase {
154
231
  });
155
232
  toProtocol(): Record<string, unknown>;
156
233
  }
157
- export declare class Header {
158
- readonly title: string;
159
- readonly subtitle: string;
160
- constructor(title: string, subtitle?: string);
161
- toProtocol(): Record<string, unknown>;
162
- }
163
234
  export declare class Section extends WidgetBase {
164
235
  private readonly options;
165
236
  constructor(options: CommonProps & {
166
237
  title?: string;
167
238
  subtitle?: string;
168
- header?: Header;
169
- body?: TreeNode[];
170
- children?: TreeNode[];
171
- });
172
- toProtocol(): Record<string, unknown>;
173
- }
174
- export declare class Collapsible extends WidgetBase {
175
- private readonly options;
176
- constructor(options: CommonProps & {
177
- title?: string;
178
- subtitle?: string;
179
- header?: Header;
180
- expanded?: boolean;
181
- body?: TreeNode[];
182
- children?: TreeNode[];
183
- });
184
- toProtocol(): Record<string, unknown>;
185
- }
186
- export declare class Item extends WidgetBase {
187
- private readonly options;
188
- constructor(options?: CommonProps & {
189
- left?: TreeNode;
190
- label?: string;
191
- right?: TreeNode;
192
- clickable?: boolean;
193
- menu?: MenuItem[];
194
- });
195
- toProtocol(): Record<string, unknown>;
196
- }
197
- export declare class CollapsibleItem extends WidgetBase {
198
- private readonly options;
199
- constructor(options?: CommonProps & {
200
- left?: TreeNode;
201
- label?: string;
202
- right?: TreeNode;
203
- expanded?: boolean;
204
- body?: TreeNode[];
205
239
  children?: TreeNode[];
206
240
  });
207
241
  toProtocol(): Record<string, unknown>;
@@ -228,32 +262,6 @@ export declare class Copyable extends WidgetBase {
228
262
  });
229
263
  toProtocol(): Record<string, unknown>;
230
264
  }
231
- export declare class ToastAction {
232
- readonly id: string;
233
- readonly label: string;
234
- constructor(id: string, label: string);
235
- toProtocol(): Record<string, unknown>;
236
- }
237
- export declare class Toast extends WidgetBase {
238
- private readonly options;
239
- constructor(options: CommonProps & {
240
- icon?: Icon;
241
- title: string;
242
- message?: string;
243
- action?: ToastAction;
244
- });
245
- toProtocol(): Record<string, unknown>;
246
- }
247
- export declare class ActionRow extends WidgetBase {
248
- private readonly options;
249
- constructor(options: CommonProps & {
250
- title: string;
251
- subtitle?: string;
252
- meta?: string;
253
- icon?: Icon;
254
- });
255
- toProtocol(): Record<string, unknown>;
256
- }
257
265
  export declare class Row extends WidgetBase {
258
266
  private readonly options;
259
267
  constructor(options?: CommonProps & {
@@ -270,50 +278,40 @@ export declare class Column extends WidgetBase {
270
278
  });
271
279
  toProtocol(): Record<string, unknown>;
272
280
  }
273
- export declare class ActionMenuItem {
274
- readonly options: {
275
- id: string;
276
- label: string;
277
- icon?: Icon;
278
- visible?: boolean;
279
- checked?: boolean;
280
- selectable?: boolean;
281
- };
282
- constructor(options: {
283
- id: string;
284
- label: string;
285
- icon?: Icon;
286
- visible?: boolean;
287
- checked?: boolean;
288
- selectable?: boolean;
289
- });
290
- toProtocol(): Record<string, unknown>;
291
- }
292
- export declare class ActionMenu extends WidgetBase {
281
+ export declare class Spinner extends WidgetBase {
293
282
  private readonly options;
294
283
  constructor(options?: CommonProps & {
295
- header?: string;
296
- items?: ActionMenuItem[];
284
+ spinning?: boolean;
297
285
  });
298
286
  toProtocol(): Record<string, unknown>;
299
287
  }
300
- export declare class Spinner extends WidgetBase {
288
+ export type Properties = Record<string, string>;
289
+ export declare class PropertyList extends WidgetBase {
301
290
  private readonly options;
302
291
  constructor(options?: CommonProps & {
303
- spinning?: boolean;
292
+ title?: string;
293
+ rows?: Properties;
304
294
  });
305
295
  toProtocol(): Record<string, unknown>;
306
296
  }
307
- export declare class DetailGridItem {
308
- readonly key: string;
309
- readonly value: string;
310
- constructor(key: string, value: string);
297
+ export declare class Item extends WidgetBase {
298
+ private readonly options;
299
+ constructor(options: CommonProps & {
300
+ label: string;
301
+ sublabel?: string;
302
+ icon?: string;
303
+ right?: TreeNode;
304
+ });
311
305
  toProtocol(): Record<string, unknown>;
312
306
  }
313
- export declare class DetailGrid extends WidgetBase {
307
+ export declare class ActionItem extends WidgetBase {
314
308
  private readonly options;
315
- constructor(options?: CommonProps & {
316
- rows?: DetailGridItem[];
309
+ constructor(options: CommonProps & {
310
+ label: string;
311
+ sublabel?: string;
312
+ icon?: string;
313
+ right?: TreeNode;
314
+ enabled?: boolean;
317
315
  });
318
316
  toProtocol(): Record<string, unknown>;
319
317
  }
@@ -336,6 +334,26 @@ export declare class StatusDot extends WidgetBase {
336
334
  constructor(options?: CommonProps);
337
335
  toProtocol(): Record<string, unknown>;
338
336
  }
337
+ export declare class PagerItem extends WidgetBase {
338
+ private readonly options;
339
+ constructor(options?: CommonProps & {
340
+ appearance?: PagerAppearance;
341
+ label?: string;
342
+ active?: boolean;
343
+ inactive?: boolean;
344
+ occupied?: boolean;
345
+ urgent?: boolean;
346
+ });
347
+ toData(): Record<string, unknown>;
348
+ toProtocol(): Record<string, unknown>;
349
+ }
350
+ export declare class PagerStrip extends WidgetBase {
351
+ private readonly options;
352
+ constructor(options?: CommonProps & {
353
+ items?: PagerItem[];
354
+ });
355
+ toProtocol(): Record<string, unknown>;
356
+ }
339
357
  export declare class Box extends WidgetBase {
340
358
  private readonly options;
341
359
  constructor(options?: CommonProps & {
@@ -347,5 +365,5 @@ export declare class Box extends WidgetBase {
347
365
  static horizontal(children: TreeNode[], spacing?: number, options?: CommonProps): Box;
348
366
  toProtocol(): Record<string, unknown>;
349
367
  }
350
- export type TreeNode = Hero | Card | Section | Collapsible | Item | CollapsibleItem | Meter | Copyable | Toast | ActionRow | ActionMenu | DetailGrid | EmptyState | Badge | StatusDot | Box | Row | Column | Grid | Scroll | Progress | Separator | Spinner | Label | IconWidget | Image | Button | Switch | Scale | Dropdown | Checkbox;
368
+ export type TreeNode = Hero | Card | Section | Meter | Copyable | PropertyList | Item | ActionItem | EmptyState | Badge | StatusDot | PagerItem | PagerStrip | Box | Row | Column | Grid | Scroll | Overlay | ListBox | LevelBar | TreeExpander | MenuButton | Progress | Separator | Spinner | Label | Image | Picture | Button | LinkButton | Expander | Switch | ToggleButton | Slider | Select | Checkbox;
351
369
  export {};