glimpse-sdk 0.2.0 → 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.
- package/README.md +27 -21
- package/dist/src/app.d.ts +2 -13
- package/dist/src/app.js +12 -19
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +3 -3
- package/dist/src/protocol.d.ts +0 -15
- package/dist/src/protocol.js +0 -19
- package/dist/src/widgets.d.ts +134 -116
- package/dist/src/widgets.js +250 -196
- package/package.json +1 -1
- package/src/app.ts +14 -25
- package/src/index.ts +23 -16
- package/src/protocol.ts +0 -25
- package/src/widgets.ts +353 -253
package/README.md
CHANGED
|
@@ -16,8 +16,7 @@ npm install glimpse-sdk
|
|
|
16
16
|
- typed widget builders
|
|
17
17
|
- async runtime
|
|
18
18
|
- explicit typed handler registration
|
|
19
|
-
- state
|
|
20
|
-
- single `render()` method that returns all panel state
|
|
19
|
+
- separate `status(state)` and `popover(state)` methods; state mutation via `await this.setState(...)`
|
|
21
20
|
|
|
22
21
|
## Example
|
|
23
22
|
|
|
@@ -29,9 +28,9 @@ import {
|
|
|
29
28
|
Hero,
|
|
30
29
|
Icon,
|
|
31
30
|
Label,
|
|
32
|
-
RenderResult,
|
|
33
31
|
StatusItem,
|
|
34
|
-
|
|
32
|
+
type TreeNode,
|
|
33
|
+
} from "glimpse-sdk";
|
|
35
34
|
|
|
36
35
|
interface DeployState {
|
|
37
36
|
version: string;
|
|
@@ -50,25 +49,31 @@ class DeployApplet extends Applet<DeployState> {
|
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
protected async
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
protected async status(state: DeployState): Promise<StatusItem[]> {
|
|
53
|
+
return [
|
|
54
|
+
new StatusItem({
|
|
55
|
+
id: "deploy",
|
|
56
|
+
icon: Icon.name("software-update-available-symbolic"),
|
|
57
|
+
label: state.status,
|
|
58
|
+
}),
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
protected async popover(state: DeployState): Promise<TreeNode | null> {
|
|
63
|
+
return Box.vertical([
|
|
64
|
+
new Hero({
|
|
63
65
|
icon: Icon.name("software-update-available-symbolic"),
|
|
64
66
|
title: "Deploy",
|
|
65
|
-
subtitle:
|
|
67
|
+
subtitle: state.version,
|
|
66
68
|
}),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
new Label("Version"),
|
|
70
|
+
new Button({
|
|
71
|
+
id: "deploy_now",
|
|
72
|
+
label: "Deploy now",
|
|
73
|
+
icon: "media-playback-start-symbolic",
|
|
74
|
+
variant: "primary",
|
|
75
|
+
}),
|
|
76
|
+
]);
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
79
|
|
|
@@ -85,4 +90,5 @@ Use explicit registration helpers instead of decorators:
|
|
|
85
90
|
- `this.onChange(id, handler)`
|
|
86
91
|
- `this.onToggle(id, handler)`
|
|
87
92
|
|
|
88
|
-
The SDK owns the line transport
|
|
93
|
+
The SDK owns the line transport. `status(state)` produces the panel items;
|
|
94
|
+
`popover(state)` produces the popover tree; both are pure functions of state.
|
package/dist/src/app.d.ts
CHANGED
|
@@ -7,18 +7,6 @@ interface OutgoingMessage {
|
|
|
7
7
|
data: unknown;
|
|
8
8
|
line: string;
|
|
9
9
|
}
|
|
10
|
-
export declare class RenderResult {
|
|
11
|
-
readonly options: {
|
|
12
|
-
status?: StatusItem[];
|
|
13
|
-
tree?: TreeNode | null;
|
|
14
|
-
};
|
|
15
|
-
constructor(options?: {
|
|
16
|
-
status?: StatusItem[];
|
|
17
|
-
tree?: TreeNode | null;
|
|
18
|
-
});
|
|
19
|
-
get status(): StatusItem[];
|
|
20
|
-
get tree(): TreeNode | null;
|
|
21
|
-
}
|
|
22
10
|
export declare abstract class Applet<State extends object> {
|
|
23
11
|
state: State;
|
|
24
12
|
private readonly handlerMap;
|
|
@@ -33,7 +21,8 @@ export declare abstract class Applet<State extends object> {
|
|
|
33
21
|
protected onStart(): Promise<void>;
|
|
34
22
|
protected onInit(_event: InitEvent): Promise<void>;
|
|
35
23
|
protected onCallback(_event: CallbackEvent): Promise<void>;
|
|
36
|
-
protected
|
|
24
|
+
protected status(_state: State): Promise<StatusItem[]>;
|
|
25
|
+
protected popover(_state: State): Promise<TreeNode | null>;
|
|
37
26
|
setState(patch: Partial<State>): Promise<void>;
|
|
38
27
|
onClick(id: string, handler: Handler<ClickEvent>): void;
|
|
39
28
|
onScroll(id: string, handler: Handler<ScrollEvent>): void;
|
package/dist/src/app.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import { createInterface } from "node:readline";
|
|
2
2
|
import { parseCallbackEvent, parseInitEvent, } from "./events.js";
|
|
3
|
-
export class RenderResult {
|
|
4
|
-
options;
|
|
5
|
-
constructor(options = {}) {
|
|
6
|
-
this.options = options;
|
|
7
|
-
}
|
|
8
|
-
get status() {
|
|
9
|
-
return this.options.status ?? [];
|
|
10
|
-
}
|
|
11
|
-
get tree() {
|
|
12
|
-
return this.options.tree ?? null;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
3
|
export class Applet {
|
|
16
4
|
state;
|
|
17
5
|
handlerMap = new Map();
|
|
@@ -27,8 +15,11 @@ export class Applet {
|
|
|
27
15
|
async onStart() { }
|
|
28
16
|
async onInit(_event) { }
|
|
29
17
|
async onCallback(_event) { }
|
|
30
|
-
async
|
|
31
|
-
return
|
|
18
|
+
async status(_state) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
async popover(_state) {
|
|
22
|
+
return null;
|
|
32
23
|
}
|
|
33
24
|
async setState(patch) {
|
|
34
25
|
this.state = { ...this.state, ...patch };
|
|
@@ -138,15 +129,17 @@ export class Applet {
|
|
|
138
129
|
await this.flushPromise;
|
|
139
130
|
}
|
|
140
131
|
async flushRender() {
|
|
141
|
-
const
|
|
142
|
-
const status =
|
|
143
|
-
const tree = { root: rendered.tree?.toProtocol() ?? null };
|
|
132
|
+
const statusItems = await this.status(this.state);
|
|
133
|
+
const status = statusItems.map((item) => item.toProtocol());
|
|
144
134
|
if (!deepEqual(status, this.lastStatus)) {
|
|
145
135
|
this.lastStatus = status;
|
|
146
136
|
this.emit("status", { items: status });
|
|
147
137
|
}
|
|
148
|
-
const
|
|
149
|
-
|
|
138
|
+
const widget = await this.popover(this.state);
|
|
139
|
+
const tree = { root: widget?.toProtocol() ?? null };
|
|
140
|
+
// Emit only when popover open, or first render, or clearing.
|
|
141
|
+
const shouldEmit = this.popoverOpen || this.lastTree === null || tree.root === null;
|
|
142
|
+
if (shouldEmit && !deepEqual(tree, this.lastTree)) {
|
|
150
143
|
this.lastTree = tree;
|
|
151
144
|
this.emit("popover", tree);
|
|
152
145
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Applet
|
|
1
|
+
export { Applet } from "./app.js";
|
|
2
2
|
export { type CallbackEvent, type ChangeEvent, type ClickEvent, type InitEvent, type InputEvent, type PopoverEvent, type ScrollEvent, type ToggleEvent, parseCallbackEvent, parseInitEvent, } from "./events.js";
|
|
3
|
-
export { Icon,
|
|
4
|
-
export {
|
|
3
|
+
export { Icon, StatusItem } from "./protocol.js";
|
|
4
|
+
export { ActionItem, type Align, Badge, Box, Button, type ButtonVariant, Card, Checkbox, Column, type ContentFit, Copyable, EmptyState, Expander, Grid, GridChild, Hero, Image, Item, Label, LevelBar, type LevelBarMode, LinkButton, ListBox, MenuButton, Meter, Overlay, type Orientation, type PagerAppearance, PagerItem, PagerStrip, Picture, Progress, type Properties, PropertyList, Row, Scroll, Section, Select, SelectOption, Separator, Slider, Spinner, StatusDot, Switch, ToggleButton, TreeExpander, type TreeNode, type Variant, } from "./widgets.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Applet
|
|
1
|
+
export { Applet } from "./app.js";
|
|
2
2
|
export { parseCallbackEvent, parseInitEvent, } from "./events.js";
|
|
3
|
-
export { Icon,
|
|
4
|
-
export {
|
|
3
|
+
export { Icon, StatusItem } from "./protocol.js";
|
|
4
|
+
export { ActionItem, Badge, Box, Button, Card, Checkbox, Column, Copyable, EmptyState, Expander, Grid, GridChild, Hero, Image, Item, Label, LevelBar, LinkButton, ListBox, MenuButton, Meter, Overlay, PagerItem, PagerStrip, Picture, Progress, PropertyList, Row, Scroll, Section, Select, SelectOption, Separator, Slider, Spinner, StatusDot, Switch, ToggleButton, TreeExpander, } from "./widgets.js";
|
package/dist/src/protocol.d.ts
CHANGED
|
@@ -26,18 +26,3 @@ export declare class StatusItem {
|
|
|
26
26
|
});
|
|
27
27
|
toProtocol(): Record<string, unknown>;
|
|
28
28
|
}
|
|
29
|
-
export declare class MenuItem {
|
|
30
|
-
readonly options: {
|
|
31
|
-
id: string;
|
|
32
|
-
label: string;
|
|
33
|
-
visible?: boolean;
|
|
34
|
-
enabled?: boolean;
|
|
35
|
-
};
|
|
36
|
-
constructor(options: {
|
|
37
|
-
id: string;
|
|
38
|
-
label: string;
|
|
39
|
-
visible?: boolean;
|
|
40
|
-
enabled?: boolean;
|
|
41
|
-
});
|
|
42
|
-
toProtocol(): Record<string, unknown>;
|
|
43
|
-
}
|
package/dist/src/protocol.js
CHANGED
|
@@ -37,22 +37,3 @@ export class StatusItem {
|
|
|
37
37
|
return payload;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
export class MenuItem {
|
|
41
|
-
options;
|
|
42
|
-
constructor(options) {
|
|
43
|
-
this.options = options;
|
|
44
|
-
}
|
|
45
|
-
toProtocol() {
|
|
46
|
-
const payload = {
|
|
47
|
-
id: this.options.id,
|
|
48
|
-
label: this.options.label,
|
|
49
|
-
};
|
|
50
|
-
if (this.options.visible !== undefined) {
|
|
51
|
-
payload.visible = this.options.visible;
|
|
52
|
-
}
|
|
53
|
-
if (this.options.enabled !== undefined) {
|
|
54
|
-
payload.enabled = this.options.enabled;
|
|
55
|
-
}
|
|
56
|
-
return payload;
|
|
57
|
-
}
|
|
58
|
-
}
|
package/dist/src/widgets.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { Icon
|
|
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
|
|
43
|
-
readonly icon: Icon;
|
|
46
|
+
export declare class Progress extends WidgetBase {
|
|
44
47
|
private readonly options;
|
|
45
|
-
constructor(
|
|
46
|
-
|
|
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
|
|
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
|
-
|
|
56
|
-
|
|
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?:
|
|
65
|
-
|
|
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
|
|
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
|
|
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
|
|
165
|
+
export declare class Select extends WidgetBase {
|
|
104
166
|
private readonly options;
|
|
105
167
|
constructor(options?: CommonProps & {
|
|
106
|
-
items?:
|
|
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
|
|
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
|
-
|
|
296
|
-
items?: ActionMenuItem[];
|
|
284
|
+
spinning?: boolean;
|
|
297
285
|
});
|
|
298
286
|
toProtocol(): Record<string, unknown>;
|
|
299
287
|
}
|
|
300
|
-
export
|
|
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
|
-
|
|
292
|
+
title?: string;
|
|
293
|
+
rows?: Properties;
|
|
304
294
|
});
|
|
305
295
|
toProtocol(): Record<string, unknown>;
|
|
306
296
|
}
|
|
307
|
-
export declare class
|
|
308
|
-
readonly
|
|
309
|
-
|
|
310
|
-
|
|
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
|
|
307
|
+
export declare class ActionItem extends WidgetBase {
|
|
314
308
|
private readonly options;
|
|
315
|
-
constructor(options
|
|
316
|
-
|
|
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 |
|
|
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 {};
|