@configura/web-api 1.6.1-alpha.4 → 1.6.1

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 (76) hide show
  1. package/.eslintrc.json +18 -0
  2. package/LICENSE +201 -201
  3. package/README.md +1 -1
  4. package/dist/CatalogueAPI.d.ts +507 -511
  5. package/dist/CatalogueAPI.js +280 -273
  6. package/dist/CfgMeasure.d.ts +32 -32
  7. package/dist/CfgMeasure.js +30 -30
  8. package/dist/CfgProduct.d.ts +258 -257
  9. package/dist/CfgProduct.js +747 -732
  10. package/dist/index.d.ts +20 -20
  11. package/dist/index.js +20 -20
  12. package/dist/material/CfgMaterialMapping.d.ts +7 -7
  13. package/dist/material/CfgMaterialMapping.js +181 -181
  14. package/dist/material/CfgMtrlApplication.d.ts +18 -18
  15. package/dist/material/CfgMtrlApplication.js +43 -43
  16. package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
  17. package/dist/material/CfgMtrlApplicationSource.js +8 -8
  18. package/dist/material/CfgMtrlSource.d.ts +19 -19
  19. package/dist/material/CfgMtrlSource.js +40 -40
  20. package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
  21. package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
  22. package/dist/productConfiguration/CfgFeature.d.ts +188 -179
  23. package/dist/productConfiguration/CfgFeature.js +636 -617
  24. package/dist/productConfiguration/CfgOption.d.ts +150 -150
  25. package/dist/productConfiguration/CfgOption.js +426 -426
  26. package/dist/productConfiguration/CfgProductConfiguration.d.ts +120 -120
  27. package/dist/productConfiguration/CfgProductConfiguration.js +309 -307
  28. package/dist/productConfiguration/filters.d.ts +15 -15
  29. package/dist/productConfiguration/filters.js +70 -70
  30. package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
  31. package/dist/productConfiguration/productParamsGenerator.js +51 -51
  32. package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -17
  33. package/dist/productConfiguration/utilitiesProductConfiguration.js +80 -80
  34. package/dist/productLoader.d.ts +33 -33
  35. package/dist/productLoader.js +49 -49
  36. package/dist/syncGroups/SyncGroupsApplyMode.d.ts +20 -20
  37. package/dist/syncGroups/SyncGroupsApplyMode.js +21 -21
  38. package/dist/syncGroups/SyncGroupsHandler.d.ts +40 -39
  39. package/dist/syncGroups/SyncGroupsHandler.js +358 -352
  40. package/dist/syncGroups/SyncGroupsPathHelper.d.ts +26 -26
  41. package/dist/syncGroups/SyncGroupsPathHelper.js +90 -89
  42. package/dist/syncGroups/SyncGroupsState.d.ts +35 -25
  43. package/dist/syncGroups/SyncGroupsState.js +125 -111
  44. package/dist/syncGroups/SyncGroupsTransaction.d.ts +154 -50
  45. package/dist/syncGroups/SyncGroupsTransaction.js +576 -100
  46. package/dist/tasks/TaskHandler.d.ts +78 -78
  47. package/dist/tasks/TaskHandler.js +276 -265
  48. package/dist/tasks/formats.d.ts +4 -4
  49. package/dist/tasks/formats.js +7 -7
  50. package/dist/tests/testData/collectorForTest.d.ts +73 -73
  51. package/dist/tests/testData/collectorForTest.js +194 -195
  52. package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
  53. package/dist/tests/testData/dummyProductForTest.js +36 -36
  54. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +11 -32
  55. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +277 -277
  56. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  57. package/dist/tests/testData/testDataCachedGetProduct.js +185 -185
  58. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  59. package/dist/tests/testData/testDataCachedPostValidate.js +183 -183
  60. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
  61. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1099 -1099
  62. package/dist/tests/testData/testDataOptions.d.ts +12 -12
  63. package/dist/tests/testData/testDataOptions.js +60 -60
  64. package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +6 -6
  65. package/dist/tests/testData/testDataProductAggregatedPrice.js +187 -187
  66. package/dist/tests/testData/testDataUpcharge.d.ts +8 -29
  67. package/dist/tests/testData/testDataUpcharge.js +119 -119
  68. package/dist/utilitiesCatalogueData.d.ts +31 -31
  69. package/dist/utilitiesCatalogueData.js +162 -168
  70. package/dist/utilitiesCataloguePermission.d.ts +37 -39
  71. package/dist/utilitiesCataloguePermission.js +80 -84
  72. package/dist/utilitiesNumericValues.d.ts +24 -24
  73. package/dist/utilitiesNumericValues.js +109 -109
  74. package/package.json +3 -3
  75. package/dist/syncGroups/SyncGroupsApplier.d.ts +0 -20
  76. package/dist/syncGroups/SyncGroupsApplier.js +0 -520
