@configura/web-api 1.4.0-alpha.0 → 1.4.0-alpha.4

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.
Files changed (57) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +1 -1
  3. package/dist/CatalogueAPI.d.ts +504 -502
  4. package/dist/CatalogueAPI.js +248 -206
  5. package/dist/CfgMeasure.d.ts +32 -32
  6. package/dist/CfgMeasure.js +30 -30
  7. package/dist/CfgProduct.d.ts +217 -217
  8. package/dist/CfgProduct.js +636 -634
  9. package/dist/index.d.ts +16 -16
  10. package/dist/index.js +16 -16
  11. package/dist/material/CfgMaterialMapping.d.ts +7 -7
  12. package/dist/material/CfgMaterialMapping.js +181 -181
  13. package/dist/material/CfgMtrlApplication.d.ts +18 -18
  14. package/dist/material/CfgMtrlApplication.js +43 -43
  15. package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
  16. package/dist/material/CfgMtrlApplicationSource.js +8 -8
  17. package/dist/material/CfgMtrlSource.d.ts +19 -19
  18. package/dist/material/CfgMtrlSource.js +40 -40
  19. package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
  20. package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
  21. package/dist/productConfiguration/CfgFeature.d.ts +160 -160
  22. package/dist/productConfiguration/CfgFeature.js +593 -593
  23. package/dist/productConfiguration/CfgOption.d.ts +128 -128
  24. package/dist/productConfiguration/CfgOption.js +394 -394
  25. package/dist/productConfiguration/CfgProductConfiguration.d.ts +120 -120
  26. package/dist/productConfiguration/CfgProductConfiguration.js +307 -307
  27. package/dist/productConfiguration/filters.d.ts +15 -7
  28. package/dist/productConfiguration/filters.js +67 -29
  29. package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
  30. package/dist/productConfiguration/productParamsGenerator.js +51 -51
  31. package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -17
  32. package/dist/productConfiguration/utilitiesProductConfiguration.js +80 -80
  33. package/dist/productLoader.d.ts +33 -33
  34. package/dist/productLoader.js +49 -49
  35. package/dist/tests/testData/collectorForTest.d.ts +73 -73
  36. package/dist/tests/testData/collectorForTest.js +195 -195
  37. package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
  38. package/dist/tests/testData/dummyProductForTest.js +36 -36
  39. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +32 -32
  40. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +348 -381
  41. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  42. package/dist/tests/testData/testDataCachedGetProduct.js +196 -205
  43. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  44. package/dist/tests/testData/testDataCachedPostValidate.js +183 -195
  45. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
  46. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1099 -1119
  47. package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +6 -28
  48. package/dist/tests/testData/testDataProductAggregatedPrice.js +198 -210
  49. package/dist/tests/testData/testDataUpcharge.d.ts +29 -29
  50. package/dist/tests/testData/testDataUpcharge.js +151 -163
  51. package/dist/utilitiesCatalogueData.d.ts +25 -22
  52. package/dist/utilitiesCatalogueData.js +64 -64
  53. package/dist/utilitiesCataloguePermission.d.ts +39 -39
  54. package/dist/utilitiesCataloguePermission.js +84 -84
  55. package/dist/utilitiesNumericValues.d.ts +24 -24
  56. package/dist/utilitiesNumericValues.js +109 -109
  57. package/package.json +3 -3
