@ifc-lite/parser 6.4.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +21 -0
  2. package/dist/cost-category-buckets.d.ts +5 -0
  3. package/dist/cost-category-buckets.d.ts.map +1 -0
  4. package/dist/cost-category-buckets.js +37 -0
  5. package/dist/cost-category-buckets.js.map +1 -0
  6. package/dist/cost-compatibility-tree.d.ts +4 -0
  7. package/dist/cost-compatibility-tree.d.ts.map +1 -0
  8. package/dist/cost-compatibility-tree.js +46 -0
  9. package/dist/cost-compatibility-tree.js.map +1 -0
  10. package/dist/cost-evaluation-arithmetic.d.ts +16 -0
  11. package/dist/cost-evaluation-arithmetic.d.ts.map +1 -0
  12. package/dist/cost-evaluation-arithmetic.js +181 -0
  13. package/dist/cost-evaluation-arithmetic.js.map +1 -0
  14. package/dist/cost-evaluation-context.d.ts +20 -0
  15. package/dist/cost-evaluation-context.d.ts.map +1 -0
  16. package/dist/cost-evaluation-context.js +54 -0
  17. package/dist/cost-evaluation-context.js.map +1 -0
  18. package/dist/cost-evaluation-result.d.ts +5 -0
  19. package/dist/cost-evaluation-result.d.ts.map +1 -0
  20. package/dist/cost-evaluation-result.js +20 -0
  21. package/dist/cost-evaluation-result.js.map +1 -0
  22. package/dist/cost-evaluator.d.ts +6 -0
  23. package/dist/cost-evaluator.d.ts.map +1 -0
  24. package/dist/cost-evaluator.js +396 -0
  25. package/dist/cost-evaluator.js.map +1 -0
  26. package/dist/cost-extractor.d.ts +3 -8
  27. package/dist/cost-extractor.d.ts.map +1 -1
  28. package/dist/cost-extractor.js +330 -335
  29. package/dist/cost-extractor.js.map +1 -1
  30. package/dist/cost-quantities.d.ts +5 -0
  31. package/dist/cost-quantities.d.ts.map +1 -0
  32. package/dist/cost-quantities.js +116 -0
  33. package/dist/cost-quantities.js.map +1 -0
  34. package/dist/cost-quantity-evaluator.d.ts +23 -0
  35. package/dist/cost-quantity-evaluator.d.ts.map +1 -0
  36. package/dist/cost-quantity-evaluator.js +153 -0
  37. package/dist/cost-quantity-evaluator.js.map +1 -0
  38. package/dist/cost-reader.d.ts +26 -0
  39. package/dist/cost-reader.d.ts.map +1 -0
  40. package/dist/cost-reader.js +117 -0
  41. package/dist/cost-reader.js.map +1 -0
  42. package/dist/cost-relationships.d.ts +7 -0
  43. package/dist/cost-relationships.d.ts.map +1 -0
  44. package/dist/cost-relationships.js +237 -0
  45. package/dist/cost-relationships.js.map +1 -0
  46. package/dist/cost-step-lexemes.d.ts +16 -0
  47. package/dist/cost-step-lexemes.d.ts.map +1 -0
  48. package/dist/cost-step-lexemes.js +131 -0
  49. package/dist/cost-step-lexemes.js.map +1 -0
  50. package/dist/cost-types.d.ts +210 -76
  51. package/dist/cost-types.d.ts.map +1 -1
  52. package/dist/cost-units.d.ts +38 -0
  53. package/dist/cost-units.d.ts.map +1 -0
  54. package/dist/cost-units.js +348 -0
  55. package/dist/cost-units.js.map +1 -0
  56. package/dist/cost-value-evaluation-session.d.ts +19 -0
  57. package/dist/cost-value-evaluation-session.d.ts.map +1 -0
  58. package/dist/cost-value-evaluation-session.js +25 -0
  59. package/dist/cost-value-evaluation-session.js.map +1 -0
  60. package/dist/cost.d.ts +4 -0
  61. package/dist/cost.d.ts.map +1 -0
  62. package/dist/cost.js +6 -0
  63. package/dist/cost.js.map +1 -0
  64. package/dist/entity-extractor.d.ts.map +1 -1
  65. package/dist/entity-extractor.js +5 -2
  66. package/dist/entity-extractor.js.map +1 -1
  67. package/dist/index.d.ts +2 -3
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +3 -2
  70. package/dist/index.js.map +1 -1
  71. package/dist/relationship-schema-slots.d.ts.map +1 -1
  72. package/dist/relationship-schema-slots.js +36 -1
  73. package/dist/relationship-schema-slots.js.map +1 -1
  74. package/dist/schedule-calendar-types.d.ts +89 -0
  75. package/dist/schedule-calendar-types.d.ts.map +1 -0
  76. package/dist/schedule-calendar-types.js +175 -0
  77. package/dist/schedule-calendar-types.js.map +1 -0
  78. package/dist/schedule-control-extractor.d.ts +41 -0
  79. package/dist/schedule-control-extractor.d.ts.map +1 -0
  80. package/dist/schedule-control-extractor.js +91 -0
  81. package/dist/schedule-control-extractor.js.map +1 -0
  82. package/dist/schedule-extractor.d.ts +1 -0
  83. package/dist/schedule-extractor.d.ts.map +1 -1
  84. package/dist/schedule-extractor.js +51 -61
  85. package/dist/schedule-extractor.js.map +1 -1
  86. package/dist/schedule-serializer-calendar-builders.d.ts +50 -0
  87. package/dist/schedule-serializer-calendar-builders.d.ts.map +1 -0
  88. package/dist/schedule-serializer-calendar-builders.js +126 -0
  89. package/dist/schedule-serializer-calendar-builders.js.map +1 -0
  90. package/dist/schedule-serializer.d.ts +21 -3
  91. package/dist/schedule-serializer.d.ts.map +1 -1
  92. package/dist/schedule-serializer.js +56 -0
  93. package/dist/schedule-serializer.js.map +1 -1
  94. package/dist/schedule-types.d.ts +24 -0
  95. package/dist/schedule-types.d.ts.map +1 -1
  96. package/dist/schedule-types.js.map +1 -1
  97. package/dist/step-entity-parameters.d.ts +9 -0
  98. package/dist/step-entity-parameters.d.ts.map +1 -0
  99. package/dist/step-entity-parameters.js +30 -0
  100. package/dist/step-entity-parameters.js.map +1 -0
  101. package/package.json +4 -3
  102. package/dist/cost-schedule-2x3.d.ts +0 -31
  103. package/dist/cost-schedule-2x3.d.ts.map +0 -1
  104. package/dist/cost-schedule-2x3.js +0 -75
  105. package/dist/cost-schedule-2x3.js.map +0 -1
