@combeenation/custom-code-sdk 0.0.1-alpha9 → 0.0.1-rc1

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 CHANGED
@@ -1,17 +1,145 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ declare const __brand: unique symbol;
4
+
5
+ export declare function addButtonControl(parent: ParentCtrl, options?: {
6
+ position?: AddCtrlPosition;
7
+ properties?: Partial<CreateButtonProperties>;
8
+ }): Button;
9
+
10
+ export declare function addCheckboxControl(parent: ParentCtrl, options?: {
11
+ position?: AddCtrlPosition;
12
+ properties?: Partial<CreateCheckboxProperties>;
13
+ }): Checkbox;
14
+
15
+ export declare function addCollapsibleControl(parent: ParentCtrl, options?: {
16
+ position?: AddCtrlPosition;
17
+ properties?: Partial<CreateCollapsibleProperties>;
18
+ }): Collapsible;
19
+
20
+ export declare function addComboboxControl<TMode extends ListMode, TValueType extends DataListValueType = never>(parent: ParentCtrl, options: {
21
+ mode: TMode;
22
+ position?: AddCtrlPosition;
23
+ /**
24
+ * When using properties of type `LiquidTemplateSource`, you have to manually cast the given `string` to
25
+ * `LiquidTemplateSource` like this:
26
+ *
27
+ * ```ts
28
+ * combobox.setProperty('dataTemplate', '<span>{{ Name }}</span>' as LiquidTemplateSource);
29
+ * ```
30
+ */
31
+ properties?: Partial<CreateComboboxProperties>;
32
+ } & (TMode extends 'no-selection' ? {
33
+ valueType?: never;
34
+ } : {
35
+ valueType: TValueType;
36
+ })): Combobox<DataListValue_2<TMode, TValueType>>;
37
+
38
+ declare type AddCtrlPosition = 'first' | 'last' | {
39
+ before: Ctrl;
40
+ } | {
41
+ after: Ctrl;
42
+ };
43
+
44
+ export declare function addCustomControl(parent: ParentCtrl, options?: {
45
+ position?: AddCtrlPosition;
46
+ properties?: Partial<CreateCustomCtrlProperties>;
47
+ }): CustomControl;
48
+
49
+ export declare function addDataviewControl<TMode extends ListMode, TValueType extends DataListValueType = never>(parent: ParentCtrl, options: {
50
+ mode: TMode;
51
+ position?: AddCtrlPosition;
52
+ /**
53
+ * When using properties of type `LiquidTemplateSource`, you have to manually cast the given `string` to
54
+ * `LiquidTemplateSource` like this:
55
+ *
56
+ * ```ts
57
+ * dataview.setProperty('dataTemplate', '<span>{{ Name }}</span>' as LiquidTemplateSource);
58
+ * ```
59
+ */
60
+ properties?: Partial<CreateDataviewProperties>;
61
+ } & (TMode extends 'no-selection' ? {
62
+ valueType?: never;
63
+ } : {
64
+ valueType: TValueType;
65
+ })): Dataview<DataListValue_2<TMode, TValueType>>;
66
+
67
+ export declare function addInputControl(parent: ParentCtrl, options?: {
68
+ position?: AddCtrlPosition;
69
+ properties?: Partial<CreateInputProperties>;
70
+ }): Input;
71
+
72
+ export declare function addPanelControl(parent: ParentCtrl, options?: {
73
+ position?: AddCtrlPosition;
74
+ properties?: Partial<CreatePanelProperties>;
75
+ }): Panel;
76
+
77
+ export declare function addTextControl(parent: ParentCtrl, options?: {
78
+ position?: AddCtrlPosition;
79
+ properties?: Partial<CreateTextProperties>;
80
+ }): Text_2;
81
+
82
+ declare type AlignmentBlockOption = z.infer<typeof ZAlignmentBlockOption>;
83
+
3
84
  declare type AppLanguage = 'en' | 'de';
4
85
 
5
86
  declare type AssetName = z.infer<typeof ZAssetName>;
6
87
 
88
+ /**
89
+ * Registers a callback which will be executed before the configurator is rendered.\
90
+ * The callback can be used to perform async operations that must be completed before the configurator is rendered.
91
+ *
92
+ * !!! Info !!!
93
+ *
94
+ * The callback must be registered in the synchronous top-level context of your main entry file.\
95
+ * The callback will have **no** effect when registered in any async context, i.e. after any `await` or inside some
96
+ * async callback function etc.
97
+ */
98
+ export declare const beforeConfiguratorIsRendered: (callback: () => Promise<void>) => void;
99
+
100
+ /**
101
+ * Give a type a distinct identity without changing its runtime representation.\
102
+ * E.g. when "branding" a simple string type, it must always be explicitly casted to the branded type.
103
+ *
104
+ * @see https://www.learningtypescript.com/articles/branded-types
105
+ * @see https://youtu.be/aP6w2OzidYM
106
+ *
107
+ * @example
108
+ * type userId = Brand<string, 'userId'>;
109
+ * const test = (id: userId) => {
110
+ * console.log(id);
111
+ * };
112
+ *
113
+ * test('blah'); // error
114
+ * test('blah' as userId);
115
+ */
116
+ declare type Brand<T, B extends string> = T & {
117
+ [__brand]: B;
118
+ };
119
+
7
120
  export declare class Button {
8
121
  #private;
9
122
  readonly id: CtrlId;
10
123
  constructor(id: CtrlId);
124
+ /**
125
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
126
+ * not meant for.
127
+ *
128
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
129
+ * callback.
130
+ */
11
131
  onRendered(callback: OnRenderedCallback<HTMLButtonElement>): CallbackUnsubscribeOption;
12
132
  onClick(callback: OnClickCallback): CallbackUnsubscribeOption;
13
133
  setVisible(visible: boolean): Promise<void>;
14
134
  setText(text: string): void;
135
+ /**
136
+ * Set arbitrary properties of the button control.\
137
+ * Behavior is the same as when setting the respective property in the configurator editor.
138
+ *
139
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
140
+ * E.g. setting `visible` is not allowed because {@link ButtonV1.setVisible} should be used instead.
141
+ */
142
+ setProperty<T extends keyof SetButtonPropertyValue>(propertyName: T, value: SetButtonPropertyValue[T]): void;
15
143
  }
16
144
 