@@ -1,218 +1,218 @@
1
- import { AggregatedLoadingObservable, LengthUnit, Observable, SingleArgCallback } from "@configura/web-utilities";
2
- import { AdditionalProductConfiguration, CatalogueParams, MeasureParam, MtrlApplication, Prices, Transform } from "./CatalogueAPI.js";
3
- import { CfgMeasureDefinition } from "./CfgMeasure.js";
4
- import { _CfgFeatureInternal } from "./productConfiguration/CfgFeature.js";
5
- import { ProductConfigurationBubbleMode } from "./productConfiguration/CfgOption.js";
6
- import { CfgProductConfiguration } from "./productConfiguration/CfgProductConfiguration.js";
7
- import { ProductLoader } from "./productLoader.js";
8
- import { CfgProductData, RootNodeSource } from "./utilitiesCatalogueData.js";
9
- export declare type CfgProductChangeNotification = {
10
- freshRef: CfgProduct;
11
- };
12
- export declare type CfgProductSettings = {
13
- /**
14
- * In a correctly setup catalogue a select-one Feature (i.e. neither optional nor multiple)
15
- * must have exactly one Option set at a time. However, this is not enforced in Catalogue
16
- * Creator and it is not uncommon with catalogues which fails to meet this requirement.
17
- * Activating this will make setApi throw an Error if more or less than one is selected.
18
- */
19
- strictSelectOneSelectionCount: boolean;
20
- /**
21
- * Activating this will make setAPI throw an error if the number of actually selected options
22
- * on Features (excluding Group) are not exactly equal to the number of options passed in.
23
- * Note: This check is not always reliable for Options with multiple Features each, which we
24
- * believe is a rare use case.
25
- */
26
- strictSetApiSelectionMatch: boolean;
27
- };
28
- /**
29
- * This enum is used internally in the SDK and is not expected by be used directly by integrators.
30
- */
31
- export declare enum CfgProductBubbleMode {
32
- /** Stop bubbling. */
33
- Stop = "Stop",
34
- /**
35
- * Bubble to the parent CfgProduct up the tree.
36
- * This makes the CfgProduct we we call from notify that it has changed, and the CfgProduct
37
- * above switch out the reference to this.
38
- */
39
- OneLevel = "OneLevel",
40
- /** Bubble to the root CfgProduct. */
41
- ToRoot = "ToRoot",
42
- /** Bubble to the root CfgProduct and turn on all optional CfgProducts on the way up. */
43
- ToRootAndBubbleSelected = "ToRootAndBubbleSelected"
44
- }
45
- export declare type CfgPrice = {
46
- basePrice: number;
47
- listPrice: number;
48
- currency: string;
49
- fractionDigits: number;
50
- };
51
- /**
52
- * This class is meant to only be used through CfgProduct. It should never be instantiated on its
53
- * own. Normally the internal state of this class should never be directly modified. CfgProduct is
54
- * the class that should be used and interacted with.
55
- */
56
- export declare class _CfgProductInternal {
57
- readonly _productLoaderRaw: ProductLoader;
58
- readonly lang: string;
59
- readonly catId: CatalogueParams;
60
- readonly partNumber: string;
61
- readonly settings: CfgProductSettings;
62
- readonly uuid: string;
63
- private readonly _rawUnit;
64
- private _rawProductData;
65
- readonly loadingObservable: AggregatedLoadingObservable;
66
- readonly refKey: string | undefined;
67
- readonly refDescription: string | undefined;
68
- readonly parent: _CfgProductInternal | undefined;
69
- readonly transform: Transform | undefined;
70
- anchor: MeasureParam | undefined;
71
- static make: (productLoaderRaw: ProductLoader, productLoaderForGroupedLoad: ProductLoader | undefined, lang: string, catId: CatalogueParams, partNumber: string, settings: CfgProductSettings, optional: boolean, loadingObservable: AggregatedLoadingObservable, refKey: string | undefined, refDescription: string | undefined, parent: _CfgProductInternal | undefined, root: _CfgProductInternal | undefined, transform: Transform | undefined, anchor: MeasureParam | undefined) => Promise<_CfgProductInternal>;
72
- private constructor();
73
- readonly root: _CfgProductInternal;
74
- private _destroyed;
75
- readonly key: string;
76
- readonly additionalProducts: CfgProduct[];
77
- private _selected;
78
- private _configuration;
79
- readonly changeObservable: Observable<CfgProductChangeNotification>;
80
- get selected(): boolean;
81
- readonly isAdditionalProduct: boolean;
82
- clone(parent?: _CfgProductInternal, root?: _CfgProductInternal): Promise<_CfgProductInternal>;
83
- destroy: () => void;
84
- get description(): string | undefined;
85
- get rootNodeSources(): RootNodeSource[] | undefined;
86
- get mtrlApplications(): MtrlApplication[] | undefined;
87
- get currency(): string;
88
- get fractionDigits(): number;
89
- get prices(): Prices | undefined;
90
- private _measureDefinitions;
91
- get measureDefinitions(): CfgMeasureDefinition[];
92
- private _unit;
93
- /** @throws an error if the actual unit sent by the server was not a LengthUnit */
94
- get unit(): LengthUnit;
95
- get aggregatedPrice(): CfgPrice;
96
- get optional(): boolean;
97
- setSelected(v: boolean, bubbleMode: CfgProductBubbleMode): Promise<boolean>;
98
- get configuration(): CfgProductConfiguration;
99
- get rawProductData(): CfgProductData;
100
- _notifyAllOfChange: (bubbleMode: CfgProductBubbleMode) => Promise<void>;
101
- /** Called when a child (additional product or the configuration) has changed. */
102
- private _childHasChanged;
103
- /** Called by child to tell its parent that it has changed. */
104
- _additionalProductHasChanged: (freshRef: CfgProduct, bubbleMode: CfgProductBubbleMode) => Promise<void>;
105
- /** Called by the configuration to tell its parent that it has changed. */
106
- _configurationHasChanged: (freshRef: CfgProductConfiguration, bubbleMode: ProductConfigurationBubbleMode) => Promise<void>;
107
- getApiSelection: () => AdditionalProductConfiguration;
108
- setApiSelection: (s: AdditionalProductConfiguration, doValidate: boolean, productLoaderForGroupedLoad?: ProductLoader | undefined) => Promise<boolean>;
109
- structureCompare: (other: _CfgProductInternal, strictOrder?: boolean, descriptionMatch?: boolean) => boolean;
110
- tryMatchSelection: (other: _CfgProductInternal, descriptionMatch?: boolean, productLoaderForGroupedLoad?: ProductLoader | undefined) => Promise<boolean>;
111
- /** Only features in selected options and selected additional products. */
112
- _getDescendantFeaturesWithCode: (code: string) => _CfgFeatureInternal[];
113
- private _revalidateInProgressToken;
114
- /**
115
- * Do a validate call for this product. It does not validate additional products, only this
116
- * product in isolation. The validation result is applied on the configuration. Then additional
117
- * products are synced (unloaded, loaded etc.) Finally the changes bubble up the tree.
118
- */
119
- _revalidate: (bubbleMode: CfgProductBubbleMode, productLoaderForGroupedLoad: ProductLoader) => Promise<boolean>;
120
- /**
121
- * Based on this configuration find what additional products should be shown and not, unload
122
- * (i.e. destroy) those that should no longer be shown, load the new ones.
123
- */
124
- _syncAndLoadAdditionalProducts: (productLoaderForGroupedLoad: ProductLoader) => Promise<boolean>;
125
- }
126
- export declare class CfgProduct {
127
- readonly _internal: _CfgProductInternal;
128
- static make(productLoader: ProductLoader, lang: string, catId: CatalogueParams, partNumber: string, settings?: Partial<CfgProductSettings>): Promise<CfgProduct>;
129
- /**
130
- * Makes an object wrapping the passed object. This is not a clone method, it is a method to
131
- * make a new outer reference. Like a shallow copy./ We use this to help frameworks that are
132
- * build around using equals to detect change.
133
- */
134
- static _makeNewRefFrom(source: _CfgProductInternal): CfgProduct;
135
- private constructor();
136
- isBackedBySame: (other: CfgProduct) => boolean;
137
- /**
138
- * Recursively marks this and descendants as destroyed so that late events are ignored
139
- * correctly. If you destroy one shallow copy of this you destroy all.
140
- */
141
- destroy: () => void;
142
- /** Makes a clone of this. It is disconnected from the original. */
143
- clone: () => Promise<CfgProduct>;
144
- /**
145
- * A client side only key that should uniquely identify this product amongst other additional
146
- * products.
147
- */
148
- get key(): string;
149
- /**
150
- * Only used when this product is in additional product.
151
- * As a product can have multiple instances of the same additional product this key exists.
152
- * It will be unique amongst child products, but not globally unique.
153
- */
154
- get refKey(): string | undefined;
155
- get lang(): string;
156
- get catId(): CatalogueParams;
157
- get partNumber(): string;
158
- get isAdditionalProduct(): boolean;
159
- /** Only used when this product is an additional product. Root products are never optional. */
160
- get optional(): boolean;
161
- /**
162
- * Only applicable when this product is optional. If this product is not optional this is
163
- * always true.
164
- */
165
- get selected(): boolean;
166
- /**
167
- * Only applicable when this product is optional.
168
- * Setting this does not cause a validation call as toggling an optional additional product is
169
- * assumed to always be legal.
170
- */
171
- setSelected: (v: boolean) => Promise<boolean>;
172
- get rawProductData(): CfgProductData;
173
- get uuid(): string;
174
- get unit(): LengthUnit;
175
- get sku(): string;
176
- get styleNr(): string;
177
- /** An URL. */
178
- get preview(): string | undefined;
179
- get description(): string | undefined;
180
- get additionalProducts(): CfgProduct[];
181
- get configuration(): CfgProductConfiguration;
182
- get transform(): Transform | undefined;
183
- get currency(): string;
184
- /**
185
- * If positive the number of fraction digits.
186
- * If negative rounding (essentially the number of zeros to the right)
187
- */
188
- get fractionDigits(): number;
189
- get aggregatedPrice(): CfgPrice;
190
- /**
191
- * Experimental. Additional products lacks descriptions or keys that are suitably for structure
192
- * compare, so we use strict-order when trying to match the additional products. This makes
193
- * this method work nicely for different products having pretty much the same child products.
194
- */
195
- structureCompare: (other: CfgProduct, strictOrder?: boolean, descriptionMatch?: boolean) => boolean;
196
- /**
197
- * Experimental. Additional products lacks descriptions or keys that are suitably for try
198
- * match, so we use strict-order when trying to match the additional products. This makes
199
- * this method work nicely for different products having pretty much the same child products.
200
- * This method does not propagate its selections.
201
- * This method will cause validation calls if something change.
202
- */
203
- tryMatchSelection: (other: CfgProduct, descriptionMatch?: boolean) => Promise<boolean>;
204
- /**
205
- * Gets what selections has been made on the product, recursively including product
206
- * configuration, optional products and additional products. Used when a full view of all
207
- * selections on a product is needed, such as when doing Render or Export.
208
- */
209
- getApiSelection: () => AdditionalProductConfiguration;
210
- setApiSelection: (s: AdditionalProductConfiguration, doValidate?: boolean) => Promise<boolean>;
211
- listenForChange: (l: SingleArgCallback<CfgProductChangeNotification>) => void;
212
- stopListenForChange: (l: SingleArgCallback<CfgProductChangeNotification>) => void;
213
- stopAllListenForChange: () => void;
214
- listenForLoading: (l: SingleArgCallback<boolean>) => void;
215
- stopListenForLoading: (l: SingleArgCallback<boolean>) => void;
216
- stopAllListenForLoading: () => void;
217
- }
1
+ import { AggregatedLoadingObservable, LengthUnit, Observable, SingleArgCallback } from "@configura/web-utilities";
2
+ import { AdditionalProductConfiguration, CatalogueParams, MeasureParam, MtrlApplication, Prices, Transform } from "./CatalogueAPI.js";
3
+ import { CfgMeasureDefinition } from "./CfgMeasure.js";
4
+ import { _CfgFeatureInternal } from "./productConfiguration/CfgFeature.js";
5
+ import { ProductConfigurationBubbleMode } from "./productConfiguration/CfgOption.js";
6
+ import { CfgProductConfiguration } from "./productConfiguration/CfgProductConfiguration.js";
7
+ import { ProductLoader } from "./productLoader.js";
8
+ import { CfgProductData, RootNodeSource } from "./utilitiesCatalogueData.js";
9
+ export declare type CfgProductChangeNotification = {
10
+ freshRef: CfgProduct;
11
+ };
12
+ export declare type CfgProductSettings = {
13
+ /**
14
+ * In a correctly setup catalogue a select-one Feature (i.e. neither optional nor multiple)
15
+ * must have exactly one Option set at a time. However, this is not enforced in Catalogue
16
+ * Creator and it is not uncommon with catalogues which fails to meet this requirement.
17
+ * Activating this will make setApi throw an Error if more or less than one is selected.
18
+ */
19
+ strictSelectOneSelectionCount: boolean;
20
+ /**
21
+ * Activating this will make setAPI throw an error if the number of actually selected options
22
+ * on Features (excluding Group) are not exactly equal to the number of options passed in.
23
+ * Note: This check is not always reliable for Options with multiple Features each, which we
24
+ * believe is a rare use case.
25
+ */
26
+ strictSetApiSelectionMatch: boolean;
27
+ };
28
+ /**
29
+ * This enum is used internally in the SDK and is not expected by be used directly by integrators.
30
+ */
31
+ export declare enum CfgProductBubbleMode {
32
+ /** Stop bubbling. */
33
+ Stop = "Stop",
34
+ /**
35
+ * Bubble to the parent CfgProduct up the tree.
36
+ * This makes the CfgProduct we we call from notify that it has changed, and the CfgProduct
37
+ * above switch out the reference to this.
38
+ */
39
+ OneLevel = "OneLevel",
40
+ /** Bubble to the root CfgProduct. */
41
+ ToRoot = "ToRoot",
42
+ /** Bubble to the root CfgProduct and turn on all optional CfgProducts on the way up. */
43
+ ToRootAndBubbleSelected = "ToRootAndBubbleSelected"
44
+ }
45
+ export declare type CfgPrice = {
46
+ basePrice: number;
47
+ listPrice: number;
48
+ currency: string;
49
+ fractionDigits: number;
50
+ };
51
+ /**
52
+ * This class is meant to only be used through CfgProduct. It should never be instantiated on its
53
+ * own. Normally the internal state of this class should never be directly modified. CfgProduct is
54
+ * the class that should be used and interacted with.
55
+ */
56
+ export declare class _CfgProductInternal {
57
+ readonly _productLoaderRaw: ProductLoader;
58
+ readonly lang: string;
59
+ readonly catId: CatalogueParams;
60
+ readonly partNumber: string;
61
+ readonly settings: CfgProductSettings;
62
+ readonly uuid: string;
63
+ private readonly _rawUnit;
64
+ private _rawProductData;
65
+ readonly loadingObservable: AggregatedLoadingObservable;
66
+ readonly refKey: string | undefined;
67
+ readonly refDescription: string | undefined;
68
+ readonly parent: _CfgProductInternal | undefined;
69
+ readonly transform: Transform | undefined;
70
+ anchor: MeasureParam | undefined;
71
+ static make: (productLoaderRaw: ProductLoader, productLoaderForGroupedLoad: ProductLoader | undefined, lang: string, catId: CatalogueParams, partNumber: string, settings: CfgProductSettings, optional: boolean, loadingObservable: AggregatedLoadingObservable, refKey: string | undefined, refDescription: string | undefined, parent: _CfgProductInternal | undefined, root: _CfgProductInternal | undefined, transform: Transform | undefined, anchor: MeasureParam | undefined) => Promise<_CfgProductInternal>;
72
+ private constructor();
73
+ readonly root: _CfgProductInternal;
74
+ private _destroyed;
75
+ readonly key: string;
76
+ readonly additionalProducts: CfgProduct[];
77
+ private _selected;
78
+ private _configuration;
79
+ readonly changeObservable: Observable<CfgProductChangeNotification>;
80
+ get selected(): boolean;
81
+ readonly isAdditionalProduct: boolean;
82
+ clone(parent?: _CfgProductInternal, root?: _CfgProductInternal): Promise<_CfgProductInternal>;
83
+ destroy: () => void;
84
+ get description(): string | undefined;
85
+ get rootNodeSources(): RootNodeSource[] | undefined;
86
+ get mtrlApplications(): MtrlApplication[] | undefined;
87
+ get currency(): string;
88
+ get fractionDigits(): number;
89
+ get prices(): Prices | undefined;
90
+ private _measureDefinitions;
91
+ get measureDefinitions(): CfgMeasureDefinition[];
92
+ private _unit;
93
+ /** @throws an error if the actual unit sent by the server was not a LengthUnit */
94
+ get unit(): LengthUnit;
95
+ get aggregatedPrice(): CfgPrice;
96
+ get optional(): boolean;
97
+ setSelected(v: boolean, bubbleMode: CfgProductBubbleMode): Promise<boolean>;
98
+ get configuration(): CfgProductConfiguration;
99
+ get rawProductData(): CfgProductData;
100
+ _notifyAllOfChange: (bubbleMode: CfgProductBubbleMode) => Promise<void>;
101
+ /** Called when a child (additional product or the configuration) has changed. */
102
+ private _childHasChanged;
103
+ /** Called by child to tell its parent that it has changed. */
104
+ _additionalProductHasChanged: (freshRef: CfgProduct, bubbleMode: CfgProductBubbleMode) => Promise<void>;
105
+ /** Called by the configuration to tell its parent that it has changed. */
106
+ _configurationHasChanged: (freshRef: CfgProductConfiguration, bubbleMode: ProductConfigurationBubbleMode) => Promise<void>;
107
+ getApiSelection: () => AdditionalProductConfiguration;
108
+ setApiSelection: (s: AdditionalProductConfiguration, doValidate: boolean, productLoaderForGroupedLoad?: ProductLoader | undefined) => Promise<boolean>;
109
+ structureCompare: (other: _CfgProductInternal, strictOrder?: boolean, descriptionMatch?: boolean) => boolean;
110
+ tryMatchSelection: (other: _CfgProductInternal, descriptionMatch?: boolean, productLoaderForGroupedLoad?: ProductLoader | undefined) => Promise<boolean>;
111
+ /** Only features in selected options and selected additional products. */
112
+ _getDescendantFeaturesWithCode: (code: string) => _CfgFeatureInternal[];
113
+ private _revalidateInProgressToken;
114
+ /**
115
+ * Do a validate call for this product. It does not validate additional products, only this
116
+ * product in isolation. The validation result is applied on the configuration. Then additional
117
+ * products are synced (unloaded, loaded etc.) Finally the changes bubble up the tree.
118
+ */
119
+ _revalidate: (bubbleMode: CfgProductBubbleMode, productLoader: ProductLoader) => Promise<boolean>;
120
+ /**
121
+ * Based on this configuration find what additional products should be shown and not, unload
122
+ * (i.e. destroy) those that should no longer be shown, load the new ones.
123
+ */
124
+ _syncAndLoadAdditionalProducts: (productLoaderForGroupedLoad: ProductLoader) => Promise<boolean>;
125
+ }
126
+ export declare class CfgProduct {
127
+ readonly _internal: _CfgProductInternal;
128
+ static make(productLoader: ProductLoader, lang: string, catId: CatalogueParams, partNumber: string, settings?: Partial<CfgProductSettings>): Promise<CfgProduct>;
129
+ /**
130
+ * Makes an object wrapping the passed object. This is not a clone method, it is a method to
131
+ * make a new outer reference. Like a shallow copy./ We use this to help frameworks that are
132
+ * build around using equals to detect change.
133
+ */
134
+ static _makeNewRefFrom(source: _CfgProductInternal): CfgProduct;
135
+ private constructor();
136
+ isBackedBySame: (other: CfgProduct) => boolean;
137
+ /**
138
+ * Recursively marks this and descendants as destroyed so that late events are ignored
139
+ * correctly. If you destroy one shallow copy of this you destroy all.
140
+ */
141
+ destroy: () => void;
142
+ /** Makes a clone of this. It is disconnected from the original. */
143
+ clone: () => Promise<CfgProduct>;
144
+ /**
145
+ * A client side only key that should uniquely identify this product amongst other additional
146
+ * products.
147
+ */
148
+ get key(): string;
149
+ /**
150
+ * Only used when this product is in additional product.
151
+ * As a product can have multiple instances of the same additional product this key exists.
152
+ * It will be unique amongst child products, but not globally unique.
153
+ */
154
+ get refKey(): string | undefined;
155
+ get lang(): string;
156
+ get catId(): CatalogueParams;
157
+ get partNumber(): string;
158
+ get isAdditionalProduct(): boolean;
159
+ /** Only used when this product is an additional product. Root products are never optional. */
160
+ get optional(): boolean;
161
+ /**
162
+ * Only applicable when this product is optional. If this product is not optional this is
163
+ * always true.
164
+ */
165
+ get selected(): boolean;
166
+ /**
167
+ * Only applicable when this product is optional.
168
+ * Setting this does not cause a validation call as toggling an optional additional product is
169
+ * assumed to always be legal.
170
+ */
171
+ setSelected: (v: boolean) => Promise<boolean>;
172
+ get rawProductData(): CfgProductData;
173
+ get uuid(): string;
174
+ get unit(): LengthUnit;
175
+ get sku(): string;
176
+ get styleNr(): string;
177
+ /** An URL. */
178
+ get preview(): string | undefined;
179
+ get description(): string | undefined;
180
+ get additionalProducts(): CfgProduct[];
181
+ get configuration(): CfgProductConfiguration;
182
+ get transform(): Transform | undefined;
183
+ get currency(): string;
184
+ /**
185
+ * If positive the number of fraction digits.
186
+ * If negative rounding (essentially the number of zeros to the right)
187
+ */
188
+ get fractionDigits(): number;
189
+ get aggregatedPrice(): CfgPrice;
190
+ /**
191
+ * Experimental. Additional products lacks descriptions or keys that are suitably for structure
192
+ * compare, so we use strict-order when trying to match the additional products. This makes
193
+ * this method work nicely for different products having pretty much the same child products.
194
+ */
195
+ structureCompare: (other: CfgProduct, strictOrder?: boolean, descriptionMatch?: boolean) => boolean;
196
+ /**
197
+ * Experimental. Additional products lacks descriptions or keys that are suitably for try
198
+ * match, so we use strict-order when trying to match the additional products. This makes
199
+ * this method work nicely for different products having pretty much the same child products.
200
+ * This method does not propagate its selections.
201
+ * This method will cause validation calls if something change.
202
+ */
203
+ tryMatchSelection: (other: CfgProduct, descriptionMatch?: boolean) => Promise<boolean>;
204
+ /**
205
+ * Gets what selections has been made on the product, recursively including product
206
+ * configuration, optional products and additional products. Used when a full view of all
207
+ * selections on a product is needed, such as when doing Render or Export.
208
+ */
209
+ getApiSelection: () => AdditionalProductConfiguration;
210
+ setApiSelection: (s: AdditionalProductConfiguration, doValidate?: boolean) => Promise<boolean>;
211
+ listenForChange: (l: SingleArgCallback<CfgProductChangeNotification>) => void;
212
+ stopListenForChange: (l: SingleArgCallback<CfgProductChangeNotification>) => void;
213
+ stopAllListenForChange: () => void;
214
+ listenForLoading: (l: SingleArgCallback<boolean>) => void;
215
+ stopListenForLoading: (l: SingleArgCallback<boolean>) => void;
216
+ stopAllListenForLoading: () => void;
217
+ }
218
218
  //# sourceMappingURL=CfgProduct.d.ts.map