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

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,28 +148,71 @@ 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,
31
170
  sendCustomMsgToParentPage,
32
171
  setConfiguratorIFrameSize,
33
172
  shareConfiguration,
173
+ executeIntegration,
34
174
  createSyncCmpValuesStore,
175
+ uploadFiles,
176
+ uploadImages,
177
+ uploadTempFiles,
178
+ uploadTempImages,
179
+ convertDocument,
180
+ createPdfFromAssets,
181
+ createArPage,
35
182
  version
36
183
  }
37
184
  }
38
185
 
186
+ export declare type CfgnFileUploadData<T extends string = string> = {
187
+ [fileName in T]: {
188
+ file: FileOrDataUri;
189
+ displayName?: string;
190
+ };
191
+ };
192
+
39
193
  export declare class Checkbox {
40
194
  #private;
41
195
  readonly id: CtrlId;
42
196
  constructor(id: CtrlId);
197
+ /**
198
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
199
+ * not meant for.
200
+ *
201
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
202
+ * callback.
203
+ */
43
204
  onRendered(callback: OnRenderedCallback<HTMLLabelElement>): CallbackUnsubscribeOption;
44
205
  setVisible(visible: boolean): Promise<void>;
206
+ setChecked(checked: boolean): void;
207
+ onCheckedChange(callback: (checked: boolean) => void | Promise<void>): CallbackUnsubscribeOption;
208
+ /**
209
+ * Set arbitrary properties of the checkbox control.\
210
+ * Behavior is the same as when setting the respective property in the configurator editor.
211
+ *
212
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
213
+ * E.g. setting `visible` is not allowed because {@link CheckboxV1.setVisible} should be used instead.
214
+ */
215
+ setProperty<T extends keyof SetCheckboxPropertyValue>(propertyName: T, value: SetCheckboxPropertyValue[T]): void;
45
216
  }
46
217
 
47
218
  declare type CmpName = string;
@@ -84,8 +255,149 @@ export declare class Collapsible {
84
255
  #private;
85
256
  readonly id: CtrlId;
86
257
  constructor(id: CtrlId);
258
+ /**
259
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
260
+ * not meant for.
261
+ *
262
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
263
+ * callback.
264
+ */
87
265
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
88
266
  setVisible(visible: boolean): Promise<void>;
267
+ /**
268
+ * Set arbitrary properties of the collapsible control.\
269
+ * Behavior is the same as when setting the respective property in the configurator editor.
270
+ *
271
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
272
+ * E.g. setting `visible` is not allowed because {@link CollapsibleV1.setVisible} should be used instead.
273
+ */
274
+ setProperty<T extends keyof SetCollapsiblePropertyValue>(propertyName: T, value: SetCollapsiblePropertyValue[T]): void;
275
+ }
276
+
277
+ export declare class Combobox<TValue extends NonNullable<DataListValue>> {
278
+ #private;
279
+ readonly id: CtrlId;
280
+ constructor(id: CtrlId);
281
+ /**
282
+ * See {@link CustomControlV1.onRendered} for detailed information on what you can do with this listener and what it
283
+ * is not meant for.
284
+ *
285
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
286
+ * callback.
287
+ */
288
+ onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
289
+ /**
290
+ * See {@link CustomControlV1.onRendered} for detailed information on what you can do with this listener and what it
291
+ * is not meant for. Most of the information there also applies to `onItemRendered`.
292
+ *
293
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
294
+ * callback which also applies here.
295
+ *
296
+ * @param callback Callback function which is given the rendered HTML element and the corresponding item data.
297
+ *
298
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
299
+ * type of the table component from which the combobox entries are populated:
300
+ *
301
+ * ```ts
302
+ * combobox.onItemRendered<IProductsTable[number]>((el, itemData) => { ... })
303
+ * ```
304
+ */
305
+ onItemRendered<TItemData>(callback: (element: HTMLDivElement, itemData: TItemData) => void): CallbackUnsubscribeOption;
306
+ /**
307
+ * See {@link CustomControlV1.onRendered} for detailed information on what you can do with this listener and what it
308
+ * is not meant for. Most of the information there also applies to `onValueItemRendered`.
309
+ *
310
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
311
+ * callback which also applies here.
312
+ *
313
+ * @param callback Callback function which is given the rendered HTML element and the corresponding item data of the
314
+ * currently selected value item shown in the trigger.
315
+ *
316
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
317
+ * type of the table component from which the combobox entries are populated:
318
+ *
319
+ * ```ts
320
+ * combobox.onValueItemRendered<IProductsTable[number]>((el, itemData) => { ... })
321
+ * ```
322
+ */
323
+ onValueItemRendered<TItemData>(callback: (element: HTMLDivElement, itemData: TItemData) => void): CallbackUnsubscribeOption;
324
+ /**
325
+ * See {@link CustomControlV1.onRendered} for detailed information on what you can do with this listener and what it
326
+ * is not meant for. Most of the information there also applies to `onGroupHeaderRendered`.
327
+ *
328
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
329
+ * callback which also applies here.
330
+ *
331
+ * @param callback Callback function which is given the rendered HTML element and the corresponding group data.
332
+ *
333
+ * Typical usage for type safe access to the group data where `IProductGroupsTable` is the auto
334
+ * generated type of the table component from which the combobox groups are populated:
335
+ *
336
+ * ```ts
337
+ * combobox.onGroupHeaderRendered<IProductGroupsTable[number]>((el, groupData) => { ... })
338
+ * ```
339
+ */
340
+ onGroupHeaderRendered<TGroupData>(callback: (element: HTMLDivElement, groupData: TGroupData) => void): CallbackUnsubscribeOption;
341
+ /**
342
+ * Fires when the selection is committed which is:
343
+ * - in single select mode: when the popup closes (or when an option is clicked).
344
+ * - in multi select mode: immediately on every selection change.
345
+ *
346
+ * @param callback Callback function which is given the raw selection value/keys and the corresponding item data of
347
+ * all the selected items.
348
+ *
349
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
350
+ * type of the table component from which the combobox entries are populated:
351
+ *
352
+ * ```ts
353
+ * // Single selection:
354
+ * combobox.onValueChange<IProductsTable[number]>((value, valueItemData) => { ... })
355
+ *
356
+ * // Multi selection:
357
+ * combobox.onValueChange<IProductsTable>((value, valueItemData) => { ... })
358
+ * ```
359
+ */
360
+ onValueChange<TItemData extends TValue extends any[] ? any[] : any>(callback: (value: TValue | undefined, valueItemData: TItemData | undefined) => void): CallbackUnsubscribeOption;
361
+ /**
362
+ * Registers a callback that fires when a combobox item is clicked.
363
+ *
364
+ * - Fires **before** `onValueChange`.
365
+ * - Fires even when the clicked item is already selected.
366
+ *
367
+ * @param callback Callback function which is given the item data of the clicked item and the raw mouse event.
368
+ *
369
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
370
+ * type of the table component from which the combobox entries are populated:
371
+ *
372
+ * ```ts
373
+ * combobox.onItemClicked<IProductsTable[number]>((itemData, event) => { ... })
374
+ * ```
375
+ */
376
+ onItemClicked<TItemData>(callback: (itemData: TItemData, event: MouseEvent) => void): CallbackUnsubscribeOption;
377
+ setVisible(visible: boolean): Promise<void>;
378
+ /**
379
+ * Sets the entries (data items) displayed by the combobox. Existing entries are overwritten.
380
+ */
381
+ setEntries(entries: TemplateData[]): void;
382
+ /**
383
+ * Sets the group data used to render the group headers of the combobox. Existing group data is overwritten.
384
+ */
385
+ setGroupData(groupData: TemplateData[]): void;
386
+ /**
387
+ * Set arbitrary properties of the combobox control.\
388
+ * Behavior is the same as when setting the respective property in the configurator editor.
389
+ *
390
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
391
+ * E.g. setting `visible` is not allowed because {@link ComboboxV1.setVisible} should be used instead.
392
+ *
393
+ * When using properties of type `LiquidTemplateSource`, you have to manually cast the given `string` to
394
+ * `LiquidTemplateSource` like this:
395
+ *
396
+ * ```ts
397
+ * combobox.setProperty('dataTemplate', '<span>{{ Name }}</span>' as LiquidTemplateSource);
398
+ * ```
399
+ */
400
+ setProperty<T extends keyof SetComboboxPropertyValue>(propertyName: T, value: SetComboboxPropertyValue[T]): void;
89
401
  }
