@uniformdev/canvas 16.2.3 → 17.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.
@@ -0,0 +1,1155 @@
1
+ import Pusher from 'pusher-js';
2
+
3
+ /**
4
+ * This file was auto-generated by openapi-typescript.
5
+ * Do not make direct changes to the file.
6
+ */
7
+ interface paths$1 {
8
+ "/api/v1/canvas-definitions": {
9
+ get: {
10
+ parameters: {
11
+ query: {
12
+ /** The project ID to get component definitions for. */
13
+ projectId: string;
14
+ /** Limit list to one result by ID (response remains an array). */
15
+ componentId?: string;
16
+ /** Number of records to skip */
17
+ offset?: number;
18
+ /** Max number of records to return */
19
+ limit?: number;
20
+ /** Whether to fetch system meta-component definitions (personalize, test, etc) */
21
+ includeSystem?: boolean;
22
+ };
23
+ };
24
+ responses: {
25
+ /** OK */
26
+ 200: {
27
+ content: {
28
+ "application/json": {
29
+ /** @description Component definitions that match the query */
30
+ componentDefinitions: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinition"][];
31
+ };
32
+ };
33
+ };
34
+ 400: external$1["swagger.yml"]["components"]["responses"]["BadRequestError"];
35
+ 401: external$1["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
36
+ 403: external$1["swagger.yml"]["components"]["responses"]["ForbiddenError"];
37
+ 429: external$1["swagger.yml"]["components"]["responses"]["RateLimitError"];
38
+ 500: external$1["swagger.yml"]["components"]["responses"]["InternalServerError"];
39
+ };
40
+ };
41
+ /** Upserts a component definition */
42
+ put: {
43
+ responses: {
44
+ /** OK */
45
+ 204: never;
46
+ 400: external$1["swagger.yml"]["components"]["responses"]["BadRequestError"];
47
+ 401: external$1["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
48
+ 403: external$1["swagger.yml"]["components"]["responses"]["ForbiddenError"];
49
+ 429: external$1["swagger.yml"]["components"]["responses"]["RateLimitError"];
50
+ 500: external$1["swagger.yml"]["components"]["responses"]["InternalServerError"];
51
+ };
52
+ requestBody: {
53
+ content: {
54
+ "application/json": {
55
+ /**
56
+ * Format: uuid
57
+ * @description The project ID to upsert the component definition to
58
+ */
59
+ projectId: string;
60
+ componentDefinition: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinition"];
61
+ };
62
+ };
63
+ };
64
+ };
65
+ /** Deletes a component definition */
66
+ delete: {
67
+ responses: {
68
+ /** OK */
69
+ 204: never;
70
+ 400: external$1["swagger.yml"]["components"]["responses"]["BadRequestError"];
71
+ 401: external$1["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
72
+ 403: external$1["swagger.yml"]["components"]["responses"]["ForbiddenError"];
73
+ 429: external$1["swagger.yml"]["components"]["responses"]["RateLimitError"];
74
+ 500: external$1["swagger.yml"]["components"]["responses"]["InternalServerError"];
75
+ };
76
+ requestBody: {
77
+ content: {
78
+ "application/json": {
79
+ /** @description The public ID of the component definition to delete */
80
+ componentId: string;
81
+ /**
82
+ * Format: uuid
83
+ * @description The ID of the project the composition to delete belongs to
84
+ */
85
+ projectId: string;
86
+ };
87
+ };
88
+ };
89
+ };
90
+ /** Handles preflight requests. This endpoint allows CORS. */
91
+ options: {
92
+ responses: {
93
+ /** OK */
94
+ 204: never;
95
+ };
96
+ };
97
+ };
98
+ }
99
+ interface external$1 {
100
+ "swagger.yml": {
101
+ paths: {};
102
+ components: {
103
+ schemas: {
104
+ Error: {
105
+ /** @description Error message(s) that occurred while processing the request */
106
+ errorMessage?: string[] | string;
107
+ };
108
+ };
109
+ responses: {
110
+ /** Request input validation failed */
111
+ BadRequestError: {
112
+ content: {
113
+ "application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
114
+ };
115
+ };
116
+ /** API key or token was not valid */
117
+ UnauthorizedError: {
118
+ content: {
119
+ "application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
120
+ };
121
+ };
122
+ /** Permission was denied */
123
+ ForbiddenError: {
124
+ content: {
125
+ "application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
126
+ };
127
+ };
128
+ /** Resource not found */
129
+ NotFoundError: {
130
+ content: {
131
+ "application/json": external$1["swagger.yml"]["components"]["schemas"]["Error"];
132
+ };
133
+ };
134
+ /** Too many requests in allowed time period */
135
+ RateLimitError: unknown;
136
+ /** Execution error occurred */
137
+ InternalServerError: unknown;
138
+ };
139
+ };
140
+ operations: {};
141
+ };
142
+ "uniform-canvas-types.swagger.yml": {
143
+ paths: {};
144
+ components: {
145
+ schemas: {
146
+ /** @description Public ID (used in code). Do not change after creation. */
147
+ PublicIdProperty: string;
148
+ /** @description The definition of a component parameter */
149
+ ComponentDefinitionParameter: {
150
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
151
+ /** @description Friendly name of the parameter */
152
+ name: string;
153
+ /** @description Appears next to the parameter in the Composition editor */
154
+ helpText?: string;
155
+ /** @description Type name of the parameter (provided by a Uniform integration) */
156
+ type: string;
157
+ /** @description The configuration object for the type (type-specific) */
158
+ typeConfig?: unknown;
159
+ };
160
+ /** @description The definition of a named component slot that can contain other components */
161
+ ComponentDefinitionSlot: {
162
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
163
+ /** @description Friendly name of the slot */
164
+ name: string;
165
+ /** @description A list of component definition public IDs that are allowed in this named slot */
166
+ allowedComponents: string[];
167
+ /**
168
+ * @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
169
+ * @default false
170
+ */
171
+ inheritAllowedComponents: boolean;
172
+ /** @description Minimum valid number of components in this slot */
173
+ minComponents?: number;
174
+ /** @description Maximum valid number of components in this slot */
175
+ maxComponents?: number;
176
+ };
177
+ /** @description The definition of a composition's slug settings */
178
+ ComponentDefinitionSlugSettings: {
179
+ /**
180
+ * @description Whether the slug is required
181
+ * no: slug is optional
182
+ * yes: slug is required
183
+ * disabled: slug is disabled and will not be shown in the editor
184
+ *
185
+ * @default no
186
+ * @enum {string}
187
+ */
188
+ required?: "no" | "yes" | "disabled";
189
+ /**
190
+ * @description Slug uniqueness configuration.
191
+ * no = no unique constraint
192
+ * local = must be unique within this component type
193
+ * global = must be unique across all component types
194
+ *
195
+ * @enum {string}
196
+ */
197
+ unique?: "no" | "local" | "global";
198
+ /** @description Regular expression slugs must match */
199
+ regularExpression?: string;
200
+ /**
201
+ * @description Custom error message when regular expression validation fails.
202
+ * Has no effect if `regularExpression` is not set.
203
+ */
204
+ regularExpressionMessage?: string;
205
+ };
206
+ /** @description The definition of a component variant */
207
+ ComponentDefinitionVariant: {
208
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
209
+ /** @description Friendly name of the variant */
210
+ name: string;
211
+ };
212
+ /** @description Permission set for a component defintion */
213
+ ComponentDefinitionPermission: {
214
+ roleId: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
215
+ /**
216
+ * @description Permission type for this permission ComponentDefinition:
217
+ * read | write | delete
218
+ *
219
+ * @enum {string}
220
+ */
221
+ permission: "read" | "write" | "delete";
222
+ /** @description State of the component that this permission applies to */
223
+ state: number;
224
+ };
225
+ /** @description Defines a component type that can live on a Composition */
226
+ ComponentDefinition: {
227
+ id: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
228
+ /** @description Friendly name of the component definition */
229
+ name: string;
230
+ /**
231
+ * @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
232
+ * @default screen
233
+ */
234
+ icon?: string;
235
+ /**
236
+ * @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
237
+ * The parameter type must support being used as a title parameter for this to work.
238
+ */
239
+ titleParameter?: string | null;
240
+ /**
241
+ * @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
242
+ * @default false
243
+ */
244
+ canBeComposition?: boolean;
245
+ /** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
246
+ parameters?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
247
+ /**
248
+ * @description if this component uses team permissions or custom permissions
249
+ * @default true
250
+ */
251
+ useTeamPermissions?: boolean;
252
+ /** @description Custom role permissions for this component definition */
253
+ permissions?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionPermission"][];
254
+ /** @description The named slots for this component; placement areas where arrays of other components can be added. */
255
+ slots?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlot"][];
256
+ slugSettings?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlugSettings"];
257
+ /** @description Default component instance value */
258
+ defaults?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"] | null;
259
+ /** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
260
+ variants?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionVariant"][];
261
+ /** @description Created date string for this definition (ignored for writes) */
262
+ created?: string;
263
+ /** @description Last modified date string for this definition (ignored for writes) */
264
+ updated?: string;
265
+ };
266
+ /** @description Defines an editable parameter on a component. */
267
+ ComponentParameter: {
268
+ /** @description The value of the parameter. Any JSON-serializable value is acceptable. */
269
+ value: unknown;
270
+ /** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
271
+ type: string;
272
+ binding?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameterBinding"];
273
+ };
274
+ /**
275
+ * @deprecated
276
+ * @description Defines a binding from a resource data value to a component parameter value. Do not use.
277
+ */
278
+ ComponentParameterBinding: {
279
+ /**
280
+ * @description A JSON Pointer expression that defines the binding directly to the parameter value, or
281
+ * a map of JSON Pointers in the target parameter to JSON Pointers in the source resource data.
282
+ * Used to bind to object-type values.
283
+ * e.g. { "/prop1/thing": "/res1/things/value" } would set the target parameter's `value` to
284
+ * {
285
+ * prop1: {
286
+ * thing: "value of /res1/things/value resource"
287
+ * }
288
+ * }
289
+ */
290
+ pointer: string | {
291
+ [key: string]: string;
292
+ };
293
+ /**
294
+ * @description The syntax of the binding (currently always 'jptr')
295
+ * @enum {string}
296
+ */
297
+ syntax: "jptr";
298
+ /**
299
+ * @description Whether the binding should cause an error if it cannot be resolved.
300
+ * If true, and the binding cannot be resolved, an error will be returned by the binding process.
301
+ * If false, and the binding cannot be resolved, the parameter will be removed from the bound composition.
302
+ *
303
+ * @default false
304
+ */
305
+ required?: boolean;
306
+ };
307
+ /** @description Defines the shape of a component instance served by the composition API. */
308
+ ComponentInstance: {
309
+ /** @description Type of the component instance (public_id of its definition) */
310
+ type: string;
311
+ /** @description Component parameter values for the component instance */
312
+ parameters?: {
313
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
314
+ };
315
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
316
+ variant?: string;
317
+ /** @description Slots containing any child components */
318
+ slots?: {
319
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
320
+ };
321
+ /** @description Unique identifier of the component within the composition. This is not set unless specifically requested via `withComponentIDs` API parameter. */
322
+ _id?: string;
323
+ /** @description Indicates this component instance should be sourced from a pattern library pattern. */
324
+ _pattern?: string;
325
+ /**
326
+ * @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
327
+ * CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
328
+ * NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
329
+ *
330
+ * @enum {string}
331
+ */
332
+ _patternError?: "NOTFOUND" | "CYCLIC";
333
+ };
334
+ /** @description Defines the shape of the root component in a composition */
335
+ RootComponentInstance: {
336
+ /** @description Type of the component instance (public_id of its definition) */
337
+ type: string;
338
+ /** @description Component parameter values for the component instance */
339
+ parameters?: {
340
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
341
+ };
342
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
343
+ variant?: string;
344
+ /** @description Slots containing any child components */
345
+ slots?: {
346
+ [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
347
+ };
348
+ /** @description The public UUID of the composition. */
349
+ _id: string;
350
+ /** @description Slug pattern of this component. */
351
+ _slug?: string | null;
352
+ /** @description Friendly name of this component. */
353
+ _name: string;
354
+ };
355
+ };
356
+ };
357
+ operations: {};
358
+ };
359
+ }
360
+
361
+ interface components$1 {
362
+ schemas: {
363
+ /** @description Public ID (used in code). Do not change after creation. */
364
+ PublicIdProperty: string;
365
+ /** @description The definition of a component parameter */
366
+ ComponentDefinitionParameter: {
367
+ id: components$1["schemas"]["PublicIdProperty"];
368
+ /** @description Friendly name of the parameter */
369
+ name: string;
370
+ /** @description Appears next to the parameter in the Composition editor */
371
+ helpText?: string;
372
+ /** @description Type name of the parameter (provided by a Uniform integration) */
373
+ type: string;
374
+ /** @description The configuration object for the type (type-specific) */
375
+ typeConfig?: unknown;
376
+ };
377
+ /** @description The definition of a named component slot that can contain other components */
378
+ ComponentDefinitionSlot: {
379
+ id: components$1["schemas"]["PublicIdProperty"];
380
+ /** @description Friendly name of the slot */
381
+ name: string;
382
+ /** @description A list of component definition public IDs that are allowed in this named slot */
383
+ allowedComponents: string[];
384
+ /**
385
+ * @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
386
+ * @default false
387
+ */
388
+ inheritAllowedComponents: boolean;
389
+ /** @description Minimum valid number of components in this slot */
390
+ minComponents?: number;
391
+ /** @description Maximum valid number of components in this slot */
392
+ maxComponents?: number;
393
+ };
394
+ /** @description The definition of a composition's slug settings */
395
+ ComponentDefinitionSlugSettings: {
396
+ /**
397
+ * @description Whether the slug is required
398
+ * no: slug is optional
399
+ * yes: slug is required
400
+ * disabled: slug is disabled and will not be shown in the editor
401
+ *
402
+ * @default no
403
+ * @enum {string}
404
+ */
405
+ required?: "no" | "yes" | "disabled";
406
+ /**
407
+ * @description Slug uniqueness configuration.
408
+ * no = no unique constraint
409
+ * local = must be unique within this component type
410
+ * global = must be unique across all component types
411
+ *
412
+ * @enum {string}
413
+ */
414
+ unique?: "no" | "local" | "global";
415
+ /** @description Regular expression slugs must match */
416
+ regularExpression?: string;
417
+ /**
418
+ * @description Custom error message when regular expression validation fails.
419
+ * Has no effect if `regularExpression` is not set.
420
+ */
421
+ regularExpressionMessage?: string;
422
+ };
423
+ /** @description The definition of a component variant */
424
+ ComponentDefinitionVariant: {
425
+ id: components$1["schemas"]["PublicIdProperty"];
426
+ /** @description Friendly name of the variant */
427
+ name: string;
428
+ };
429
+ /** @description Permission set for a component defintion */
430
+ ComponentDefinitionPermission: {
431
+ roleId: components$1["schemas"]["PublicIdProperty"];
432
+ /**
433
+ * @description Permission type for this permission ComponentDefinition:
434
+ * read | write | delete
435
+ *
436
+ * @enum {string}
437
+ */
438
+ permission: "read" | "write" | "delete";
439
+ /** @description State of the component that this permission applies to */
440
+ state: number;
441
+ };
442
+ /** @description Defines a component type that can live on a Composition */
443
+ ComponentDefinition: {
444
+ id: components$1["schemas"]["PublicIdProperty"];
445
+ /** @description Friendly name of the component definition */
446
+ name: string;
447
+ /**
448
+ * @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
449
+ * @default screen
450
+ */
451
+ icon?: string;
452
+ /**
453
+ * @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
454
+ * The parameter type must support being used as a title parameter for this to work.
455
+ */
456
+ titleParameter?: string | null;
457
+ /**
458
+ * @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
459
+ * @default false
460
+ */
461
+ canBeComposition?: boolean;
462
+ /** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
463
+ parameters?: components$1["schemas"]["ComponentDefinitionParameter"][];
464
+ /**
465
+ * @description if this component uses team permissions or custom permissions
466
+ * @default true
467
+ */
468
+ useTeamPermissions?: boolean;
469
+ /** @description Custom role permissions for this component definition */
470
+ permissions?: components$1["schemas"]["ComponentDefinitionPermission"][];
471
+ /** @description The named slots for this component; placement areas where arrays of other components can be added. */
472
+ slots?: components$1["schemas"]["ComponentDefinitionSlot"][];
473
+ slugSettings?: components$1["schemas"]["ComponentDefinitionSlugSettings"];
474
+ /** @description Default component instance value */
475
+ defaults?: components$1["schemas"]["ComponentInstance"] | null;
476
+ /** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
477
+ variants?: components$1["schemas"]["ComponentDefinitionVariant"][];
478
+ /** @description Created date string for this definition (ignored for writes) */
479
+ created?: string;
480
+ /** @description Last modified date string for this definition (ignored for writes) */
481
+ updated?: string;
482
+ };
483
+ /** @description Defines an editable parameter on a component. */
484
+ ComponentParameter: {
485
+ /** @description The value of the parameter. Any JSON-serializable value is acceptable. */
486
+ value: unknown;
487
+ /** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
488
+ type: string;
489
+ binding?: components$1["schemas"]["ComponentParameterBinding"];
490
+ };
491
+ /**
492
+ * @deprecated
493
+ * @description Defines a binding from a resource data value to a component parameter value. Do not use.
494
+ */
495
+ ComponentParameterBinding: {
496
+ /**
497
+ * @description A JSON Pointer expression that defines the binding directly to the parameter value, or
498
+ * a map of JSON Pointers in the target parameter to JSON Pointers in the source resource data.
499
+ * Used to bind to object-type values.
500
+ * e.g. { "/prop1/thing": "/res1/things/value" } would set the target parameter's `value` to
501
+ * {
502
+ * prop1: {
503
+ * thing: "value of /res1/things/value resource"
504
+ * }
505
+ * }
506
+ */
507
+ pointer: string | {
508
+ [key: string]: string;
509
+ };
510
+ /**
511
+ * @description The syntax of the binding (currently always 'jptr')
512
+ * @enum {string}
513
+ */
514
+ syntax: "jptr";
515
+ /**
516
+ * @description Whether the binding should cause an error if it cannot be resolved.
517
+ * If true, and the binding cannot be resolved, an error will be returned by the binding process.
518
+ * If false, and the binding cannot be resolved, the parameter will be removed from the bound composition.
519
+ *
520
+ * @default false
521
+ */
522
+ required?: boolean;
523
+ };
524
+ /** @description Defines the shape of a component instance served by the composition API. */
525
+ ComponentInstance: {
526
+ /** @description Type of the component instance (public_id of its definition) */
527
+ type: string;
528
+ /** @description Component parameter values for the component instance */
529
+ parameters?: {
530
+ [key: string]: components$1["schemas"]["ComponentParameter"];
531
+ };
532
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
533
+ variant?: string;
534
+ /** @description Slots containing any child components */
535
+ slots?: {
536
+ [key: string]: components$1["schemas"]["ComponentInstance"][];
537
+ };
538
+ /** @description Unique identifier of the component within the composition. This is not set unless specifically requested via `withComponentIDs` API parameter. */
539
+ _id?: string;
540
+ /** @description Indicates this component instance should be sourced from a pattern library pattern. */
541
+ _pattern?: string;
542
+ /**
543
+ * @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
544
+ * CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
545
+ * NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
546
+ *
547
+ * @enum {string}
548
+ */
549
+ _patternError?: "NOTFOUND" | "CYCLIC";
550
+ };
551
+ /** @description Defines the shape of the root component in a composition */
552
+ RootComponentInstance: {
553
+ /** @description Type of the component instance (public_id of its definition) */
554
+ type: string;
555
+ /** @description Component parameter values for the component instance */
556
+ parameters?: {
557
+ [key: string]: components$1["schemas"]["ComponentParameter"];
558
+ };
559
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
560
+ variant?: string;
561
+ /** @description Slots containing any child components */
562
+ slots?: {
563
+ [key: string]: components$1["schemas"]["ComponentInstance"][];
564
+ };
565
+ /** @description The public UUID of the composition. */
566
+ _id: string;
567
+ /** @description Slug pattern of this component. */
568
+ _slug?: string | null;
569
+ /** @description Friendly name of this component. */
570
+ _name: string;
571
+ };
572
+ };
573
+ }
574
+
575
+ declare type SharedComponents$1 = components$1['schemas'];
576
+ declare type Api$1 = paths$1['/api/v1/canvas-definitions'];
577
+ /** Shape of the GET response from /api/v1/canvas-definitions */
578
+ declare type ComponentDefinitionGetResponse = Api$1['get']['responses']['200']['content']['application/json'];
579
+ /** Shape of the PUT request body for /api/v1/canvas-definitions */
580
+ declare type ComponentDefinitionPutParameters = Api$1['put']['requestBody']['content']['application/json'];
581
+ /** Shape of the DELETE request body for /api/v1/canvas-definitions */
582
+ declare type ComponentDefinitionDeleteParameters = Api$1['delete']['requestBody']['content']['application/json'];
583
+ /** Query parameter options for GET /api/v1/canvas-definitions */
584
+ declare type ComponentDefinitionGetParameters = Api$1['get']['parameters']['query'];
585
+ /** @deprecated use ComponentDefinitionGetResponse instead */
586
+ declare type ComponentDefinitionAPIResponse = ComponentDefinitionGetResponse;
587
+ /** @deprecated use ComponentDefinitionPutParameters */
588
+ declare type ComponentDefinitionAPIPutRequest = ComponentDefinitionPutParameters;
589
+ /** @deprecated use ComponentDefinitionDeleteParameters */
590
+ declare type ComponentDefinitionAPIDeleteRequest = ComponentDefinitionDeleteParameters;
591
+ /** @deprecated use ComponentDefinitionGetParameters */
592
+ declare type ComponentDefinitionListAPIOptions = ComponentDefinitionGetParameters;
593
+ /** The definition of a component parameter */
594
+ declare type ComponentDefinitionParameter<TConfig = unknown> = Omit<components$1['schemas']['ComponentDefinitionParameter'], 'typeConfig'> & {
595
+ typeConfig?: TConfig;
596
+ };
597
+ /** The definition of a component visual variant */
598
+ declare type ComponentDefinitionVariant = SharedComponents$1['ComponentDefinitionVariant'];
599
+ /** The definition of a composition's slug settings */
600
+ declare type ComponentDefinitionSlugSettings = SharedComponents$1['ComponentDefinitionSlugSettings'];
601
+ /** The definition of a named component slot that can contain other components */
602
+ declare type ComponentDefinitionSlot = SharedComponents$1['ComponentDefinitionSlot'];
603
+ /** Permission set for a component defintion */
604
+ declare type ComponentDefinitionPermission = SharedComponents$1['ComponentDefinitionPermission'];
605
+ /** Defines a component type that can live on a Composition */
606
+ declare type ComponentDefinition = SharedComponents$1['ComponentDefinition'];
607
+ /** @deprecated use ComponentDefinition instead */
608
+ declare type CreatingComponentDefinition = Omit<Partial<ComponentDefinition>, 'created' | 'updated'>;
609
+
610
+ /**
611
+ * This file was auto-generated by openapi-typescript.
612
+ * Do not make direct changes to the file.
613
+ */
614
+ interface paths {
615
+ "/api/v1/canvas": {
616
+ get: {
617
+ parameters: {
618
+ query: {
619
+ /** The project the composition(s) are on. */
620
+ projectId: string;
621
+ /** Specify a single composition ID to fetch. Changes response from list to single. */
622
+ compositionId?: string;
623
+ /** Specify a single composition to fetch by slug. Changes response from list to single. */
624
+ slug?: string;
625
+ /** The component type to filter by */
626
+ type?: string;
627
+ /** State of compositions to fetch. 0 = draft, 64 = published. */
628
+ state?: number;
629
+ /** Number of records to skip */
630
+ offset?: number;
631
+ /** Max number of records to return */
632
+ limit?: number;
633
+ /**
634
+ * @deprecated Signals an enhancer proxy to skip processing enhancements to the data and return raw data only.
635
+ * This improves performance if you do not require enhanced component data.
636
+ * If calling the Canvas API directly with no enhancer proxy, this has no effect.
637
+ */
638
+ skipEnhance?: boolean;
639
+ /**
640
+ * If true, any pattern references in the composition will be left unresolved.
641
+ * This is appropriate if you intend to serialize the composition data without pattern
642
+ * data embedded into it, and serialize the pattern data separately.
643
+ */
644
+ skipPatternResolution?: boolean;
645
+ /**
646
+ * If true the `_id` unique identifier of each non-root component will be part of the response data.
647
+ * If false, the `_id` will not be present in the API response.
648
+ */
649
+ withComponentIDs?: boolean;
650
+ };
651
+ };
652
+ responses: {
653
+ /** OK */
654
+ 200: {
655
+ content: {
656
+ "application/json": components["schemas"]["CompositionListResponse"] | components["schemas"]["CompositionApiResponse"];
657
+ };
658
+ };
659
+ 400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
660
+ 401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
661
+ 403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
662
+ /** Composition not found */
663
+ 404: {
664
+ content: {
665
+ "text/plain": string;
666
+ };
667
+ };
668
+ 429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
669
+ 500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
670
+ };
671
+ };
672
+ /** Upserts a composition */
673
+ put: {
674
+ responses: {
675
+ /** OK */
676
+ 204: never;
677
+ 400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
678
+ 401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
679
+ 403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
680
+ 429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
681
+ 500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
682
+ };
683
+ requestBody: {
684
+ content: {
685
+ "application/json": {
686
+ /**
687
+ * Format: uuid
688
+ * @description The project ID to upsert the composition to
689
+ */
690
+ projectId: string;
691
+ /** @description The state of the composition to upsert into. 0 = draft, 64 = published */
692
+ state: number;
693
+ composition: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["RootComponentInstance"];
694
+ /**
695
+ * @description True if the composition is a pattern (which can be referenced on other compositions)
696
+ * @default false
697
+ */
698
+ pattern?: boolean;
699
+ resources?: components["schemas"]["CompositionResourceDefinitions"];
700
+ variables?: components["schemas"]["CompositionVariableDefinitions"];
701
+ /** @description Ignored if present */
702
+ created?: string;
703
+ /** @description Ignored if present */
704
+ modified?: string;
705
+ };
706
+ };
707
+ };
708
+ };
709
+ /** Deletes or unpublishes a composition */
710
+ delete: {
711
+ responses: {
712
+ /** OK */
713
+ 204: never;
714
+ 400: external["swagger.yml"]["components"]["responses"]["BadRequestError"];
715
+ 401: external["swagger.yml"]["components"]["responses"]["UnauthorizedError"];
716
+ 403: external["swagger.yml"]["components"]["responses"]["ForbiddenError"];
717
+ 429: external["swagger.yml"]["components"]["responses"]["RateLimitError"];
718
+ 500: external["swagger.yml"]["components"]["responses"]["InternalServerError"];
719
+ };
720
+ requestBody: {
721
+ content: {
722
+ "application/json": {
723
+ /**
724
+ * Format: uuid
725
+ * @description The ID of the composition to delete
726
+ */
727
+ compositionId: string;
728
+ /**
729
+ * Format: uuid
730
+ * @description The ID of the project the composition to delete belongs to
731
+ */
732
+ projectId: string;
733
+ /** @description The state of the composition to delete (0 = draft, 64 = published [causes unpublishing], unspecified = all) */
734
+ state?: number;
735
+ };
736
+ };
737
+ };
738
+ };
739
+ /** Handles preflight requests. This endpoint allows CORS. */
740
+ options: {
741
+ responses: {
742
+ /** OK */
743
+ 204: never;
744
+ };
745
+ };
746
+ };
747
+ }
748
+ interface components {
749
+ schemas: {
750
+ CompositionApiResponse: {
751
+ /** @description State of compositions to fetch. 0 = draft, 64 = published. */
752
+ state: number;
753
+ /**
754
+ * Format: uuid
755
+ * @description The project ID that this layout data is part of
756
+ */
757
+ projectId: string;
758
+ /**
759
+ * Format: date-time,
760
+ * @description Created date string for this definition
761
+ */
762
+ created: string;
763
+ /**
764
+ * Format: date-time,
765
+ * @description Modified date string for this definition
766
+ */
767
+ modified: string;
768
+ /** @description Whether this composition is a pattern (can be referenced by other compositions, not treated as a composition) */
769
+ pattern: boolean;
770
+ resources?: components["schemas"]["CompositionResourceDefinitions"];
771
+ composition: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["RootComponentInstance"];
772
+ variables?: components["schemas"]["CompositionVariableDefinitions"];
773
+ };
774
+ CompositionListResponse: {
775
+ compositions: components["schemas"]["CompositionApiResponse"][];
776
+ };
777
+ /**
778
+ * @deprecated
779
+ * @description Variables defined for this composition.
780
+ */
781
+ CompositionVariableDefinitions: {
782
+ [key: string]: components["schemas"]["CompositionVariable"];
783
+ };
784
+ /**
785
+ * @deprecated
786
+ * @description Defines a variable value that can be used in resources and bindings.
787
+ */
788
+ CompositionVariable: {
789
+ /**
790
+ * @description Whether the variable must have a value when bound to.
791
+ * If true, binding a composition without this variable set will return an error.
792
+ * If false, binding a composition without this variable set will use the default value instead.
793
+ */
794
+ required: boolean;
795
+ /** @description The default value of the variable, used when binding for editing or when an optional variable value is not provided. */
796
+ default: string;
797
+ };
798
+ /**
799
+ * @deprecated
800
+ * @description Resource definitions attached to this composition. The property name is the key of the resource in the resource document.
801
+ */
802
+ CompositionResourceDefinitions: {
803
+ [key: string]: components["schemas"]["CompositionResourceDefinition"];
804
+ };
805
+ /**
806
+ * @deprecated
807
+ * @description Resource definition attached to this composition
808
+ */
809
+ CompositionResourceDefinition: {
810
+ /** @description Integration that provides this resource */
811
+ type: string;
812
+ /** @description Type-specific data to configure resource */
813
+ data: {
814
+ [key: string]: unknown;
815
+ };
816
+ };
817
+ };
818
+ }
819
+ interface external {
820
+ "swagger.yml": {
821
+ paths: {};
822
+ components: {
823
+ schemas: {
824
+ Error: {
825
+ /** @description Error message(s) that occurred while processing the request */
826
+ errorMessage?: string[] | string;
827
+ };
828
+ };
829
+ responses: {
830
+ /** Request input validation failed */
831
+ BadRequestError: {
832
+ content: {
833
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
834
+ };
835
+ };
836
+ /** API key or token was not valid */
837
+ UnauthorizedError: {
838
+ content: {
839
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
840
+ };
841
+ };
842
+ /** Permission was denied */
843
+ ForbiddenError: {
844
+ content: {
845
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
846
+ };
847
+ };
848
+ /** Resource not found */
849
+ NotFoundError: {
850
+ content: {
851
+ "application/json": external["swagger.yml"]["components"]["schemas"]["Error"];
852
+ };
853
+ };
854
+ /** Too many requests in allowed time period */
855
+ RateLimitError: unknown;
856
+ /** Execution error occurred */
857
+ InternalServerError: unknown;
858
+ };
859
+ };
860
+ operations: {};
861
+ };
862
+ "uniform-canvas-types.swagger.yml": {
863
+ paths: {};
864
+ components: {
865
+ schemas: {
866
+ /** @description Public ID (used in code). Do not change after creation. */
867
+ PublicIdProperty: string;
868
+ /** @description The definition of a component parameter */
869
+ ComponentDefinitionParameter: {
870
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
871
+ /** @description Friendly name of the parameter */
872
+ name: string;
873
+ /** @description Appears next to the parameter in the Composition editor */
874
+ helpText?: string;
875
+ /** @description Type name of the parameter (provided by a Uniform integration) */
876
+ type: string;
877
+ /** @description The configuration object for the type (type-specific) */
878
+ typeConfig?: unknown;
879
+ };
880
+ /** @description The definition of a named component slot that can contain other components */
881
+ ComponentDefinitionSlot: {
882
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
883
+ /** @description Friendly name of the slot */
884
+ name: string;
885
+ /** @description A list of component definition public IDs that are allowed in this named slot */
886
+ allowedComponents: string[];
887
+ /**
888
+ * @description Whether this slot inherits its allowed components from the parent slot it lives in. If true, allowedComponents is irrelevant.
889
+ * @default false
890
+ */
891
+ inheritAllowedComponents: boolean;
892
+ /** @description Minimum valid number of components in this slot */
893
+ minComponents?: number;
894
+ /** @description Maximum valid number of components in this slot */
895
+ maxComponents?: number;
896
+ };
897
+ /** @description The definition of a composition's slug settings */
898
+ ComponentDefinitionSlugSettings: {
899
+ /**
900
+ * @description Whether the slug is required
901
+ * no: slug is optional
902
+ * yes: slug is required
903
+ * disabled: slug is disabled and will not be shown in the editor
904
+ *
905
+ * @default no
906
+ * @enum {string}
907
+ */
908
+ required?: "no" | "yes" | "disabled";
909
+ /**
910
+ * @description Slug uniqueness configuration.
911
+ * no = no unique constraint
912
+ * local = must be unique within this component type
913
+ * global = must be unique across all component types
914
+ *
915
+ * @enum {string}
916
+ */
917
+ unique?: "no" | "local" | "global";
918
+ /** @description Regular expression slugs must match */
919
+ regularExpression?: string;
920
+ /**
921
+ * @description Custom error message when regular expression validation fails.
922
+ * Has no effect if `regularExpression` is not set.
923
+ */
924
+ regularExpressionMessage?: string;
925
+ };
926
+ /** @description The definition of a component variant */
927
+ ComponentDefinitionVariant: {
928
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
929
+ /** @description Friendly name of the variant */
930
+ name: string;
931
+ };
932
+ /** @description Permission set for a component defintion */
933
+ ComponentDefinitionPermission: {
934
+ roleId: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
935
+ /**
936
+ * @description Permission type for this permission ComponentDefinition:
937
+ * read | write | delete
938
+ *
939
+ * @enum {string}
940
+ */
941
+ permission: "read" | "write" | "delete";
942
+ /** @description State of the component that this permission applies to */
943
+ state: number;
944
+ };
945
+ /** @description Defines a component type that can live on a Composition */
946
+ ComponentDefinition: {
947
+ id: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["PublicIdProperty"];
948
+ /** @description Friendly name of the component definition */
949
+ name: string;
950
+ /**
951
+ * @description Icon name or URL for the component definition (e.g. 'screen' or 'https://s3/my-component.jpg')
952
+ * @default screen
953
+ */
954
+ icon?: string;
955
+ /**
956
+ * @description The public ID of the parameter whose value should be used to create a display title for this component in the UI.
957
+ * The parameter type must support being used as a title parameter for this to work.
958
+ */
959
+ titleParameter?: string | null;
960
+ /**
961
+ * @description Whether this component type can be the root of a composition. If false, this component is only used within slots on other components.
962
+ * @default false
963
+ */
964
+ canBeComposition?: boolean;
965
+ /** @description The parameters for this component. Parameters are key-value pairs that can be anything from text values to links to CMS entries. */
966
+ parameters?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionParameter"][];
967
+ /**
968
+ * @description if this component uses team permissions or custom permissions
969
+ * @default true
970
+ */
971
+ useTeamPermissions?: boolean;
972
+ /** @description Custom role permissions for this component definition */
973
+ permissions?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionPermission"][];
974
+ /** @description The named slots for this component; placement areas where arrays of other components can be added. */
975
+ slots?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlot"][];
976
+ slugSettings?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionSlugSettings"];
977
+ /** @description Default component instance value */
978
+ defaults?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"] | null;
979
+ /** @description Named variants for this component; enables creation of visual variants that use the same parameter data */
980
+ variants?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentDefinitionVariant"][];
981
+ /** @description Created date string for this definition (ignored for writes) */
982
+ created?: string;
983
+ /** @description Last modified date string for this definition (ignored for writes) */
984
+ updated?: string;
985
+ };
986
+ /** @description Defines an editable parameter on a component. */
987
+ ComponentParameter: {
988
+ /** @description The value of the parameter. Any JSON-serializable value is acceptable. */
989
+ value: unknown;
990
+ /** @description The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
991
+ type: string;
992
+ binding?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameterBinding"];
993
+ };
994
+ /**
995
+ * @deprecated
996
+ * @description Defines a binding from a resource data value to a component parameter value. Do not use.
997
+ */
998
+ ComponentParameterBinding: {
999
+ /**
1000
+ * @description A JSON Pointer expression that defines the binding directly to the parameter value, or
1001
+ * a map of JSON Pointers in the target parameter to JSON Pointers in the source resource data.
1002
+ * Used to bind to object-type values.
1003
+ * e.g. { "/prop1/thing": "/res1/things/value" } would set the target parameter's `value` to
1004
+ * {
1005
+ * prop1: {
1006
+ * thing: "value of /res1/things/value resource"
1007
+ * }
1008
+ * }
1009
+ */
1010
+ pointer: string | {
1011
+ [key: string]: string;
1012
+ };
1013
+ /**
1014
+ * @description The syntax of the binding (currently always 'jptr')
1015
+ * @enum {string}
1016
+ */
1017
+ syntax: "jptr";
1018
+ /**
1019
+ * @description Whether the binding should cause an error if it cannot be resolved.
1020
+ * If true, and the binding cannot be resolved, an error will be returned by the binding process.
1021
+ * If false, and the binding cannot be resolved, the parameter will be removed from the bound composition.
1022
+ *
1023
+ * @default false
1024
+ */
1025
+ required?: boolean;
1026
+ };
1027
+ /** @description Defines the shape of a component instance served by the composition API. */
1028
+ ComponentInstance: {
1029
+ /** @description Type of the component instance (public_id of its definition) */
1030
+ type: string;
1031
+ /** @description Component parameter values for the component instance */
1032
+ parameters?: {
1033
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
1034
+ };
1035
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
1036
+ variant?: string;
1037
+ /** @description Slots containing any child components */
1038
+ slots?: {
1039
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
1040
+ };
1041
+ /** @description Unique identifier of the component within the composition. This is not set unless specifically requested via `withComponentIDs` API parameter. */
1042
+ _id?: string;
1043
+ /** @description Indicates this component instance should be sourced from a pattern library pattern. */
1044
+ _pattern?: string;
1045
+ /**
1046
+ * @description Describes why the pattern could not be resolved, if a pattern could not be resolved. For PUTs, this is allowed but ignored.
1047
+ * CYCLIC: A cyclic pattern graph was detected, which could not be resolved because it would cause an infinite loop.
1048
+ * NOTFOUND: The pattern ID referenced could not be found. It may have been deleted, or not be published yet.
1049
+ *
1050
+ * @enum {string}
1051
+ */
1052
+ _patternError?: "NOTFOUND" | "CYCLIC";
1053
+ };
1054
+ /** @description Defines the shape of the root component in a composition */
1055
+ RootComponentInstance: {
1056
+ /** @description Type of the component instance (public_id of its definition) */
1057
+ type: string;
1058
+ /** @description Component parameter values for the component instance */
1059
+ parameters?: {
1060
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentParameter"];
1061
+ };
1062
+ /** @description Public ID of alternate visual appearance for this component, if any selected */
1063
+ variant?: string;
1064
+ /** @description Slots containing any child components */
1065
+ slots?: {
1066
+ [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
1067
+ };
1068
+ /** @description The public UUID of the composition. */
1069
+ _id: string;
1070
+ /** @description Slug pattern of this component. */
1071
+ _slug?: string | null;
1072
+ /** @description Friendly name of this component. */
1073
+ _name: string;
1074
+ };
1075
+ };
1076
+ };
1077
+ operations: {};
1078
+ };
1079
+ }
1080
+
1081
+ declare type Components = components['schemas'];
1082
+ declare type SharedComponents = components$1['schemas'];
1083
+ declare type Api = paths['/api/v1/canvas'];
1084
+ /** Query parameter options for GET /api/v1/canvas */
1085
+ declare type CompositionGetParameters = Api['get']['parameters']['query'];
1086
+ /** The GET response from /api/v1/canvas when `component` or `slug` params are specified */
1087
+ declare type CompositionGetResponse = Components['CompositionApiResponse'];
1088
+ /** The GET response from /api/v1/canvas when `component` or `slug` are not specified */
1089
+ declare type CompositionGetListResponse = Components['CompositionListResponse'];
1090
+ /** The PUT request body for /api/v1/canvas */
1091
+ declare type CompositionPutParameters = Api['put']['requestBody']['content']['application/json'];
1092
+ /** Shape of the DELETE request body for /api/v1/canvas */
1093
+ declare type CompositionDeleteParameters = Api['delete']['requestBody']['content']['application/json'];
1094
+ /** @deprecated use CompositionGetResponse */
1095
+ declare type CompositionAPIResponse = CompositionGetResponse;
1096
+ /** @deprecated use CompositionDeleteParameters */
1097
+ declare type CompositionAPIDeleteRequest = CompositionDeleteParameters;
1098
+ /** @deprecated use CompositionGetParameters */
1099
+ declare type CompositionListAPIResponse = CompositionGetListResponse;
1100
+ /** @deprecated use CompositionGetParameters */
1101
+ declare type CompositionAPIOptions = CompositionGetParameters;
1102
+ /** Defines an editable parameter on a component. */
1103
+ declare type ComponentParameter<TValue = unknown> = Omit<SharedComponents['ComponentParameter'], 'value'> & {
1104
+ /** The type of the parameter. Determines how it is displayed when editing, and tells the consumer how to process it. */
1105
+ value: TValue;
1106
+ };
1107
+ /** Defines a binding from a resource data value to a component parameter value. */
1108
+ declare type ComponentParameterBinding = SharedComponents['ComponentParameterBinding'];
1109
+ /** Variables defined for this composition. */
1110
+ declare type CompositionVariableDefinitions = Components['CompositionVariableDefinitions'];
1111
+ /** Defines a variable value that can be used in resources and bindings. */
1112
+ declare type CompositionVariable = Components['CompositionVariable'];
1113
+ /** Defines the shape of a resource bound to a composition */
1114
+ declare type CompositionResourceDefinitions = components['schemas']['CompositionResourceDefinitions'];
1115
+ /** Defines the shape of a resource bound to a composition */
1116
+ declare type CompositionResourceDefinition = components['schemas']['CompositionResourceDefinition'];
1117
+ /** Defines the shape of a component instance served by the composition API. */
1118
+ declare type ComponentInstance = SharedComponents['ComponentInstance'] & {
1119
+ /** Data for the component instance, provided by a component enhancer. Never set in unenhanced data. */
1120
+ data?: Record<string, unknown>;
1121
+ };
1122
+ /** Defines the shape of the root component in a composition */
1123
+ declare type RootComponentInstance = SharedComponents['RootComponentInstance'];
1124
+ /** Defines single structure to keep all canvas models (used in CLI commands and Starter content generations) */
1125
+ declare type CanvasDefinitions = {
1126
+ components?: Array<ComponentDefinition>;
1127
+ compositions?: Array<CompositionGetResponse>;
1128
+ };
1129
+
1130
+ /**
1131
+ * Pusher-js is large (80k) and not tree shakable so it is always bundled if directly referenced,
1132
+ * when it's only needed during preview mode. To avoid bundling it for all, we use an old-school
1133
+ * write-a-script-tag hack to load it in a poor man's approximation of a dynamic import ;)
1134
+ */
1135
+ declare type ChannelSubscription = {
1136
+ addEventHandler: (eventName: string, handler: (data: unknown) => void) => () => void;
1137
+ unsubscribe: () => void;
1138
+ };
1139
+ declare type PreviewEventBus = {
1140
+ subscribe: (channel: string) => ChannelSubscription;
1141
+ };
1142
+ declare global {
1143
+ interface Window {
1144
+ Pusher?: typeof Pusher;
1145
+ __UNIFORM_EVENT_BUS__?: PreviewEventBus;
1146
+ }
1147
+ }
1148
+ /**
1149
+ * Creates an event bus client to receive updates from Canvas
1150
+ * IMPORTANT: in a server-side context this will always return undefined
1151
+ * IMPORTANT: in a browser context this is cached in window and does not create multiple instances
1152
+ */
1153
+ declare function createEventBus(): Promise<PreviewEventBus | undefined>;
1154
+
1155
+ export { CompositionVariableDefinitions as A, CompositionVariable as B, ComponentInstance as C, CompositionResourceDefinitions as D, CompositionResourceDefinition as E, CanvasDefinitions as F, ChannelSubscription as G, createEventBus as H, PreviewEventBus as P, RootComponentInstance as R, ComponentParameter as a, CompositionGetParameters as b, CompositionPutParameters as c, CompositionDeleteParameters as d, ComponentDefinitionGetParameters as e, ComponentDefinitionPutParameters as f, ComponentDefinitionDeleteParameters as g, ComponentDefinitionGetResponse as h, ComponentDefinitionAPIResponse as i, ComponentDefinitionAPIPutRequest as j, ComponentDefinitionAPIDeleteRequest as k, ComponentDefinitionListAPIOptions as l, ComponentDefinitionParameter as m, ComponentDefinitionVariant as n, ComponentDefinitionSlugSettings as o, ComponentDefinitionSlot as p, ComponentDefinitionPermission as q, ComponentDefinition as r, CreatingComponentDefinition as s, CompositionGetResponse as t, CompositionGetListResponse as u, CompositionAPIResponse as v, CompositionAPIDeleteRequest as w, CompositionListAPIResponse as x, CompositionAPIOptions as y, ComponentParameterBinding as z };