@theaiplatform/miniapp-sdk 0.0.1 → 0.0.2

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,660 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Mounts a serializable UI model into a DOM element and returns its complete
5
+ * imperative lifecycle. This API is safe to bind with wasm-bindgen.
6
+ */
7
+ export declare function createMiniAppUiRoot(container: Element, initialModel: unknown, dispatch: MiniAppUiDispatch, options?: MiniAppUiRootOptions): MiniAppUiRoot;
8
+
9
+ /** Serializable action delivered to Rust/WASM. */
10
+ export declare type MiniAppUiAction = z.output<typeof miniAppUiActionSchema>;
11
+
12
+ /** A serializable UI action with replay and stale-model metadata. */
13
+ export declare const miniAppUiActionSchema: z.ZodObject<{
14
+ eventId: z.ZodString;
15
+ revision: z.ZodNumber;
16
+ controlId: z.ZodString;
17
+ entityId: z.ZodOptional<z.ZodString>;
18
+ action: z.ZodString;
19
+ event: z.ZodEnum<{
20
+ activate: "activate";
21
+ "value-change": "value-change";
22
+ "selection-change": "selection-change";
23
+ "open-change": "open-change";
24
+ }>;
25
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
26
+ }, z.core.$strict>;
27
+
28
+ /** Synchronous or asynchronous action handler implemented by the mini-app. */
29
+ export declare type MiniAppUiDispatch = (action: MiniAppUiAction) => void | Promise<void>;
30
+
31
+ /** Explicit error surfaced by the imperative UI lifecycle. */
32
+ export declare class MiniAppUiError extends Error {
33
+ readonly code: MiniAppUiErrorCode;
34
+ readonly cause?: unknown;
35
+ constructor(code: MiniAppUiErrorCode, message: string, cause?: unknown);
36
+ }
37
+
38
+ /** Stable error codes exposed to JavaScript and wasm-bindgen consumers. */
39
+ export declare type MiniAppUiErrorCode = 'cleanup-failed' | 'dispatch-failed' | 'focus-target-missing' | 'invalid-model' | 'render-failed' | 'root-unmounted' | 'stale-action' | 'stale-model';
40
+
41
+ /** Supported action event names. */
42
+ export declare type MiniAppUiEventKind = z.output<typeof miniAppUiEventKindSchema>;
43
+
44
+ /** Event kinds emitted over the serializable ABI. */
45
+ export declare const miniAppUiEventKindSchema: z.ZodEnum<{
46
+ activate: "activate";
47
+ "value-change": "value-change";
48
+ "selection-change": "selection-change";
49
+ "open-change": "open-change";
50
+ }>;
51
+
52
+ /** Complete, validated UI state supplied by a WASM mini-app. */
53
+ export declare type MiniAppUiModel = z.output<typeof miniAppUiModelSchema>;
54
+
55
+ /**
56
+ * Runtime validator for the complete model. It enforces a bounded, acyclic
57
+ * tree with unique stable identifiers and no unreachable nodes.
58
+ */
59
+ export declare const miniAppUiModelSchema: z.ZodObject<{
60
+ revision: z.ZodNumber;
61
+ state: z.ZodDefault<z.ZodEnum<{
62
+ success: "success";
63
+ loading: "loading";
64
+ empty: "empty";
65
+ idle: "idle";
66
+ conflict: "conflict";
67
+ failure: "failure";
68
+ }>>;
69
+ rootIds: z.ZodArray<z.ZodString>;
70
+ nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
71
+ type: z.ZodLiteral<"stack">;
72
+ id: z.ZodString;
73
+ children: z.ZodArray<z.ZodString>;
74
+ gap: z.ZodDefault<z.ZodEnum<{
75
+ sm: "sm";
76
+ none: "none";
77
+ lg: "lg";
78
+ md: "md";
79
+ }>>;
80
+ }, z.core.$strict>, z.ZodObject<{
81
+ type: z.ZodLiteral<"row">;
82
+ id: z.ZodString;
83
+ children: z.ZodArray<z.ZodString>;
84
+ gap: z.ZodDefault<z.ZodEnum<{
85
+ sm: "sm";
86
+ none: "none";
87
+ lg: "lg";
88
+ md: "md";
89
+ }>>;
90
+ wrap: z.ZodDefault<z.ZodBoolean>;
91
+ }, z.core.$strict>, z.ZodObject<{
92
+ type: z.ZodLiteral<"toolbar">;
93
+ id: z.ZodString;
94
+ label: z.ZodString;
95
+ children: z.ZodArray<z.ZodString>;
96
+ }, z.core.$strict>, z.ZodObject<{
97
+ type: z.ZodLiteral<"status-bar">;
98
+ id: z.ZodString;
99
+ text: z.ZodString;
100
+ tone: z.ZodDefault<z.ZodEnum<{
101
+ success: "success";
102
+ error: "error";
103
+ neutral: "neutral";
104
+ }>>;
105
+ }, z.core.$strict>, z.ZodObject<{
106
+ type: z.ZodLiteral<"heading">;
107
+ id: z.ZodString;
108
+ level: z.ZodNumber;
109
+ text: z.ZodString;
110
+ }, z.core.$strict>, z.ZodObject<{
111
+ type: z.ZodLiteral<"text">;
112
+ id: z.ZodString;
113
+ text: z.ZodString;
114
+ tone: z.ZodDefault<z.ZodEnum<{
115
+ default: "default";
116
+ muted: "muted";
117
+ }>>;
118
+ }, z.core.$strict>, z.ZodObject<{
119
+ variant: z.ZodDefault<z.ZodEnum<{
120
+ link: "link";
121
+ default: "default";
122
+ destructive: "destructive";
123
+ outline: "outline";
124
+ secondary: "secondary";
125
+ tertiary: "tertiary";
126
+ ghost: "ghost";
127
+ }>>;
128
+ disabled: z.ZodDefault<z.ZodBoolean>;
129
+ busy: z.ZodDefault<z.ZodBoolean>;
130
+ action: z.ZodString;
131
+ entityId: z.ZodOptional<z.ZodString>;
132
+ type: z.ZodLiteral<"button">;
133
+ id: z.ZodString;
134
+ label: z.ZodString;
135
+ }, z.core.$strict>, z.ZodObject<{
136
+ variant: z.ZodDefault<z.ZodEnum<{
137
+ default: "default";
138
+ destructive: "destructive";
139
+ outline: "outline";
140
+ secondary: "secondary";
141
+ ghost: "ghost";
142
+ }>>;
143
+ disabled: z.ZodDefault<z.ZodBoolean>;
144
+ busy: z.ZodDefault<z.ZodBoolean>;
145
+ action: z.ZodString;
146
+ entityId: z.ZodOptional<z.ZodString>;
147
+ type: z.ZodLiteral<"icon-button">;
148
+ id: z.ZodString;
149
+ label: z.ZodString;
150
+ icon: z.ZodEnum<{
151
+ search: "search";
152
+ info: "info";
153
+ add: "add";
154
+ help: "help";
155
+ close: "close";
156
+ check: "check";
157
+ delete: "delete";
158
+ refresh: "refresh";
159
+ settings: "settings";
160
+ }>;
161
+ }, z.core.$strict>, z.ZodObject<{
162
+ type: z.ZodLiteral<"button-group">;
163
+ id: z.ZodString;
164
+ label: z.ZodString;
165
+ children: z.ZodArray<z.ZodString>;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ type: z.ZodLiteral<"badge">;
168
+ id: z.ZodString;
169
+ text: z.ZodString;
170
+ variant: z.ZodDefault<z.ZodEnum<{
171
+ default: "default";
172
+ destructive: "destructive";
173
+ outline: "outline";
174
+ secondary: "secondary";
175
+ }>>;
176
+ }, z.core.$strict>, z.ZodObject<{
177
+ type: z.ZodLiteral<"card">;
178
+ id: z.ZodString;
179
+ title: z.ZodOptional<z.ZodString>;
180
+ description: z.ZodOptional<z.ZodString>;
181
+ children: z.ZodArray<z.ZodString>;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ type: z.ZodLiteral<"item">;
184
+ id: z.ZodString;
185
+ title: z.ZodString;
186
+ description: z.ZodOptional<z.ZodString>;
187
+ children: z.ZodArray<z.ZodString>;
188
+ }, z.core.$strict>, z.ZodObject<{
189
+ type: z.ZodLiteral<"tabs">;
190
+ id: z.ZodString;
191
+ value: z.ZodString;
192
+ action: z.ZodString;
193
+ entityId: z.ZodOptional<z.ZodString>;
194
+ disabled: z.ZodDefault<z.ZodBoolean>;
195
+ tabs: z.ZodArray<z.ZodObject<{
196
+ id: z.ZodString;
197
+ label: z.ZodString;
198
+ children: z.ZodArray<z.ZodString>;
199
+ disabled: z.ZodDefault<z.ZodBoolean>;
200
+ }, z.core.$strict>>;
201
+ }, z.core.$strict>, z.ZodObject<{
202
+ type: z.ZodLiteral<"alert">;
203
+ id: z.ZodString;
204
+ title: z.ZodString;
205
+ description: z.ZodOptional<z.ZodString>;
206
+ tone: z.ZodDefault<z.ZodEnum<{
207
+ default: "default";
208
+ info: "info";
209
+ destructive: "destructive";
210
+ warning: "warning";
211
+ success: "success";
212
+ }>>;
213
+ }, z.core.$strict>, z.ZodObject<{
214
+ type: z.ZodLiteral<"empty">;
215
+ id: z.ZodString;
216
+ title: z.ZodString;
217
+ description: z.ZodOptional<z.ZodString>;
218
+ children: z.ZodArray<z.ZodString>;
219
+ }, z.core.$strict>, z.ZodObject<{
220
+ type: z.ZodLiteral<"loading">;
221
+ id: z.ZodString;
222
+ label: z.ZodString;
223
+ rows: z.ZodDefault<z.ZodNumber>;
224
+ }, z.core.$strict>, z.ZodObject<{
225
+ value: z.ZodString;
226
+ inputType: z.ZodDefault<z.ZodEnum<{
227
+ search: "search";
228
+ text: "text";
229
+ email: "email";
230
+ password: "password";
231
+ }>>;
232
+ placeholder: z.ZodOptional<z.ZodString>;
233
+ disabled: z.ZodDefault<z.ZodBoolean>;
234
+ busy: z.ZodDefault<z.ZodBoolean>;
235
+ action: z.ZodString;
236
+ entityId: z.ZodOptional<z.ZodString>;
237
+ description: z.ZodOptional<z.ZodString>;
238
+ error: z.ZodOptional<z.ZodString>;
239
+ label: z.ZodString;
240
+ required: z.ZodDefault<z.ZodBoolean>;
241
+ type: z.ZodLiteral<"input">;
242
+ id: z.ZodString;
243
+ }, z.core.$strict>, z.ZodObject<{
244
+ value: z.ZodString;
245
+ placeholder: z.ZodOptional<z.ZodString>;
246
+ rows: z.ZodDefault<z.ZodNumber>;
247
+ disabled: z.ZodDefault<z.ZodBoolean>;
248
+ busy: z.ZodDefault<z.ZodBoolean>;
249
+ action: z.ZodString;
250
+ entityId: z.ZodOptional<z.ZodString>;
251
+ description: z.ZodOptional<z.ZodString>;
252
+ error: z.ZodOptional<z.ZodString>;
253
+ label: z.ZodString;
254
+ required: z.ZodDefault<z.ZodBoolean>;
255
+ type: z.ZodLiteral<"textarea">;
256
+ id: z.ZodString;
257
+ }, z.core.$strict>, z.ZodObject<{
258
+ value: z.ZodString;
259
+ options: z.ZodArray<z.ZodObject<{
260
+ value: z.ZodString;
261
+ label: z.ZodString;
262
+ disabled: z.ZodDefault<z.ZodBoolean>;
263
+ }, z.core.$strict>>;
264
+ disabled: z.ZodDefault<z.ZodBoolean>;
265
+ busy: z.ZodDefault<z.ZodBoolean>;
266
+ action: z.ZodString;
267
+ entityId: z.ZodOptional<z.ZodString>;
268
+ description: z.ZodOptional<z.ZodString>;
269
+ error: z.ZodOptional<z.ZodString>;
270
+ label: z.ZodString;
271
+ required: z.ZodDefault<z.ZodBoolean>;
272
+ type: z.ZodLiteral<"select">;
273
+ id: z.ZodString;
274
+ }, z.core.$strict>, z.ZodObject<{
275
+ checked: z.ZodBoolean;
276
+ disabled: z.ZodDefault<z.ZodBoolean>;
277
+ busy: z.ZodDefault<z.ZodBoolean>;
278
+ action: z.ZodString;
279
+ entityId: z.ZodOptional<z.ZodString>;
280
+ description: z.ZodOptional<z.ZodString>;
281
+ error: z.ZodOptional<z.ZodString>;
282
+ label: z.ZodString;
283
+ required: z.ZodDefault<z.ZodBoolean>;
284
+ type: z.ZodLiteral<"checkbox">;
285
+ id: z.ZodString;
286
+ }, z.core.$strict>, z.ZodObject<{
287
+ type: z.ZodLiteral<"progress">;
288
+ id: z.ZodString;
289
+ label: z.ZodString;
290
+ value: z.ZodNumber;
291
+ }, z.core.$strict>, z.ZodObject<{
292
+ type: z.ZodLiteral<"tooltip">;
293
+ id: z.ZodString;
294
+ label: z.ZodString;
295
+ child: z.ZodString;
296
+ }, z.core.$strict>, z.ZodObject<{
297
+ type: z.ZodLiteral<"dialog">;
298
+ id: z.ZodString;
299
+ entityId: z.ZodOptional<z.ZodString>;
300
+ open: z.ZodBoolean;
301
+ openChangeAction: z.ZodString;
302
+ title: z.ZodString;
303
+ description: z.ZodOptional<z.ZodString>;
304
+ children: z.ZodArray<z.ZodString>;
305
+ actions: z.ZodArray<z.ZodObject<{
306
+ id: z.ZodString;
307
+ label: z.ZodString;
308
+ action: z.ZodString;
309
+ variant: z.ZodDefault<z.ZodEnum<{
310
+ default: "default";
311
+ destructive: "destructive";
312
+ outline: "outline";
313
+ secondary: "secondary";
314
+ ghost: "ghost";
315
+ }>>;
316
+ disabled: z.ZodDefault<z.ZodBoolean>;
317
+ }, z.core.$strict>>;
318
+ }, z.core.$strict>, z.ZodObject<{
319
+ type: z.ZodLiteral<"confirmation">;
320
+ id: z.ZodString;
321
+ entityId: z.ZodOptional<z.ZodString>;
322
+ open: z.ZodBoolean;
323
+ openChangeAction: z.ZodString;
324
+ title: z.ZodString;
325
+ description: z.ZodString;
326
+ confirm: z.ZodObject<{
327
+ id: z.ZodString;
328
+ label: z.ZodString;
329
+ action: z.ZodString;
330
+ variant: z.ZodDefault<z.ZodEnum<{
331
+ default: "default";
332
+ destructive: "destructive";
333
+ outline: "outline";
334
+ secondary: "secondary";
335
+ ghost: "ghost";
336
+ }>>;
337
+ disabled: z.ZodDefault<z.ZodBoolean>;
338
+ }, z.core.$strict>;
339
+ cancelLabel: z.ZodDefault<z.ZodString>;
340
+ }, z.core.$strict>, z.ZodObject<{
341
+ type: z.ZodLiteral<"separator">;
342
+ id: z.ZodString;
343
+ }, z.core.$strict>, z.ZodObject<{
344
+ type: z.ZodLiteral<"metric">;
345
+ id: z.ZodString;
346
+ label: z.ZodString;
347
+ value: z.ZodString;
348
+ detail: z.ZodOptional<z.ZodString>;
349
+ badge: z.ZodOptional<z.ZodString>;
350
+ }, z.core.$strict>], "type">>;
351
+ }, z.core.$strict>;
352
+
353
+ /** A single validated node in a mini-app UI model. */
354
+ export declare type MiniAppUiNode = z.output<typeof miniAppUiNodeSchema>;
355
+
356
+ /** Runtime validator for every node accepted by the WASM UI bridge. */
357
+ export declare const miniAppUiNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
358
+ type: z.ZodLiteral<"stack">;
359
+ id: z.ZodString;
360
+ children: z.ZodArray<z.ZodString>;
361
+ gap: z.ZodDefault<z.ZodEnum<{
362
+ sm: "sm";
363
+ none: "none";
364
+ lg: "lg";
365
+ md: "md";
366
+ }>>;
367
+ }, z.core.$strict>, z.ZodObject<{
368
+ type: z.ZodLiteral<"row">;
369
+ id: z.ZodString;
370
+ children: z.ZodArray<z.ZodString>;
371
+ gap: z.ZodDefault<z.ZodEnum<{
372
+ sm: "sm";
373
+ none: "none";
374
+ lg: "lg";
375
+ md: "md";
376
+ }>>;
377
+ wrap: z.ZodDefault<z.ZodBoolean>;
378
+ }, z.core.$strict>, z.ZodObject<{
379
+ type: z.ZodLiteral<"toolbar">;
380
+ id: z.ZodString;
381
+ label: z.ZodString;
382
+ children: z.ZodArray<z.ZodString>;
383
+ }, z.core.$strict>, z.ZodObject<{
384
+ type: z.ZodLiteral<"status-bar">;
385
+ id: z.ZodString;
386
+ text: z.ZodString;
387
+ tone: z.ZodDefault<z.ZodEnum<{
388
+ success: "success";
389
+ error: "error";
390
+ neutral: "neutral";
391
+ }>>;
392
+ }, z.core.$strict>, z.ZodObject<{
393
+ type: z.ZodLiteral<"heading">;
394
+ id: z.ZodString;
395
+ level: z.ZodNumber;
396
+ text: z.ZodString;
397
+ }, z.core.$strict>, z.ZodObject<{
398
+ type: z.ZodLiteral<"text">;
399
+ id: z.ZodString;
400
+ text: z.ZodString;
401
+ tone: z.ZodDefault<z.ZodEnum<{
402
+ default: "default";
403
+ muted: "muted";
404
+ }>>;
405
+ }, z.core.$strict>, z.ZodObject<{
406
+ variant: z.ZodDefault<z.ZodEnum<{
407
+ link: "link";
408
+ default: "default";
409
+ destructive: "destructive";
410
+ outline: "outline";
411
+ secondary: "secondary";
412
+ tertiary: "tertiary";
413
+ ghost: "ghost";
414
+ }>>;
415
+ disabled: z.ZodDefault<z.ZodBoolean>;
416
+ busy: z.ZodDefault<z.ZodBoolean>;
417
+ action: z.ZodString;
418
+ entityId: z.ZodOptional<z.ZodString>;
419
+ type: z.ZodLiteral<"button">;
420
+ id: z.ZodString;
421
+ label: z.ZodString;
422
+ }, z.core.$strict>, z.ZodObject<{
423
+ variant: z.ZodDefault<z.ZodEnum<{
424
+ default: "default";
425
+ destructive: "destructive";
426
+ outline: "outline";
427
+ secondary: "secondary";
428
+ ghost: "ghost";
429
+ }>>;
430
+ disabled: z.ZodDefault<z.ZodBoolean>;
431
+ busy: z.ZodDefault<z.ZodBoolean>;
432
+ action: z.ZodString;
433
+ entityId: z.ZodOptional<z.ZodString>;
434
+ type: z.ZodLiteral<"icon-button">;
435
+ id: z.ZodString;
436
+ label: z.ZodString;
437
+ icon: z.ZodEnum<{
438
+ search: "search";
439
+ info: "info";
440
+ add: "add";
441
+ help: "help";
442
+ close: "close";
443
+ check: "check";
444
+ delete: "delete";
445
+ refresh: "refresh";
446
+ settings: "settings";
447
+ }>;
448
+ }, z.core.$strict>, z.ZodObject<{
449
+ type: z.ZodLiteral<"button-group">;
450
+ id: z.ZodString;
451
+ label: z.ZodString;
452
+ children: z.ZodArray<z.ZodString>;
453
+ }, z.core.$strict>, z.ZodObject<{
454
+ type: z.ZodLiteral<"badge">;
455
+ id: z.ZodString;
456
+ text: z.ZodString;
457
+ variant: z.ZodDefault<z.ZodEnum<{
458
+ default: "default";
459
+ destructive: "destructive";
460
+ outline: "outline";
461
+ secondary: "secondary";
462
+ }>>;
463
+ }, z.core.$strict>, z.ZodObject<{
464
+ type: z.ZodLiteral<"card">;
465
+ id: z.ZodString;
466
+ title: z.ZodOptional<z.ZodString>;
467
+ description: z.ZodOptional<z.ZodString>;
468
+ children: z.ZodArray<z.ZodString>;
469
+ }, z.core.$strict>, z.ZodObject<{
470
+ type: z.ZodLiteral<"item">;
471
+ id: z.ZodString;
472
+ title: z.ZodString;
473
+ description: z.ZodOptional<z.ZodString>;
474
+ children: z.ZodArray<z.ZodString>;
475
+ }, z.core.$strict>, z.ZodObject<{
476
+ type: z.ZodLiteral<"tabs">;
477
+ id: z.ZodString;
478
+ value: z.ZodString;
479
+ action: z.ZodString;
480
+ entityId: z.ZodOptional<z.ZodString>;
481
+ disabled: z.ZodDefault<z.ZodBoolean>;
482
+ tabs: z.ZodArray<z.ZodObject<{
483
+ id: z.ZodString;
484
+ label: z.ZodString;
485
+ children: z.ZodArray<z.ZodString>;
486
+ disabled: z.ZodDefault<z.ZodBoolean>;
487
+ }, z.core.$strict>>;
488
+ }, z.core.$strict>, z.ZodObject<{
489
+ type: z.ZodLiteral<"alert">;
490
+ id: z.ZodString;
491
+ title: z.ZodString;
492
+ description: z.ZodOptional<z.ZodString>;
493
+ tone: z.ZodDefault<z.ZodEnum<{
494
+ default: "default";
495
+ info: "info";
496
+ destructive: "destructive";
497
+ warning: "warning";
498
+ success: "success";
499
+ }>>;
500
+ }, z.core.$strict>, z.ZodObject<{
501
+ type: z.ZodLiteral<"empty">;
502
+ id: z.ZodString;
503
+ title: z.ZodString;
504
+ description: z.ZodOptional<z.ZodString>;
505
+ children: z.ZodArray<z.ZodString>;
506
+ }, z.core.$strict>, z.ZodObject<{
507
+ type: z.ZodLiteral<"loading">;
508
+ id: z.ZodString;
509
+ label: z.ZodString;
510
+ rows: z.ZodDefault<z.ZodNumber>;
511
+ }, z.core.$strict>, z.ZodObject<{
512
+ value: z.ZodString;
513
+ inputType: z.ZodDefault<z.ZodEnum<{
514
+ search: "search";
515
+ text: "text";
516
+ email: "email";
517
+ password: "password";
518
+ }>>;
519
+ placeholder: z.ZodOptional<z.ZodString>;
520
+ disabled: z.ZodDefault<z.ZodBoolean>;
521
+ busy: z.ZodDefault<z.ZodBoolean>;
522
+ action: z.ZodString;
523
+ entityId: z.ZodOptional<z.ZodString>;
524
+ description: z.ZodOptional<z.ZodString>;
525
+ error: z.ZodOptional<z.ZodString>;
526
+ label: z.ZodString;
527
+ required: z.ZodDefault<z.ZodBoolean>;
528
+ type: z.ZodLiteral<"input">;
529
+ id: z.ZodString;
530
+ }, z.core.$strict>, z.ZodObject<{
531
+ value: z.ZodString;
532
+ placeholder: z.ZodOptional<z.ZodString>;
533
+ rows: z.ZodDefault<z.ZodNumber>;
534
+ disabled: z.ZodDefault<z.ZodBoolean>;
535
+ busy: z.ZodDefault<z.ZodBoolean>;
536
+ action: z.ZodString;
537
+ entityId: z.ZodOptional<z.ZodString>;
538
+ description: z.ZodOptional<z.ZodString>;
539
+ error: z.ZodOptional<z.ZodString>;
540
+ label: z.ZodString;
541
+ required: z.ZodDefault<z.ZodBoolean>;
542
+ type: z.ZodLiteral<"textarea">;
543
+ id: z.ZodString;
544
+ }, z.core.$strict>, z.ZodObject<{
545
+ value: z.ZodString;
546
+ options: z.ZodArray<z.ZodObject<{
547
+ value: z.ZodString;
548
+ label: z.ZodString;
549
+ disabled: z.ZodDefault<z.ZodBoolean>;
550
+ }, z.core.$strict>>;
551
+ disabled: z.ZodDefault<z.ZodBoolean>;
552
+ busy: z.ZodDefault<z.ZodBoolean>;
553
+ action: z.ZodString;
554
+ entityId: z.ZodOptional<z.ZodString>;
555
+ description: z.ZodOptional<z.ZodString>;
556
+ error: z.ZodOptional<z.ZodString>;
557
+ label: z.ZodString;
558
+ required: z.ZodDefault<z.ZodBoolean>;
559
+ type: z.ZodLiteral<"select">;
560
+ id: z.ZodString;
561
+ }, z.core.$strict>, z.ZodObject<{
562
+ checked: z.ZodBoolean;
563
+ disabled: z.ZodDefault<z.ZodBoolean>;
564
+ busy: z.ZodDefault<z.ZodBoolean>;
565
+ action: z.ZodString;
566
+ entityId: z.ZodOptional<z.ZodString>;
567
+ description: z.ZodOptional<z.ZodString>;
568
+ error: z.ZodOptional<z.ZodString>;
569
+ label: z.ZodString;
570
+ required: z.ZodDefault<z.ZodBoolean>;
571
+ type: z.ZodLiteral<"checkbox">;
572
+ id: z.ZodString;
573
+ }, z.core.$strict>, z.ZodObject<{
574
+ type: z.ZodLiteral<"progress">;
575
+ id: z.ZodString;
576
+ label: z.ZodString;
577
+ value: z.ZodNumber;
578
+ }, z.core.$strict>, z.ZodObject<{
579
+ type: z.ZodLiteral<"tooltip">;
580
+ id: z.ZodString;
581
+ label: z.ZodString;
582
+ child: z.ZodString;
583
+ }, z.core.$strict>, z.ZodObject<{
584
+ type: z.ZodLiteral<"dialog">;
585
+ id: z.ZodString;
586
+ entityId: z.ZodOptional<z.ZodString>;
587
+ open: z.ZodBoolean;
588
+ openChangeAction: z.ZodString;
589
+ title: z.ZodString;
590
+ description: z.ZodOptional<z.ZodString>;
591
+ children: z.ZodArray<z.ZodString>;
592
+ actions: z.ZodArray<z.ZodObject<{
593
+ id: z.ZodString;
594
+ label: z.ZodString;
595
+ action: z.ZodString;
596
+ variant: z.ZodDefault<z.ZodEnum<{
597
+ default: "default";
598
+ destructive: "destructive";
599
+ outline: "outline";
600
+ secondary: "secondary";
601
+ ghost: "ghost";
602
+ }>>;
603
+ disabled: z.ZodDefault<z.ZodBoolean>;
604
+ }, z.core.$strict>>;
605
+ }, z.core.$strict>, z.ZodObject<{
606
+ type: z.ZodLiteral<"confirmation">;
607
+ id: z.ZodString;
608
+ entityId: z.ZodOptional<z.ZodString>;
609
+ open: z.ZodBoolean;
610
+ openChangeAction: z.ZodString;
611
+ title: z.ZodString;
612
+ description: z.ZodString;
613
+ confirm: z.ZodObject<{
614
+ id: z.ZodString;
615
+ label: z.ZodString;
616
+ action: z.ZodString;
617
+ variant: z.ZodDefault<z.ZodEnum<{
618
+ default: "default";
619
+ destructive: "destructive";
620
+ outline: "outline";
621
+ secondary: "secondary";
622
+ ghost: "ghost";
623
+ }>>;
624
+ disabled: z.ZodDefault<z.ZodBoolean>;
625
+ }, z.core.$strict>;
626
+ cancelLabel: z.ZodDefault<z.ZodString>;
627
+ }, z.core.$strict>, z.ZodObject<{
628
+ type: z.ZodLiteral<"separator">;
629
+ id: z.ZodString;
630
+ }, z.core.$strict>, z.ZodObject<{
631
+ type: z.ZodLiteral<"metric">;
632
+ id: z.ZodString;
633
+ label: z.ZodString;
634
+ value: z.ZodString;
635
+ detail: z.ZodOptional<z.ZodString>;
636
+ badge: z.ZodOptional<z.ZodString>;
637
+ }, z.core.$strict>], "type">;
638
+
639
+ /** Imperative UI root retained by JavaScript or Rust/WASM. */
640
+ export declare interface MiniAppUiRoot {
641
+ readonly revision: number;
642
+ /** Replaces controlled state. Reusing a revision is valid only for an identical model. */
643
+ update(model: unknown): void;
644
+ /** Focuses an interactive control by its stable model identifier. */
645
+ focus(controlId: string): void;
646
+ /** Publishes an accessible live-region announcement. */
647
+ announce(message: string, priority?: 'polite' | 'assertive'): void;
648
+ /** Releases appearance listeners and the React root. Safe to call repeatedly. */
649
+ unmount(): void;
650
+ }
651
+
652
+ /** Optional lifecycle hooks for the imperative root. */
653
+ export declare interface MiniAppUiRootOptions {
654
+ /** Receives render, dispatch, stale-action, and cleanup failures. */
655
+ onError?: (error: MiniAppUiError) => void;
656
+ /** Overrides the URL search string used for initial theme and UI scale. */
657
+ appearanceSearch?: string | URLSearchParams;
658
+ }
659
+
660
+ export { }