90
402
 
91
403
  /**
@@ -93,6 +405,279 @@ export declare class Collapsible {
93
405
  */
94
406
  export declare const configuratorIsInIFrame: () => boolean;
95
407
 
408
+ /**
409
+ * Create and convert a document (e.g. HTML to PDF).\
410
+ * The conversion consists of multiple individual tasks to allow full flexibility when creating documents.
411
+ *
412
+ * Example case: Create a PDF with dynamic content (PDF asset) and append a static product datasheet.
413
+ *
414
+ * See also {@link createPdfFromAssets} for a simplified version to create a PDF.
415
+ * @param tasks The tasks are executed based on their connection with the properties `name` and `inputTaskName`
416
+ * (the order in the array is irrelevant)
417
+ * @returns URL to the generated cfgn file, if successful
418
+ *
419
+ * @example
420
+ * ```ts
421
+ * const resultUrl = await convertDocument([
422
+ * {
423
+ * type: DocumentConvertTaskTypes.PdfAsset,
424
+ * name: 'HtmlToPdfTask',
425
+ * bundleAliasName: 'MyBundle',
426
+ * assetPath: 'quotePdfAsset',
427
+ * context: {
428
+ * subject: 'MySubject',
429
+ * },
430
+ * },
431
+ * {
432
+ * type: DocumentConvertTaskTypes.OutputToCfgnFile,
433
+ * name: 'OutputPdfTask',
434
+ * inputTaskName: 'HtmlToPdfTask',
435
+ * cfgnFileName: 'QuotePdf',
436
+ * cfgnFileExtension: 'pdf',
437
+ * cfgnFileDisplayName: `Your_quote_${new Date().toISOString()}`,
438
+ * },
439
+ * ]);
440
+ * ```
441
+ */
442
+ export declare const convertDocument: (tasks: DocumentConvertTask[]) => Promise<string | undefined>;
443
+
444
+ /**
445
+ * Uploads the given GLB file to a peristent storage and creates a dedicated page with an AR viewer that loads the GLB.
446
+ *
447
+ * After successful creation, it either redirects to that page or shows a dialog with a QR code linking to that page.
448
+ *
449
+ * Whether it redirects or shows a dialog depends on the browsers capabilities to directly open AR experiences.
450
+ */
451
+ export declare const createArPage: (glb: File, options?: SdkCreateArPageOptions) => Promise<void>;
452
+
453
+ declare type CreateButtonProperties = {
454
+ text: string | undefined;
455
+ width: string | undefined;
456
+ height: string | undefined;
457
+ minWidth: string | undefined;
458
+ minHeight: string | undefined;
459
+ maxWidth: string | undefined;
460
+ maxHeight: string | undefined;
461
+ margin: string | undefined;
462
+ padding: string | undefined;
463
+ cssClasses: string[] | undefined;
464
+ backgroundNormal: string | undefined;
465
+ backgroundHover: string | undefined;
466
+ backgroundPressed: string | undefined;
467
+ borderRadius: string | undefined;
468
+ font: string | undefined;
469
+ color: string | undefined;
470
+ visible: boolean | undefined;
471
+ enabled: boolean | undefined;
472
+ tooltipText: string | undefined;
473
+ tooltipPos: ElementPosOption | undefined;
474
+ alignmentBlock: AlignmentBlockOption | undefined;
475
+ };
476
+
477
+ declare type CreateCheckboxProperties = {
478
+ checked: boolean | undefined;
479
+ captionPos: ElementPosOption | undefined;
480
+ captionText: string | undefined;
481
+ visible: boolean | undefined;
482
+ enabled: boolean | undefined;
483
+ minWidth: string | undefined;
484
+ minHeight: string | undefined;
485
+ maxWidth: string | undefined;
486
+ maxHeight: string | undefined;
487
+ margin: string | undefined;
488
+ padding: string | undefined;
489
+ font: string | undefined;
490
+ color: string | undefined;
491
+ backgroundNormal: string | undefined;
492
+ backgroundHover: string | undefined;
493
+ backgroundPressed: string | undefined;
494
+ borderRadius: string | undefined;
495
+ cssClasses: string[] | undefined;
496
+ tooltipText: string | undefined;
497
+ tooltipPos: ElementPosOption | undefined;
498
+ };
499
+
500
+ declare type CreateCollapsibleProperties = {
501
+ captionText: string | undefined;
502
+ collapsed: boolean | undefined;
503
+ group: string | undefined;
504
+ visible: boolean | undefined;
505
+ cssClasses: string[] | undefined;
506
+ };
507
+
508
+ declare type CreateComboboxProperties = {
509
+ value: string | undefined;
510
+ valueType: DataListValueType | undefined;
511
+ width: string | undefined;
512
+ minWidth: string | undefined;
513
+ maxWidth: string | undefined;
514
+ height: string | undefined;
515
+ minHeight: string | undefined;
516
+ maxHeight: string | undefined;
517
+ backgroundNormal: string | undefined;
518
+ margin: string | undefined;
519
+ padding: string | undefined;
520
+ borderRadius: string | undefined;
521
+ captionText: string | undefined;
522
+ captionPos: ElementPosOption | undefined;
523
+ cssClasses: string[] | undefined;
524
+ flexDirection: FlexDirection | undefined;
525
+ flexWrap: boolean | undefined;
526
+ gap: string | undefined;
527
+ visible: boolean | undefined;
528
+ enabled: boolean | undefined;
529
+ placeholder: string | undefined;
530
+ dataEntries: DataListEntries | undefined;
531
+ dataTemplate: LiquidTemplateSource | undefined;
532
+ valueTemplate: LiquidTemplateSource | undefined;
533
+ groupKey: string | undefined;
534
+ groupData: DataListGroupData | undefined;
535
+ groupTemplate: LiquidTemplateSource | undefined;
536
+ tooltipKey: string | undefined;
537
+ itemHiddenKey: string | undefined;
538
+ itemDisabledKey: string | undefined;
539
+ itemCssClassesKey: string | undefined;
540
+ filterable: boolean | undefined;
541
+ filterKey: string | undefined;
542
+ filterCaptionText: string | undefined;
543
+ filterPlaceholder: string | undefined;
544
+ listMode: ListMode | undefined;
545
+ clearable: boolean | undefined;
546
+ };
547
+
548
+ declare type CreateCustomCtrlProperties = {
549
+ customCodeControlled: boolean | undefined;
550
+ rawHtml: string | undefined;
551
+ visible: boolean | undefined;
552
+ cssClasses: string[] | undefined;
553
+ };
554
+
555
+ declare type CreateDataviewProperties = {
556
+ value: string | undefined;
557
+ valueType: DataListValueType | undefined;
558
+ dataEntries: DataListEntries | undefined;
559
+ cssClasses: string[] | undefined;
560
+ padding: string | undefined;
561
+ margin: string | undefined;
562
+ visible: boolean | undefined;
563
+ gap: string | undefined;
564
+ flexDirection: FlexDirection | undefined;
565
+ flexWrap: boolean | undefined;
566
+ dataTemplate: LiquidTemplateSource | undefined;
567
+ groupKey: string | undefined;
568
+ groupData: DataListGroupData | undefined;
569
+ groupTemplate: LiquidTemplateSource | undefined;
570
+ tooltipKey: string | undefined;
571
+ itemHiddenKey: string | undefined;
572
+ itemDisabledKey: string | undefined;
573
+ itemCssClassesKey: string | undefined;
574
+ filterable: boolean | undefined;
575
+ filterKey: string | undefined;
576
+ filterCaptionText: string | undefined;
577
+ filterPlaceholder: string | undefined;
578
+ listMode: ListMode | undefined;
579
+ allowDeselect: boolean | undefined;
580
+ };
581
+
582
+ declare type CreateInputProperties = {
583
+ value: string | undefined;
584
+ errorMsg: string | undefined;
585
+ description: string | undefined;
586
+ captionText: string | undefined;
587
+ captionPos: ElementPosOption | undefined;
588
+ captionWidth: string | undefined;
589
+ backgroundNormal: string | undefined;
590
+ borderRadius: string | undefined;
591
+ padding: string | undefined;
592
+ margin: string | undefined;
593
+ width: string | undefined;
594
+ height: string | undefined;
595
+ maxHeight: string | undefined;
596
+ maxWidth: string | undefined;
597
+ minHeight: string | undefined;
598
+ minWidth: string | undefined;
599
+ enabled: boolean | undefined;
600
+ visible: boolean | undefined;
601
+ cssClasses: string[] | undefined;
602
+ placeholder: string | undefined;
603
+ };
604
+
605
+ declare type CreatePanelProperties = {
606
+ margin: string | undefined;
607
+ width: string | undefined;
608
+ height: string | undefined;
609
+ minWidth: string | undefined;
610
+ minHeight: string | undefined;
611
+ maxWidth: string | undefined;
612
+ maxHeight: string | undefined;
613
+ padding: string | undefined;
614
+ flexDirection: FlexDirection | undefined;
615
+ flexGrow: string | undefined;
616
+ flexWrap: boolean | undefined;
617
+ alignmentBlock: AlignmentBlockOption | undefined;
618
+ gap: string | undefined;
619
+ cssClasses: string[] | undefined;
620
+ backgroundNormal: string | undefined;
621
+ visible: boolean | undefined;
622
+ enabled: boolean | undefined;
623
+ opacity: string | undefined;
624
+ border: string | undefined;
625
+ borderRadius: string | undefined;
626
+ };
627
+
628
+ /**
629
+ * Creates a PDF from one or more assets which will be merged in the given order.
630
+ *
631
+ * Simplified helper built on top of {@link convertDocument}.
632
+ * Use {@link convertDocument} directly for advanced scenarios.
633
+ *
634
+ * @param bundleAliasName Bundle name where the assets are stored
635
+ * @param assetTasks One or more "assets tasks" which will be merged in the given order
636
+ * @param cfgnFileName Name of the generated cfgn file
637
+ * @param cfgnFileDisplayName Optional name which will be used when downloading the file
638
+ * @returns URL to the generated cfgn file, if successful
639
+ *
640
+ * @example
641
+ * ```ts
642
+ * const resultUrl = await createPdfFromAssets(
643
+ * 'MyBundle',
644
+ * [
645
+ * {
646
+ * type: 'PdfAsset',
647
+ * assetPath: 'quotePdfAsset',
648
+ * context: {
649
+ * subject: 'MySubject',
650
+ * },
651
+ * },
652
+ * {
653
+ * type: 'Asset',
654
+ * assetPath: 'Pdf2',
655
+ * },
656
+ * ],
657
+ * 'QuotePdf',
658
+ * `Your_quote_${new Date().toISOString()}`
659
+ * );
660
+ * ```
661
+ *
662
+ */
663
+ export declare function createPdfFromAssets(bundleAliasName: string, assetTasks: CreatePdfTasks[], cfgnFileName: string, cfgnFileDisplayName?: string): Promise<string | undefined>;
664
+
665
+ export declare type CreatePdfTasks = {
666
+ type: CreatePdfTaskTypes.PdfAsset;
667
+ assetPath: string;
668
+ context: object;
669
+ } | {
670
+ type: CreatePdfTaskTypes.Asset;
671
+ assetPath: string;
672
+ };
673
+
674
+ export declare enum CreatePdfTaskTypes {
675
+ /** Create a PDF with dynamic content based on the given `context` */
676
+ PdfAsset = 0,
677
+ /** Static pdf asset (which is stored as File Asset) */
678
+ Asset = 1
679
+ }
680
+
96
681
  /**
97
682
  * Creates a store holding component values which can be accessed synchronously.
98
683
  *
@@ -151,6 +736,32 @@ export declare const createSyncCmpValuesStore: <TCmps extends {
151
736
  [id: CmpName]: ValueComponent;
152
737
  }>(cmps: TCmps) => Promise<Readonly<SyncCmpValuesStore<TCmps>>>;
153
738
 
739
+ declare type CreateTextProperties = {
740
+ text: string | undefined;
741
+ width: string | undefined;
742
+ height: string | undefined;
743
+ padding: string | undefined;
744
+ margin: string | undefined;
745
+ cssClasses: string[] | undefined;
746
+ visible: boolean | undefined;
747
+ tooltipText: string | undefined;
748
+ tooltipPos: ElementPosOption | undefined;
749
+ htmlTag: HtmlTagKind | undefined;
750
+ minWidth: string | undefined;
751
+ minHeight: string | undefined;
752
+ maxWidth: string | undefined;
753
+ maxHeight: string | undefined;
754
+ font: string | undefined;
755
+ color: string | undefined;
756
+ wrapText: boolean | undefined;
757
+ selfAlignmentBlock: AlignmentBlockOption | undefined;
758
+ };
759
+
760
+ /** Any control instance */
761
+ declare type Ctrl = {
762
+ id: CtrlId;
763
+ };
764
+
154
765
  declare type CtrlId = z.infer<typeof ZCtrlId>;
