@adieyal/catalogue-core 0.1.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/dist/index.d.ts +1958 -0
- package/dist/index.js +1567 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1958 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Apply a RenderNode's configuration to an existing element.
|
|
5
|
+
* Useful for playground where we update rather than recreate.
|
|
6
|
+
*/
|
|
7
|
+
export declare function applyNodeToElement(element: Element, node: RenderNode): void;
|
|
8
|
+
|
|
9
|
+
export declare type BooleanControl = z.infer<typeof BooleanControlSchema>;
|
|
10
|
+
|
|
11
|
+
declare const BooleanControlSchema: z.ZodObject<{
|
|
12
|
+
type: z.ZodLiteral<"boolean">;
|
|
13
|
+
label: z.ZodOptional<z.ZodString>;
|
|
14
|
+
defaultValue: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
type: "boolean";
|
|
17
|
+
label?: string | undefined;
|
|
18
|
+
defaultValue?: boolean | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
type: "boolean";
|
|
21
|
+
label?: string | undefined;
|
|
22
|
+
defaultValue?: boolean | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
export declare interface Breakpoint {
|
|
26
|
+
name: string;
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
/** If true, this breakpoint fills available space */
|
|
30
|
+
fullScreen?: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare interface CatalogueApp {
|
|
34
|
+
/** The router instance */
|
|
35
|
+
router: Router;
|
|
36
|
+
/** Start the application */
|
|
37
|
+
start: () => void;
|
|
38
|
+
/** Navigate to a path */
|
|
39
|
+
navigate: (path: string) => void;
|
|
40
|
+
/** Current registry */
|
|
41
|
+
registry: Registry;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare interface CatalogueAppOptions {
|
|
45
|
+
/** Container element to render into */
|
|
46
|
+
container: HTMLElement;
|
|
47
|
+
/** Registry data */
|
|
48
|
+
registry: Registry;
|
|
49
|
+
/** Optional base path for deployment */
|
|
50
|
+
basePath?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export declare interface CategoriesConfig {
|
|
54
|
+
/** Category definitions */
|
|
55
|
+
items: CategoryDefinition[];
|
|
56
|
+
/** Label for uncategorised components */
|
|
57
|
+
uncategorisedLabel: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Registry types for the component catalogue.
|
|
62
|
+
*/
|
|
63
|
+
export declare interface CategoryDefinition {
|
|
64
|
+
/** Unique category identifier (kebab-case) */
|
|
65
|
+
id: string;
|
|
66
|
+
/** Human-readable label */
|
|
67
|
+
label: string;
|
|
68
|
+
/** Optional description */
|
|
69
|
+
description?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export declare interface CodegenOptions {
|
|
73
|
+
/** Indentation string (default: 2 spaces) */
|
|
74
|
+
indent?: string;
|
|
75
|
+
/** Include script tag for complex props */
|
|
76
|
+
includeScript?: boolean;
|
|
77
|
+
/** ID to use for element reference in script */
|
|
78
|
+
elementId?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export declare interface CodePanelElements {
|
|
82
|
+
wrapper: HTMLDivElement;
|
|
83
|
+
header: HTMLDivElement;
|
|
84
|
+
content: HTMLPreElement;
|
|
85
|
+
copyButton: HTMLButtonElement;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Code panel component for displaying and copying HTML snippets.
|
|
90
|
+
*/
|
|
91
|
+
export declare interface CodePanelOptions {
|
|
92
|
+
/** Code content to display */
|
|
93
|
+
code: string;
|
|
94
|
+
/** Language for syntax highlighting hints */
|
|
95
|
+
language?: 'html' | 'javascript' | 'json';
|
|
96
|
+
/** Whether the panel is collapsible */
|
|
97
|
+
collapsible?: boolean;
|
|
98
|
+
/** Initial collapsed state */
|
|
99
|
+
collapsed?: boolean;
|
|
100
|
+
/** Title for the panel */
|
|
101
|
+
title?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare type ColorControl = z.infer<typeof ColorControlSchema>;
|
|
105
|
+
|
|
106
|
+
declare const ColorControlSchema: z.ZodObject<{
|
|
107
|
+
type: z.ZodLiteral<"color">;
|
|
108
|
+
label: z.ZodOptional<z.ZodString>;
|
|
109
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
type: "color";
|
|
112
|
+
label?: string | undefined;
|
|
113
|
+
defaultValue?: string | undefined;
|
|
114
|
+
}, {
|
|
115
|
+
type: "color";
|
|
116
|
+
label?: string | undefined;
|
|
117
|
+
defaultValue?: string | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
|
|
120
|
+
export declare type Component = z.infer<typeof ComponentSchema>;
|
|
121
|
+
|
|
122
|
+
export declare type ComponentExports = z.infer<typeof ComponentExportsSchema>;
|
|
123
|
+
|
|
124
|
+
export declare const ComponentExportsSchema: z.ZodObject<{
|
|
125
|
+
/** Custom element tag name (must be kebab-case with at least one hyphen) */
|
|
126
|
+
customElement: z.ZodString;
|
|
127
|
+
/** npm package name (optional, defaults to consumer's package) */
|
|
128
|
+
package: z.ZodOptional<z.ZodString>;
|
|
129
|
+
/** Entry point path (optional, defaults to main entry) */
|
|
130
|
+
entry: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, "strip", z.ZodTypeAny, {
|
|
132
|
+
customElement: string;
|
|
133
|
+
package?: string | undefined;
|
|
134
|
+
entry?: string | undefined;
|
|
135
|
+
}, {
|
|
136
|
+
customElement: string;
|
|
137
|
+
package?: string | undefined;
|
|
138
|
+
entry?: string | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
|
|
141
|
+
export declare type ComponentKind = z.infer<typeof ComponentKindSchema>;
|
|
142
|
+
|
|
143
|
+
export declare const ComponentKindSchema: z.ZodEnum<["standalone", "subcomponent", "feature"]>;
|
|
144
|
+
|
|
145
|
+
export declare interface ComponentPageElements {
|
|
146
|
+
root: HTMLDivElement;
|
|
147
|
+
header: HTMLElement;
|
|
148
|
+
variantsGrid: HTMLDivElement;
|
|
149
|
+
docsSection: HTMLDivElement | null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export declare interface ComponentPageOptions {
|
|
153
|
+
registry: Registry;
|
|
154
|
+
componentId: string;
|
|
155
|
+
onNavigate: (path: string) => void;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export declare const ComponentSchema: z.ZodEffects<z.ZodObject<{
|
|
159
|
+
/** Unique identifier for the component (kebab-case) */
|
|
160
|
+
id: z.ZodString;
|
|
161
|
+
/** Human-readable title */
|
|
162
|
+
title: z.ZodString;
|
|
163
|
+
/** Component maturity status */
|
|
164
|
+
status: z.ZodEnum<["stable", "beta", "deprecated"]>;
|
|
165
|
+
/** Component kind */
|
|
166
|
+
kind: z.ZodEnum<["standalone", "subcomponent", "feature"]>;
|
|
167
|
+
/** Optional description */
|
|
168
|
+
description: z.ZodOptional<z.ZodString>;
|
|
169
|
+
/** Tags for search and filtering */
|
|
170
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
171
|
+
/** Category ID (must match a category defined in config) */
|
|
172
|
+
category: z.ZodOptional<z.ZodString>;
|
|
173
|
+
/** Export configuration */
|
|
174
|
+
exports: z.ZodObject<{
|
|
175
|
+
/** Custom element tag name (must be kebab-case with at least one hyphen) */
|
|
176
|
+
customElement: z.ZodString;
|
|
177
|
+
/** npm package name (optional, defaults to consumer's package) */
|
|
178
|
+
package: z.ZodOptional<z.ZodString>;
|
|
179
|
+
/** Entry point path (optional, defaults to main entry) */
|
|
180
|
+
entry: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
customElement: string;
|
|
183
|
+
package?: string | undefined;
|
|
184
|
+
entry?: string | undefined;
|
|
185
|
+
}, {
|
|
186
|
+
customElement: string;
|
|
187
|
+
package?: string | undefined;
|
|
188
|
+
entry?: string | undefined;
|
|
189
|
+
}>;
|
|
190
|
+
/** Playground configuration */
|
|
191
|
+
playground: z.ZodObject<{
|
|
192
|
+
/** ID of the primary scenario to use as default in playground */
|
|
193
|
+
primaryScenarioId: z.ZodString;
|
|
194
|
+
/** Control definitions keyed by property name */
|
|
195
|
+
controls: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
196
|
+
type: z.ZodLiteral<"text">;
|
|
197
|
+
label: z.ZodOptional<z.ZodString>;
|
|
198
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
199
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, "strip", z.ZodTypeAny, {
|
|
201
|
+
type: "text";
|
|
202
|
+
label?: string | undefined;
|
|
203
|
+
defaultValue?: string | undefined;
|
|
204
|
+
placeholder?: string | undefined;
|
|
205
|
+
}, {
|
|
206
|
+
type: "text";
|
|
207
|
+
label?: string | undefined;
|
|
208
|
+
defaultValue?: string | undefined;
|
|
209
|
+
placeholder?: string | undefined;
|
|
210
|
+
}>, z.ZodObject<{
|
|
211
|
+
type: z.ZodLiteral<"number">;
|
|
212
|
+
label: z.ZodOptional<z.ZodString>;
|
|
213
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
215
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
216
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
type: "number";
|
|
219
|
+
label?: string | undefined;
|
|
220
|
+
defaultValue?: number | undefined;
|
|
221
|
+
min?: number | undefined;
|
|
222
|
+
max?: number | undefined;
|
|
223
|
+
step?: number | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
type: "number";
|
|
226
|
+
label?: string | undefined;
|
|
227
|
+
defaultValue?: number | undefined;
|
|
228
|
+
min?: number | undefined;
|
|
229
|
+
max?: number | undefined;
|
|
230
|
+
step?: number | undefined;
|
|
231
|
+
}>, z.ZodObject<{
|
|
232
|
+
type: z.ZodLiteral<"boolean">;
|
|
233
|
+
label: z.ZodOptional<z.ZodString>;
|
|
234
|
+
defaultValue: z.ZodOptional<z.ZodBoolean>;
|
|
235
|
+
}, "strip", z.ZodTypeAny, {
|
|
236
|
+
type: "boolean";
|
|
237
|
+
label?: string | undefined;
|
|
238
|
+
defaultValue?: boolean | undefined;
|
|
239
|
+
}, {
|
|
240
|
+
type: "boolean";
|
|
241
|
+
label?: string | undefined;
|
|
242
|
+
defaultValue?: boolean | undefined;
|
|
243
|
+
}>, z.ZodObject<{
|
|
244
|
+
type: z.ZodLiteral<"select">;
|
|
245
|
+
label: z.ZodOptional<z.ZodString>;
|
|
246
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
247
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
248
|
+
label: z.ZodString;
|
|
249
|
+
value: z.ZodString;
|
|
250
|
+
}, "strip", z.ZodTypeAny, {
|
|
251
|
+
value: string;
|
|
252
|
+
label: string;
|
|
253
|
+
}, {
|
|
254
|
+
value: string;
|
|
255
|
+
label: string;
|
|
256
|
+
}>]>, "many">;
|
|
257
|
+
}, "strip", z.ZodTypeAny, {
|
|
258
|
+
options: (string | {
|
|
259
|
+
value: string;
|
|
260
|
+
label: string;
|
|
261
|
+
})[];
|
|
262
|
+
type: "select";
|
|
263
|
+
label?: string | undefined;
|
|
264
|
+
defaultValue?: string | undefined;
|
|
265
|
+
}, {
|
|
266
|
+
options: (string | {
|
|
267
|
+
value: string;
|
|
268
|
+
label: string;
|
|
269
|
+
})[];
|
|
270
|
+
type: "select";
|
|
271
|
+
label?: string | undefined;
|
|
272
|
+
defaultValue?: string | undefined;
|
|
273
|
+
}>, z.ZodObject<{
|
|
274
|
+
type: z.ZodLiteral<"radio">;
|
|
275
|
+
label: z.ZodOptional<z.ZodString>;
|
|
276
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
277
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
278
|
+
label: z.ZodString;
|
|
279
|
+
value: z.ZodString;
|
|
280
|
+
}, "strip", z.ZodTypeAny, {
|
|
281
|
+
value: string;
|
|
282
|
+
label: string;
|
|
283
|
+
}, {
|
|
284
|
+
value: string;
|
|
285
|
+
label: string;
|
|
286
|
+
}>]>, "many">;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
options: (string | {
|
|
289
|
+
value: string;
|
|
290
|
+
label: string;
|
|
291
|
+
})[];
|
|
292
|
+
type: "radio";
|
|
293
|
+
label?: string | undefined;
|
|
294
|
+
defaultValue?: string | undefined;
|
|
295
|
+
}, {
|
|
296
|
+
options: (string | {
|
|
297
|
+
value: string;
|
|
298
|
+
label: string;
|
|
299
|
+
})[];
|
|
300
|
+
type: "radio";
|
|
301
|
+
label?: string | undefined;
|
|
302
|
+
defaultValue?: string | undefined;
|
|
303
|
+
}>, z.ZodObject<{
|
|
304
|
+
type: z.ZodLiteral<"color">;
|
|
305
|
+
label: z.ZodOptional<z.ZodString>;
|
|
306
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
307
|
+
}, "strip", z.ZodTypeAny, {
|
|
308
|
+
type: "color";
|
|
309
|
+
label?: string | undefined;
|
|
310
|
+
defaultValue?: string | undefined;
|
|
311
|
+
}, {
|
|
312
|
+
type: "color";
|
|
313
|
+
label?: string | undefined;
|
|
314
|
+
defaultValue?: string | undefined;
|
|
315
|
+
}>, z.ZodObject<{
|
|
316
|
+
type: z.ZodLiteral<"range">;
|
|
317
|
+
label: z.ZodOptional<z.ZodString>;
|
|
318
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
319
|
+
min: z.ZodNumber;
|
|
320
|
+
max: z.ZodNumber;
|
|
321
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
322
|
+
}, "strip", z.ZodTypeAny, {
|
|
323
|
+
type: "range";
|
|
324
|
+
min: number;
|
|
325
|
+
max: number;
|
|
326
|
+
label?: string | undefined;
|
|
327
|
+
defaultValue?: number | undefined;
|
|
328
|
+
step?: number | undefined;
|
|
329
|
+
}, {
|
|
330
|
+
type: "range";
|
|
331
|
+
min: number;
|
|
332
|
+
max: number;
|
|
333
|
+
label?: string | undefined;
|
|
334
|
+
defaultValue?: number | undefined;
|
|
335
|
+
step?: number | undefined;
|
|
336
|
+
}>, z.ZodObject<{
|
|
337
|
+
type: z.ZodLiteral<"json">;
|
|
338
|
+
label: z.ZodOptional<z.ZodString>;
|
|
339
|
+
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
340
|
+
}, "strip", z.ZodTypeAny, {
|
|
341
|
+
type: "json";
|
|
342
|
+
label?: string | undefined;
|
|
343
|
+
defaultValue?: unknown;
|
|
344
|
+
}, {
|
|
345
|
+
type: "json";
|
|
346
|
+
label?: string | undefined;
|
|
347
|
+
defaultValue?: unknown;
|
|
348
|
+
}>]>>;
|
|
349
|
+
}, "strip", z.ZodTypeAny, {
|
|
350
|
+
primaryScenarioId: string;
|
|
351
|
+
controls: Record<string, {
|
|
352
|
+
type: "text";
|
|
353
|
+
label?: string | undefined;
|
|
354
|
+
defaultValue?: string | undefined;
|
|
355
|
+
placeholder?: string | undefined;
|
|
356
|
+
} | {
|
|
357
|
+
type: "number";
|
|
358
|
+
label?: string | undefined;
|
|
359
|
+
defaultValue?: number | undefined;
|
|
360
|
+
min?: number | undefined;
|
|
361
|
+
max?: number | undefined;
|
|
362
|
+
step?: number | undefined;
|
|
363
|
+
} | {
|
|
364
|
+
type: "boolean";
|
|
365
|
+
label?: string | undefined;
|
|
366
|
+
defaultValue?: boolean | undefined;
|
|
367
|
+
} | {
|
|
368
|
+
options: (string | {
|
|
369
|
+
value: string;
|
|
370
|
+
label: string;
|
|
371
|
+
})[];
|
|
372
|
+
type: "select";
|
|
373
|
+
label?: string | undefined;
|
|
374
|
+
defaultValue?: string | undefined;
|
|
375
|
+
} | {
|
|
376
|
+
options: (string | {
|
|
377
|
+
value: string;
|
|
378
|
+
label: string;
|
|
379
|
+
})[];
|
|
380
|
+
type: "radio";
|
|
381
|
+
label?: string | undefined;
|
|
382
|
+
defaultValue?: string | undefined;
|
|
383
|
+
} | {
|
|
384
|
+
type: "color";
|
|
385
|
+
label?: string | undefined;
|
|
386
|
+
defaultValue?: string | undefined;
|
|
387
|
+
} | {
|
|
388
|
+
type: "range";
|
|
389
|
+
min: number;
|
|
390
|
+
max: number;
|
|
391
|
+
label?: string | undefined;
|
|
392
|
+
defaultValue?: number | undefined;
|
|
393
|
+
step?: number | undefined;
|
|
394
|
+
} | {
|
|
395
|
+
type: "json";
|
|
396
|
+
label?: string | undefined;
|
|
397
|
+
defaultValue?: unknown;
|
|
398
|
+
}>;
|
|
399
|
+
}, {
|
|
400
|
+
primaryScenarioId: string;
|
|
401
|
+
controls: Record<string, {
|
|
402
|
+
type: "text";
|
|
403
|
+
label?: string | undefined;
|
|
404
|
+
defaultValue?: string | undefined;
|
|
405
|
+
placeholder?: string | undefined;
|
|
406
|
+
} | {
|
|
407
|
+
type: "number";
|
|
408
|
+
label?: string | undefined;
|
|
409
|
+
defaultValue?: number | undefined;
|
|
410
|
+
min?: number | undefined;
|
|
411
|
+
max?: number | undefined;
|
|
412
|
+
step?: number | undefined;
|
|
413
|
+
} | {
|
|
414
|
+
type: "boolean";
|
|
415
|
+
label?: string | undefined;
|
|
416
|
+
defaultValue?: boolean | undefined;
|
|
417
|
+
} | {
|
|
418
|
+
options: (string | {
|
|
419
|
+
value: string;
|
|
420
|
+
label: string;
|
|
421
|
+
})[];
|
|
422
|
+
type: "select";
|
|
423
|
+
label?: string | undefined;
|
|
424
|
+
defaultValue?: string | undefined;
|
|
425
|
+
} | {
|
|
426
|
+
options: (string | {
|
|
427
|
+
value: string;
|
|
428
|
+
label: string;
|
|
429
|
+
})[];
|
|
430
|
+
type: "radio";
|
|
431
|
+
label?: string | undefined;
|
|
432
|
+
defaultValue?: string | undefined;
|
|
433
|
+
} | {
|
|
434
|
+
type: "color";
|
|
435
|
+
label?: string | undefined;
|
|
436
|
+
defaultValue?: string | undefined;
|
|
437
|
+
} | {
|
|
438
|
+
type: "range";
|
|
439
|
+
min: number;
|
|
440
|
+
max: number;
|
|
441
|
+
label?: string | undefined;
|
|
442
|
+
defaultValue?: number | undefined;
|
|
443
|
+
step?: number | undefined;
|
|
444
|
+
} | {
|
|
445
|
+
type: "json";
|
|
446
|
+
label?: string | undefined;
|
|
447
|
+
defaultValue?: unknown;
|
|
448
|
+
}>;
|
|
449
|
+
}>;
|
|
450
|
+
/** Parent component ID (required when kind is 'subcomponent') */
|
|
451
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
452
|
+
/** List of subcomponent IDs */
|
|
453
|
+
subcomponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
454
|
+
}, "strip", z.ZodTypeAny, {
|
|
455
|
+
status: "stable" | "beta" | "deprecated";
|
|
456
|
+
id: string;
|
|
457
|
+
title: string;
|
|
458
|
+
kind: "standalone" | "subcomponent" | "feature";
|
|
459
|
+
exports: {
|
|
460
|
+
customElement: string;
|
|
461
|
+
package?: string | undefined;
|
|
462
|
+
entry?: string | undefined;
|
|
463
|
+
};
|
|
464
|
+
playground: {
|
|
465
|
+
primaryScenarioId: string;
|
|
466
|
+
controls: Record<string, {
|
|
467
|
+
type: "text";
|
|
468
|
+
label?: string | undefined;
|
|
469
|
+
defaultValue?: string | undefined;
|
|
470
|
+
placeholder?: string | undefined;
|
|
471
|
+
} | {
|
|
472
|
+
type: "number";
|
|
473
|
+
label?: string | undefined;
|
|
474
|
+
defaultValue?: number | undefined;
|
|
475
|
+
min?: number | undefined;
|
|
476
|
+
max?: number | undefined;
|
|
477
|
+
step?: number | undefined;
|
|
478
|
+
} | {
|
|
479
|
+
type: "boolean";
|
|
480
|
+
label?: string | undefined;
|
|
481
|
+
defaultValue?: boolean | undefined;
|
|
482
|
+
} | {
|
|
483
|
+
options: (string | {
|
|
484
|
+
value: string;
|
|
485
|
+
label: string;
|
|
486
|
+
})[];
|
|
487
|
+
type: "select";
|
|
488
|
+
label?: string | undefined;
|
|
489
|
+
defaultValue?: string | undefined;
|
|
490
|
+
} | {
|
|
491
|
+
options: (string | {
|
|
492
|
+
value: string;
|
|
493
|
+
label: string;
|
|
494
|
+
})[];
|
|
495
|
+
type: "radio";
|
|
496
|
+
label?: string | undefined;
|
|
497
|
+
defaultValue?: string | undefined;
|
|
498
|
+
} | {
|
|
499
|
+
type: "color";
|
|
500
|
+
label?: string | undefined;
|
|
501
|
+
defaultValue?: string | undefined;
|
|
502
|
+
} | {
|
|
503
|
+
type: "range";
|
|
504
|
+
min: number;
|
|
505
|
+
max: number;
|
|
506
|
+
label?: string | undefined;
|
|
507
|
+
defaultValue?: number | undefined;
|
|
508
|
+
step?: number | undefined;
|
|
509
|
+
} | {
|
|
510
|
+
type: "json";
|
|
511
|
+
label?: string | undefined;
|
|
512
|
+
defaultValue?: unknown;
|
|
513
|
+
}>;
|
|
514
|
+
};
|
|
515
|
+
description?: string | undefined;
|
|
516
|
+
tags?: string[] | undefined;
|
|
517
|
+
category?: string | undefined;
|
|
518
|
+
parentId?: string | undefined;
|
|
519
|
+
subcomponents?: string[] | undefined;
|
|
520
|
+
}, {
|
|
521
|
+
status: "stable" | "beta" | "deprecated";
|
|
522
|
+
id: string;
|
|
523
|
+
title: string;
|
|
524
|
+
kind: "standalone" | "subcomponent" | "feature";
|
|
525
|
+
exports: {
|
|
526
|
+
customElement: string;
|
|
527
|
+
package?: string | undefined;
|
|
528
|
+
entry?: string | undefined;
|
|
529
|
+
};
|
|
530
|
+
playground: {
|
|
531
|
+
primaryScenarioId: string;
|
|
532
|
+
controls: Record<string, {
|
|
533
|
+
type: "text";
|
|
534
|
+
label?: string | undefined;
|
|
535
|
+
defaultValue?: string | undefined;
|
|
536
|
+
placeholder?: string | undefined;
|
|
537
|
+
} | {
|
|
538
|
+
type: "number";
|
|
539
|
+
label?: string | undefined;
|
|
540
|
+
defaultValue?: number | undefined;
|
|
541
|
+
min?: number | undefined;
|
|
542
|
+
max?: number | undefined;
|
|
543
|
+
step?: number | undefined;
|
|
544
|
+
} | {
|
|
545
|
+
type: "boolean";
|
|
546
|
+
label?: string | undefined;
|
|
547
|
+
defaultValue?: boolean | undefined;
|
|
548
|
+
} | {
|
|
549
|
+
options: (string | {
|
|
550
|
+
value: string;
|
|
551
|
+
label: string;
|
|
552
|
+
})[];
|
|
553
|
+
type: "select";
|
|
554
|
+
label?: string | undefined;
|
|
555
|
+
defaultValue?: string | undefined;
|
|
556
|
+
} | {
|
|
557
|
+
options: (string | {
|
|
558
|
+
value: string;
|
|
559
|
+
label: string;
|
|
560
|
+
})[];
|
|
561
|
+
type: "radio";
|
|
562
|
+
label?: string | undefined;
|
|
563
|
+
defaultValue?: string | undefined;
|
|
564
|
+
} | {
|
|
565
|
+
type: "color";
|
|
566
|
+
label?: string | undefined;
|
|
567
|
+
defaultValue?: string | undefined;
|
|
568
|
+
} | {
|
|
569
|
+
type: "range";
|
|
570
|
+
min: number;
|
|
571
|
+
max: number;
|
|
572
|
+
label?: string | undefined;
|
|
573
|
+
defaultValue?: number | undefined;
|
|
574
|
+
step?: number | undefined;
|
|
575
|
+
} | {
|
|
576
|
+
type: "json";
|
|
577
|
+
label?: string | undefined;
|
|
578
|
+
defaultValue?: unknown;
|
|
579
|
+
}>;
|
|
580
|
+
};
|
|
581
|
+
description?: string | undefined;
|
|
582
|
+
tags?: string[] | undefined;
|
|
583
|
+
category?: string | undefined;
|
|
584
|
+
parentId?: string | undefined;
|
|
585
|
+
subcomponents?: string[] | undefined;
|
|
586
|
+
}>, {
|
|
587
|
+
status: "stable" | "beta" | "deprecated";
|
|
588
|
+
id: string;
|
|
589
|
+
title: string;
|
|
590
|
+
kind: "standalone" | "subcomponent" | "feature";
|
|
591
|
+
exports: {
|
|
592
|
+
customElement: string;
|
|
593
|
+
package?: string | undefined;
|
|
594
|
+
entry?: string | undefined;
|
|
595
|
+
};
|
|
596
|
+
playground: {
|
|
597
|
+
primaryScenarioId: string;
|
|
598
|
+
controls: Record<string, {
|
|
599
|
+
type: "text";
|
|
600
|
+
label?: string | undefined;
|
|
601
|
+
defaultValue?: string | undefined;
|
|
602
|
+
placeholder?: string | undefined;
|
|
603
|
+
} | {
|
|
604
|
+
type: "number";
|
|
605
|
+
label?: string | undefined;
|
|
606
|
+
defaultValue?: number | undefined;
|
|
607
|
+
min?: number | undefined;
|
|
608
|
+
max?: number | undefined;
|
|
609
|
+
step?: number | undefined;
|
|
610
|
+
} | {
|
|
611
|
+
type: "boolean";
|
|
612
|
+
label?: string | undefined;
|
|
613
|
+
defaultValue?: boolean | undefined;
|
|
614
|
+
} | {
|
|
615
|
+
options: (string | {
|
|
616
|
+
value: string;
|
|
617
|
+
label: string;
|
|
618
|
+
})[];
|
|
619
|
+
type: "select";
|
|
620
|
+
label?: string | undefined;
|
|
621
|
+
defaultValue?: string | undefined;
|
|
622
|
+
} | {
|
|
623
|
+
options: (string | {
|
|
624
|
+
value: string;
|
|
625
|
+
label: string;
|
|
626
|
+
})[];
|
|
627
|
+
type: "radio";
|
|
628
|
+
label?: string | undefined;
|
|
629
|
+
defaultValue?: string | undefined;
|
|
630
|
+
} | {
|
|
631
|
+
type: "color";
|
|
632
|
+
label?: string | undefined;
|
|
633
|
+
defaultValue?: string | undefined;
|
|
634
|
+
} | {
|
|
635
|
+
type: "range";
|
|
636
|
+
min: number;
|
|
637
|
+
max: number;
|
|
638
|
+
label?: string | undefined;
|
|
639
|
+
defaultValue?: number | undefined;
|
|
640
|
+
step?: number | undefined;
|
|
641
|
+
} | {
|
|
642
|
+
type: "json";
|
|
643
|
+
label?: string | undefined;
|
|
644
|
+
defaultValue?: unknown;
|
|
645
|
+
}>;
|
|
646
|
+
};
|
|
647
|
+
description?: string | undefined;
|
|
648
|
+
tags?: string[] | undefined;
|
|
649
|
+
category?: string | undefined;
|
|
650
|
+
parentId?: string | undefined;
|
|
651
|
+
subcomponents?: string[] | undefined;
|
|
652
|
+
}, {
|
|
653
|
+
status: "stable" | "beta" | "deprecated";
|
|
654
|
+
id: string;
|
|
655
|
+
title: string;
|
|
656
|
+
kind: "standalone" | "subcomponent" | "feature";
|
|
657
|
+
exports: {
|
|
658
|
+
customElement: string;
|
|
659
|
+
package?: string | undefined;
|
|
660
|
+
entry?: string | undefined;
|
|
661
|
+
};
|
|
662
|
+
playground: {
|
|
663
|
+
primaryScenarioId: string;
|
|
664
|
+
controls: Record<string, {
|
|
665
|
+
type: "text";
|
|
666
|
+
label?: string | undefined;
|
|
667
|
+
defaultValue?: string | undefined;
|
|
668
|
+
placeholder?: string | undefined;
|
|
669
|
+
} | {
|
|
670
|
+
type: "number";
|
|
671
|
+
label?: string | undefined;
|
|
672
|
+
defaultValue?: number | undefined;
|
|
673
|
+
min?: number | undefined;
|
|
674
|
+
max?: number | undefined;
|
|
675
|
+
step?: number | undefined;
|
|
676
|
+
} | {
|
|
677
|
+
type: "boolean";
|
|
678
|
+
label?: string | undefined;
|
|
679
|
+
defaultValue?: boolean | undefined;
|
|
680
|
+
} | {
|
|
681
|
+
options: (string | {
|
|
682
|
+
value: string;
|
|
683
|
+
label: string;
|
|
684
|
+
})[];
|
|
685
|
+
type: "select";
|
|
686
|
+
label?: string | undefined;
|
|
687
|
+
defaultValue?: string | undefined;
|
|
688
|
+
} | {
|
|
689
|
+
options: (string | {
|
|
690
|
+
value: string;
|
|
691
|
+
label: string;
|
|
692
|
+
})[];
|
|
693
|
+
type: "radio";
|
|
694
|
+
label?: string | undefined;
|
|
695
|
+
defaultValue?: string | undefined;
|
|
696
|
+
} | {
|
|
697
|
+
type: "color";
|
|
698
|
+
label?: string | undefined;
|
|
699
|
+
defaultValue?: string | undefined;
|
|
700
|
+
} | {
|
|
701
|
+
type: "range";
|
|
702
|
+
min: number;
|
|
703
|
+
max: number;
|
|
704
|
+
label?: string | undefined;
|
|
705
|
+
defaultValue?: number | undefined;
|
|
706
|
+
step?: number | undefined;
|
|
707
|
+
} | {
|
|
708
|
+
type: "json";
|
|
709
|
+
label?: string | undefined;
|
|
710
|
+
defaultValue?: unknown;
|
|
711
|
+
}>;
|
|
712
|
+
};
|
|
713
|
+
description?: string | undefined;
|
|
714
|
+
tags?: string[] | undefined;
|
|
715
|
+
category?: string | undefined;
|
|
716
|
+
parentId?: string | undefined;
|
|
717
|
+
subcomponents?: string[] | undefined;
|
|
718
|
+
}>;
|
|
719
|
+
|
|
720
|
+
export declare type ComponentStatus = z.infer<typeof ComponentStatusSchema>;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Component schema defines the structure of a component.json file
|
|
724
|
+
* in the registry. Each component has metadata, exports, and playground config.
|
|
725
|
+
*/
|
|
726
|
+
export declare const ComponentStatusSchema: z.ZodEnum<["stable", "beta", "deprecated"]>;
|
|
727
|
+
|
|
728
|
+
export declare interface ComponentValidationResult {
|
|
729
|
+
success: boolean;
|
|
730
|
+
data?: Component;
|
|
731
|
+
errors?: Array<{
|
|
732
|
+
path: string;
|
|
733
|
+
message: string;
|
|
734
|
+
}>;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
export declare interface ControlsElements {
|
|
738
|
+
container: HTMLDivElement;
|
|
739
|
+
controls: Map<string, HTMLElement>;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export declare interface ControlsOptions {
|
|
743
|
+
component: RegistryComponent;
|
|
744
|
+
values: Record<string, unknown>;
|
|
745
|
+
onChange: (propName: string, value: unknown) => void;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
export declare type ControlSpec = z.infer<typeof ControlSpecSchema>;
|
|
749
|
+
|
|
750
|
+
export declare const ControlSpecSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
751
|
+
type: z.ZodLiteral<"text">;
|
|
752
|
+
label: z.ZodOptional<z.ZodString>;
|
|
753
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
754
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
755
|
+
}, "strip", z.ZodTypeAny, {
|
|
756
|
+
type: "text";
|
|
757
|
+
label?: string | undefined;
|
|
758
|
+
defaultValue?: string | undefined;
|
|
759
|
+
placeholder?: string | undefined;
|
|
760
|
+
}, {
|
|
761
|
+
type: "text";
|
|
762
|
+
label?: string | undefined;
|
|
763
|
+
defaultValue?: string | undefined;
|
|
764
|
+
placeholder?: string | undefined;
|
|
765
|
+
}>, z.ZodObject<{
|
|
766
|
+
type: z.ZodLiteral<"number">;
|
|
767
|
+
label: z.ZodOptional<z.ZodString>;
|
|
768
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
769
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
770
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
771
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
772
|
+
}, "strip", z.ZodTypeAny, {
|
|
773
|
+
type: "number";
|
|
774
|
+
label?: string | undefined;
|
|
775
|
+
defaultValue?: number | undefined;
|
|
776
|
+
min?: number | undefined;
|
|
777
|
+
max?: number | undefined;
|
|
778
|
+
step?: number | undefined;
|
|
779
|
+
}, {
|
|
780
|
+
type: "number";
|
|
781
|
+
label?: string | undefined;
|
|
782
|
+
defaultValue?: number | undefined;
|
|
783
|
+
min?: number | undefined;
|
|
784
|
+
max?: number | undefined;
|
|
785
|
+
step?: number | undefined;
|
|
786
|
+
}>, z.ZodObject<{
|
|
787
|
+
type: z.ZodLiteral<"boolean">;
|
|
788
|
+
label: z.ZodOptional<z.ZodString>;
|
|
789
|
+
defaultValue: z.ZodOptional<z.ZodBoolean>;
|
|
790
|
+
}, "strip", z.ZodTypeAny, {
|
|
791
|
+
type: "boolean";
|
|
792
|
+
label?: string | undefined;
|
|
793
|
+
defaultValue?: boolean | undefined;
|
|
794
|
+
}, {
|
|
795
|
+
type: "boolean";
|
|
796
|
+
label?: string | undefined;
|
|
797
|
+
defaultValue?: boolean | undefined;
|
|
798
|
+
}>, z.ZodObject<{
|
|
799
|
+
type: z.ZodLiteral<"select">;
|
|
800
|
+
label: z.ZodOptional<z.ZodString>;
|
|
801
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
802
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
803
|
+
label: z.ZodString;
|
|
804
|
+
value: z.ZodString;
|
|
805
|
+
}, "strip", z.ZodTypeAny, {
|
|
806
|
+
value: string;
|
|
807
|
+
label: string;
|
|
808
|
+
}, {
|
|
809
|
+
value: string;
|
|
810
|
+
label: string;
|
|
811
|
+
}>]>, "many">;
|
|
812
|
+
}, "strip", z.ZodTypeAny, {
|
|
813
|
+
options: (string | {
|
|
814
|
+
value: string;
|
|
815
|
+
label: string;
|
|
816
|
+
})[];
|
|
817
|
+
type: "select";
|
|
818
|
+
label?: string | undefined;
|
|
819
|
+
defaultValue?: string | undefined;
|
|
820
|
+
}, {
|
|
821
|
+
options: (string | {
|
|
822
|
+
value: string;
|
|
823
|
+
label: string;
|
|
824
|
+
})[];
|
|
825
|
+
type: "select";
|
|
826
|
+
label?: string | undefined;
|
|
827
|
+
defaultValue?: string | undefined;
|
|
828
|
+
}>, z.ZodObject<{
|
|
829
|
+
type: z.ZodLiteral<"radio">;
|
|
830
|
+
label: z.ZodOptional<z.ZodString>;
|
|
831
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
832
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
833
|
+
label: z.ZodString;
|
|
834
|
+
value: z.ZodString;
|
|
835
|
+
}, "strip", z.ZodTypeAny, {
|
|
836
|
+
value: string;
|
|
837
|
+
label: string;
|
|
838
|
+
}, {
|
|
839
|
+
value: string;
|
|
840
|
+
label: string;
|
|
841
|
+
}>]>, "many">;
|
|
842
|
+
}, "strip", z.ZodTypeAny, {
|
|
843
|
+
options: (string | {
|
|
844
|
+
value: string;
|
|
845
|
+
label: string;
|
|
846
|
+
})[];
|
|
847
|
+
type: "radio";
|
|
848
|
+
label?: string | undefined;
|
|
849
|
+
defaultValue?: string | undefined;
|
|
850
|
+
}, {
|
|
851
|
+
options: (string | {
|
|
852
|
+
value: string;
|
|
853
|
+
label: string;
|
|
854
|
+
})[];
|
|
855
|
+
type: "radio";
|
|
856
|
+
label?: string | undefined;
|
|
857
|
+
defaultValue?: string | undefined;
|
|
858
|
+
}>, z.ZodObject<{
|
|
859
|
+
type: z.ZodLiteral<"color">;
|
|
860
|
+
label: z.ZodOptional<z.ZodString>;
|
|
861
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
862
|
+
}, "strip", z.ZodTypeAny, {
|
|
863
|
+
type: "color";
|
|
864
|
+
label?: string | undefined;
|
|
865
|
+
defaultValue?: string | undefined;
|
|
866
|
+
}, {
|
|
867
|
+
type: "color";
|
|
868
|
+
label?: string | undefined;
|
|
869
|
+
defaultValue?: string | undefined;
|
|
870
|
+
}>, z.ZodObject<{
|
|
871
|
+
type: z.ZodLiteral<"range">;
|
|
872
|
+
label: z.ZodOptional<z.ZodString>;
|
|
873
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
874
|
+
min: z.ZodNumber;
|
|
875
|
+
max: z.ZodNumber;
|
|
876
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
877
|
+
}, "strip", z.ZodTypeAny, {
|
|
878
|
+
type: "range";
|
|
879
|
+
min: number;
|
|
880
|
+
max: number;
|
|
881
|
+
label?: string | undefined;
|
|
882
|
+
defaultValue?: number | undefined;
|
|
883
|
+
step?: number | undefined;
|
|
884
|
+
}, {
|
|
885
|
+
type: "range";
|
|
886
|
+
min: number;
|
|
887
|
+
max: number;
|
|
888
|
+
label?: string | undefined;
|
|
889
|
+
defaultValue?: number | undefined;
|
|
890
|
+
step?: number | undefined;
|
|
891
|
+
}>, z.ZodObject<{
|
|
892
|
+
type: z.ZodLiteral<"json">;
|
|
893
|
+
label: z.ZodOptional<z.ZodString>;
|
|
894
|
+
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
895
|
+
}, "strip", z.ZodTypeAny, {
|
|
896
|
+
type: "json";
|
|
897
|
+
label?: string | undefined;
|
|
898
|
+
defaultValue?: unknown;
|
|
899
|
+
}, {
|
|
900
|
+
type: "json";
|
|
901
|
+
label?: string | undefined;
|
|
902
|
+
defaultValue?: unknown;
|
|
903
|
+
}>]>;
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Create breakpoint preset buttons.
|
|
907
|
+
*/
|
|
908
|
+
export declare function createBreakpointPresets(resizer: ResizerElements, breakpoints?: Breakpoint[], onSelect?: (breakpoint: Breakpoint) => void): HTMLDivElement;
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Create and initialize the catalogue application.
|
|
912
|
+
*/
|
|
913
|
+
export declare function createCatalogueApp(options: CatalogueAppOptions): CatalogueApp;
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* Create a code panel with copy functionality.
|
|
917
|
+
*/
|
|
918
|
+
export declare function createCodePanel(options: CodePanelOptions): CodePanelElements;
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Create the component detail page.
|
|
922
|
+
*/
|
|
923
|
+
export declare function createComponentPage(options: ComponentPageOptions): ComponentPageElements | null;
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Create the controls panel for a component.
|
|
927
|
+
*/
|
|
928
|
+
export declare function createControls(options: ControlsOptions): ControlsElements;
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* Create an empty registry.
|
|
932
|
+
*/
|
|
933
|
+
export declare function createEmptyRegistry(): Registry;
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Create the harness page.
|
|
937
|
+
*/
|
|
938
|
+
export declare function createHarnessPage(options: HarnessPageOptions): HarnessPageElements | null;
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Create the landing page.
|
|
942
|
+
*/
|
|
943
|
+
export declare function createLandingPage(options: LandingPageOptions): LandingPageElements;
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Create a navigation link element.
|
|
947
|
+
*/
|
|
948
|
+
export declare function createNavLink(href: string, text: string, className?: string): HTMLAnchorElement;
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* Create the playground page.
|
|
952
|
+
*/
|
|
953
|
+
export declare function createPlaygroundPage(options: PlaygroundPageOptions): PlaygroundPageElements | null;
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Create a resizable container.
|
|
957
|
+
*/
|
|
958
|
+
export declare function createResizer(options?: ResizerOptions): ResizerElements;
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Create a theme toggle button element.
|
|
962
|
+
*/
|
|
963
|
+
export declare function createThemeToggle(): HTMLButtonElement;
|
|
964
|
+
|
|
965
|
+
export declare const DEFAULT_BREAKPOINTS: Breakpoint[];
|
|
966
|
+
|
|
967
|
+
export declare type Example = Scenario;
|
|
968
|
+
|
|
969
|
+
export declare const ExampleSchema: z.ZodObject<{
|
|
970
|
+
/** Unique identifier for the scenario (kebab-case) */
|
|
971
|
+
id: z.ZodString;
|
|
972
|
+
/** Human-readable title */
|
|
973
|
+
title: z.ZodString;
|
|
974
|
+
/** Optional description explaining the scenario */
|
|
975
|
+
description: z.ZodOptional<z.ZodString>;
|
|
976
|
+
/** Component ID this scenario belongs to */
|
|
977
|
+
componentId: z.ZodString;
|
|
978
|
+
/** Tags for search and filtering */
|
|
979
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
980
|
+
/** The RenderNode tree that defines the DOM structure */
|
|
981
|
+
render: z.ZodType<RenderNode, z.ZodTypeDef, RenderNode>;
|
|
982
|
+
/** Optional viewport configuration for screenshots */
|
|
983
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
984
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
985
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
986
|
+
}, "strip", z.ZodTypeAny, {
|
|
987
|
+
width?: number | undefined;
|
|
988
|
+
height?: number | undefined;
|
|
989
|
+
}, {
|
|
990
|
+
width?: number | undefined;
|
|
991
|
+
height?: number | undefined;
|
|
992
|
+
}>>;
|
|
993
|
+
/** Optional background color override */
|
|
994
|
+
background: z.ZodOptional<z.ZodString>;
|
|
995
|
+
/** Whether this is the primary scenario (shown first) */
|
|
996
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
997
|
+
}, "strip", z.ZodTypeAny, {
|
|
998
|
+
id: string;
|
|
999
|
+
title: string;
|
|
1000
|
+
componentId: string;
|
|
1001
|
+
render: RenderNode;
|
|
1002
|
+
description?: string | undefined;
|
|
1003
|
+
tags?: string[] | undefined;
|
|
1004
|
+
viewport?: {
|
|
1005
|
+
width?: number | undefined;
|
|
1006
|
+
height?: number | undefined;
|
|
1007
|
+
} | undefined;
|
|
1008
|
+
background?: string | undefined;
|
|
1009
|
+
primary?: boolean | undefined;
|
|
1010
|
+
}, {
|
|
1011
|
+
id: string;
|
|
1012
|
+
title: string;
|
|
1013
|
+
componentId: string;
|
|
1014
|
+
render: RenderNode;
|
|
1015
|
+
description?: string | undefined;
|
|
1016
|
+
tags?: string[] | undefined;
|
|
1017
|
+
viewport?: {
|
|
1018
|
+
width?: number | undefined;
|
|
1019
|
+
height?: number | undefined;
|
|
1020
|
+
} | undefined;
|
|
1021
|
+
background?: string | undefined;
|
|
1022
|
+
primary?: boolean | undefined;
|
|
1023
|
+
}>;
|
|
1024
|
+
|
|
1025
|
+
export declare function formatComponentErrors(errors: Array<{
|
|
1026
|
+
path: string;
|
|
1027
|
+
message: string;
|
|
1028
|
+
}>, filePath?: string): string;
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Format HTML code for display.
|
|
1032
|
+
*/
|
|
1033
|
+
export declare function formatHtml(html: string, indent?: number): string;
|
|
1034
|
+
|
|
1035
|
+
export declare function formatScenarioErrors(errors: Array<{
|
|
1036
|
+
path: string;
|
|
1037
|
+
message: string;
|
|
1038
|
+
}>, filePath?: string): string;
|
|
1039
|
+
|
|
1040
|
+
export declare function formatValidationErrors(result: ValidationResult): string;
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Generate HTML from a RenderNode.
|
|
1044
|
+
*/
|
|
1045
|
+
export declare function generateHtml(node: RenderNode, options?: CodegenOptions): string;
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Generate just the HTML without script tags.
|
|
1049
|
+
*/
|
|
1050
|
+
export declare function generateHtmlOnly(node: RenderNode, options?: Omit<CodegenOptions, 'includeScript'>): string;
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Generate JavaScript code for setting complex properties.
|
|
1054
|
+
*/
|
|
1055
|
+
export declare function generatePropsScript(node: RenderNode, selector: string, options?: {
|
|
1056
|
+
indent?: string;
|
|
1057
|
+
}): string | null;
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Generate all harness URLs for a registry (for Playwright test generation).
|
|
1061
|
+
*/
|
|
1062
|
+
export declare function getAllHarnessUrls(registry: Registry, breakpoints?: Array<{
|
|
1063
|
+
width: number;
|
|
1064
|
+
height: number;
|
|
1065
|
+
}>): Array<{
|
|
1066
|
+
scenarioId: string;
|
|
1067
|
+
componentId: string;
|
|
1068
|
+
url: string;
|
|
1069
|
+
theme: Theme;
|
|
1070
|
+
width?: number;
|
|
1071
|
+
height?: number;
|
|
1072
|
+
}>;
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Group standalone components by category.
|
|
1076
|
+
*/
|
|
1077
|
+
export declare function getComponentsByCategory(registry: Registry): GroupedComponents[];
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Get harness URL for a scenario.
|
|
1081
|
+
*/
|
|
1082
|
+
export declare function getHarnessUrl(scenarioId: string, options?: {
|
|
1083
|
+
theme?: Theme;
|
|
1084
|
+
width?: number;
|
|
1085
|
+
height?: number;
|
|
1086
|
+
background?: string;
|
|
1087
|
+
}): string;
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* Get the initial theme based on localStorage or system preference.
|
|
1091
|
+
*/
|
|
1092
|
+
export declare function getInitialTheme(): Theme;
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* Get all standalone components (not subcomponents).
|
|
1096
|
+
*/
|
|
1097
|
+
export declare function getStandaloneComponents(registry: Registry): RegistryComponent[];
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* Get subcomponents of a component.
|
|
1101
|
+
*/
|
|
1102
|
+
export declare function getSubcomponents(registry: Registry, parentId: string): RegistryComponent[];
|
|
1103
|
+
|
|
1104
|
+
export declare interface GroupedComponents {
|
|
1105
|
+
/** Category definition, or null for uncategorised */
|
|
1106
|
+
category: CategoryDefinition | null;
|
|
1107
|
+
/** Components in this category */
|
|
1108
|
+
components: RegistryComponent[];
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
export declare interface HarnessPageElements {
|
|
1112
|
+
root: HTMLDivElement;
|
|
1113
|
+
container: HTMLDivElement;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
export declare interface HarnessPageOptions {
|
|
1117
|
+
registry: Registry;
|
|
1118
|
+
scenarioId: string;
|
|
1119
|
+
query: URLSearchParams;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Initialize the theme on page load.
|
|
1124
|
+
*/
|
|
1125
|
+
export declare function initTheme(): Theme;
|
|
1126
|
+
|
|
1127
|
+
export declare type JsonControl = z.infer<typeof JsonControlSchema>;
|
|
1128
|
+
|
|
1129
|
+
declare const JsonControlSchema: z.ZodObject<{
|
|
1130
|
+
type: z.ZodLiteral<"json">;
|
|
1131
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1132
|
+
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
1133
|
+
}, "strip", z.ZodTypeAny, {
|
|
1134
|
+
type: "json";
|
|
1135
|
+
label?: string | undefined;
|
|
1136
|
+
defaultValue?: unknown;
|
|
1137
|
+
}, {
|
|
1138
|
+
type: "json";
|
|
1139
|
+
label?: string | undefined;
|
|
1140
|
+
defaultValue?: unknown;
|
|
1141
|
+
}>;
|
|
1142
|
+
|
|
1143
|
+
export declare interface LandingPageElements {
|
|
1144
|
+
root: HTMLDivElement;
|
|
1145
|
+
searchInput: HTMLInputElement;
|
|
1146
|
+
filterContainer: HTMLDivElement;
|
|
1147
|
+
componentList: HTMLDivElement;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
export declare interface LandingPageOptions {
|
|
1151
|
+
registry: Registry;
|
|
1152
|
+
onNavigate: (path: string) => void;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* Parse and validate raw registry data into a typed Registry.
|
|
1157
|
+
*/
|
|
1158
|
+
export declare function loadRegistry(raw: RawRegistryData): LoadResult;
|
|
1159
|
+
|
|
1160
|
+
export declare interface LoadResult {
|
|
1161
|
+
registry: Registry;
|
|
1162
|
+
errors: ValidationError[];
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Mount the catalogue app to the DOM.
|
|
1167
|
+
*/
|
|
1168
|
+
export declare function mountCatalogueApp(selector: string, registry: Registry, options?: Partial<CatalogueAppOptions>): CatalogueApp;
|
|
1169
|
+
|
|
1170
|
+
export declare type NumberControl = z.infer<typeof NumberControlSchema>;
|
|
1171
|
+
|
|
1172
|
+
declare const NumberControlSchema: z.ZodObject<{
|
|
1173
|
+
type: z.ZodLiteral<"number">;
|
|
1174
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1175
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
1176
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
1177
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
1178
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
1179
|
+
}, "strip", z.ZodTypeAny, {
|
|
1180
|
+
type: "number";
|
|
1181
|
+
label?: string | undefined;
|
|
1182
|
+
defaultValue?: number | undefined;
|
|
1183
|
+
min?: number | undefined;
|
|
1184
|
+
max?: number | undefined;
|
|
1185
|
+
step?: number | undefined;
|
|
1186
|
+
}, {
|
|
1187
|
+
type: "number";
|
|
1188
|
+
label?: string | undefined;
|
|
1189
|
+
defaultValue?: number | undefined;
|
|
1190
|
+
min?: number | undefined;
|
|
1191
|
+
max?: number | undefined;
|
|
1192
|
+
step?: number | undefined;
|
|
1193
|
+
}>;
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* Parse route parameters from a URL pattern match.
|
|
1197
|
+
*/
|
|
1198
|
+
export declare function parseRouteParams(pattern: string, path: string): Record<string, string> | null;
|
|
1199
|
+
|
|
1200
|
+
export declare type PlaygroundConfig = z.infer<typeof PlaygroundConfigSchema>;
|
|
1201
|
+
|
|
1202
|
+
export declare const PlaygroundConfigSchema: z.ZodObject<{
|
|
1203
|
+
/** ID of the primary scenario to use as default in playground */
|
|
1204
|
+
primaryScenarioId: z.ZodString;
|
|
1205
|
+
/** Control definitions keyed by property name */
|
|
1206
|
+
controls: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1207
|
+
type: z.ZodLiteral<"text">;
|
|
1208
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1209
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1210
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
1211
|
+
}, "strip", z.ZodTypeAny, {
|
|
1212
|
+
type: "text";
|
|
1213
|
+
label?: string | undefined;
|
|
1214
|
+
defaultValue?: string | undefined;
|
|
1215
|
+
placeholder?: string | undefined;
|
|
1216
|
+
}, {
|
|
1217
|
+
type: "text";
|
|
1218
|
+
label?: string | undefined;
|
|
1219
|
+
defaultValue?: string | undefined;
|
|
1220
|
+
placeholder?: string | undefined;
|
|
1221
|
+
}>, z.ZodObject<{
|
|
1222
|
+
type: z.ZodLiteral<"number">;
|
|
1223
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1224
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
1225
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
1226
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
1227
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
1228
|
+
}, "strip", z.ZodTypeAny, {
|
|
1229
|
+
type: "number";
|
|
1230
|
+
label?: string | undefined;
|
|
1231
|
+
defaultValue?: number | undefined;
|
|
1232
|
+
min?: number | undefined;
|
|
1233
|
+
max?: number | undefined;
|
|
1234
|
+
step?: number | undefined;
|
|
1235
|
+
}, {
|
|
1236
|
+
type: "number";
|
|
1237
|
+
label?: string | undefined;
|
|
1238
|
+
defaultValue?: number | undefined;
|
|
1239
|
+
min?: number | undefined;
|
|
1240
|
+
max?: number | undefined;
|
|
1241
|
+
step?: number | undefined;
|
|
1242
|
+
}>, z.ZodObject<{
|
|
1243
|
+
type: z.ZodLiteral<"boolean">;
|
|
1244
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1245
|
+
defaultValue: z.ZodOptional<z.ZodBoolean>;
|
|
1246
|
+
}, "strip", z.ZodTypeAny, {
|
|
1247
|
+
type: "boolean";
|
|
1248
|
+
label?: string | undefined;
|
|
1249
|
+
defaultValue?: boolean | undefined;
|
|
1250
|
+
}, {
|
|
1251
|
+
type: "boolean";
|
|
1252
|
+
label?: string | undefined;
|
|
1253
|
+
defaultValue?: boolean | undefined;
|
|
1254
|
+
}>, z.ZodObject<{
|
|
1255
|
+
type: z.ZodLiteral<"select">;
|
|
1256
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1257
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1258
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1259
|
+
label: z.ZodString;
|
|
1260
|
+
value: z.ZodString;
|
|
1261
|
+
}, "strip", z.ZodTypeAny, {
|
|
1262
|
+
value: string;
|
|
1263
|
+
label: string;
|
|
1264
|
+
}, {
|
|
1265
|
+
value: string;
|
|
1266
|
+
label: string;
|
|
1267
|
+
}>]>, "many">;
|
|
1268
|
+
}, "strip", z.ZodTypeAny, {
|
|
1269
|
+
options: (string | {
|
|
1270
|
+
value: string;
|
|
1271
|
+
label: string;
|
|
1272
|
+
})[];
|
|
1273
|
+
type: "select";
|
|
1274
|
+
label?: string | undefined;
|
|
1275
|
+
defaultValue?: string | undefined;
|
|
1276
|
+
}, {
|
|
1277
|
+
options: (string | {
|
|
1278
|
+
value: string;
|
|
1279
|
+
label: string;
|
|
1280
|
+
})[];
|
|
1281
|
+
type: "select";
|
|
1282
|
+
label?: string | undefined;
|
|
1283
|
+
defaultValue?: string | undefined;
|
|
1284
|
+
}>, z.ZodObject<{
|
|
1285
|
+
type: z.ZodLiteral<"radio">;
|
|
1286
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1287
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1288
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1289
|
+
label: z.ZodString;
|
|
1290
|
+
value: z.ZodString;
|
|
1291
|
+
}, "strip", z.ZodTypeAny, {
|
|
1292
|
+
value: string;
|
|
1293
|
+
label: string;
|
|
1294
|
+
}, {
|
|
1295
|
+
value: string;
|
|
1296
|
+
label: string;
|
|
1297
|
+
}>]>, "many">;
|
|
1298
|
+
}, "strip", z.ZodTypeAny, {
|
|
1299
|
+
options: (string | {
|
|
1300
|
+
value: string;
|
|
1301
|
+
label: string;
|
|
1302
|
+
})[];
|
|
1303
|
+
type: "radio";
|
|
1304
|
+
label?: string | undefined;
|
|
1305
|
+
defaultValue?: string | undefined;
|
|
1306
|
+
}, {
|
|
1307
|
+
options: (string | {
|
|
1308
|
+
value: string;
|
|
1309
|
+
label: string;
|
|
1310
|
+
})[];
|
|
1311
|
+
type: "radio";
|
|
1312
|
+
label?: string | undefined;
|
|
1313
|
+
defaultValue?: string | undefined;
|
|
1314
|
+
}>, z.ZodObject<{
|
|
1315
|
+
type: z.ZodLiteral<"color">;
|
|
1316
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1317
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1318
|
+
}, "strip", z.ZodTypeAny, {
|
|
1319
|
+
type: "color";
|
|
1320
|
+
label?: string | undefined;
|
|
1321
|
+
defaultValue?: string | undefined;
|
|
1322
|
+
}, {
|
|
1323
|
+
type: "color";
|
|
1324
|
+
label?: string | undefined;
|
|
1325
|
+
defaultValue?: string | undefined;
|
|
1326
|
+
}>, z.ZodObject<{
|
|
1327
|
+
type: z.ZodLiteral<"range">;
|
|
1328
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1329
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
1330
|
+
min: z.ZodNumber;
|
|
1331
|
+
max: z.ZodNumber;
|
|
1332
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
1333
|
+
}, "strip", z.ZodTypeAny, {
|
|
1334
|
+
type: "range";
|
|
1335
|
+
min: number;
|
|
1336
|
+
max: number;
|
|
1337
|
+
label?: string | undefined;
|
|
1338
|
+
defaultValue?: number | undefined;
|
|
1339
|
+
step?: number | undefined;
|
|
1340
|
+
}, {
|
|
1341
|
+
type: "range";
|
|
1342
|
+
min: number;
|
|
1343
|
+
max: number;
|
|
1344
|
+
label?: string | undefined;
|
|
1345
|
+
defaultValue?: number | undefined;
|
|
1346
|
+
step?: number | undefined;
|
|
1347
|
+
}>, z.ZodObject<{
|
|
1348
|
+
type: z.ZodLiteral<"json">;
|
|
1349
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1350
|
+
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
1351
|
+
}, "strip", z.ZodTypeAny, {
|
|
1352
|
+
type: "json";
|
|
1353
|
+
label?: string | undefined;
|
|
1354
|
+
defaultValue?: unknown;
|
|
1355
|
+
}, {
|
|
1356
|
+
type: "json";
|
|
1357
|
+
label?: string | undefined;
|
|
1358
|
+
defaultValue?: unknown;
|
|
1359
|
+
}>]>>;
|
|
1360
|
+
}, "strip", z.ZodTypeAny, {
|
|
1361
|
+
primaryScenarioId: string;
|
|
1362
|
+
controls: Record<string, {
|
|
1363
|
+
type: "text";
|
|
1364
|
+
label?: string | undefined;
|
|
1365
|
+
defaultValue?: string | undefined;
|
|
1366
|
+
placeholder?: string | undefined;
|
|
1367
|
+
} | {
|
|
1368
|
+
type: "number";
|
|
1369
|
+
label?: string | undefined;
|
|
1370
|
+
defaultValue?: number | undefined;
|
|
1371
|
+
min?: number | undefined;
|
|
1372
|
+
max?: number | undefined;
|
|
1373
|
+
step?: number | undefined;
|
|
1374
|
+
} | {
|
|
1375
|
+
type: "boolean";
|
|
1376
|
+
label?: string | undefined;
|
|
1377
|
+
defaultValue?: boolean | undefined;
|
|
1378
|
+
} | {
|
|
1379
|
+
options: (string | {
|
|
1380
|
+
value: string;
|
|
1381
|
+
label: string;
|
|
1382
|
+
})[];
|
|
1383
|
+
type: "select";
|
|
1384
|
+
label?: string | undefined;
|
|
1385
|
+
defaultValue?: string | undefined;
|
|
1386
|
+
} | {
|
|
1387
|
+
options: (string | {
|
|
1388
|
+
value: string;
|
|
1389
|
+
label: string;
|
|
1390
|
+
})[];
|
|
1391
|
+
type: "radio";
|
|
1392
|
+
label?: string | undefined;
|
|
1393
|
+
defaultValue?: string | undefined;
|
|
1394
|
+
} | {
|
|
1395
|
+
type: "color";
|
|
1396
|
+
label?: string | undefined;
|
|
1397
|
+
defaultValue?: string | undefined;
|
|
1398
|
+
} | {
|
|
1399
|
+
type: "range";
|
|
1400
|
+
min: number;
|
|
1401
|
+
max: number;
|
|
1402
|
+
label?: string | undefined;
|
|
1403
|
+
defaultValue?: number | undefined;
|
|
1404
|
+
step?: number | undefined;
|
|
1405
|
+
} | {
|
|
1406
|
+
type: "json";
|
|
1407
|
+
label?: string | undefined;
|
|
1408
|
+
defaultValue?: unknown;
|
|
1409
|
+
}>;
|
|
1410
|
+
}, {
|
|
1411
|
+
primaryScenarioId: string;
|
|
1412
|
+
controls: Record<string, {
|
|
1413
|
+
type: "text";
|
|
1414
|
+
label?: string | undefined;
|
|
1415
|
+
defaultValue?: string | undefined;
|
|
1416
|
+
placeholder?: string | undefined;
|
|
1417
|
+
} | {
|
|
1418
|
+
type: "number";
|
|
1419
|
+
label?: string | undefined;
|
|
1420
|
+
defaultValue?: number | undefined;
|
|
1421
|
+
min?: number | undefined;
|
|
1422
|
+
max?: number | undefined;
|
|
1423
|
+
step?: number | undefined;
|
|
1424
|
+
} | {
|
|
1425
|
+
type: "boolean";
|
|
1426
|
+
label?: string | undefined;
|
|
1427
|
+
defaultValue?: boolean | undefined;
|
|
1428
|
+
} | {
|
|
1429
|
+
options: (string | {
|
|
1430
|
+
value: string;
|
|
1431
|
+
label: string;
|
|
1432
|
+
})[];
|
|
1433
|
+
type: "select";
|
|
1434
|
+
label?: string | undefined;
|
|
1435
|
+
defaultValue?: string | undefined;
|
|
1436
|
+
} | {
|
|
1437
|
+
options: (string | {
|
|
1438
|
+
value: string;
|
|
1439
|
+
label: string;
|
|
1440
|
+
})[];
|
|
1441
|
+
type: "radio";
|
|
1442
|
+
label?: string | undefined;
|
|
1443
|
+
defaultValue?: string | undefined;
|
|
1444
|
+
} | {
|
|
1445
|
+
type: "color";
|
|
1446
|
+
label?: string | undefined;
|
|
1447
|
+
defaultValue?: string | undefined;
|
|
1448
|
+
} | {
|
|
1449
|
+
type: "range";
|
|
1450
|
+
min: number;
|
|
1451
|
+
max: number;
|
|
1452
|
+
label?: string | undefined;
|
|
1453
|
+
defaultValue?: number | undefined;
|
|
1454
|
+
step?: number | undefined;
|
|
1455
|
+
} | {
|
|
1456
|
+
type: "json";
|
|
1457
|
+
label?: string | undefined;
|
|
1458
|
+
defaultValue?: unknown;
|
|
1459
|
+
}>;
|
|
1460
|
+
}>;
|
|
1461
|
+
|
|
1462
|
+
export declare interface PlaygroundPageElements {
|
|
1463
|
+
root: HTMLDivElement;
|
|
1464
|
+
preview: HTMLDivElement;
|
|
1465
|
+
controls: HTMLDivElement;
|
|
1466
|
+
codePanel: HTMLDivElement;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
export declare interface PlaygroundPageOptions {
|
|
1470
|
+
registry: Registry;
|
|
1471
|
+
componentId: string;
|
|
1472
|
+
onNavigate: (path: string) => void;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
export declare type RadioControl = z.infer<typeof RadioControlSchema>;
|
|
1476
|
+
|
|
1477
|
+
declare const RadioControlSchema: z.ZodObject<{
|
|
1478
|
+
type: z.ZodLiteral<"radio">;
|
|
1479
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1480
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1481
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1482
|
+
label: z.ZodString;
|
|
1483
|
+
value: z.ZodString;
|
|
1484
|
+
}, "strip", z.ZodTypeAny, {
|
|
1485
|
+
value: string;
|
|
1486
|
+
label: string;
|
|
1487
|
+
}, {
|
|
1488
|
+
value: string;
|
|
1489
|
+
label: string;
|
|
1490
|
+
}>]>, "many">;
|
|
1491
|
+
}, "strip", z.ZodTypeAny, {
|
|
1492
|
+
options: (string | {
|
|
1493
|
+
value: string;
|
|
1494
|
+
label: string;
|
|
1495
|
+
})[];
|
|
1496
|
+
type: "radio";
|
|
1497
|
+
label?: string | undefined;
|
|
1498
|
+
defaultValue?: string | undefined;
|
|
1499
|
+
}, {
|
|
1500
|
+
options: (string | {
|
|
1501
|
+
value: string;
|
|
1502
|
+
label: string;
|
|
1503
|
+
})[];
|
|
1504
|
+
type: "radio";
|
|
1505
|
+
label?: string | undefined;
|
|
1506
|
+
defaultValue?: string | undefined;
|
|
1507
|
+
}>;
|
|
1508
|
+
|
|
1509
|
+
export declare type RangeControl = z.infer<typeof RangeControlSchema>;
|
|
1510
|
+
|
|
1511
|
+
declare const RangeControlSchema: z.ZodObject<{
|
|
1512
|
+
type: z.ZodLiteral<"range">;
|
|
1513
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1514
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
1515
|
+
min: z.ZodNumber;
|
|
1516
|
+
max: z.ZodNumber;
|
|
1517
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
1518
|
+
}, "strip", z.ZodTypeAny, {
|
|
1519
|
+
type: "range";
|
|
1520
|
+
min: number;
|
|
1521
|
+
max: number;
|
|
1522
|
+
label?: string | undefined;
|
|
1523
|
+
defaultValue?: number | undefined;
|
|
1524
|
+
step?: number | undefined;
|
|
1525
|
+
}, {
|
|
1526
|
+
type: "range";
|
|
1527
|
+
min: number;
|
|
1528
|
+
max: number;
|
|
1529
|
+
label?: string | undefined;
|
|
1530
|
+
defaultValue?: number | undefined;
|
|
1531
|
+
step?: number | undefined;
|
|
1532
|
+
}>;
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* Registry loader for the component catalogue.
|
|
1536
|
+
* Handles loading and parsing registry data in both dev and build modes.
|
|
1537
|
+
*/
|
|
1538
|
+
export declare interface RawRegistryData {
|
|
1539
|
+
components: Array<{
|
|
1540
|
+
filePath: string;
|
|
1541
|
+
data: unknown;
|
|
1542
|
+
docs?: string;
|
|
1543
|
+
}>;
|
|
1544
|
+
scenarios: Array<{
|
|
1545
|
+
filePath: string;
|
|
1546
|
+
data: unknown;
|
|
1547
|
+
}>;
|
|
1548
|
+
examples: Array<{
|
|
1549
|
+
filePath: string;
|
|
1550
|
+
data: unknown;
|
|
1551
|
+
}>;
|
|
1552
|
+
categories?: CategoriesConfig;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
export declare interface Registry {
|
|
1556
|
+
/** All components indexed by ID */
|
|
1557
|
+
components: Map<string, RegistryComponent>;
|
|
1558
|
+
/** All scenarios indexed by ID */
|
|
1559
|
+
scenarios: Map<string, RegistryScenario>;
|
|
1560
|
+
/** All examples indexed by ID */
|
|
1561
|
+
examples: Map<string, RegistryExample>;
|
|
1562
|
+
/** Category configuration */
|
|
1563
|
+
categories: CategoriesConfig;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
export declare interface RegistryComponent extends Component {
|
|
1567
|
+
/** Path to the component.json file */
|
|
1568
|
+
filePath: string;
|
|
1569
|
+
/** Parsed docs.md content (if exists) */
|
|
1570
|
+
docs?: string;
|
|
1571
|
+
/** Scenarios for this component */
|
|
1572
|
+
scenarios: RegistryScenario[];
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
export declare interface RegistryExample extends Scenario {
|
|
1576
|
+
/** Path to the example.json file */
|
|
1577
|
+
filePath: string;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
export declare interface RegistryLoader {
|
|
1581
|
+
load(): Promise<Registry>;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
export declare interface RegistryScenario extends Scenario {
|
|
1585
|
+
/** Path to the scenario.json file */
|
|
1586
|
+
filePath: string;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
/**
|
|
1590
|
+
* Render a RenderNode tree into a container.
|
|
1591
|
+
*/
|
|
1592
|
+
export declare function render(node: RenderNode, options: RenderOptions): RenderResult;
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* Render the component page into a container.
|
|
1596
|
+
*/
|
|
1597
|
+
export declare function renderComponentPage(container: HTMLElement, options: ComponentPageOptions): ComponentPageElements | null;
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Render the harness page into a container.
|
|
1601
|
+
*/
|
|
1602
|
+
export declare function renderHarnessPage(container: HTMLElement, options: HarnessPageOptions): HarnessPageElements | null;
|
|
1603
|
+
|
|
1604
|
+
/**
|
|
1605
|
+
* Render the landing page into a container.
|
|
1606
|
+
*/
|
|
1607
|
+
export declare function renderLandingPage(container: HTMLElement, options: LandingPageOptions): LandingPageElements;
|
|
1608
|
+
|
|
1609
|
+
declare interface RenderNode {
|
|
1610
|
+
element: string;
|
|
1611
|
+
attrs?: Record<string, string | number | boolean | null>;
|
|
1612
|
+
props?: Record<string, unknown>;
|
|
1613
|
+
slots?: Record<string, string | RenderNode | RenderNode[]>;
|
|
1614
|
+
children?: RenderNode[];
|
|
1615
|
+
text?: string;
|
|
1616
|
+
}
|
|
1617
|
+
export { RenderNode }
|
|
1618
|
+
export { RenderNode as RenderNodeType }
|
|
1619
|
+
|
|
1620
|
+
/**
|
|
1621
|
+
* Render a single RenderNode to a DOM element.
|
|
1622
|
+
*/
|
|
1623
|
+
export declare function renderNode(node: RenderNode): Element;
|
|
1624
|
+
|
|
1625
|
+
export declare const RenderNodeSchema: z.ZodType<RenderNode>;
|
|
1626
|
+
|
|
1627
|
+
/**
|
|
1628
|
+
* RenderNode → DOM renderer.
|
|
1629
|
+
* Converts declarative RenderNode trees into actual DOM elements.
|
|
1630
|
+
*/
|
|
1631
|
+
export declare interface RenderOptions {
|
|
1632
|
+
/** Container element to render into */
|
|
1633
|
+
container: Element;
|
|
1634
|
+
/** Whether to clear the container before rendering */
|
|
1635
|
+
clear?: boolean;
|
|
1636
|
+
/** Callback when an error occurs */
|
|
1637
|
+
onError?: (error: Error, node: RenderNode) => void;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* Render the playground page into a container.
|
|
1642
|
+
*/
|
|
1643
|
+
export declare function renderPlaygroundPage(container: HTMLElement, options: PlaygroundPageOptions): PlaygroundPageElements | null;
|
|
1644
|
+
|
|
1645
|
+
export declare interface RenderResult {
|
|
1646
|
+
/** The root element that was created */
|
|
1647
|
+
element: Element;
|
|
1648
|
+
/** Any errors that occurred during rendering */
|
|
1649
|
+
errors: Array<{
|
|
1650
|
+
node: RenderNode;
|
|
1651
|
+
error: Error;
|
|
1652
|
+
}>;
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
export declare interface ResizerElements {
|
|
1656
|
+
wrapper: HTMLDivElement;
|
|
1657
|
+
container: HTMLDivElement;
|
|
1658
|
+
content: HTMLDivElement;
|
|
1659
|
+
handleRight: HTMLDivElement;
|
|
1660
|
+
handleBottom: HTMLDivElement;
|
|
1661
|
+
handleCorner: HTMLDivElement;
|
|
1662
|
+
dimensionLabel: HTMLDivElement;
|
|
1663
|
+
/** Set dimensions with optional animation */
|
|
1664
|
+
setSize: (width: number | 'full', height: number | 'full', animate?: boolean) => void;
|
|
1665
|
+
/** Check if currently in full screen mode */
|
|
1666
|
+
isFullScreen: () => boolean;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* Resizable container component for playground and harness views.
|
|
1671
|
+
* Supports drag-to-resize with dimension display and breakpoint presets.
|
|
1672
|
+
*/
|
|
1673
|
+
export declare interface ResizerOptions {
|
|
1674
|
+
/** Initial width (CSS value) */
|
|
1675
|
+
initialWidth?: string;
|
|
1676
|
+
/** Initial height (CSS value) */
|
|
1677
|
+
initialHeight?: string;
|
|
1678
|
+
/** Minimum width in pixels */
|
|
1679
|
+
minWidth?: number;
|
|
1680
|
+
/** Minimum height in pixels */
|
|
1681
|
+
minHeight?: number;
|
|
1682
|
+
/** Maximum width in pixels */
|
|
1683
|
+
maxWidth?: number;
|
|
1684
|
+
/** Maximum height in pixels */
|
|
1685
|
+
maxHeight?: number;
|
|
1686
|
+
/** Callback when dimensions change */
|
|
1687
|
+
onResize?: (width: number, height: number) => void;
|
|
1688
|
+
/** Callback when full screen mode changes */
|
|
1689
|
+
onFullScreenChange?: (isFullScreen: boolean) => void;
|
|
1690
|
+
/** Enable smooth transitions for preset changes */
|
|
1691
|
+
animatePresets?: boolean;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* Client-side router for the catalogue app.
|
|
1696
|
+
* Handles hash-based routing for simplicity and static hosting compatibility.
|
|
1697
|
+
*/
|
|
1698
|
+
export declare interface Route {
|
|
1699
|
+
pattern: RegExp;
|
|
1700
|
+
handler: (params: Record<string, string>, query: URLSearchParams) => void;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
export declare class Router {
|
|
1704
|
+
private routes;
|
|
1705
|
+
private options;
|
|
1706
|
+
constructor(options: RouterOptions);
|
|
1707
|
+
/**
|
|
1708
|
+
* Add a route.
|
|
1709
|
+
*/
|
|
1710
|
+
route(pattern: string, handler: Route['handler']): this;
|
|
1711
|
+
/**
|
|
1712
|
+
* Navigate to a path.
|
|
1713
|
+
*/
|
|
1714
|
+
navigate(path: string): void;
|
|
1715
|
+
/**
|
|
1716
|
+
* Get current path from hash.
|
|
1717
|
+
*/
|
|
1718
|
+
getCurrentPath(): string;
|
|
1719
|
+
/**
|
|
1720
|
+
* Get query parameters from current URL.
|
|
1721
|
+
*/
|
|
1722
|
+
getQueryParams(): URLSearchParams;
|
|
1723
|
+
/**
|
|
1724
|
+
* Resolve the current route.
|
|
1725
|
+
*/
|
|
1726
|
+
resolve(): void;
|
|
1727
|
+
/**
|
|
1728
|
+
* Start listening for route changes.
|
|
1729
|
+
*/
|
|
1730
|
+
private setupListeners;
|
|
1731
|
+
/**
|
|
1732
|
+
* Manually trigger route resolution.
|
|
1733
|
+
*/
|
|
1734
|
+
start(): void;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
export declare interface RouterOptions {
|
|
1738
|
+
/** Base path for the application */
|
|
1739
|
+
basePath?: string;
|
|
1740
|
+
/** Root element to render into */
|
|
1741
|
+
root: HTMLElement;
|
|
1742
|
+
/** Called when no route matches */
|
|
1743
|
+
onNotFound?: (path: string) => void;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
export declare type Scenario = z.infer<typeof ScenarioSchema>;
|
|
1747
|
+
|
|
1748
|
+
/**
|
|
1749
|
+
* Scenario schema defines the structure of a scenario.json file.
|
|
1750
|
+
* Scenarios define specific component configurations for documentation,
|
|
1751
|
+
* testing, and the catalogue UI.
|
|
1752
|
+
*
|
|
1753
|
+
* This schema is also used for example.json files, which have identical structure.
|
|
1754
|
+
*/
|
|
1755
|
+
export declare const ScenarioSchema: z.ZodObject<{
|
|
1756
|
+
/** Unique identifier for the scenario (kebab-case) */
|
|
1757
|
+
id: z.ZodString;
|
|
1758
|
+
/** Human-readable title */
|
|
1759
|
+
title: z.ZodString;
|
|
1760
|
+
/** Optional description explaining the scenario */
|
|
1761
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1762
|
+
/** Component ID this scenario belongs to */
|
|
1763
|
+
componentId: z.ZodString;
|
|
1764
|
+
/** Tags for search and filtering */
|
|
1765
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1766
|
+
/** The RenderNode tree that defines the DOM structure */
|
|
1767
|
+
render: z.ZodType<RenderNode, z.ZodTypeDef, RenderNode>;
|
|
1768
|
+
/** Optional viewport configuration for screenshots */
|
|
1769
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
1770
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
1771
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
1772
|
+
}, "strip", z.ZodTypeAny, {
|
|
1773
|
+
width?: number | undefined;
|
|
1774
|
+
height?: number | undefined;
|
|
1775
|
+
}, {
|
|
1776
|
+
width?: number | undefined;
|
|
1777
|
+
height?: number | undefined;
|
|
1778
|
+
}>>;
|
|
1779
|
+
/** Optional background color override */
|
|
1780
|
+
background: z.ZodOptional<z.ZodString>;
|
|
1781
|
+
/** Whether this is the primary scenario (shown first) */
|
|
1782
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
1783
|
+
}, "strip", z.ZodTypeAny, {
|
|
1784
|
+
id: string;
|
|
1785
|
+
title: string;
|
|
1786
|
+
componentId: string;
|
|
1787
|
+
render: RenderNode;
|
|
1788
|
+
description?: string | undefined;
|
|
1789
|
+
tags?: string[] | undefined;
|
|
1790
|
+
viewport?: {
|
|
1791
|
+
width?: number | undefined;
|
|
1792
|
+
height?: number | undefined;
|
|
1793
|
+
} | undefined;
|
|
1794
|
+
background?: string | undefined;
|
|
1795
|
+
primary?: boolean | undefined;
|
|
1796
|
+
}, {
|
|
1797
|
+
id: string;
|
|
1798
|
+
title: string;
|
|
1799
|
+
componentId: string;
|
|
1800
|
+
render: RenderNode;
|
|
1801
|
+
description?: string | undefined;
|
|
1802
|
+
tags?: string[] | undefined;
|
|
1803
|
+
viewport?: {
|
|
1804
|
+
width?: number | undefined;
|
|
1805
|
+
height?: number | undefined;
|
|
1806
|
+
} | undefined;
|
|
1807
|
+
background?: string | undefined;
|
|
1808
|
+
primary?: boolean | undefined;
|
|
1809
|
+
}>;
|
|
1810
|
+
|
|
1811
|
+
export declare interface ScenarioValidationResult {
|
|
1812
|
+
success: boolean;
|
|
1813
|
+
data?: Scenario;
|
|
1814
|
+
errors?: Array<{
|
|
1815
|
+
path: string;
|
|
1816
|
+
message: string;
|
|
1817
|
+
}>;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
/**
|
|
1821
|
+
* Search components by query.
|
|
1822
|
+
*/
|
|
1823
|
+
export declare function searchComponents(registry: Registry, query: string, filters?: {
|
|
1824
|
+
status?: string[];
|
|
1825
|
+
kind?: string[];
|
|
1826
|
+
tags?: string[];
|
|
1827
|
+
}): RegistryComponent[];
|
|
1828
|
+
|
|
1829
|
+
export declare type SelectControl = z.infer<typeof SelectControlSchema>;
|
|
1830
|
+
|
|
1831
|
+
declare const SelectControlSchema: z.ZodObject<{
|
|
1832
|
+
type: z.ZodLiteral<"select">;
|
|
1833
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1834
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1835
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1836
|
+
label: z.ZodString;
|
|
1837
|
+
value: z.ZodString;
|
|
1838
|
+
}, "strip", z.ZodTypeAny, {
|
|
1839
|
+
value: string;
|
|
1840
|
+
label: string;
|
|
1841
|
+
}, {
|
|
1842
|
+
value: string;
|
|
1843
|
+
label: string;
|
|
1844
|
+
}>]>, "many">;
|
|
1845
|
+
}, "strip", z.ZodTypeAny, {
|
|
1846
|
+
options: (string | {
|
|
1847
|
+
value: string;
|
|
1848
|
+
label: string;
|
|
1849
|
+
})[];
|
|
1850
|
+
type: "select";
|
|
1851
|
+
label?: string | undefined;
|
|
1852
|
+
defaultValue?: string | undefined;
|
|
1853
|
+
}, {
|
|
1854
|
+
options: (string | {
|
|
1855
|
+
value: string;
|
|
1856
|
+
label: string;
|
|
1857
|
+
})[];
|
|
1858
|
+
type: "select";
|
|
1859
|
+
label?: string | undefined;
|
|
1860
|
+
defaultValue?: string | undefined;
|
|
1861
|
+
}>;
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* Set specific dimensions on a resizer.
|
|
1865
|
+
*/
|
|
1866
|
+
export declare function setResizerDimensions(resizer: ResizerElements, width: number | 'full', height: number | 'full', animate?: boolean): void;
|
|
1867
|
+
|
|
1868
|
+
/**
|
|
1869
|
+
* Set the theme and persist to localStorage.
|
|
1870
|
+
*/
|
|
1871
|
+
export declare function setTheme(theme: Theme): void;
|
|
1872
|
+
|
|
1873
|
+
export declare type TextControl = z.infer<typeof TextControlSchema>;
|
|
1874
|
+
|
|
1875
|
+
/**
|
|
1876
|
+
* ControlSpec defines the type and configuration of playground controls
|
|
1877
|
+
* that allow users to interactively modify component properties.
|
|
1878
|
+
*/
|
|
1879
|
+
declare const TextControlSchema: z.ZodObject<{
|
|
1880
|
+
type: z.ZodLiteral<"text">;
|
|
1881
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1882
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
1883
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
1884
|
+
}, "strip", z.ZodTypeAny, {
|
|
1885
|
+
type: "text";
|
|
1886
|
+
label?: string | undefined;
|
|
1887
|
+
defaultValue?: string | undefined;
|
|
1888
|
+
placeholder?: string | undefined;
|
|
1889
|
+
}, {
|
|
1890
|
+
type: "text";
|
|
1891
|
+
label?: string | undefined;
|
|
1892
|
+
defaultValue?: string | undefined;
|
|
1893
|
+
placeholder?: string | undefined;
|
|
1894
|
+
}>;
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* Theme toggle component for light/dark mode switching.
|
|
1898
|
+
* Persists preference to localStorage and respects system preference.
|
|
1899
|
+
*/
|
|
1900
|
+
export declare type Theme = 'light' | 'dark';
|
|
1901
|
+
|
|
1902
|
+
/**
|
|
1903
|
+
* Toggle between light and dark themes.
|
|
1904
|
+
*/
|
|
1905
|
+
export declare function toggleTheme(): Theme;
|
|
1906
|
+
|
|
1907
|
+
/**
|
|
1908
|
+
* Update the code content in a code panel.
|
|
1909
|
+
*/
|
|
1910
|
+
export declare function updateCodePanel(panel: CodePanelElements, code: string): void;
|
|
1911
|
+
|
|
1912
|
+
/**
|
|
1913
|
+
* Update an existing element with new properties.
|
|
1914
|
+
* Used for live playground updates.
|
|
1915
|
+
*/
|
|
1916
|
+
export declare function updateElement(element: Element, attrs?: Record<string, string | number | boolean | null>, props?: Record<string, unknown>): void;
|
|
1917
|
+
|
|
1918
|
+
export declare function validateComponent(data: unknown): ComponentValidationResult;
|
|
1919
|
+
|
|
1920
|
+
export declare function validateControlSpec(data: unknown): {
|
|
1921
|
+
success: true;
|
|
1922
|
+
data: ControlSpec;
|
|
1923
|
+
} | {
|
|
1924
|
+
success: false;
|
|
1925
|
+
errors: string[];
|
|
1926
|
+
};
|
|
1927
|
+
|
|
1928
|
+
export declare function validateExample(data: unknown): ScenarioValidationResult;
|
|
1929
|
+
|
|
1930
|
+
/**
|
|
1931
|
+
* Cross-reference validator for the component registry.
|
|
1932
|
+
* Validates relationships between components, scenarios, and examples.
|
|
1933
|
+
*/
|
|
1934
|
+
export declare function validateRegistry(registry: Registry): ValidationResult;
|
|
1935
|
+
|
|
1936
|
+
export declare function validateRenderNode(data: unknown): {
|
|
1937
|
+
success: true;
|
|
1938
|
+
data: RenderNode;
|
|
1939
|
+
} | {
|
|
1940
|
+
success: false;
|
|
1941
|
+
errors: string[];
|
|
1942
|
+
};
|
|
1943
|
+
|
|
1944
|
+
export declare function validateScenario(data: unknown): ScenarioValidationResult;
|
|
1945
|
+
|
|
1946
|
+
export declare interface ValidationError {
|
|
1947
|
+
file: string;
|
|
1948
|
+
path: string;
|
|
1949
|
+
message: string;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
export declare interface ValidationResult {
|
|
1953
|
+
valid: boolean;
|
|
1954
|
+
errors: ValidationError[];
|
|
1955
|
+
warnings: ValidationError[];
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
export { }
|