@@ -1,105 +1,239 @@
1
- /**
2
- * Read-model types for the cost (5D) extractor. See `cost-extractor.ts` for
3
- * the extraction logic and the relationship-wiring rationale.
4
- */
1
+ /** Schema-aware, read-only IFC cost graph types. */
5
2
  import type { CollectedQuantity } from './quantity-collect.js';
6
3
  export type { CollectedQuantity };
7
- /**
8
- * `UnitBasis` resolved (`IfcAppliedValue.UnitBasis : OPTIONAL
9
- * IfcMeasureWithUnit`, schema slot 3 in `IFC4_ADD2_TC1.exp` / `IFC4X3.exp` /
10
- * `IFC2X3_TC1.exp` alike). Present exactly when the source declared a
11
- * `UnitBasis` that resolves to an `IFCMEASUREWITHUNIT` entity — that presence
12
- * alone is what marks this `CostValueInfo` as a RATE ("$85 per hour") rather
13
- * than a flat total ("$5,000"), even when `valueComponent`/`unitSymbol` below
14
- * could not themselves be resolved (e.g. `UnitComponent` selects an
15
- * `IfcContextDependentUnit`, which carries no SI conversion and
16
- * `resolveUnitByRef` does not resolve). `undefined` on `CostValueInfo` when
17
- * `UnitBasis` itself is absent or its reference is broken — matching this
18
- * module's absent-vs-unresolved convention for `costValues`/`parentGlobalId`.
19
- */
4
+ export type CostSchemaVersion = 'IFC2X3' | 'IFC4' | 'IFC4X3' | 'IFC5';
5
+ export type CostDiagnosticCode = 'IFC2X3_PARTIAL_READ' | 'UNSUPPORTED_SCHEMA' | 'MISSING_REFERENCE' | 'INVALID_LIST' | 'MULTIPLE_NESTING_PARENTS' | 'NESTING_CYCLE' | 'QUANTITY_CYCLE' | 'VALUE_CYCLE' | 'MISSING_VALUE' | 'INVALID_NUMBER' | 'UNSUPPORTED_APPLIED_VALUE' | 'UNSUPPORTED_CONDITION' | 'UNSUPPORTED_UNIT' | 'INCOMPATIBLE_UNIT' | 'MISSING_CURRENCY' | 'MIXED_CURRENCY' | 'DIVISION_BY_ZERO';
6
+ export interface CostDiagnostic {
7
+ Code: CostDiagnosticCode;
8
+ Message: string;
9
+ Severity: 'warning' | 'error';
10
+ expressId?: number;
11
+ RelatedExpressId?: number;
12
+ }
13
+ export interface CostScheduleInfo {
14
+ expressId: number;
15
+ GlobalId?: string;
16
+ Name?: string;
17
+ Description?: string;
18
+ ObjectType?: string;
19
+ Identification?: string;
20
+ PredefinedType?: string;
21
+ Status?: string;
22
+ SubmittedOn?: string;
23
+ UpdateDate?: string;
24
+ /** IFC2X3-only identifier. */
25
+ ID?: string;
26
+ /** @deprecated Use the exact IFC-cased field. */
27
+ globalId: string;
28
+ /** @deprecated Use the exact IFC-cased field. */
29
+ name: string;
30
+ /** @deprecated Use PredefinedType. */
31
+ predefinedType?: string;
32
+ /** @deprecated Use Status. */
33
+ status?: string;
34
+ /** @deprecated Use SubmittedOn. */
35
+ submittedOn?: string;
36
+ /** @deprecated Use UpdateDate. */
37
+ updateDate?: string;
38
+ /** Existing normalized schedule-root convenience view. */
39
+ costItemGlobalIds: string[];
40
+ }
41
+ export interface CostItemInfo {
42
+ expressId: number;
43
+ GlobalId?: string;
44
+ Name?: string;
45
+ Description?: string;
46
+ ObjectType?: string;
47
+ Identification?: string;
48
+ PredefinedType?: string;
49
+ /** Ordered IFC4/IFC4X3 attribute references. Undefined means absent. */
50
+ CostValues?: number[];
51
+ /** Ordered IFC4/IFC4X3 attribute references. Undefined means absent. */
52
+ CostQuantities?: number[];
53
+ /** @deprecated Use the exact IFC-cased field. */
54
+ globalId: string;
55
+ /** @deprecated Use the exact IFC-cased field. */
56
+ name: string;
57
+ /** @deprecated Use PredefinedType. */
58
+ predefinedType?: string;
59
+ /** Existing normalized quantity view; never falls back to product Qto. */
60
+ costQuantities?: CollectedQuantity[];
61
+ /** Existing nested value view retained for compatibility. */
62
+ costValues?: CostValueInfo[];
63
+ parentGlobalId?: string;
64
+ childGlobalIds: string[];
65
+ productExpressIds: number[];
66
+ productGlobalIds: string[];
67
+ controllingScheduleGlobalIds: string[];
68
+ }
20
69
  export interface CostValueUnitBasis {
21
- /** `ValueComponent`, e.g. `1` in "per 1 hour". `undefined` when the
22
- * `IfcValue` select member is not a plain numeric measure this reader
23
- * resolves (same resolution `appliedValue` below uses). */
24
70
  valueComponent?: number;
25
- /** `UnitComponent`'s display symbol, e.g. `"h"`, `"m²"`. `undefined` when
26
- * `resolveUnitByRef` does not resolve the referenced `IfcUnit` member. */
27
71
  unitSymbol?: string;
28
- /** SI scale factor for `unitSymbol`, when resolved. */
29
72
  unitSiScale?: number;
30
73
  }