155
766
 
156
767
  export declare class CustomControl {
@@ -205,6 +816,10 @@ export declare class CustomControl {
205
816
  *
206
817
  * !!! Important !!!
207
818
  *
819
+ * See {@link OnRenderedCallback} for important information regarding the `element` which is passed to the callback.
820
+ *
821
+ * !!! Important !!!
822
+ *
208
823
  * This is **not** meant to be used for manipulating the rendered content of the control besides simple,
209
824
  * non-structural/-behavioral changes like adding CSS classes or data attributes etc.
210
825
  *
@@ -215,6 +830,14 @@ export declare class CustomControl {
215
830
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
216
831
  getElement(): HTMLElement | undefined;
217
832
  setVisible(visible: boolean): Promise<void>;
833
+ /**
834
+ * Set arbitrary properties of the custom control.\
835
+ * Behavior is the same as when setting the respective property in the configurator editor.
836
+ *
837
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
838
+ * E.g. setting `visible` is not allowed because {@link CustomControlV1.setVisible} should be used instead.
839
+ */
840
+ setProperty<T extends keyof SetCustomCtrlPropertyValue>(propertyName: T, value: SetCustomCtrlPropertyValue[T]): void;
218
841
  }
219
842
 
220
843
  /**
@@ -223,14 +846,188 @@ export declare class CustomControl {
223
846
  */
224
847
  declare type CustomCtrlRenderFn = (element: HTMLDivElement, rawHtml: string | undefined) => void | Promise<void>;
225
848
 
226
- export declare class Dataview {
849
+ declare type DataListEntries = z.infer<typeof ZDataListEntries>;
850
+
851
+ declare type DataListGroupData = z.infer<typeof ZDataListGroupData>;
852
+
853
+ /**
854
+ * The actual value which comes from the entries data and which is converted to `DataListHtmlValue` before being passed
855
+ * to the DOM elements.
856
+ */
857
+ declare type DataListValue = string | string[] | number | number[] | undefined;
858
+
859
+ 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;
860
+
861
+ declare type DataListValueType = z.infer<typeof ZDataListValueType>;
862
+
863
+ export declare class Dataview<TValue extends NonNullable<DataListValue>> {
227
864
  #private;
228
865
  readonly id: CtrlId;
229
866
  constructor(id: CtrlId);
867
+ /**
868
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
869
+ * not meant for.
870
+ *
871
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
872
+ * callback.
873
+ */
230
874
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
875
+ /**
876
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
877
+ * not meant for. Most of the information there also applies to `onItemRendered`.
878
+ *
879
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
880
+ * callback which also applies here.
881
+ *
882
+ * @param callback Callback function which is given the rendered HTML element and the corresponding item data.
883
+ *
884
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
885
+ * type of the table component from which the dataview entries are populated:
886
+ *
887
+ * ```ts
888
+ * dataview.onItemRendered<IProductsTable[number]>(el, itemData) => { ... }
889
+ * ```
890
+ */
891
+ onItemRendered<TItemData>(callback: (element: HTMLDivElement, itemData: TItemData) => void): CallbackUnsubscribeOption;
892
+ /**
893
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
894
+ * not meant for. Most of the information there also applies to `onGroupHeaderRendered`.
895
+ *
896
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
897
+ * callback which also applies here.
898
+ *
899
+ * @param callback Callback function which is given the rendered HTML element and the corresponding group data.
900
+ *
901
+ * Typical usage for type safe access to the group data where `IProductGroupsTable` is the auto
902
+ * generated type of the table component from which the dataview groups are populated:
903
+ *
904
+ * ```ts
905
+ * dataview.onGroupHeaderRendered<IProductGroupsTable[number]>((el, groupData) => { ... })
906
+ * ```
907
+ */
908
+ onGroupHeaderRendered<TGroupData>(callback: (element: HTMLDivElement, groupData: TGroupData) => void): CallbackUnsubscribeOption;
909
+ /**
910
+ * @param callback Callback function which is given the raw selection value/keys and the corresponding item data of
911
+ * all the selected items.
912
+ *
913
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
914
+ * type of the table component from which the dataview entries are populated:
915
+ *
916
+ * ```ts
917
+ * // Single selection list:
918
+ * dataview.onValueChange<IProductsTable[number]>(value, valueItemData) => { ... }
919
+ *
920
+ * // Multi selection list:
921
+ * dataview.onValueChange<IProductsTable>(value, valueItemData) => { ... }
922
+ * ```
923
+ */
924
+ onValueChange<TItemData extends TValue extends any[] ? any[] : any>(callback: (value: TValue | undefined, valueItemData: TItemData | undefined) => void): CallbackUnsubscribeOption;
925
+ /**
926
+ * Registers a callback that fires when a datalist item is clicked.
927
+ *
928
+ * - Fires **before** `onValueChange`.
929
+ * - Fires even when the clicked item is already selected.
930
+ *
931
+ * @param callback Callback function which is given the item data of rendered item and the raw mouse event.
932
+ *
933
+ * Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
934
+ * type of the table component from which the dataview entries are populated:
935
+ *
936
+ * ```ts
937
+ * dataview.onItemClicked<IProductsTable[number]>(itemData, event) => { ... }
938
+ * ```
939
+ */
940
+ onItemClicked<TItemData>(callback: (itemData: TItemData, event: MouseEvent) => void): CallbackUnsubscribeOption;
231
941
  setVisible(visible: boolean): Promise<void>;
942
+ /**
943
+ * Sets the entries (data items) displayed by the dataview. Existing entries are overwritten.
944
+ */
945
+ setEntries(entries: TemplateData[]): void;
946
+ /**
947
+ * Sets the group data used to render the group headers of the dataview. Existing group data is overwritten.
948
+ */
949
+ setGroupData(groupData: TemplateData[]): void;
950
+ /**
951
+ * Set arbitrary properties of the dataview control.\
952
+ * Behavior is the same as when setting the respective property in the configurator editor.
953
+ *
954
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
955
+ * E.g. setting `visible` is not allowed because {@link DataviewV1.setVisible} should be used instead.
956
+ *
957
+ * When using properties of type `LiquidTemplateSource`, you have to manually cast the given `string` to
958
+ * `LiquidTemplateSource` like this:
959
+ *
960
+ * ```ts
961
+ * dataview.setProperty('dataTemplate', '<span>{{ Name }}</span>' as LiquidTemplateSource);
962
+ * ```
963
+ */
964
+ setProperty<T extends keyof SetDataviewPropertyValue>(propertyName: T, value: SetDataviewPropertyValue[T]): void;
965
+ }
966
+
967
+ export declare type DocumentConvertTask = {
968
+ type: DocumentConvertTaskTypes.PdfAsset;
969
+ name: string;
970
+ /** Alias name, as set in the asset bundle assignment dialog */
971
+ bundleAliasName: string;
972
+ /** Dot seperated path, e.g. 'MyPDFFolder.MyPDFAsset' */
973
+ assetPath: string;
974
+ /** Custom object which must represent the context, as defined in the PDF asset */
975
+ context: object;
976
+ } | {
977
+ type: DocumentConvertTaskTypes.Asset;
978
+ name: string;
979
+ /** Alias name, as set in the asset bundle assignment dialog */
980
+ bundleAliasName: string;
981
+ /** Dot seperated path, e.g. 'MyPDFFolder.MyStaticAsset' */
982
+ assetPath: string;
983
+ } | {
984
+ type: DocumentConvertTaskTypes.Merge;
985
+ name: string;
986
+ /** Names of the tasks which should be merged in the given order */
987
+ inputTaskNames: string[];
988
+ } | {
989
+ type: DocumentConvertTaskTypes.OutputToCfgnFile;
990
+ name: string;
991
+ inputTaskName: string;
992
+ /** Name of the generated cfgn file */
993
+ cfgnFileName: string;
994
+ cfgnFileExtension: string;
995
+ /** Optional name which will be used when downloading the file */
996
+ cfgnFileDisplayName?: string;
997
+ };
998
+
999
+ export declare enum DocumentConvertTaskTypes {
1000
+ /** Create a PDF with dynamic content based on the given `context` */
1001
+ PdfAsset = 0,
1002
+ /** Retrieve an asset to be used for suceeding tasks (e.g. static PDF for merge) */
1003
+ Asset = 1,
1004
+ /** Merge multiple input tasks into a single document */
1005
+ Merge = 2,
1006
+ /** Finalize the conversion by storing it as `Configuration file` */
1007
+ OutputToCfgnFile = 4
232
1008
  }
233
1009
 
1010
+ declare type ElementPosOption = z.infer<typeof ZElementPosOption>;
1011
+
1012
+ /**
1013
+ * Runs the given integration and returns the response.
1014
+ *
1015
+ * Integrations have to be set up in the company settings on the Combeenation platform.
1016
+ */
1017
+ export declare function executeIntegration(data: {
1018
+ integrationName: string;
1019
+ httpMethod: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
1020
+ url: string;
1021
+ body?: string | null;
1022
+ headers?: Record<string, string> | null;
1023
+ timeoutSeconds?: number | null;
1024
+ }): Promise<Response>;
1025
+
1026
+ declare type FileOrDataUri = File | {
1027
+ dataUri: string;
1028
+ extension: string;
1029
+ };
1030
+
234
1031
  /**
235
1032
  * Creates a finish of the current configuration by running all the Configurator's finish actions and optionally passes
236
1033
  * the resulting data to the parent page.
@@ -290,6 +1087,11 @@ declare type FinishConfigurationBaseOptions = {
290
1087
  */
291
1088
  export declare const fireAnalyticsEvent: (event: string, eventData?: object | string) => Promise<ParentPageComResult<void>>;
292
1089
 
1090
+ export declare enum FlexDirection {
1091
+ Column = 0,
1092
+ Row = 1
1093
+ }
1094
+
293
1095
  export declare type FlexShopFinishJson = Shopware6FinishJson;
294
1096
 
295
1097
  /**
@@ -312,12 +1114,31 @@ export declare const getParentPageUrl: () => Promise<ParentPageComResult<{
312
1114
  url: string;
313
1115
  }>>;
314
1116
 
1117
+ declare type HtmlTagKind = z.infer<typeof ZHtmlTagKind>;
1118
+
315
1119
  export declare class Input {
316
1120
  #private;
317
1121
  readonly id: CtrlId;
318
1122
  constructor(id: CtrlId);
1123
+ /**
1124
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
1125
+ * not meant for.
1126
+ *
1127
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
1128
+ * callback.
1129
+ */
319
1130
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
320
1131
  setVisible(visible: boolean): Promise<void>;
1132
+ setValue(value: string): void;
1133
+ onValueChange(callback: (value: string) => void | Promise<void>): CallbackUnsubscribeOption;
1134
+ /**
1135
+ * Set arbitrary properties of the input control.\
1136
+ * Behavior is the same as when setting the respective property in the configurator editor.
1137
+ *
1138
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
1139
+ * E.g. setting `visible` is not allowed because {@link InputV1.setVisible} should be used instead.
1140
+ */
1141
+ setProperty<T extends keyof SetInputPropertyValue>(propertyName: T, value: SetInputPropertyValue[T]): void;
321
1142
  }
322
1143
 
323
1144
  declare type JsonArray = Array<SerializableJsonValue>;
@@ -328,10 +1149,18 @@ declare type JsonObject = {
328
1149
 
329
1150
  declare type JsonPrimitive = string | number | boolean | null;
330
1151
 
1152
+ /**
1153
+ * Template written in ["Liquid HTML"](https://liquidjs.com/tutorials/intro-to-liquid.html)).
1154
+ * When rendering actual HTML from this, it is enriched by the `dataEntries`.
1155
+ */
1156
+ export declare type LiquidTemplateSource = Brand<string, 'LiquidTemplate'>;
1157
+
1158
+ declare type ListMode = z.infer<typeof ZListMode>;
1159
+
331
1160
  /**
332
1161
  * Raw material JSON which can be passed to Babylon.js e.g. via `Material.Parse(material)`
333
1162
  */
334
- declare type MaterialAsset = z.infer<typeof ZMaterialAsset>;
1163
+ declare type MaterialObject = z.infer<typeof ZMaterialObject>;
335
1164
 
336
1165
  /**
337
1166
  * Navigates to the login page of the Configurator.
@@ -381,16 +1210,68 @@ export declare const onAnyCmpValueChanged: <TInput extends ValueComponent>(liste
381
1210
 
382
1211
  declare type OnClickCallback = () => void;
383
1212
 
1213
+ /**
1214
+ * Registers a callback for events from the parent page.\
1215
+ * The parent page can send those events by calling `Combeenation.sendEventToConfigurator`.
1216
+ */
1217
+ export declare const onParentPageEvent: (callback: (type: "success" | "error", data: unknown) => void) => CallbackUnsubscribeOption;
1218
+
1219
+ /**
1220
+ * @param element The rendered DOM element.
1221
+ *
1222
+ * !!! Important !!!
1223
+ *
1224
+ * This can either be a newly created element or the same, reused element which was already passed to a
1225
+ * previous `onRendered` callback invocation.
1226
+ *
1227
+ * What does this mean?
1228
+ * - When registering event listener, avoid `element.addEventListener` but use the form
1229
+ * `element.onclick = ...` instead.
1230
+ * - Be careful when using API like `MutationObserver` on the element and ensure to not register multiple
1231
+ * observer on the same element over time.
1232
+ * - Be careful when binding/using the element in external libraries which might use `addEventListener`
1233
+ * or things like `MutationObserver` internally (e.g. DnD libraries etc.).
1234
+ * - If you **need to** use `addEventListener` etc. e.g. because you have to use a library which uses it
1235
+ * internally, make sure to manually check whether the element was already processed/initialized in a
1236
+ * previous `onRendered` invocation or not.
1237
+ *
1238
+ * E.g. something like this:
1239
+ *
1240
+ * ```ts
1241
+ * dataview.onRendered((element) => {
1242
+ * if (element.dataset.wasVisited) return;
1243
+ * element.dataset.wasVisited = 'true';
1244
+ *
1245
+ * // -> Safely use `element.addEventListener` or `dndManager.init(element)` etc.
1246
+ * });
1247
+ */
384
1248
  declare type OnRenderedCallback<T extends HTMLElement = HTMLElement> = (element: T) => void;
385
1249
 
386
1250
  export declare class Panel {
387
1251
  #private;
388
1252
  readonly id: CtrlId;
389
1253
  constructor(id: CtrlId);
1254
+ /**
1255
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
1256
+ * not meant for.
1257
+ *
1258
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
1259
+ * callback.
1260
+ */
390
1261
  onRendered(callback: OnRenderedCallback<HTMLDivElement>): CallbackUnsubscribeOption;
391
1262
  setVisible(visible: boolean): Promise<void>;
1263
+ /**
1264
+ * Set arbitrary properties of the panel control.\
1265
+ * Behavior is the same as when setting the respective property in the configurator editor.
1266
+ *
1267
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
1268
+ * E.g. setting `visible` is not allowed because {@link PanelV1.setVisible} should be used instead.
1269
+ */
1270
+ setProperty<T extends keyof SetPanelPropertyValue>(propertyName: T, value: SetPanelPropertyValue[T]): void;
392
1271
  }
393
1272
 
1273
+ declare type ParentCtrl = Panel | Collapsible;
1274
+
394
1275
  export declare type ParentPageCheckoutData = {
395
1276
  /** Cfgn id */
396
1277
  id: string;
@@ -469,16 +1350,49 @@ export declare const redirectParentPage: (url: string) => Promise<ParentPageComR
469
1350
 
470
1351
  declare type SdkAssetPaths = {
471
1352
  babylonJsAssets: {
472
- [key: AssetName]: Url;
1353
+ [key: AssetName]: UrlString;
473
1354
  };
474
1355
  materialAssets: {
475
- [key: AssetName]: MaterialAsset;
1356
+ [key: AssetName]: MaterialObject;
476
1357
  };
477
1358
  textureImageAssets: {
478
- [key: AssetName]: Url;
1359
+ [key: AssetName]: UrlString;
479
1360
  };
480
1361
  };
481
1362
 
1363
+ /**
1364
+ * `urls` contains a map of the uploaded files, where the key represents the name and the value the url.\
1365
+ * It's recommended to check for the `success` flag beforehand.
1366
+ */
1367
+ declare type SdkCfgnFileUploadResult<T extends string = string> = {
1368
+ success: false;
1369
+ urls?: never;
1370
+ } | {
1371
+ success: true;
1372
+ urls: {
1373
+ [fileName in T]: string;
1374
+ };
1375
+ };
1376
+
1377
+ declare type SdkCfgnTempFileUploadResult = {
1378
+ success: false;
1379
+ urls?: never;
1380
+ } | {
1381
+ success: true;
1382
+ urls: string[];
1383
+ };
1384
+
1385
+ declare type SdkCreateArPageOptions = {
1386
+ qrSubTitle?: string;
1387
+ qrDescription?: string;
1388
+ preparationText?: string;
1389
+ popupBlockedTitle?: string;
1390
+ popupBlockedDescription?: string;
1391
+ popupBlockedLinkText?: string;
1392
+ environment?: UrlString;
1393
+ loadingScreenImg?: UrlString;
1394
+ };
1395
+
482
1396
  /**
483
1397
  * Send a custom message to the parent page via the "CustomMessage".\
484
1398
  * The parent page can handle those messages by implementing the function `Combeenation.on{msgName}`.
@@ -491,6 +1405,14 @@ export declare const sendCustomMsgToParentPage: (msgName: string, data?: object)
491
1405
  /** A JSON-serializable value safe to use as a `postMessage` payload etc. */
492
1406
  declare type SerializableJsonValue = JsonPrimitive | JsonObject | JsonArray;
493
1407
 
1408
+ declare type SetButtonPropertyValue = Omit<CreateButtonProperties, 'visible'>;
1409
+
1410
+ declare type SetCheckboxPropertyValue = Omit<CreateCheckboxProperties, 'visible'>;
1411
+
1412
+ declare type SetCollapsiblePropertyValue = Omit<CreateCollapsibleProperties, 'visible'>;
1413
+
1414
+ declare type SetComboboxPropertyValue = Omit<CreateComboboxProperties, 'visible' | 'listMode' | 'valueType'>;
1415
+
494
1416
  /**
495
1417
  * Changes the width and/or height of the IFrame and/or scroll position of the parent page window.
496
1418
  *
@@ -509,6 +1431,16 @@ export declare const setConfiguratorIFrameSize: (data: {
509
1431
  scrollToY?: number;
510
1432
  }) => Promise<ParentPageComResult<void>>;
511
1433
 
1434
+ declare type SetCustomCtrlPropertyValue = Omit<CreateCustomCtrlProperties, 'visible'>;
1435
+
1436
+ declare type SetDataviewPropertyValue = Omit<CreateDataviewProperties, 'visible' | 'listMode' | 'valueType'>;
1437
+
1438
+ declare type SetInputPropertyValue = Omit<CreateInputProperties, 'visible'>;
1439
+
1440
+ declare type SetPanelPropertyValue = Omit<CreatePanelProperties, 'visible'>;
1441
+
1442
+ declare type SetTextPropertyValue = Omit<CreateTextProperties, 'visible'>;
1443
+
512
1444
  /**
513
1445
  * Creates a copy of the current configuration and opens a share window for the given platform with the resulting share
514
1446
  * URL
@@ -636,17 +1568,88 @@ declare type SyncCmpValuesStore<TCmps extends Record<CmpName, ValueComponent>> =
636
1568
  [K in keyof TCmps & CmpName]: TCmps[K] extends ValueComponent<any, infer TValue, any> ? TValue | undefined : never;
637
1569
  };
638
1570
 
1571
+ /**
1572
+ * The raw data passed to the corresponding liquid template (e.g. to a datalist item template or a group header
1573
+ * template etc.)
1574
+ */
1575
+ declare type TemplateData = Record<string, unknown>;
1576
+
639
1577
  declare class Text_2 {
640
1578
  #private;
641
1579
  readonly id: CtrlId;
642
1580
  constructor(id: CtrlId);
1581
+ /**
1582
+ * See {@link CustomControl.onRendered} for detailed information on what you can do with this listener and what it is
1583
+ * not meant for.
1584
+ *
1585
+ * Also see {@link OnRenderedCallback} for important information regarding the `element` which is passed to the
1586
+ * callback.
1587
+ */
643
1588
  onRendered(callback: OnRenderedCallback<HTMLSpanElement>): CallbackUnsubscribeOption;
644
1589
  setVisible(visible: boolean): Promise<void>;
645
1590
  setText(text: string): void;
1591
+ /**
1592
+ * Set arbitrary properties of the text control.\
1593
+ * Behavior is the same as when setting the respective property in the configurator editor.
1594
+ *
1595
+ * Some properties are not allowed to be set here because they have a dedicated method which should be used instead.\
1596
+ * E.g. setting `visible` is not allowed because {@link TextV1.setVisible} should be used instead.
1597
+ */
1598
+ setProperty<T extends keyof SetTextPropertyValue>(propertyName: T, value: SetTextPropertyValue[T]): void;
646
1599
  }
647
1600
  export { Text_2 as Text }
648
1601
 
649
- declare type Url = z.infer<typeof ZUrl>;
1602
+ /**
1603
+ * Upload one or more files into the current configuration
1604
+ *
1605
+ * Consider using {@link uploadTempFiles} if the files don't need to be persisted and
1606
+ * aren't relevant for the finished configuration.
1607
+ *
1608
+ * @param files The key represents the name, which can be used in Hive with `configuration.GetFile("")`
1609
+ * @returns An object with the same keys as the input. The values contain according result information.
1610
+ */
1611
+ export declare const uploadFiles: <T extends string>(files: CfgnFileUploadData<T>) => Promise<SdkCfgnFileUploadResult<T>>;
1612
+
1613
+ /**
1614
+ * Upload one or more images into the current configuration.
1615
+ *
1616
+ * Consider using {@link uploadTempImages} if the images don't need to be persisted and
1617
+ * aren't relevant for the finished configuration.
1618
+ *
1619
+ * @param images The key represents the name, which can be used in Hive with `configuration.GetImage("")`
1620
+ * @returns An object with the same keys as the input. The values contain according result information.
1621
+ */
1622
+ export declare const uploadImages: <T extends string>(images: CfgnFileUploadData<T>) => Promise<SdkCfgnFileUploadResult<T>>;
1623
+
1624
+ /**
1625
+ * Upload temporary files into the current configuration. This should only be used for files which don't need to be
1626
+ * persisted or aren't relevant for the finished configuration.
1627
+ * Examples:
1628
+ * - The user can upload multiple files but he still has to apply them on the product in a second step.
1629
+ * It's recommended to upload the files as temporary files and only upload them as cfgn files after they were
1630
+ * actually applied.
1631
+ *
1632
+ * @param files files to be uploaded
1633
+ * @returns on success it returns the URLs of the uploaded files in the same order as they were provided.
1634
+ */
1635
+ export declare const uploadTempFiles: (files: FileOrDataUri[]) => Promise<SdkCfgnTempFileUploadResult>;
1636
+
1637
+ /**
1638
+ * Upload temporary images into the current configuration. This should only be used for files which don't need to be
1639
+ * persisted or aren't relevant for the finished configuration.
1640
+ * Examples:
1641
+ * - When creating a PDF with screenshots of the 3d model, the images can be uploaded as temporary files, as they
1642
+ * will be embedded in the PDF.
1643
+ * - The user can upload multiple images but he still has to apply them on the product in a second step.
1644
+ * It's recommended to upload the images as temporary files and only upload them as cfgn files after they were
1645
+ * actually applied.
1646
+ *
1647
+ * @param images images to be uploaded
1648
+ * @returns on success it returns the URLs of the uploaded images in the same order as they were provided.
1649
+ */
1650
+ export declare const uploadTempImages: (images: FileOrDataUri[]) => Promise<SdkCfgnTempFileUploadResult>;
1651
+
1652
+ declare type UrlString = z.infer<typeof ZUrlString>;
650
1653
 
651
1654
  /**
652
1655
  * Represents a component of type `Value`
@@ -677,12 +1680,42 @@ export declare class ValueComponent<TName extends CmpName = CmpName, TValue exte
677
1680
 
678
1681
  export declare const version: string;
679
1682
 
1683
+ 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">]>;
1684
+
680
1685
  declare const ZAssetName: z.ZodString;
681
1686
 
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]>;
1687
+ 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
1688
 
684
1689
  declare const ZCtrlId: z.ZodString;
685
1690
 
1691
+ declare const ZDataListEntries: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1692
+
1693
+ declare const ZDataListGroupData: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1694
+
1695
+ /**
1696
+ * !!! Note !!!
1697
+ *
1698
+ * We're relying on those values to be actual TS types which can be used in the generated typings for custom code as
1699
+ * generics like `new Dataview<${valueType}>()`.
1700
+ *
1701
+ * Double check all consuming code if this ever changes (only `FlatCtrlMeta.typeGenerics` at the time of writing).
1702
+ */
1703
+ declare const ZDataListValueType: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">]>;
1704
+
1705
+ declare const ZElementPosOption: z.ZodUnion<readonly [z.ZodLiteral<"left">, z.ZodLiteral<"right">, z.ZodLiteral<"bottom">, z.ZodLiteral<"top">]>;
1706
+
1707
+ declare const ZHtmlTagKind: z.ZodEnum<{
1708
+ div: "div";
1709
+ h1: "h1";
1710
+ h2: "h2";
1711
+ h3: "h3";
1712
+ h4: "h4";
1713
+ h5: "h5";
1714
+ span: "span";
1715
+ }>;
1716
+
1717
+ declare const ZListMode: z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"multi">, z.ZodLiteral<"no-selection">]>;
1718
+
686
1719
  /**
687
1720
  * Raw material JSON which can be passed to Babylon.js e.g. via `Material.Parse(material)`
688
1721
  *
@@ -691,17 +1724,20 @@ declare const ZCtrlId: z.ZodString;
691
1724
  *
692
1725
  * Could be extended as needed.
693
1726
  */
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<{
1727
+ declare const ZMaterialObject: z.ZodObject<{
701
1728
  name: z.ZodString;
702
1729
  id: z.ZodString;
703
- }, z.ZodTypeAny, "passthrough">>;
1730
+ customType: z.ZodEnum<{
1731
+ "BABYLON.PBRMaterial": "BABYLON.PBRMaterial";
1732
+ "BABYLON.PBRMetallicRoughnessMaterial": "BABYLON.PBRMetallicRoughnessMaterial";
1733
+ "BABYLON.PBRSpecularGlossinessMaterial": "BABYLON.PBRSpecularGlossinessMaterial";
1734
+ "BABYLON.StandardMaterial": "BABYLON.StandardMaterial";
1735
+ "BABYLON.BackgroundMaterial": "BABYLON.BackgroundMaterial";
1736
+ "BABYLON.NodeMaterial": "BABYLON.NodeMaterial";
1737
+ }>;
1738
+ tags: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1739
+ }, z.core.$loose>;
704
1740
 
705
- declare const ZUrl: z.ZodBranded<z.ZodString, "Url">;
1741
+ declare const ZUrlString: z.core.$ZodBranded<z.ZodURL, "Url", "out">;
706
1742
 
707
1743
  export { }