@@ -1,20 +1,20 @@
1
- export declare abstract class CfgMtrlSource {
2
- abstract isSame(other: CfgMtrlSource): boolean;
3
- }
4
- export declare class CfgMtrlSourceUrl extends CfgMtrlSource {
5
- private _url;
6
- private _urlIsFromProperty;
7
- constructor(_url: string, _urlIsFromProperty: string);
8
- get url(): string;
9
- get urlIsFromProperty(): string;
10
- isSame(other: CfgMtrlSource): boolean;
11
- }
12
- export declare class CfgMtrlSourceBuffer extends CfgMtrlSource {
13
- private _fileName;
14
- private _buffer;
15
- constructor(_fileName: string, _buffer: ArrayBuffer);
16
- get fileName(): string;
17
- get buffer(): ArrayBuffer;
18
- isSame(other: CfgMtrlSource): boolean;
19
- }
1
+ export declare abstract class CfgMtrlSource {
2
+ abstract isSame(other: CfgMtrlSource): boolean;
3
+ }
4
+ export declare class CfgMtrlSourceUrl extends CfgMtrlSource {
5
+ private _url;
6
+ private _urlIsFromProperty;
7
+ constructor(_url: string, _urlIsFromProperty: string);
8
+ get url(): string;
9
+ get urlIsFromProperty(): string;
10
+ isSame(other: CfgMtrlSource): boolean;
11
+ }
12
+ export declare class CfgMtrlSourceBuffer extends CfgMtrlSource {
13
+ private _fileName;
14
+ private _buffer;
15
+ constructor(_fileName: string, _buffer: ArrayBuffer);
16
+ get fileName(): string;
17
+ get buffer(): ArrayBuffer;
18
+ isSame(other: CfgMtrlSource): boolean;
19
+ }
20
20
  //# sourceMappingURL=CfgMtrlSource.d.ts.map