31
- /**
32
- * One `IfcCostValue` (a subtype of `IfcAppliedValue` that adds no attributes
33
- * of its own — `packages/codegen/schemas/IFC4_ADD2_TC1.exp` /
34
- * `IFC4X3.exp`: `ENTITY IfcCostValue SUBTYPE OF (IfcAppliedValue); END_ENTITY;`).
35
- * Every field below is `IfcAppliedValue`'s own, per its EXPRESS definition.
36
- */
74
+ export type CostAppliedValue = {
75
+ Kind: 'Typed';
76
+ Type: string;
77
+ Value: string;
78
+ } | {
79
+ Kind: 'Reference';
80
+ expressId: number;
81
+ } | {
82
+ Kind: 'Unsupported';
83
+ Raw: unknown;
84
+ InvalidNumber?: boolean;
85
+ };
37
86
  export interface CostValueInfo {
87
+ /** Present on values returned by the schema-aware extractor. Optional for source compatibility. */
88
+ expressId?: number;
89
+ /** Present on values returned by the schema-aware extractor. Optional for source compatibility. */
90
+ Type?: 'IfcCostValue' | 'IfcAppliedValue';
91
+ Name?: string;
92
+ Description?: string;
93
+ AppliedValue?: CostAppliedValue;
94
+ UnitBasis?: number;
95
+ /** The source supplied UnitBasis but it was not an entity reference. */
96
+ InvalidUnitBasis?: boolean;
97
+ ApplicableDate?: string;
98
+ FixedUntilDate?: string;
99
+ Category?: string;
100
+ Condition?: string;
101
+ /** The source supplied Condition with a non-string representation. */
102
+ InvalidCondition?: boolean;
103
+ ArithmeticOperator?: string;
104
+ /** Ordered references; shared references retain their original expressId. */
105
+ Components?: number[];
106
+ /** IFC2X3-only equivalent of Category. */
107
+ CostType?: string;
108
+ /** @deprecated Use the exact IFC-cased field. */
38
109
  name?: string;
110
+ /** @deprecated Use the exact IFC-cased field. */
39
111
  description?: string;
40
- /**
41
- * `AppliedValue` is an `IfcAppliedValueSelect` — in practice almost always
42
- * an `IfcMonetaryMeasure`/`IfcNumericMeasure`/`IfcRatioMeasure` typed
43
- * numeric wrapper. Resolved to a plain number when the wrapped value reads
44
- * as one; left `undefined` when it selects a non-numeric member (e.g. an
45
- * `IfcMeasureWithUnit` reference) this extractor does not resolve.
46
- */
112
+ /** @deprecated Use AppliedValue. */
47
113
  appliedValue?: number;
48
- /** See {@link CostValueUnitBasis} — distinguishes a rate from a flat total. */
114
+ /** Existing resolved rate basis view. */
49
115
  unitBasis?: CostValueUnitBasis;
50
116
  applicableDate?: string;
51
117
  fixedUntilDate?: string;
52
118
  category?: string;
53
119
  condition?: string;
54
120
  arithmeticOperator?: string;
55
- /** Nested `IfcCostValue` components (`Components : OPTIONAL LIST [1:?] OF IfcAppliedValue`). */
121
+ /** Existing nested component view. Shared identity is available in Components. */
56
122
  components?: CostValueInfo[];
57
123
  }