17
145
  declare type CallbackUnsubscribeOption = {
@@ -20,11 +148,22 @@ declare type CallbackUnsubscribeOption = {
20
148
 
21
149
  export declare namespace CbnSdk {
22
150
  export {
151
+ addButtonControl,
152
+ addCheckboxControl,
153
+ addCollapsibleControl,
154
+ addComboboxControl,
155
+ addCustomControl,
156
+ addDataviewControl,
157
+ addInputControl,
158
+ addPanelControl,
159
+ addTextControl,
160
+ beforeConfiguratorIsRendered,
23
161
  configuratorIsInIFrame,
24
162
  finishConfiguration,
25
163
  fireAnalyticsEvent,
26
164
  getAssetPaths,
27
165
  getParentPageUrl,
166
+ onParentPageEvent,
28
167
  navigateToLogin,
29
168
  onAnyCmpValueChanged,
30
169
  redirectParentPage,
@@ -32,16 +171,47 @@ export declare namespace CbnSdk {
32
171
  setConfiguratorIFrameSize,
33
172
  shareConfiguration,
34
173
  createSyncCmpValuesStore,
174
+ uploadFiles,
175
+ uploadImages,
176
+ uploadTempFiles,
177
+ uploadTempImages,
178
+ convertDocument,
179
+ createPdfFromAssets,
180
+ createArPage,
35
181
  version
36
182
  }
37
183
  }
38
184
 
185
+ export declare type CfgnFileUploadData<T extends string = string> = {
186
+ [fileName in T]: {
187
+ file: FileOrDataUri;
188
+ displayName?: string;
189
+ };
190
+ };
191
+
39
192
  export declare class Checkbox {
40
193
  #private;
41
194
  readonly id: CtrlId;
42
195
  constructor(id: CtrlId);
196
+ /**
197
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
198
+ * not meant for.
199
+ *
200
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
201
+ * callback.
202
+ */
43
203
  onRendered(callback: OnRenderedCallback<HTMLLabelElement>): CallbackUnsubscribeOption;
44
204
  setVisible(visible: boolean): Promise<void>;
205
+ setChecked(checked: boolean): void;
206
+ onCheckedChange(callback: (checked: boolean) => void | Promise<void>): CallbackUnsubscribeOption;
207
+ /**
208
+ * Set arbitrary properties of the checkbox control.\
209
+ * Behavior is the same as when setting the respective property in the configurator editor.
210
+ *
211
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
212
+ * E.g. setting `visible` is not allowed because {@link CheckboxV1.setVisible} should be used instead.
213
+ */
214
+ setProperty<T extends keyof SetCheckboxPropertyValue>(propertyName: T, value: SetCheckboxPropertyValue[T]): void;
45
215
  }
46
216
 
47
217
  declare type CmpName = string;
@@ -84,8 +254,149 @@ export declare class Collapsible {
84
254
  #private;
85
255
  readonly id: CtrlId;
86
256
  constructor(id: CtrlId);
257
+ /**
258
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
259
+ * not meant for.
260
+ *
261
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
262
+ * callback.
263
+ */
87
264
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
88
265
  setVisible(visible: boolean): Promise<void>;
266
+ /**
267
+ * Set arbitrary properties of the collapsible control.\
268
+ * Behavior is the same as when setting the respective property in the configurator editor.
269
+ *
270
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
271
+ * E.g. setting `visible` is not allowed because {@link CollapsibleV1.setVisible} should be used instead.
272
+ */
273
+ setProperty<T extends keyof SetCollapsiblePropertyValue>(propertyName: T, value: SetCollapsiblePropertyValue[T]): void;
274
+ }
275
+
276
+ export declare class Combobox<TValue extends NonNullable<DataListValue>> {
277
+ #private;
278
+ readonly id: CtrlId;
279
+ constructor(id: CtrlId);
280
+ /**
281
+ * See {@link CustomControlV1.onRendered} for detailed information on what you can do with this listener and what it
282
+ * is not meant for.
283
+ *
284
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
285
+ * callback.
286
+ */
287
+ onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
288
+ /**
289
+ * See {@link CustomControlV1.onRendered} for detailed information on what you can do with this listener and what it
290
+ * is not meant for. Most of the information there also applies to `onItemRendered`.
291
+ *
292
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
293
+ * callback which also applies here.
294
+ *
295
+ * @param callback Callback function which is given the rendered HTML element and the corresponding item data.
296
+ *
297
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
298
+ * type of the table component from which the combobox entries are populated:
299
+ *
300
+ * ```ts
301
+ * combobox.onItemRendered<IProductsTable[number]>((el, itemData) => { ... })
302
+ * ```
303
+ */
304
+ onItemRendered<TItemData>(callback: (element: HTMLDivElement, itemData: TItemData) => void): CallbackUnsubscribeOption;
305
+ /**
306
+ * See {@link CustomControlV1.onRendered} for detailed information on what you can do with this listener and what it
307
+ * is not meant for. Most of the information there also applies to `onValueItemRendered`.
308
+ *
309
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
310
+ * callback which also applies here.
311
+ *
312
+ * @param callback Callback function which is given the rendered HTML element and the corresponding item data of the
313
+ * currently selected value item shown in the trigger.
314
+ *
315
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
316
+ * type of the table component from which the combobox entries are populated:
317
+ *
318
+ * ```ts
319
+ * combobox.onValueItemRendered<IProductsTable[number]>((el, itemData) => { ... })
320
+ * ```
321
+ */
322
+ onValueItemRendered<TItemData>(callback: (element: HTMLDivElement, itemData: TItemData) => void): CallbackUnsubscribeOption;
323
+ /**
324
+ * See {@link CustomControlV1.onRendered} for detailed information on what you can do with this listener and what it
325
+ * is not meant for. Most of the information there also applies to `onGroupHeaderRendered`.
326
+ *
327
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
328
+ * callback which also applies here.
329
+ *
330
+ * @param callback Callback function which is given the rendered HTML element and the corresponding group data.
331
+ *
332
+ * Typical usage for type safe access to the group data where `IProductGroupsTable` is the auto
333
+ * generated type of the table component from which the combobox groups are populated:
334
+ *
335
+ * ```ts
336
+ * combobox.onGroupHeaderRendered<IProductGroupsTable[number]>((el, groupData) => { ... })
337
+ * ```
338
+ */
339
+ onGroupHeaderRendered<TGroupData>(callback: (element: HTMLDivElement, groupData: TGroupData) => void): CallbackUnsubscribeOption;
340
+ /**
341
+ * Fires when the selection is committed which is:
342
+ * - in single select mode: when the popup closes (or when an option is clicked).
343
+ * - in multi select mode: immediately on every selection change.
344
+ *
345
+ * @param callback Callback function which is given the raw selection value/keys and the corresponding item data of
346
+ * all the selected items.
347
+ *
348
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
349
+ * type of the table component from which the combobox entries are populated:
350
+ *
351
+ * ```ts
352
+ * // Single selection:
353
+ * combobox.onValueChange<IProductsTable[number]>((value, valueItemData) => { ... })
354
+ *
355
+ * // Multi selection:
356
+ * combobox.onValueChange<IProductsTable>((value, valueItemData) => { ... })
357
+ * ```
358
+ */
359
+ onValueChange<TItemData extends TValue extends any[] ? any[] : any>(callback: (value: TValue | undefined, valueItemData: TItemData | undefined) => void): CallbackUnsubscribeOption;
360
+ /**
361
+ * Registers a callback that fires when a combobox item is clicked.
362
+ *
363
+ * - Fires **before** `onValueChange`.
364
+ * - Fires even when the clicked item is already selected.
365
+ *
366
+ * @param callback Callback function which is given the item data of the clicked item and the raw mouse event.
367
+ *
368
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
369
+ * type of the table component from which the combobox entries are populated:
370
+ *
371
+ * ```ts
372
+ * combobox.onItemClicked<IProductsTable[number]>((itemData, event) => { ... })
373
+ * ```
374
+ */
375
+ onItemClicked<TItemData>(callback: (itemData: TItemData, event: MouseEvent) => void): CallbackUnsubscribeOption;
376
+ setVisible(visible: boolean): Promise<void>;
377
+ /**
378
+ * Sets the entries (data items) displayed by the combobox. Existing entries are overwritten.
379
+ */
380
+ setEntries(entries: TemplateData[]): void;
381
+ /**
382
+ * Sets the group data used to render the group headers of the combobox. Existing group data is overwritten.
383
+ */
384
+ setGroupData(groupData: TemplateData[]): void;
385
+ /**
386
+ * Set arbitrary properties of the combobox control.\
387
+ * Behavior is the same as when setting the respective property in the configurator editor.
388
+ *
389
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
390
+ * E.g. setting `visible` is not allowed because {@link ComboboxV1.setVisible} should be used instead.
391
+ *
392
+ * When using properties of type `LiquidTemplateSource`, you have to manually cast the given `string` to
393
+ * `LiquidTemplateSource` like this:
394
+ *
395
+ * ```ts
396
+ * combobox.setProperty('dataTemplate', '<span>{{ Name }}</span>' as LiquidTemplateSource);
397
+ * ```
398
+ */
399
+ setProperty<T extends keyof SetComboboxPropertyValue>(propertyName: T, value: SetComboboxPropertyValue[T]): void;
89
400
  }
90
401
 
91
402
  /**
@@ -93,6 +404,279 @@ export declare class Collapsible {
93
404
  */
94
405
  export declare const configuratorIsInIFrame: () => boolean;
95
406
 
407
+ /**
408
+ * Create and convert a document (e.g. HTML to PDF).\
409
+ * The conversion consists of multiple individual tasks to allow full flexibility when creating documents.
410
+ *
411
+ * Example case: Create a PDF with dynamic content (PDF asset) and append a static product datasheet.
412
+ *
413
+ * See also {@link createPdfFromAssets} for a simplified version to create a PDF.
414
+ * @param tasks The tasks are executed based on their connection with the properties `name` and `inputTaskName`
415
+ * (the order in the array is irrelevant)
416
+ * @returns URL to the generated cfgn file, if successful
417
+ *
418
+ * @example
419
+ * ```ts
420
+ * const resultUrl = await convertDocument([
421
+ * {
422
+ * type: DocumentConvertTaskTypes.PdfAsset,
423
+ * name: 'HtmlToPdfTask',
424
+ * bundleAliasName: 'MyBundle',
425
+ * assetPath: 'quotePdfAsset',
426
+ * context: {
427
+ * subject: 'MySubject',
428
+ * },
429
+ * },
430
+ * {
431
+ * type: DocumentConvertTaskTypes.OutputToCfgnFile,
432
+ * name: 'OutputPdfTask',
433
+ * inputTaskName: 'HtmlToPdfTask',
434
+ * cfgnFileName: 'QuotePdf',
435
+ * cfgnFileExtension: 'pdf',
436
+ * cfgnFileDisplayName: `Your_quote_${new Date().toISOString()}`,
437
+ * },
438
+ * ]);
439
+ * ```
440
+ */
441
+ export declare const convertDocument: (tasks: DocumentConvertTask[]) => Promise<string | undefined>;
442
+
443
+ /**
444
+ * Uploads the given GLB file to a peristent storage and creates a dedicated page with an AR viewer that loads the GLB.
445
+ *
446
+ * After successful creation, it either redirects to that page or shows a dialog with a QR code linking to that page.
447
+ *
448
+ * Whether it redirects or shows a dialog depends on the browsers capabilities to directly open AR experiences.
449
+ */
450
+ export declare const createArPage: (glb: File, options?: SdkCreateArPageOptions) => Promise<void>;
451
+
452
+ declare type CreateButtonProperties = {
453
+ text: string | undefined;
454
+ width: string | undefined;
455
+ height: string | undefined;
456
+ minWidth: string | undefined;
457
+ minHeight: string | undefined;
458
+ maxWidth: string | undefined;
459
+ maxHeight: string | undefined;
460
+ margin: string | undefined;
461
+ padding: string | undefined;
462
+ cssClasses: string[] | undefined;
463
+ backgroundNormal: string | undefined;
464
+ backgroundHover: string | undefined;
465
+ backgroundPressed: string | undefined;
466
+ borderRadius: string | undefined;
467
+ font: string | undefined;
468
+ color: string | undefined;
469
+ visible: boolean | undefined;
470
+ enabled: boolean | undefined;
471
+ tooltipText: string | undefined;
472
+ tooltipPos: ElementPosOption | undefined;
473
+ alignmentBlock: AlignmentBlockOption | undefined;
474
+ };
475
+
476
+ declare type CreateCheckboxProperties = {
477
+ checked: boolean | undefined;
478
+ captionPos: ElementPosOption | undefined;
479
+ captionText: string | undefined;
480
+ visible: boolean | undefined;
481
+ enabled: boolean | undefined;
482
+ minWidth: string | undefined;
483
+ minHeight: string | undefined;
484
+ maxWidth: string | undefined;
485
+ maxHeight: string | undefined;
486
+ margin: string | undefined;
487
+ padding: string | undefined;
488
+ font: string | undefined;
489
+ color: string | undefined;
490
+ backgroundNormal: string | undefined;
491
+ backgroundHover: string | undefined;
492
+ backgroundPressed: string | undefined;
493
+ borderRadius: string | undefined;
494
+ cssClasses: string[] | undefined;
495
+ tooltipText: string | undefined;
496
+ tooltipPos: ElementPosOption | undefined;
497
+ };
498
+
499
+ declare type CreateCollapsibleProperties = {
500
+ captionText: string | undefined;
501
+ collapsed: boolean | undefined;
502
+ group: string | undefined;
503
+ visible: boolean | undefined;
504
+ cssClasses: string[] | undefined;
505
+ };
506
+
507
+ declare type CreateComboboxProperties = {
508
+ value: string | undefined;
509
+ valueType: DataListValueType | undefined;
510
+ width: string | undefined;
511
+ minWidth: string | undefined;
512
+ maxWidth: string | undefined;
513
+ height: string | undefined;
514
+ minHeight: string | undefined;
515
+ maxHeight: string | undefined;
516
+ backgroundNormal: string | undefined;
517
+ margin: string | undefined;
518
+ padding: string | undefined;
519
+ borderRadius: string | undefined;
520
+ captionText: string | undefined;
521
+ captionPos: ElementPosOption | undefined;
522
+ cssClasses: string[] | undefined;
523
+ flexDirection: FlexDirection | undefined;
524
+ flexWrap: boolean | undefined;
525
+ gap: string | undefined;
526
+ visible: boolean | undefined;
527
+ enabled: boolean | undefined;
528
+ placeholder: string | undefined;
529
+ dataEntries: DataListEntries | undefined;
530
+ dataTemplate: LiquidTemplateSource | undefined;
531
+ valueTemplate: LiquidTemplateSource | undefined;
532
+ groupKey: string | undefined;
533
+ groupData: DataListGroupData | undefined;
534
+ groupTemplate: LiquidTemplateSource | undefined;
535
+ tooltipKey: string | undefined;
536
+ itemHiddenKey: string | undefined;
537
+ itemDisabledKey: string | undefined;
538
+ itemCssClassesKey: string | undefined;
539
+ filterable: boolean | undefined;
540
+ filterKey: string | undefined;
541
+ filterCaptionText: string | undefined;
542
+ filterPlaceholder: string | undefined;
543
+ listMode: ListMode | undefined;
544
+ clearable: boolean | undefined;
545
+ };
546
+
547
+ declare type CreateCustomCtrlProperties = {
548
+ customCodeControlled: boolean | undefined;
549
+ rawHtml: string | undefined;
550
+ visible: boolean | undefined;
551
+ cssClasses: string[] | undefined;
552
+ };
553
+
554
+ declare type CreateDataviewProperties = {
555
+ value: string | undefined;
556
+ valueType: DataListValueType | undefined;
557
+ dataEntries: DataListEntries | undefined;
558
+ cssClasses: string[] | undefined;
559
+ padding: string | undefined;
560
+ margin: string | undefined;
561
+ visible: boolean | undefined;
562
+ gap: string | undefined;
563
+ flexDirection: FlexDirection | undefined;
564
+ flexWrap: boolean | undefined;
565
+ dataTemplate: LiquidTemplateSource | undefined;
566
+ groupKey: string | undefined;
567
+ groupData: DataListGroupData | undefined;
568
+ groupTemplate: LiquidTemplateSource | undefined;
569
+ tooltipKey: string | undefined;
570
+ itemHiddenKey: string | undefined;
571
+ itemDisabledKey: string | undefined;
572
+ itemCssClassesKey: string | undefined;
573
+ filterable: boolean | undefined;
574
+ filterKey: string | undefined;
575
+ filterCaptionText: string | undefined;
576
+ filterPlaceholder: string | undefined;
577
+ listMode: ListMode | undefined;
578
+ allowDeselect: boolean | undefined;
579
+ };
580
+
581
+ declare type CreateInputProperties = {
582
+ value: string | undefined;
583
+ errorMsg: string | undefined;
584
+ description: string | undefined;
585
+ captionText: string | undefined;
586
+ captionPos: ElementPosOption | undefined;
587
+ captionWidth: string | undefined;
588
+ backgroundNormal: string | undefined;
589
+ borderRadius: string | undefined;
590
+ padding: string | undefined;
591
+ margin: string | undefined;
592
+ width: string | undefined;
593
+ height: string | undefined;
594
+ maxHeight: string | undefined;
595
+ maxWidth: string | undefined;
596
+ minHeight: string | undefined;
597
+ minWidth: string | undefined;
598
+ enabled: boolean | undefined;
599
+ visible: boolean | undefined;
600
+ cssClasses: string[] | undefined;
601
+ placeholder: string | undefined;
602
+ };
603
+
604
+ declare type CreatePanelProperties = {
605
+ margin: string | undefined;
606
+ width: string | undefined;
607
+ height: string | undefined;
608
+ minWidth: string | undefined;
609
+ minHeight: string | undefined;
610
+ maxWidth: string | undefined;
611
+ maxHeight: string | undefined;
612
+ padding: string | undefined;
613
+ flexDirection: FlexDirection | undefined;
614
+ flexGrow: string | undefined;
615
+ flexWrap: boolean | undefined;
616
+ alignmentBlock: AlignmentBlockOption | undefined;
617
+ gap: string | undefined;
618
+ cssClasses: string[] | undefined;
619
+ backgroundNormal: string | undefined;
620
+ visible: boolean | undefined;
621
+ enabled: boolean | undefined;
622
+ opacity: string | undefined;
623
+ border: string | undefined;
624
+ borderRadius: string | undefined;
625
+ };
626
+
627
+ /**
628
+ * Creates a PDF from one or more assets which will be merged in the given order.
629
+ *
630
+ * Simplified helper built on top of {@link convertDocument}.
631
+ * Use {@link convertDocument} directly for advanced scenarios.
632
+ *
633
+ * @param bundleAliasName Bundle name where the assets are stored
634
+ * @param assetTasks One or more "assets tasks" which will be merged in the given order
635
+ * @param cfgnFileName Name of the generated cfgn file
636
+ * @param cfgnFileDisplayName Optional name which will be used when downloading the file
637
+ * @returns URL to the generated cfgn file, if successful
638
+ *
639
+ * @example
640
+ * ```ts
641
+ * const resultUrl = await createPdfFromAssets(
642
+ * 'MyBundle',
643
+ * [
644
+ * {
645
+ * type: 'PdfAsset',
646
+ * assetPath: 'quotePdfAsset',
647
+ * context: {
648
+ * subject: 'MySubject',
649
+ * },
650
+ * },
651
+ * {
652
+ * type: 'Asset',
653
+ * assetPath: 'Pdf2',
654
+ * },
655
+ * ],
656
+ * 'QuotePdf',
657
+ * `Your_quote_${new Date().toISOString()}`
658
+ * );
659
+ * ```
660
+ *
661
+ */
662
+ export declare function createPdfFromAssets(bundleAliasName: string, assetTasks: CreatePdfTasks[], cfgnFileName: string, cfgnFileDisplayName?: string): Promise<string | undefined>;
663
+
664
+ export declare type CreatePdfTasks = {
665
+ type: CreatePdfTaskTypes.PdfAsset;
666
+ assetPath: string;
667
+ context: object;
668
+ } | {
669
+ type: CreatePdfTaskTypes.Asset;
670
+ assetPath: string;
671
+ };
672
+
673
+ export declare enum CreatePdfTaskTypes {
674
+ /** Create a PDF with dynamic content based on the given `context` */
675
+ PdfAsset = 0,
676
+ /** Static pdf asset (which is stored as File Asset) */
677
+ Asset = 1
678
+ }
679
+
96
680
  /**
97
681
  * Creates a store holding component values which can be accessed synchronously.
98
682
  *
@@ -151,6 +735,32 @@ export declare const createSyncCmpValuesStore: <TCmps extends {
151
735
  [id: CmpName]: ValueComponent;
152
736
  }>(cmps: TCmps) => Promise<Readonly<SyncCmpValuesStore<TCmps>>>;
153
737
 
738
+ declare type CreateTextProperties = {
739
+ text: string | undefined;
740
+ width: string | undefined;
741
+ height: string | undefined;
742
+ padding: string | undefined;
743
+ margin: string | undefined;
744
+ cssClasses: string[] | undefined;
745
+ visible: boolean | undefined;
746
+ tooltipText: string | undefined;
747
+ tooltipPos: ElementPosOption | undefined;
748
+ htmlTag: HtmlTagKind | undefined;
749
+ minWidth: string | undefined;
750
+ minHeight: string | undefined;
751
+ maxWidth: string | undefined;
752
+ maxHeight: string | undefined;
753
+ font: string | undefined;
754
+ color: string | undefined;
755
+ wrapText: boolean | undefined;
756
+ selfAlignmentBlock: AlignmentBlockOption | undefined;
757
+ };
758
+
759
+ /** Any control instance */
760
+ declare type Ctrl = {
761
+ id: CtrlId;
762
+ };
763
+
154
764
  declare type CtrlId = z.infer<typeof ZCtrlId>;
155
765
 
156
766
  export declare class CustomControl {
@@ -205,6 +815,10 @@ export declare class CustomControl {
205
815
  *
206
816
  * !!! Important !!!
207
817
  *
818
+ * See {@link OnRenderedCallback} for important information regarding the `element` which is passed to the callback.
819
+ *
820
+ * !!! Important !!!
821
+ *
208
822
  * This is **not** meant to be used for manipulating the rendered content of the control besides simple,
209
823
  * non-structural/-behavioral changes like adding CSS classes or data attributes etc.
210
824
  *
@@ -215,6 +829,14 @@ export declare class CustomControl {
215
829
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
216
830
  getElement(): HTMLElement | undefined;
217
831
  setVisible(visible: boolean): Promise<void>;
832
+ /**
833
+ * Set arbitrary properties of the custom control.\
834
+ * Behavior is the same as when setting the respective property in the configurator editor.
835
+ *
836
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
837
+ * E.g. setting `visible` is not allowed because {@link CustomControlV1.setVisible} should be used instead.
838
+ */
839
+ setProperty<T extends keyof SetCustomCtrlPropertyValue>(propertyName: T, value: SetCustomCtrlPropertyValue[T]): void;
218
840
  }
219
841
 
220
842
  /**
@@ -223,14 +845,174 @@ export declare class CustomControl {
223
845
  */
224
846
  declare type CustomCtrlRenderFn = (element: HTMLDivElement, rawHtml: string | undefined) => void | Promise<void>;
225
847
 
226
- export declare class Dataview {
848
+ declare type DataListEntries = z.infer<typeof ZDataListEntries>;
849
+
850
+ declare type DataListGroupData = z.infer<typeof ZDataListGroupData>;
851
+
852
+ /**
853
+ * The actual value which comes from the entries data and which is converted to `DataListHtmlValue` before being passed
854
+ * to the DOM elements.
855
+ */
856
+ declare type DataListValue = string | string[] | number | number[] | undefined;
857
+
858
+ declare type DataListValue_2<TMode extends ListMode, TValueType extends DataListValueType> = TMode extends 'no-selection' ? never : TMode extends 'single' ? TValueType : TValueType extends infer TBase ? TBase extends string | number ? TBase[] : never : never;
859
+
860
+ declare type DataListValueType = z.infer<typeof ZDataListValueType>;
861
+
862
+ export declare class Dataview<TValue extends NonNullable<DataListValue>> {
227
863
  #private;
228
864
  readonly id: CtrlId;
229
865
  constructor(id: CtrlId);
866
+ /**
867
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
868
+ * not meant for.
869
+ *
870
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
871
+ * callback.
872
+ */
230
873
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
874
+ /**
875
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
876
+ * not meant for. Most of the information there also applies to `onItemRendered`.
877
+ *
878
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
879
+ * callback which also applies here.
880
+ *
881
+ * @param callback Callback function which is given the rendered HTML element and the corresponding item data.
882
+ *
883
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
884
+ * type of the table component from which the dataview entries are populated:
885
+ *
886
+ * ```ts
887
+ * dataview.onItemRendered<IProductsTable[number]>(el, itemData) => { ... }
888
+ * ```
889
+ */
890
+ onItemRendered<TItemData>(callback: (element: HTMLDivElement, itemData: TItemData) => void): CallbackUnsubscribeOption;
891
+ /**
892
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
893
+ * not meant for. Most of the information there also applies to `onGroupHeaderRendered`.
894
+ *
895
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
896
+ * callback which also applies here.
897
+ *
898
+ * @param callback Callback function which is given the rendered HTML element and the corresponding group data.
899
+ *
900
+ * Typical usage for type safe access to the group data where `IProductGroupsTable` is the auto
901
+ * generated type of the table component from which the dataview groups are populated:
902
+ *
903
+ * ```ts
904
+ * dataview.onGroupHeaderRendered<IProductGroupsTable[number]>((el, groupData) => { ... })
905
+ * ```
906
+ */
907
+ onGroupHeaderRendered<TGroupData>(callback: (element: HTMLDivElement, groupData: TGroupData) => void): CallbackUnsubscribeOption;
908
+ /**
909
+ * @param callback Callback function which is given the raw selection value/keys and the corresponding item data of
910
+ * all the selected items.
911
+ *
912
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
913
+ * type of the table component from which the dataview entries are populated:
914
+ *
915
+ * ```ts
916
+ * // Single selection list:
917
+ * dataview.onValueChange<IProductsTable[number]>(value, valueItemData) => { ... }
918
+ *
919
+ * // Multi selection list:
920
+ * dataview.onValueChange<IProductsTable>(value, valueItemData) => { ... }
921
+ * ```
922
+ */
923
+ onValueChange<TItemData extends TValue extends any[] ? any[] : any>(callback: (value: TValue | undefined, valueItemData: TItemData | undefined) => void): CallbackUnsubscribeOption;
924
+ /**
925
+ * Registers a callback that fires when a datalist item is clicked.
926
+ *
927
+ * - Fires **before** `onValueChange`.
928
+ * - Fires even when the clicked item is already selected.
929
+ *
930
+ * @param callback Callback function which is given the item data of rendered item and the raw mouse event.
931
+ *
932
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
933
+ * type of the table component from which the dataview entries are populated:
934
+ *
935
+ * ```ts
936
+ * dataview.onItemClicked<IProductsTable[number]>(itemData, event) => { ... }
937
+ * ```
938
+ */
939
+ onItemClicked<TItemData>(callback: (itemData: TItemData, event: MouseEvent) => void): CallbackUnsubscribeOption;
231
940
  setVisible(visible: boolean): Promise<void>;
941
+ /**
942
+ * Sets the entries (data items) displayed by the dataview. Existing entries are overwritten.
943
+ */
944
+ setEntries(entries: TemplateData[]): void;
945
+ /**
946
+ * Sets the group data used to render the group headers of the dataview. Existing group data is overwritten.
947
+ */
948
+ setGroupData(groupData: TemplateData[]): void;
949
+ /**
950
+ * Set arbitrary properties of the dataview control.\
951
+ * Behavior is the same as when setting the respective property in the configurator editor.
952
+ *
953
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
954
+ * E.g. setting `visible` is not allowed because {@link DataviewV1.setVisible} should be used instead.
955
+ *
956
+ * When using properties of type `LiquidTemplateSource`, you have to manually cast the given `string` to
957
+ * `LiquidTemplateSource` like this:
958
+ *
959
+ * ```ts
960
+ * dataview.setProperty('dataTemplate', '<span>{{ Name }}</span>' as LiquidTemplateSource);
961
+ * ```
962
+ */
963
+ setProperty<T extends keyof SetDataviewPropertyValue>(propertyName: T, value: SetDataviewPropertyValue[T]): void;
964
+ }
965
+
966
+ export declare type DocumentConvertTask = {
967
+ type: DocumentConvertTaskTypes.PdfAsset;
968
+ name: string;
969
+ /** Alias name, as set in the asset bundle assignment dialog */
970
+ bundleAliasName: string;
971
+ /** Dot seperated path, e.g. 'MyPDFFolder.MyPDFAsset' */
972
+ assetPath: string;
973
+ /** Custom object which must represent the context, as defined in the PDF asset */
974
+ context: object;
975
+ } | {
976
+ type: DocumentConvertTaskTypes.Asset;
977
+ name: string;
978
+ /** Alias name, as set in the asset bundle assignment dialog */
979
+ bundleAliasName: string;
980
+ /** Dot seperated path, e.g. 'MyPDFFolder.MyStaticAsset' */
981
+ assetPath: string;
982
+ } | {
983
+ type: DocumentConvertTaskTypes.Merge;
984
+ name: string;
985
+ /** Names of the tasks which should be merged in the given order */
986
+ inputTaskNames: string[];
987
+ } | {
988
+ type: DocumentConvertTaskTypes.OutputToCfgnFile;
989
+ name: string;
990
+ inputTaskName: string;
991
+ /** Name of the generated cfgn file */
992
+ cfgnFileName: string;
993
+ cfgnFileExtension: string;
994
+ /** Optional name which will be used when downloading the file */
995
+ cfgnFileDisplayName?: string;
996
+ };
997
+
998
+ export declare enum DocumentConvertTaskTypes {
999
+ /** Create a PDF with dynamic content based on the given `context` */
1000
+ PdfAsset = 0,
1001
+ /** Retrieve an asset to be used for suceeding tasks (e.g. static PDF for merge) */
1002
+ Asset = 1,
1003
+ /** Merge multiple input tasks into a single document */
1004
+ Merge = 2,
1005
+ /** Finalize the conversion by storing it as `Configuration file` */
1006
+ OutputToCfgnFile = 4
232
1007
  }
233
1008
 
1009
+ declare type ElementPosOption = z.infer<typeof ZElementPosOption>;
1010
+
1011
+ declare type FileOrDataUri = File | {
1012
+ dataUri: string;
1013
+ extension: string;
1014
+ };
1015
+
234
1016
  /**
235
1017
  * Creates a finish of the current configuration by running all the Configurator's finish actions and optionally passes
236
1018
  * the resulting data to the parent page.
@@ -290,6 +1072,11 @@ declare type FinishConfigurationBaseOptions = {
290
1072
  */
291
1073
  export declare const fireAnalyticsEvent: (event: string, eventData?: object | string) => Promise<ParentPageComResult<void>>;
292
1074
 
1075
+ export declare enum FlexDirection {
1076
+ Column = 0,
1077
+ Row = 1
1078
+ }
1079
+
293
1080
  export declare type FlexShopFinishJson = Shopware6FinishJson;
294
1081
 
295
1082
  /**
@@ -312,12 +1099,31 @@ export declare const getParentPageUrl: () => Promise<ParentPageComResult<{
312
1099
  url: string;
313
1100
  }>>;
314
1101
 
1102
+ declare type HtmlTagKind = z.infer<typeof ZHtmlTagKind>;
1103
+
315
1104
  export declare class Input {
316
1105
  #private;
317
1106
  readonly id: CtrlId;
318
1107
  constructor(id: CtrlId);
1108
+ /**
1109
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
1110
+ * not meant for.
1111
+ *
1112
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
1113
+ * callback.
1114
+ */
319
1115
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
320
1116
  setVisible(visible: boolean): Promise<void>;
1117
+ setValue(value: string): void;
1118
+ onValueChange(callback: (value: string) => void | Promise<void>): CallbackUnsubscribeOption;
1119
+ /**
1120
+ * Set arbitrary properties of the input control.\
1121
+ * Behavior is the same as when setting the respective property in the configurator editor.
1122
+ *
1123
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
1124
+ * E.g. setting `visible` is not allowed because {@link InputV1.setVisible} should be used instead.
1125
+ */
1126
+ setProperty<T extends keyof SetInputPropertyValue>(propertyName: T, value: SetInputPropertyValue[T]): void;
321
1127
  }
322
1128
 
323
1129
  declare type JsonArray = Array<SerializableJsonValue>;
@@ -328,10 +1134,18 @@ declare type JsonObject = {
328
1134
 
329
1135
  declare type JsonPrimitive = string | number | boolean | null;
330
1136
 
1137
+ /**
1138
+ * Template written in ["Liquid HTML"](https://liquidjs.com/tutorials/intro-to-liquid.html)).
1139
+ * When rendering actual HTML from this, it is enriched by the `dataEntries`.
1140
+ */
1141
+ export declare type LiquidTemplateSource = Brand<string, 'LiquidTemplate'>;
1142
+
1143
+ declare type ListMode = z.infer<typeof ZListMode>;
1144
+
331
1145
  /**
332
1146
  * Raw material JSON which can be passed to Babylon.js e.g. via `Material.Parse(material)`
333
1147
  */
334
- declare type MaterialAsset = z.infer<typeof ZMaterialAsset>;
1148
+ declare type MaterialObject = z.infer<typeof ZMaterialObject>;
335
1149
 
336
1150
  /**
337
1151
  * Navigates to the login page of the Configurator.
@@ -381,16 +1195,68 @@ export declare const onAnyCmpValueChanged: <TInput extends ValueComponent>(liste
381
1195
 
382
1196
  declare type OnClickCallback = () => void;
383
1197
 
1198
+ /**
1199
+ * Registers a callback for events from the parent page.\
1200
+ * The parent page can send those events by calling `Combeenation.sendEventToConfigurator`.
1201
+ */
1202
+ export declare const onParentPageEvent: (callback: (type: "success" | "error", data: unknown) => void) => CallbackUnsubscribeOption;
1203
+
1204
+ /**
1205
+ * @param element The rendered DOM element.
1206
+ *
1207
+ * !!! Important !!!
1208
+ *
1209
+ * This can either be a newly created element or the same, reused element which was already passed to a
1210
+ * previous `onRendered` callback invocation.
1211
+ *
1212
+ * What does this mean?
1213
+ * - When registering event listener, avoid `element.addEventListener` but use the form
1214
+ * `element.onclick = ...` instead.
1215
+ * - Be careful when using API like `MutationObserver` on the element and ensure to not register multiple
1216
+ * observer on the same element over time.
1217
+ * - Be careful when binding/using the element in external libraries which might use `addEventListener`
1218
+ * or things like `MutationObserver` internally (e.g. DnD libraries etc.).
1219
+ * - If you **need to** use `addEventListener` etc. e.g. because you have to use a library which uses it
1220
+ * internally, make sure to manually check whether the element was already processed/initialized in a
1221
+ * previous `onRendered` invocation or not.
1222
+ *
1223
+ * E.g. something like this:
1224
+ *
1225
+ * ```ts
1226
+ * dataview.onRendered((element) => {
1227
+ * if (element.dataset.wasVisited) return;
1228
+ * element.dataset.wasVisited = 'true';
1229
+ *
1230
+ * // -> Safely use `element.addEventListener` or `dndManager.init(element)` etc.
1231
+ * });
1232
+ */
384
1233
  declare type OnRenderedCallback<T extends HTMLElement = HTMLElement> = (element: T) => void;
385
1234
 
386
1235
  export declare class Panel {
387
1236
  #private;
388
1237
  readonly id: CtrlId;
389
1238
  constructor(id: CtrlId);
1239
+ /**
1240
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
1241
+ * not meant for.
1242
+ *
1243
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
1244
+ * callback.
1245
+ */
390
1246
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
391
1247
  setVisible(visible: boolean): Promise<void>;
1248
+ /**
1249
+ * Set arbitrary properties of the panel control.\
1250
+ * Behavior is the same as when setting the respective property in the configurator editor.
1251
+ *
1252
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
1253
+ * E.g. setting `visible` is not allowed because {@link PanelV1.setVisible} should be used instead.
1254
+ */
1255
+ setProperty<T extends keyof SetPanelPropertyValue>(propertyName: T, value: SetPanelPropertyValue[T]): void;
392
1256
  }
393
1257
 
1258
+ declare type ParentCtrl = Panel | Collapsible;
1259
+
394
1260
  export declare type ParentPageCheckoutData = {
395
1261
  /** Cfgn id */
396
1262
  id: string;
@@ -469,16 +1335,49 @@ export declare const redirectParentPage: (url: string) => Promise<ParentPageComR
469
1335
 
470
1336
  declare type SdkAssetPaths = {
471
1337
  babylonJsAssets: {
472
- [key: AssetName]: Url;
1338
+ [key: AssetName]: UrlString;
473
1339
  };
474
1340
  materialAssets: {
475
- [key: AssetName]: MaterialAsset;
1341
+ [key: AssetName]: MaterialObject;
476
1342
  };
477
1343
  textureImageAssets: {
478
- [key: AssetName]: Url;
1344
+ [key: AssetName]: UrlString;
479
1345
  };
480
1346
  };
481
1347
 
1348
+ /**
1349
+ * `urls` contains a map of the uploaded files, where the key represents the name and the value the url.\
1350
+ * It's recommended to check for the `success` flag beforehand.
1351
+ */
1352
+ declare type SdkCfgnFileUploadResult<T extends string = string> = {
1353
+ success: false;
1354
+ urls?: never;
1355
+ } | {
1356
+ success: true;
1357
+ urls: {
1358
+ [fileName in T]: string;
1359
+ };
1360
+ };
1361
+
1362
+ declare type SdkCfgnTempFileUploadResult = {
1363
+ success: false;
1364
+ urls?: never;
1365
+ } | {
1366
+ success: true;
1367
+ urls: string[];
1368
+ };
1369
+
1370
+ declare type SdkCreateArPageOptions = {
1371
+ qrSubTitle?: string;
1372
+ qrDescription?: string;
1373
+ preparationText?: string;
1374
+ popupBlockedTitle?: string;
1375
+ popupBlockedDescription?: string;
1376
+ popupBlockedLinkText?: string;
1377
+ environment?: UrlString;
1378
+ loadingScreenImg?: UrlString;
1379
+ };
1380
+
482
1381
  /**
483
1382
  * Send a custom message to the parent page via the "CustomMessage".\
484
1383
  * The parent page can handle those messages by implementing the function `Combeenation.on{msgName}`.
@@ -491,6 +1390,14 @@ export declare const sendCustomMsgToParentPage: (msgName: string, data?: object)
491
1390
  /** A JSON-serializable value safe to use as a `postMessage` payload etc. */
492
1391
  declare type SerializableJsonValue = JsonPrimitive | JsonObject | JsonArray;
493
1392
 
1393
+ declare type SetButtonPropertyValue = Omit<CreateButtonProperties, 'visible'>;
1394
+
1395
+ declare type SetCheckboxPropertyValue = Omit<CreateCheckboxProperties, 'visible'>;
1396
+
1397
+ declare type SetCollapsiblePropertyValue = Omit<CreateCollapsibleProperties, 'visible'>;
1398
+
1399
+ declare type SetComboboxPropertyValue = Omit<CreateComboboxProperties, 'visible' | 'listMode' | 'valueType'>;
1400
+
494
1401
  /**
495
1402
  * Changes the width and/or height of the IFrame and/or scroll position of the parent page window.
496
1403
  *
@@ -509,6 +1416,16 @@ export declare const setConfiguratorIFrameSize: (data: {
509
1416
  scrollToY?: number;
510
1417
  }) => Promise<ParentPageComResult<void>>;
511
1418
 
1419
+ declare type SetCustomCtrlPropertyValue = Omit<CreateCustomCtrlProperties, 'visible'>;
1420
+
1421
+ declare type SetDataviewPropertyValue = Omit<CreateDataviewProperties, 'visible' | 'listMode' | 'valueType'>;
1422
+
1423
+ declare type SetInputPropertyValue = Omit<CreateInputProperties, 'visible'>;
1424
+
1425
+ declare type SetPanelPropertyValue = Omit<CreatePanelProperties, 'visible'>;
1426
+
1427
+ declare type SetTextPropertyValue = Omit<CreateTextProperties, 'visible'>;
1428
+
512
1429
  /**
513
1430
  * Creates a copy of the current configuration and opens a share window for the given platform with the resulting share
514
1431
  * URL
@@ -636,17 +1553,88 @@ declare type SyncCmpValuesStore<TCmps extends Record<CmpName, ValueComponent>> =
636
1553
  [K in keyof TCmps & CmpName]: TCmps[K] extends ValueComponent<any, infer TValue, any> ? TValue | undefined : never;
637
1554
  };
638
1555
 
1556
+ /**
1557
+ * The raw data passed to the corresponding liquid template (e.g. to a datalist item template or a group header
1558
+ * template etc.)
1559
+ */
1560
+ declare type TemplateData = Record<string, unknown>;
1561
+
639
1562
  declare class Text_2 {
640
1563
  #private;
641
1564
  readonly id: CtrlId;
642
1565
  constructor(id: CtrlId);
1566
+ /**
1567
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
1568
+ * not meant for.
1569
+ *
1570
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
1571
+ * callback.
1572
+ */
643
1573
  onRendered(callback: OnRenderedCallback<HTMLSpanElement>): CallbackUnsubscribeOption;
644
1574
  setVisible(visible: boolean): Promise<void>;
645
1575
  setText(text: string): void;
1576
+ /**
1577
+ * Set arbitrary properties of the text control.\
1578
+ * Behavior is the same as when setting the respective property in the configurator editor.
1579
+ *
1580
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
1581
+ * E.g. setting `visible` is not allowed because {@link TextV1.setVisible} should be used instead.
1582
+ */
1583
+ setProperty<T extends keyof SetTextPropertyValue>(propertyName: T, value: SetTextPropertyValue[T]): void;
646
1584
  }
647
1585
  export { Text_2 as Text }
648
1586
 
649
- declare type Url = z.infer<typeof ZUrl>;
1587
+ /**
1588
+ * Upload one or more files into the current configuration
1589
+ *
1590
+ * Consider using {@link uploadTempFiles} if the files don't need to be persisted and
1591
+ * aren't relevant for the finished configuration.
1592
+ *
1593
+ * @param files The key represents the name, which can be used in Hive with `configuration.GetFile("")`
1594
+ * @returns An object with the same keys as the input. The values contain according result information.
1595
+ */
1596
+ export declare const uploadFiles: <T extends string>(files: CfgnFileUploadData<T>) => Promise<SdkCfgnFileUploadResult<T>>;
1597
+
1598
+ /**
1599
+ * Upload one or more images into the current configuration.
1600
+ *
1601
+ * Consider using {@link uploadTempImages} if the images don't need to be persisted and
1602
+ * aren't relevant for the finished configuration.
1603
+ *
1604
+ * @param images The key represents the name, which can be used in Hive with `configuration.GetImage("")`
1605
+ * @returns An object with the same keys as the input. The values contain according result information.
1606
+ */
1607
+ export declare const uploadImages: <T extends string>(images: CfgnFileUploadData<T>) => Promise<SdkCfgnFileUploadResult<T>>;
1608
+
1609
+ /**
1610
+ * Upload temporary files into the current configuration. This should only be used for files which don't need to be
1611
+ * persisted or aren't relevant for the finished configuration.
1612
+ * Examples:
1613
+ * - The user can upload multiple files but he still has to apply them on the product in a second step.
1614
+ * It's recommended to upload the files as temporary files and only upload them as cfgn files after they were
1615
+ * actually applied.
1616
+ *
1617
+ * @param files files to be uploaded
1618
+ * @returns on success it returns the URLs of the uploaded files in the same order as they were provided.
1619
+ */
1620
+ export declare const uploadTempFiles: (files: FileOrDataUri[]) => Promise<SdkCfgnTempFileUploadResult>;
1621
+
1622
+ /**
1623
+ * Upload temporary images into the current configuration. This should only be used for files which don't need to be
1624
+ * persisted or aren't relevant for the finished configuration.
1625
+ * Examples:
1626
+ * - When creating a PDF with screenshots of the 3d model, the images can be uploaded as temporary files, as they
1627
+ * will be embedded in the PDF.
1628
+ * - The user can upload multiple images but he still has to apply them on the product in a second step.
1629
+ * It's recommended to upload the images as temporary files and only upload them as cfgn files after they were
1630
+ * actually applied.
1631
+ *
1632
+ * @param images images to be uploaded
1633
+ * @returns on success it returns the URLs of the uploaded images in the same order as they were provided.
1634
+ */
1635
+ export declare const uploadTempImages: (images: FileOrDataUri[]) => Promise<SdkCfgnTempFileUploadResult>;
1636
+
1637
+ declare type UrlString = z.infer<typeof ZUrlString>;
650
1638
 
651
1639
  /**
652
1640
  * Represents a component of type `Value`
@@ -677,12 +1665,42 @@ export declare class ValueComponent<TName extends CmpName = CmpName, TValue exte
677
1665
 
678
1666
  export declare const version: string;
679
1667
 
1668
+ declare const ZAlignmentBlockOption: z.ZodUnion<readonly [z.ZodLiteral<"topLeft">, z.ZodLiteral<"topCenter">, z.ZodLiteral<"topRight">, z.ZodLiteral<"centerLeft">, z.ZodLiteral<"centerCenter">, z.ZodLiteral<"centerRight">, z.ZodLiteral<"bottomLeft">, z.ZodLiteral<"bottomCenter">, z.ZodLiteral<"bottomRight">]>;
1669
+
680
1670
  declare const ZAssetName: z.ZodString;
681
1671
 
682
- declare const ZCmpValue: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, z.ZodUnknown]>;
1672
+ declare const ZCmpValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>, z.ZodObject<{}, z.core.$strip>, z.ZodUnknown]>;
683
1673
 
684
1674
  declare const ZCtrlId: z.ZodString;
685
1675
 
1676
+ declare const ZDataListEntries: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1677
+
1678
+ declare const ZDataListGroupData: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1679
+
1680
+ /**
1681
+ * !!! Note !!!
1682
+ *
1683
+ * We're relying on those values to be actual TS types which can be used in the generated typings for custom code as
1684
+ * generics like `new Dataview<${valueType}>()`.
1685
+ *
1686
+ * Double check all consuming code if this ever changes (only `FlatCtrlMeta.typeGenerics` at the time of writing).
1687
+ */
1688
+ declare const ZDataListValueType: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">]>;
1689
+
1690
+ declare const ZElementPosOption: z.ZodUnion<readonly [z.ZodLiteral<"left">, z.ZodLiteral<"right">, z.ZodLiteral<"bottom">, z.ZodLiteral<"top">]>;
1691
+
1692
+ declare const ZHtmlTagKind: z.ZodEnum<{
1693
+ div: "div";
1694
+ h1: "h1";
1695
+ h2: "h2";
1696
+ h3: "h3";
1697
+ h4: "h4";
1698
+ h5: "h5";
1699
+ span: "span";
1700
+ }>;
1701
+
1702
+ declare const ZListMode: z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"multi">, z.ZodLiteral<"no-selection">]>;
1703
+
686
1704
  /**
687
1705
  * Raw material JSON which can be passed to Babylon.js e.g. via `Material.Parse(material)`
688
1706
  *
@@ -691,17 +1709,20 @@ declare const ZCtrlId: z.ZodString;
691
1709
  *
692
1710
  * Could be extended as needed.
693
1711
  */
694
- declare const ZMaterialAsset: z.ZodObject<{
695
- name: z.ZodString;
696
- id: z.ZodString;
697
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
698
- name: z.ZodString;
699
- id: z.ZodString;
700
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1712
+ declare const ZMaterialObject: z.ZodObject<{
701
1713
  name: z.ZodString;
702
1714
  id: z.ZodString;
703
- }, z.ZodTypeAny, "passthrough">>;
1715
+ customType: z.ZodEnum<{
1716
+ "BABYLON.PBRMaterial": "BABYLON.PBRMaterial";
1717
+ "BABYLON.PBRMetallicRoughnessMaterial": "BABYLON.PBRMetallicRoughnessMaterial";
1718
+ "BABYLON.PBRSpecularGlossinessMaterial": "BABYLON.PBRSpecularGlossinessMaterial";
1719
+ "BABYLON.StandardMaterial": "BABYLON.StandardMaterial";
1720
+ "BABYLON.BackgroundMaterial": "BABYLON.BackgroundMaterial";
1721
+ "BABYLON.NodeMaterial": "BABYLON.NodeMaterial";
1722
+ }>;
1723
+ tags: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1724
+ }, z.core.$loose>;
704
1725
 
705
- declare const ZUrl: z.ZodBranded<z.ZodString, "Url">;
1726
+ declare const ZUrlString: z.core.$ZodBranded<z.ZodURL, "Url", "out">;
706
1727
 
707
1728
  export { }