@@ -1,40 +1,40 @@
1
- export class CfgMtrlSource {
2
- }
3
- export class CfgMtrlSourceUrl extends CfgMtrlSource {
4
- constructor(_url, _urlIsFromProperty) {
5
- super();
6
- this._url = _url;
7
- this._urlIsFromProperty = _urlIsFromProperty;
8
- }
9
- get url() {
10
- return this._url;
11
- }
12
- get urlIsFromProperty() {
13
- return this._urlIsFromProperty;
14
- }
15
- isSame(other) {
16
- if (!(other instanceof CfgMtrlSourceUrl)) {
17
- return false;
18
- }
19
- return this.url === other.url;
20
- }
21
- }
22
- export class CfgMtrlSourceBuffer extends CfgMtrlSource {
23
- constructor(_fileName, _buffer) {
24
- super();
25
- this._fileName = _fileName;
26
- this._buffer = _buffer;
27
- }
28
- get fileName() {
29
- return this._fileName;
30
- }
31
- get buffer() {
32
- return this._buffer;
33
- }
34
- isSame(other) {
35
- if (!(other instanceof CfgMtrlSourceBuffer)) {
36
- return false;
37
- }
38
- return this.fileName === other.fileName;
39
- }
40
- }
1
+ export class CfgMtrlSource {
2
+ }
3
+ export class CfgMtrlSourceUrl extends CfgMtrlSource {
4
+ constructor(_url, _urlIsFromProperty) {
5
+ super();
6
+ this._url = _url;
7
+ this._urlIsFromProperty = _urlIsFromProperty;
8
+ }
9
+ get url() {
10
+ return this._url;
11
+ }
12
+ get urlIsFromProperty() {
13
+ return this._urlIsFromProperty;
14
+ }
15
+ isSame(other) {
16
+ if (!(other instanceof CfgMtrlSourceUrl)) {
17
+ return false;
18
+ }
19
+ return this.url === other.url;
20
+ }
21
+ }
22
+ export class CfgMtrlSourceBuffer extends CfgMtrlSource {
23
+ constructor(_fileName, _buffer) {
24
+ super();
25
+ this._fileName = _fileName;
26
+ this._buffer = _buffer;
27
+ }
28
+ get fileName() {
29
+ return this._fileName;
30
+ }
31
+ get buffer() {
32
+ return this._buffer;
33
+ }
34
+ isSame(other) {
35
+ if (!(other instanceof CfgMtrlSourceBuffer)) {
36
+ return false;
37
+ }
38
+ return this.fileName === other.fileName;
39
+ }
40
+ }
@@ -1,8 +1,8 @@
1
- import { CfgMtrlApplication } from "./CfgMtrlApplication.js";
2
- import { CfgMtrlSource } from "./CfgMtrlSource.js";
3
- export interface CfgMtrlSourceWithMetaData {
4
- mtrl: CfgMtrlSource;
5
- source: CfgMtrlApplication;
6
- overriddenByOption: boolean;
7
- }
1
+ import { CfgMtrlApplication } from "./CfgMtrlApplication.js";
2
+ import { CfgMtrlSource } from "./CfgMtrlSource.js";
3
+ export interface CfgMtrlSourceWithMetaData {
4
+ mtrl: CfgMtrlSource;
5
+ source: CfgMtrlApplication;
6
+ overriddenByOption: boolean;
7
+ }
8
8
  //# sourceMappingURL=CfgMtrlSourceWithMetaData.d.ts.map
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,180 +1,189 @@
1
- import { LengthUnit, Observable, SingleArgCallback } from "@configura/web-utilities";
2
- import { Feature, SelectedOption, SyncGroup } from "../CatalogueAPI.js";
3
- import { CfgProduct, _CfgProductInternal } from "../CfgProduct.js";
4
- import { CfgMtrlApplication } from "../material/CfgMtrlApplication.js";
5
- import { CfgOption, ProductConfigurationBubbleMode, _CfgOptionInternal } from "./CfgOption.js";
6
- import { _CfgProductConfigurationInternal } from "./CfgProductConfiguration.js";
7
- export declare enum SelectionType {
8
- /**
9
- * All options are permanently selected. In our ui-component for this we skip over this level,
10
- * and immediately show the children, but you could do this differently, like for instance
11
- * showing the group heading.
12
- */
13
- Group = 0,
14
- /**
15
- * One and only one can be selected at a time. This normally corresponds to either a dropdown
16
- * menu or radio buttons.
17
- */
18
- SelectOne = 1,
19
- /** Zero to all can be selected at a time. This normally corresponds to checkboxes. */
20
- SelectMany = 2
21
- }
22
- export declare type FeatureChangeNotification = {
23
- freshRef: CfgFeature;
24
- };
25
- /**
26
- * This class is meant to only be used through CfgFeature. It should
27
- * never be instantiated on its own. Normally the internal state of this class
28
- * should never be directly modified. CfgFeature is the class that
29
- * should be used and interacted with.
30
- */
31
- export declare class _CfgFeatureInternal {
32
- readonly rawFeature: Feature;
33
- private readonly allRawFeatures;
34
- readonly key: string;
35
- readonly parent: _CfgProductConfigurationInternal | _CfgOptionInternal;
36
- readonly parentConfiguration: _CfgProductConfigurationInternal;
37
- readonly parentProduct: _CfgProductInternal;
38
- readonly rootProduct: _CfgProductInternal;
39
- constructor(rawFeature: Feature, allRawFeatures: Feature[], key: string, // Unique amongst siblings
40
- parent: _CfgProductConfigurationInternal | _CfgOptionInternal, parentConfiguration: _CfgProductConfigurationInternal, parentProduct: _CfgProductInternal, rootProduct: _CfgProductInternal);
41
- readonly selectionType: SelectionType;
42
- private _options;
43
- private readonly _selectedOptions;
44
- private _mtrlApplications;
45
- readonly hasUpcharge: boolean;
46
- readonly changeObservable: Observable<FeatureChangeNotification>;
47
- get code(): string;
48
- get groupCode(): string | undefined;
49
- get isUseNumericValue(): boolean;
50
- get numericValue(): number | undefined;
51
- setNumericValue: (val: number) => Promise<boolean>;
52
- get syncGroup(): SyncGroup | undefined;
53
- get description(): string;
54
- /**
55
- * The MeasureParam class is re-used for different purposes. In Features it is used
56
- * to indicate which stretch measures inside Models shall be affected by this state
57
- * of this Feature. Hence only the code property is used.
58
- */
59
- get measureParamCodes(): string[] | undefined;
60
- get unit(): LengthUnit;
61
- get mtrlApplications(): CfgMtrlApplication[];
62
- get selectedOptions(): CfgOption[];
63
- get ancestorsSelected(): boolean;
64
- /**
65
- * If one option is selected or deselected this will potentially
66
- * affect all other Options on this Feature
67
- */
68
- private get isAllOptionsAffectedByAnySelection();
69
- get preview(): string | undefined;
70
- /**
71
- * Please note that this relates to the visibility in the Configuration tree.
72
- * It does not affect the visibility of anything in the 3D view at all.
73
- */
74
- get visibleIfAdditionalProduct(): boolean;
75
- /**
76
- * Please note that this relates to the visibility in the Configuration tree.
77
- * It does not affect the visibility of anything in the 3D view at all.
78
- */
79
- get visibleIfMainProduct(): boolean;
80
- /**
81
- * Please note that this relates to the visibility in the Configuration tree.
82
- * It does not affect the visibility of anything in the 3D view at all.
83
- */
84
- get visible(): boolean;
85
- get options(): CfgOption[];
86
- private _notifyAllOfChange;
87
- /**
88
- * Called by child to tell its parent that it has changed.
89
- * @throws Will throw if options have not yet been generated. This should be impossible
90
- * as nonexisting children can not call their parent.
91
- */
92
- _childHasChanged: (childOption: _CfgOptionInternal, bubbleMode: ProductConfigurationBubbleMode) => Promise<void>;
93
- getApiSelection: () => {
94
- [index: string]: SelectedOption;
95
- } | undefined;
96
- setApiSelection: (apiOptionSelectionMap: {
97
- [index: string]: SelectedOption;
98
- } | undefined) => Promise<boolean>;
99
- /** Pushes to refresh stretch. Does not cause validation. */
100
- pushStretch: () => Promise<boolean>;
101
- structureCompare: (other: _CfgFeatureInternal, strictOrder?: boolean, descriptionMatch?: boolean) => boolean;
102
- tryMatchSelection: (other: _CfgFeatureInternal, descriptionMatch?: boolean) => Promise<boolean>;
103
- /**
104
- * Normally this is used through methods on CfgFeature and CfgOption. Use this
105
- * internal version if you need to control the bubbleMode.
106
- * Using a validate bubbleMode will cause validation calls to the server.
107
- */
108
- selectOption: (optionInternal: _CfgOptionInternal, on: boolean, bubbleMode: ProductConfigurationBubbleMode) => Promise<boolean>;
109
- isSelected: (option: _CfgOptionInternal) => boolean;
110
- keyMatch: (other: _CfgFeatureInternal, descriptionMatch?: boolean) => boolean;
111
- /** Only in selected options */
112
- _getFeaturesWithCode: (code: string) => _CfgFeatureInternal[];
113
- /**
114
- * Make fresh references to all options on this feature.
115
- * Also includes currently selected options.
116
- * @throws Will throw if options have not yet been generated.
117
- */
118
- private _freshRefAllOptions;
119
- _freshRefDescendants(): void;
120
- }
121
- export declare class CfgFeature {
122
- readonly _internal: _CfgFeatureInternal;
123
- static make(rawFeature: Feature, allRawFeatures: Feature[], key: string, parent: _CfgProductConfigurationInternal | _CfgOptionInternal, parentConfiguration: _CfgProductConfigurationInternal, parentProduct: _CfgProductInternal, rootProduct: _CfgProductInternal): CfgFeature;
124
- /**
125
- * Makes an object wrapping the passed object. This is not a clone method,
126
- * it is a method to make a new outer reference. Like a shallow copy.
127
- * We use this to help frameworks that are built around using equals to detect change.
128
- */
129
- static _makeNewRefFrom(internal: _CfgFeatureInternal): CfgFeature;
130
- /**
131
- * Private constructor and make-method because make new ref requires the constructor to
132
- * take an internal and we don't want those who instantiate CfgFeature to have to be aware
133
- * of the internal.
134
- */
135
- private constructor();
136
- isBackedBySame: (other: CfgFeature) => boolean;
137
- get parentProduct(): CfgProduct;
138
- get rootProduct(): CfgProduct;
139
- get selectionType(): SelectionType;
140
- get key(): string;
141
- get code(): string;
142
- get groupCode(): string | undefined;
143
- /**
144
- * If true the options in the feature is selected by both sending its code and numeric value
145
- * when selecting.
146
- */
147
- get isUseNumericValue(): boolean;
148
- /** This will read the numeric value of the selected option. */
149
- get numericValue(): number | undefined;
150
- /**
151
- * This will find the first option allowing the value, set the value on it and select it.
152
- * This is an implicit option-select.
153
- */
154
- setNumericValue: (val: number) => Promise<boolean>;
155
- get unit(): LengthUnit;
156
- get description(): string;
157
- get hasUpcharge(): boolean | undefined;
158
- get selectedOptions(): CfgOption[];
159
- /** Are all ancestors up to the CfgProductConfiguration selected? */
160
- get ancestorsSelected(): boolean;
161
- get preview(): string | undefined;
162
- get options(): CfgOption[];
163
- /**
164
- * Please note that this relates to the visibility in the Configuration tree.
165
- * It does not affect the visibility of anything in the 3D view at all.
166
- * Visibility is not inherited. If this is hidden the children
167
- * of this Feature might still be visible, depending on their settings.
168
- */
169
- get visible(): boolean;
170
- /**
171
- * Selects the passed Option.
172
- * Only Options belonging to Features that are "select many" can be deselected.
173
- * Calling this will cause a validation call to the server.
174
- */
175
- selectOption: (option: CfgOption, on: boolean) => Promise<boolean>;
176
- isSelected: (option: CfgOption) => boolean;
177
- listenForChange: (l: SingleArgCallback<FeatureChangeNotification>) => void;
178
- stopListenForChange: (l: SingleArgCallback<FeatureChangeNotification>) => void;
179
- }
1
+ import { LengthUnit, Observable, SingleArgCallback } from "@configura/web-utilities";
2
+ import { Feature, SelectedOption, SyncGroup, SyncGroupMethods } from "../CatalogueAPI.js";
3
+ import { CfgProduct, _CfgProductInternal } from "../CfgProduct.js";
4
+ import { CfgMtrlApplication } from "../material/CfgMtrlApplication.js";
5
+ import { SyncCode } from "../syncGroups/SyncGroupsHandler.js";
6
+ import { CfgOption, ProductConfigurationBubbleMode, _CfgOptionInternal } from "./CfgOption.js";
7
+ import { _CfgProductConfigurationInternal } from "./CfgProductConfiguration.js";
8
+ export declare enum SelectionType {
9
+ /**
10
+ * All options are permanently selected. In our ui-component for this we skip over this level,
11
+ * and immediately show the children, but you could do this differently, like for instance
12
+ * showing the group heading.
13
+ */
14
+ Group = 0,
15
+ /**
16
+ * One and only one can be selected at a time. This normally corresponds to either a dropdown
17
+ * menu or radio buttons.
18
+ */
19
+ SelectOne = 1,
20
+ /** Zero to all can be selected at a time. This normally corresponds to checkboxes. */
21
+ SelectMany = 2
22
+ }
23
+ export declare type FeatureChangeNotification = {
24
+ freshRef: CfgFeature;
25
+ };
26
+ /**
27
+ * This class is meant to only be used through CfgFeature. It should
28
+ * never be instantiated on its own. Normally the internal state of this class
29
+ * should never be directly modified. CfgFeature is the class that
30
+ * should be used and interacted with.
31
+ */
32
+ export declare class _CfgFeatureInternal {
33
+ readonly rawFeature: Feature;
34
+ private readonly allRawFeatures;
35
+ readonly key: string;
36
+ readonly parent: _CfgProductConfigurationInternal | _CfgOptionInternal;
37
+ readonly parentConfiguration: _CfgProductConfigurationInternal;
38
+ readonly parentProduct: _CfgProductInternal;
39
+ readonly rootProduct: _CfgProductInternal;
40
+ constructor(rawFeature: Feature, allRawFeatures: Feature[], key: string, // Unique amongst siblings
41
+ parent: _CfgProductConfigurationInternal | _CfgOptionInternal, parentConfiguration: _CfgProductConfigurationInternal, parentProduct: _CfgProductInternal, rootProduct: _CfgProductInternal);
42
+ readonly selectionType: SelectionType;
43
+ private _options;
44
+ private readonly _selectedOptions;
45
+ private _mtrlApplications;
46
+ readonly hasUpcharge: boolean;
47
+ readonly changeObservable: Observable<FeatureChangeNotification>;
48
+ get code(): string;
49
+ get groupCode(): string | undefined;
50
+ get isUseNumericValue(): boolean;
51
+ get numericValue(): number | undefined;
52
+ setNumericValue: (val: number) => Promise<boolean>;
53
+ get description(): string;
54
+ get syncGroup(): SyncGroup | undefined;
55
+ /**
56
+ * @return one of the following, in order:
57
+ * - undefined if the Feature lacks a syncGroup.
58
+ * - false if the syncGroup doesn't fulfill the optional mustSupport requirement.
59
+ * - syncCode from the syncGroup.
60
+ */
61
+ getSyncCode(mustSupport?: SyncGroupMethods): undefined | false | SyncCode;
62
+ /**
63
+ * The MeasureParam class is re-used for different purposes. In Features it is used
64
+ * to indicate which stretch measures inside Models shall be affected by this state
65
+ * of this Feature. Hence only the code property is used.
66
+ */
67
+ get measureParamCodes(): string[] | undefined;
68
+ get unit(): LengthUnit;
69
+ get mtrlApplications(): CfgMtrlApplication[];
70
+ get selectedOptions(): CfgOption[];
71
+ get ancestorsSelected(): boolean;
72
+ /**
73
+ * If one option is selected or deselected this will potentially
74
+ * affect all other Options on this Feature
75
+ */
76
+ private get isAllOptionsAffectedByAnySelection();
77
+ get preview(): string | undefined;
78
+ /**
79
+ * Please note that this relates to the visibility in the Configuration tree.
80
+ * It does not affect the visibility of anything in the 3D view at all.
81
+ */
82
+ get visibleIfAdditionalProduct(): boolean;
83
+ /**
84
+ * Please note that this relates to the visibility in the Configuration tree.
85
+ * It does not affect the visibility of anything in the 3D view at all.
86
+ */
87
+ get visibleIfMainProduct(): boolean;
88
+ /**
89
+ * Please note that this relates to the visibility in the Configuration tree.
90
+ * It does not affect the visibility of anything in the 3D view at all.
91
+ */
92
+ get visible(): boolean;
93
+ get options(): CfgOption[];
94
+ private _notifyAllOfChange;
95
+ /**
96
+ * Called by child to tell its parent that it has changed.
97
+ * @throws Will throw if options have not yet been generated. This should be impossible
98
+ * as nonexisting children can not call their parent.
99
+ */
100
+ _childHasChanged: (childOption: _CfgOptionInternal, bubbleMode: ProductConfigurationBubbleMode) => Promise<void>;
101
+ getApiSelection: () => {
102
+ [index: string]: SelectedOption;
103
+ } | undefined;
104
+ setApiSelection: (apiOptionSelectionMap: {
105
+ [index: string]: SelectedOption;
106
+ } | undefined) => Promise<boolean>;
107
+ /** Pushes to refresh stretch. Does not cause validation. */
108
+ pushStretch: () => Promise<boolean>;
109
+ structureCompare: (other: _CfgFeatureInternal, strictOrder?: boolean, descriptionMatch?: boolean) => boolean;
110
+ tryMatchSelection: (other: _CfgFeatureInternal, descriptionMatch?: boolean) => Promise<boolean>;
111
+ /**
112
+ * Normally this is used through methods on CfgFeature and CfgOption. Use this internal version
113
+ * if you need to control the bubbleMode.
114
+ *
115
+ * Using a validate bubbleMode will cause validation calls to the server.
116
+ */
117
+ selectOption: (optionInternal: _CfgOptionInternal, on: boolean, bubbleMode: ProductConfigurationBubbleMode) => Promise<boolean>;
118
+ isSelected: (option: _CfgOptionInternal) => boolean;
119
+ keyMatch: (other: _CfgFeatureInternal, descriptionMatch?: boolean) => boolean;
120
+ /** Only in selected options */
121
+ _getFeaturesWithCode: (code: string) => _CfgFeatureInternal[];
122
+ /**
123
+ * Make fresh references to all options on this feature.
124
+ * Also includes currently selected options.
125
+ * @throws Will throw if options have not yet been generated.
126
+ */
127
+ private _freshRefAllOptions;
128
+ _freshRefDescendants(): void;
129
+ }
130
+ export declare class CfgFeature {
131
+ readonly _internal: _CfgFeatureInternal;
132
+ static make(rawFeature: Feature, allRawFeatures: Feature[], key: string, parent: _CfgProductConfigurationInternal | _CfgOptionInternal, parentConfiguration: _CfgProductConfigurationInternal, parentProduct: _CfgProductInternal, rootProduct: _CfgProductInternal): CfgFeature;
133
+ /**
134
+ * Makes an object wrapping the passed object. This is not a clone method,
135
+ * it is a method to make a new outer reference. Like a shallow copy.
136
+ * We use this to help frameworks that are built around using equals to detect change.
137
+ */
138
+ static _makeNewRefFrom(internal: _CfgFeatureInternal): CfgFeature;
139
+ /**
140
+ * Private constructor and make-method because make new ref requires the constructor to
141
+ * take an internal and we don't want those who instantiate CfgFeature to have to be aware
142
+ * of the internal.
143
+ */
144
+ private constructor();
145
+ isBackedBySame: (other: CfgFeature) => boolean;
146
+ get parentProduct(): CfgProduct;
147
+ get rootProduct(): CfgProduct;
148
+ get selectionType(): SelectionType;
149
+ get key(): string;
150
+ get code(): string;
151
+ get groupCode(): string | undefined;
152
+ /**
153
+ * If true the options in the feature is selected by both sending its code and numeric value
154
+ * when selecting.
155
+ */
156
+ get isUseNumericValue(): boolean;
157
+ /** This will read the numeric value of the selected option. */
158
+ get numericValue(): number | undefined;
159
+ /**
160
+ * This will find the first option allowing the value, set the value on it and select it.
161
+ * This is an implicit option-select.
162
+ */
163
+ setNumericValue: (val: number) => Promise<boolean>;
164
+ get unit(): LengthUnit;
165
+ get description(): string;
166
+ get hasUpcharge(): boolean | undefined;
167
+ get selectedOptions(): CfgOption[];
168
+ /** Are all ancestors up to the CfgProductConfiguration selected? */
169
+ get ancestorsSelected(): boolean;
170
+ get preview(): string | undefined;
171
+ get options(): CfgOption[];
172
+ /**
173
+ * Please note that this relates to the visibility in the Configuration tree.
174
+ * It does not affect the visibility of anything in the 3D view at all.
175
+ * Visibility is not inherited. If this is hidden the children
176
+ * of this Feature might still be visible, depending on their settings.
177
+ */
178
+ get visible(): boolean;
179
+ /**
180
+ * Selects the passed Option.
181
+ * Only Options belonging to Features that are "select many" can be deselected.
182
+ * Calling this will cause a validation call to the server.
183
+ */
184
+ selectOption: (option: CfgOption, on: boolean) => Promise<boolean>;
185
+ isSelected: (option: CfgOption) => boolean;
186
+ listenForChange: (l: SingleArgCallback<FeatureChangeNotification>) => void;
187
+ stopListenForChange: (l: SingleArgCallback<FeatureChangeNotification>) => void;
188
+ }
180
189
  //# sourceMappingURL=CfgFeature.d.ts.map