58
- /**
59
- * One `IfcCostItem`. Mirrors `ScheduleTaskInfo`'s shape in `schedule-extractor.ts`.
60
- *
61
- * `costQuantities` is `undefined` when `CostQuantities` is absent (the
62
- * schema's `LIST [1:?]` forbids an empty-but-declared list, so `undefined`
63
- * is the only "nothing here" state) or when every referenced quantity failed
64
- * to resolve. It is never a fallback to a product's `Qto_` quantities — see
65
- * `cost-extractor.ts` for why.
66
- *
67
- * `productExpressIds`/`productGlobalIds` use an empty array as a genuine
68
- * "no products assigned" state, distinct from "not resolved".
69
- */
70
- export interface CostItemInfo {
124
+ export type CostQuantityDimension = 'length' | 'area' | 'volume' | 'mass' | 'time' | 'count' | 'number';
125
+ export interface CostQuantityInfo {
71
126
  expressId: number;
72
- globalId: string;
73
- name: string;
74
- predefinedType?: string;
75
- costQuantities?: CollectedQuantity[];
76
- costValues?: CostValueInfo[];
77
- /** Parent cost item globalId (from IfcRelNests where this item is in RelatedObjects). */
78
- parentGlobalId?: string;
79
- /** Child cost item globalIds (from IfcRelNests where this item is RelatingObject). */
80
- childGlobalIds: string[];
81
- /** expressIds of objects/products this cost item is assigned to via IfcRelAssignsToControl. */
82
- productExpressIds: number[];
83
- /** globalIds of the same products (index-aligned with productExpressIds). */
84
- productGlobalIds: string[];
85
- /** CostSchedule globalIds that control this cost item via IfcRelAssignsToControl. */
86
- controllingScheduleGlobalIds: string[];
127
+ Type: string;
128
+ Name?: string;
129
+ Description?: string;
130
+ Unit?: number;
131
+ /** The source supplied Unit but it was not an entity reference. */
132
+ InvalidUnit?: boolean;
133
+ LengthValue?: string;
134
+ AreaValue?: string;
135
+ VolumeValue?: string;
136
+ CountValue?: string;
137
+ WeightValue?: string;
138
+ TimeValue?: string;
139
+ NumberValue?: string;
140
+ Formula?: string;
141
+ Dimension?: CostQuantityDimension;
142
+ /** IfcPhysicalComplexQuantity children, in source order. */
143
+ HasQuantities?: number[];
144
+ /** The source aggregate contained a non-reference member. */
145
+ InvalidHasQuantities?: boolean;
87
146
  }
88
- export interface CostScheduleInfo {
147
+ export interface CostUnitInfo {
89
148
  expressId: number;
90
- globalId: string;
91
- name: string;
92
- predefinedType?: string;
93
- status?: string;
94
- submittedOn?: string;
95
- updateDate?: string;
96
- /** Top-level cost item globalIds directly assigned via IfcRelAssignsToControl. */
97
- costItemGlobalIds: string[];
149
+ Type: string;
150
+ UnitType?: string;
151
+ Prefix?: string;
152
+ Name?: string;
153
+ Symbol?: string;
154
+ Currency?: string;
155
+ Dimension?: CostQuantityDimension;
156
+ /** Decimal multiplier into the dimension's canonical SI unit. */
157
+ Scale?: string;
158
+ }
159
+ export interface CostMeasureWithUnitInfo {
160
+ expressId: number;
161
+ ValueComponent: string;
162
+ UnitComponent: number;
163
+ ValueType?: string;
164
+ ValueDimension?: CostQuantityDimension;
98
165
  }
166
+ export type CostRelationshipType = 'IfcRelAssignsToControl' | 'IfcRelAssignsToProduct' | 'IfcRelAssignsToProcess' | 'IfcRelNests' | 'IfcRelDeclares' | 'IfcRelAssociatesAppliedValue' | 'IfcRelSchedulesCostItems' | 'IfcAppliedValueRelationship';
167
+ /**
168
+ * Exact relationship endpoints are retained instead of flattened ID arrays.
169
+ * Only attributes present on a relationship kind are populated.
170
+ */
171
+ export interface CostRelationshipInfo {
172
+ expressId: number;
173
+ Type: CostRelationshipType;
174
+ GlobalId?: string;
175
+ Name?: string;
176
+ Description?: string;
177
+ RelatedObjects?: number[];
178
+ /** The source RelatedObjects aggregate contained a non-reference member. */
179
+ InvalidRelatedObjects?: boolean;
180
+ /** One or more source endpoints were present but not STEP references. */
181
+ InvalidReferences?: boolean;
182
+ RelatedDefinitions?: number[];
183
+ RelatingControl?: number;
184
+ RelatingObject?: number;
185
+ RelatingProduct?: number;
186
+ RelatingProcess?: number;
187
+ RelatingContext?: number;
188
+ RelatingAppliedValue?: number;
189
+ ComponentOfTotal?: number;
190
+ Components?: number[];
191
+ ArithmeticOperator?: string;
192
+ }
193
+ /** Backward-compatible normalized extraction shape. */
99
194
  export interface CostExtraction {
100
195
  costSchedules: CostScheduleInfo[];
101
196
  costItems: CostItemInfo[];
102
- /** True if we encountered any costing entity (useful for empty-state UI). */
103
197
  hasCost: boolean;
198
+ SchemaVersion?: CostSchemaVersion;
199
+ CostSchedules?: CostScheduleInfo[];
200
+ CostItems?: CostItemInfo[];
201
+ CostValues?: CostValueInfo[];
202
+ CostQuantities?: CostQuantityInfo[];
203
+ Units?: CostUnitInfo[];
204
+ MeasuresWithUnit?: CostMeasureWithUnitInfo[];
205
+ ProjectUnits?: Partial<Record<CostQuantityDimension, number>>;
206
+ Relationships?: CostRelationshipInfo[];
207
+ Diagnostics?: CostDiagnostic[];
208
+ HasCostData?: boolean;
209
+ Currency?: string;
210
+ }
211
+ /** Complete schema-aware graph returned by {@link extractCostOnDemand}. */
212
+ export interface CostGraphExtraction extends CostExtraction {
213
+ SchemaVersion: CostSchemaVersion;
214
+ CostSchedules: CostScheduleInfo[];
215
+ CostItems: CostItemInfo[];
216
+ CostValues: CostValueInfo[];
217
+ CostQuantities: CostQuantityInfo[];
218
+ Units: CostUnitInfo[];
219
+ MeasuresWithUnit: CostMeasureWithUnitInfo[];
220
+ ProjectUnits: Partial<Record<CostQuantityDimension, number>>;
221
+ Relationships: CostRelationshipInfo[];
222
+ Diagnostics: CostDiagnostic[];
223
+ HasCostData: boolean;
224
+ /** Project currency, when supplied by IfcUnitAssignment. */
225
+ Currency?: string;
226
+ }
227
+ export interface CostEvaluationResult {
228
+ expressId: number;
229
+ Amount?: string;
230
+ Currency?: string;
231
+ Dimension?: CostQuantityDimension | 'ratio';
232
+ QuantityApplied?: string;
233
+ Diagnostics: CostDiagnostic[];
234
+ }
235
+ export interface CostEvaluationOptions {
236
+ /** Decimal significant-digit precision from 1 through 10,000. Defaults to 34 (decimal128). */
237
+ Precision?: number;
104
238
  }
105
239
  //# sourceMappingURL=cost-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cost-types.d.ts","sourceRoot":"","sources":["../src/cost-types.ts"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kBAAkB;IACjC;;gEAE4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;+EAC2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gGAAgG;IAChG,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;CAC9B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,M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AAc,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,38 @@
1
+ import type { CostDiagnostic, CostMeasureWithUnitInfo, CostQuantityDimension, CostUnitInfo } from './cost-types.js';
2
+ import { CostEntityReader } from './cost-reader.js';
3
+ export interface ResolvedMeasureWithUnit {
4
+ Value: string;
5
+ Unit: CostUnitInfo;
6
+ ValueType?: string;
7
+ ValueDimension?: CostQuantityDimension;
8
+ }
9
+ export interface CompatibilityMeasureWithUnit {
10
+ Value?: string;
11
+ Unit?: CostUnitInfo;
12
+ }
13
+ export declare class CostUnitResolver {
14
+ private readonly reader;
15
+ private readonly diagnostics;
16
+ readonly Units: Map<number, CostUnitInfo>;
17
+ readonly MeasuresWithUnit: Map<number, CostMeasureWithUnitInfo>;
18
+ readonly ProjectUnits: Map<CostQuantityDimension, CostUnitInfo>;
19
+ Currency?: string;
20
+ private conversionScaleWork;
21
+ private conversionScaleBudgetReported;
22
+ constructor(reader: CostEntityReader, diagnostics: CostDiagnostic[]);
23
+ resolve(expressId: number): CostUnitInfo | undefined;
24
+ private buildSimpleUnit;
25
+ private unresolvedUnit;
26
+ private buildConversionUnit;
27
+ private conversionScale;
28
+ resolveMeasureWithUnit(expressId: number | undefined): ResolvedMeasureWithUnit | undefined;
29
+ /** Preserve the former best-effort rate marker without weakening canonical validation. */
30
+ compatibilityMeasureWithUnit(expressId: number | undefined, canonical: ResolvedMeasureWithUnit | undefined): CompatibilityMeasureWithUnit | undefined;
31
+ private readMeasureHeader;
32
+ private readMeasure;
33
+ private readProjectUnits;
34
+ private warn;
35
+ private reference;
36
+ private references;
37
+ }
38
+ //# sourceMappingURL=cost-units.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cost-units.d.ts","sourceRoot":"","sources":["../src/cost-units.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB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