@ifc-lite/parser 6.5.0 → 7.1.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.
- package/README.md +21 -0
- package/dist/columnar-parser-root-attributes.d.ts +2 -5
- package/dist/columnar-parser-root-attributes.d.ts.map +1 -1
- package/dist/columnar-parser-root-attributes.js +22 -2
- package/dist/columnar-parser-root-attributes.js.map +1 -1
- package/dist/columnar-parser.d.ts +4 -0
- package/dist/columnar-parser.d.ts.map +1 -1
- package/dist/columnar-parser.js +2 -47
- package/dist/columnar-parser.js.map +1 -1
- package/dist/cost-category-buckets.d.ts +5 -0
- package/dist/cost-category-buckets.d.ts.map +1 -0
- package/dist/cost-category-buckets.js +37 -0
- package/dist/cost-category-buckets.js.map +1 -0
- package/dist/cost-compatibility-tree.d.ts +4 -0
- package/dist/cost-compatibility-tree.d.ts.map +1 -0
- package/dist/cost-compatibility-tree.js +46 -0
- package/dist/cost-compatibility-tree.js.map +1 -0
- package/dist/cost-evaluation-arithmetic.d.ts +16 -0
- package/dist/cost-evaluation-arithmetic.d.ts.map +1 -0
- package/dist/cost-evaluation-arithmetic.js +181 -0
- package/dist/cost-evaluation-arithmetic.js.map +1 -0
- package/dist/cost-evaluation-context.d.ts +20 -0
- package/dist/cost-evaluation-context.d.ts.map +1 -0
- package/dist/cost-evaluation-context.js +54 -0
- package/dist/cost-evaluation-context.js.map +1 -0
- package/dist/cost-evaluation-result.d.ts +5 -0
- package/dist/cost-evaluation-result.d.ts.map +1 -0
- package/dist/cost-evaluation-result.js +20 -0
- package/dist/cost-evaluation-result.js.map +1 -0
- package/dist/cost-evaluator.d.ts +6 -0
- package/dist/cost-evaluator.d.ts.map +1 -0
- package/dist/cost-evaluator.js +398 -0
- package/dist/cost-evaluator.js.map +1 -0
- package/dist/cost-extractor.d.ts +4 -8
- package/dist/cost-extractor.d.ts.map +1 -1
- package/dist/cost-extractor.js +346 -334
- package/dist/cost-extractor.js.map +1 -1
- package/dist/cost-overlay.d.ts +72 -0
- package/dist/cost-overlay.d.ts.map +1 -0
- package/dist/cost-overlay.js +5 -0
- package/dist/cost-overlay.js.map +1 -0
- package/dist/cost-quantities.d.ts +5 -0
- package/dist/cost-quantities.d.ts.map +1 -0
- package/dist/cost-quantities.js +116 -0
- package/dist/cost-quantities.js.map +1 -0
- package/dist/cost-quantity-evaluator.d.ts +23 -0
- package/dist/cost-quantity-evaluator.d.ts.map +1 -0
- package/dist/cost-quantity-evaluator.js +153 -0
- package/dist/cost-quantity-evaluator.js.map +1 -0
- package/dist/cost-reader.d.ts +59 -0
- package/dist/cost-reader.d.ts.map +1 -0
- package/dist/cost-reader.js +210 -0
- package/dist/cost-reader.js.map +1 -0
- package/dist/cost-relationships.d.ts +7 -0
- package/dist/cost-relationships.d.ts.map +1 -0
- package/dist/cost-relationships.js +237 -0
- package/dist/cost-relationships.js.map +1 -0
- package/dist/cost-step-lexemes.d.ts +16 -0
- package/dist/cost-step-lexemes.d.ts.map +1 -0
- package/dist/cost-step-lexemes.js +131 -0
- package/dist/cost-step-lexemes.js.map +1 -0
- package/dist/cost-types.d.ts +218 -76
- package/dist/cost-types.d.ts.map +1 -1
- package/dist/cost-units.d.ts +38 -0
- package/dist/cost-units.d.ts.map +1 -0
- package/dist/cost-units.js +348 -0
- package/dist/cost-units.js.map +1 -0
- package/dist/cost-value-evaluation-session.d.ts +19 -0
- package/dist/cost-value-evaluation-session.d.ts.map +1 -0
- package/dist/cost-value-evaluation-session.js +25 -0
- package/dist/cost-value-evaluation-session.js.map +1 -0
- package/dist/cost.d.ts +5 -0
- package/dist/cost.d.ts.map +1 -0
- package/dist/cost.js +6 -0
- package/dist/cost.js.map +1 -0
- package/dist/entity-extractor.d.ts.map +1 -1
- package/dist/entity-extractor.js +5 -2
- package/dist/entity-extractor.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/on-demand-extractors.d.ts +3 -4
- package/dist/on-demand-extractors.d.ts.map +1 -1
- package/dist/on-demand-extractors.js +9 -6
- package/dist/on-demand-extractors.js.map +1 -1
- package/dist/project-units.d.ts.map +1 -1
- package/dist/project-units.js +8 -2
- package/dist/project-units.js.map +1 -1
- package/dist/property-unit.d.ts +24 -0
- package/dist/property-unit.d.ts.map +1 -0
- package/dist/property-unit.js +29 -0
- package/dist/property-unit.js.map +1 -0
- package/dist/step-entity-parameters.d.ts +9 -0
- package/dist/step-entity-parameters.d.ts.map +1 -0
- package/dist/step-entity-parameters.js +30 -0
- package/dist/step-entity-parameters.js.map +1 -0
- package/dist/worker-parser.d.ts +29 -1
- package/dist/worker-parser.d.ts.map +1 -1
- package/dist/worker-parser.js +80 -7
- package/dist/worker-parser.js.map +1 -1
- package/package.json +6 -5
- package/dist/cost-schedule-2x3.d.ts +0 -31
- package/dist/cost-schedule-2x3.d.ts.map +0 -1
- package/dist/cost-schedule-2x3.js +0 -75
- package/dist/cost-schedule-2x3.js.map +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
const STEP_NUMBER = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?$/i;
|
|
5
|
+
const TYPED_VALUE = /^[A-Z][A-Z0-9_]*\s*\(([\s\S]*)\)$/i;
|
|
6
|
+
const STEP_REFERENCE = /^#(0|[1-9]\d*)$/;
|
|
7
|
+
const STEP_ZERO = /^[+-]?(?:0+(?:\.0*)?|\.0+)(?:E[+-]?\d+)?$/i;
|
|
8
|
+
export function withoutStepComments(token) {
|
|
9
|
+
const scan = new StepTextScan(token);
|
|
10
|
+
const pieces = [];
|
|
11
|
+
let retainedFrom = 0;
|
|
12
|
+
for (let index = 0; index < token.length;) {
|
|
13
|
+
const skipped = scan.skipLexicalAt(index);
|
|
14
|
+
if (skipped > index) {
|
|
15
|
+
if (token[index] === '/') {
|
|
16
|
+
pieces.push(token.slice(retainedFrom, index), ' ');
|
|
17
|
+
retainedFrom = skipped;
|
|
18
|
+
}
|
|
19
|
+
index = skipped;
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
index++;
|
|
23
|
+
}
|
|
24
|
+
pieces.push(token.slice(retainedFrom));
|
|
25
|
+
return pieces.join('').trim();
|
|
26
|
+
}
|
|
27
|
+
const withoutComments = withoutStepComments;
|
|
28
|
+
/** Distinguish an omitted STEP attribute from malformed-but-present input. */
|
|
29
|
+
export function costAttributePresent(token) {
|
|
30
|
+
if (token === undefined)
|
|
31
|
+
return false;
|
|
32
|
+
const candidate = withoutComments(token);
|
|
33
|
+
return candidate !== '$' && candidate !== '*';
|
|
34
|
+
}
|
|
35
|
+
/** Split one entity parameter list while retaining the original STEP lexemes. */
|
|
36
|
+
export function splitCostAttributeLexemes(record) {
|
|
37
|
+
let open = -1;
|
|
38
|
+
let close = -1;
|
|
39
|
+
let depth = 0;
|
|
40
|
+
const recordScan = new StepTextScan(record);
|
|
41
|
+
for (let index = 0; index < record.length;) {
|
|
42
|
+
const skipped = recordScan.skipLexicalAt(index);
|
|
43
|
+
if (skipped > index) {
|
|
44
|
+
index = skipped;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const char = record[index];
|
|
48
|
+
if (char === '(') {
|
|
49
|
+
if (open < 0)
|
|
50
|
+
open = index;
|
|
51
|
+
depth++;
|
|
52
|
+
}
|
|
53
|
+
else if (char === ')' && open >= 0) {
|
|
54
|
+
depth--;
|
|
55
|
+
if (depth === 0) {
|
|
56
|
+
close = index;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
index++;
|
|
61
|
+
}
|
|
62
|
+
if (open < 0 || close <= open)
|
|
63
|
+
return [];
|
|
64
|
+
const params = record.slice(open + 1, close);
|
|
65
|
+
const result = [];
|
|
66
|
+
let start = 0;
|
|
67
|
+
depth = 0;
|
|
68
|
+
const parameterScan = new StepTextScan(params);
|
|
69
|
+
for (let index = 0; index < params.length;) {
|
|
70
|
+
const skipped = parameterScan.skipLexicalAt(index);
|
|
71
|
+
if (skipped > index) {
|
|
72
|
+
index = skipped;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const char = params[index];
|
|
76
|
+
if (char === '(')
|
|
77
|
+
depth++;
|
|
78
|
+
else if (char === ')')
|
|
79
|
+
depth--;
|
|
80
|
+
else if (char === ',' && depth === 0) {
|
|
81
|
+
result.push(params.slice(start, index).trim());
|
|
82
|
+
start = index + 1;
|
|
83
|
+
}
|
|
84
|
+
index++;
|
|
85
|
+
}
|
|
86
|
+
result.push(params.slice(start).trim());
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
/** Return the exact numeric token, unwrapping an IFC typed value when present. */
|
|
90
|
+
export function costNumericLexeme(token) {
|
|
91
|
+
if (!token)
|
|
92
|
+
return undefined;
|
|
93
|
+
let candidate = withoutComments(token);
|
|
94
|
+
const typed = TYPED_VALUE.exec(candidate);
|
|
95
|
+
if (typed)
|
|
96
|
+
candidate = typed[1].trim();
|
|
97
|
+
return STEP_NUMBER.test(candidate) ? candidate : undefined;
|
|
98
|
+
}
|
|
99
|
+
/** Return the EXPRESS wrapper around an exact numeric token, if one was supplied. */
|
|
100
|
+
export function costNumericTypeLexeme(token) {
|
|
101
|
+
if (!token)
|
|
102
|
+
return undefined;
|
|
103
|
+
const typed = TYPED_VALUE.exec(withoutComments(token));
|
|
104
|
+
return typed ? withoutComments(token).slice(0, withoutComments(token).indexOf('(')).trim().toUpperCase() : undefined;
|
|
105
|
+
}
|
|
106
|
+
/** True only when the STEP significand is zero; exponent digits do not count. */
|
|
107
|
+
export function isZeroCostNumericLexeme(token) {
|
|
108
|
+
return STEP_ZERO.test(token);
|
|
109
|
+
}
|
|
110
|
+
/** Read one exact STEP entity-reference token, rejecting integer literals. */
|
|
111
|
+
export function costReferenceLexeme(token) {
|
|
112
|
+
if (!token)
|
|
113
|
+
return undefined;
|
|
114
|
+
const match = STEP_REFERENCE.exec(withoutComments(token));
|
|
115
|
+
return match ? Number(match[1]) : undefined;
|
|
116
|
+
}
|
|
117
|
+
/** Read a flat non-empty aggregate of exact STEP entity-reference tokens. */
|
|
118
|
+
export function costReferenceListLexeme(token) {
|
|
119
|
+
if (!token)
|
|
120
|
+
return undefined;
|
|
121
|
+
const candidate = withoutComments(token);
|
|
122
|
+
if (!candidate.startsWith('(') || !candidate.endsWith(')'))
|
|
123
|
+
return undefined;
|
|
124
|
+
const entries = candidate.slice(1, -1).split(',').map(entry => entry.trim());
|
|
125
|
+
if (entries.length === 0 || entries.some(entry => entry.length === 0))
|
|
126
|
+
return undefined;
|
|
127
|
+
const refs = entries.map(entry => costReferenceLexeme(entry));
|
|
128
|
+
return refs.every((ref) => ref !== undefined) ? refs : undefined;
|
|
129
|
+
}
|
|
130
|
+
import { StepTextScan } from './step-lexing.js';
|
|
131
|
+
//# sourceMappingURL=cost-step-lexemes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-step-lexemes.js","sourceRoot":"","sources":["../src/cost-step-lexemes.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,MAAM,WAAW,GAAG,+CAA+C,CAAC;AACpE,MAAM,WAAW,GAAG,oCAAoC,CAAC;AACzD,MAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,MAAM,SAAS,GAAG,4CAA4C,CAAC;AAE/D,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,MAAM,IAAI,GAAG,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC;QAC1C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AG,EAAiB,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAClF,CAAC;AACD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/cost-types.d.ts
CHANGED
|
@@ -1,105 +1,247 @@
|
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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' | 'PENDING_EDIT_NOT_APPLIED';
|
|
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
|
+
/**
|
|
66
|
+
* Express IDs of the `IfcProduct` instances assigned to this cost item,
|
|
67
|
+
* via either `IfcRelAssignsToProduct` or `IfcRelAssignsToControl`. Tasks,
|
|
68
|
+
* resources and actors assigned via `IfcRelAssignsToControl` are excluded
|
|
69
|
+
* — that relationship also legitimately binds those, but this field is
|
|
70
|
+
* a products-only view (#4877).
|
|
71
|
+
*/
|
|
72
|
+
productExpressIds: number[];
|
|
73
|
+
/** GlobalIds parallel to {@link productExpressIds}, same filtering. */
|
|
74
|
+
productGlobalIds: string[];
|
|
75
|
+
controllingScheduleGlobalIds: string[];
|
|
76
|
+
}
|
|
20
77
|
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
78
|
valueComponent?: number;
|
|
25
|
-
/** `UnitComponent`'s display symbol, e.g. `"h"`, `"m²"`. `undefined` when
|
|
26
|
-
* `resolveUnitByRef` does not resolve the referenced `IfcUnit` member. */
|
|
27
79
|
unitSymbol?: string;
|
|
28
|
-
/** SI scale factor for `unitSymbol`, when resolved. */
|
|
29
80
|
unitSiScale?: number;
|
|
30
81
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
82
|
+
export type CostAppliedValue = {
|
|
83
|
+
Kind: 'Typed';
|
|
84
|
+
Type: string;
|
|
85
|
+
Value: string;
|
|
86
|
+
} | {
|
|
87
|
+
Kind: 'Reference';
|
|
88
|
+
expressId: number;
|
|
89
|
+
} | {
|
|
90
|
+
Kind: 'Unsupported';
|
|
91
|
+
Raw: unknown;
|
|
92
|
+
InvalidNumber?: boolean;
|
|
93
|
+
};
|
|
37
94
|
export interface CostValueInfo {
|
|
95
|
+
/** Present on values returned by the schema-aware extractor. Optional for source compatibility. */
|
|
96
|
+
expressId?: number;
|
|
97
|
+
/** Present on values returned by the schema-aware extractor. Optional for source compatibility. */
|
|
98
|
+
Type?: 'IfcCostValue' | 'IfcAppliedValue';
|
|
99
|
+
Name?: string;
|
|
100
|
+
Description?: string;
|
|
101
|
+
AppliedValue?: CostAppliedValue;
|
|
102
|
+
UnitBasis?: number;
|
|
103
|
+
/** The source supplied UnitBasis but it was not an entity reference. */
|
|
104
|
+
InvalidUnitBasis?: boolean;
|
|
105
|
+
ApplicableDate?: string;
|
|
106
|
+
FixedUntilDate?: string;
|
|
107
|
+
Category?: string;
|
|
108
|
+
Condition?: string;
|
|
109
|
+
/** The source supplied Condition with a non-string representation. */
|
|
110
|
+
InvalidCondition?: boolean;
|
|
111
|
+
ArithmeticOperator?: string;
|
|
112
|
+
/** Ordered references; shared references retain their original expressId. */
|
|
113
|
+
Components?: number[];
|
|
114
|
+
/** IFC2X3-only equivalent of Category. */
|
|
115
|
+
CostType?: string;
|
|
116
|
+
/** @deprecated Use the exact IFC-cased field. */
|
|
38
117
|
name?: string;
|
|
118
|
+
/** @deprecated Use the exact IFC-cased field. */
|
|
39
119
|
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
|
-
*/
|
|
120
|
+
/** @deprecated Use AppliedValue. */
|
|
47
121
|
appliedValue?: number;
|
|
48
|
-
/**
|
|
122
|
+
/** Existing resolved rate basis view. */
|
|
49
123
|
unitBasis?: CostValueUnitBasis;
|
|
50
124
|
applicableDate?: string;
|
|
51
125
|
fixedUntilDate?: string;
|
|
52
126
|
category?: string;
|
|
53
127
|
condition?: string;
|
|
54
128
|
arithmeticOperator?: string;
|
|
55
|
-
/**
|
|
129
|
+
/** Existing nested component view. Shared identity is available in Components. */
|
|
56
130
|
components?: CostValueInfo[];
|
|
57
131
|
}
|
|
58
|
-
|
|
59
|
-
|
|
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 {
|
|
132
|
+
export type CostQuantityDimension = 'length' | 'area' | 'volume' | 'mass' | 'time' | 'count' | 'number';
|
|
133
|
+
export interface CostQuantityInfo {
|
|
71
134
|
expressId: number;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
135
|
+
Type: string;
|
|
136
|
+
Name?: string;
|
|
137
|
+
Description?: string;
|
|
138
|
+
Unit?: number;
|
|
139
|
+
/** The source supplied Unit but it was not an entity reference. */
|
|
140
|
+
InvalidUnit?: boolean;
|
|
141
|
+
LengthValue?: string;
|
|
142
|
+
AreaValue?: string;
|
|
143
|
+
VolumeValue?: string;
|
|
144
|
+
CountValue?: string;
|
|
145
|
+
WeightValue?: string;
|
|
146
|
+
TimeValue?: string;
|
|
147
|
+
NumberValue?: string;
|
|
148
|
+
Formula?: string;
|
|
149
|
+
Dimension?: CostQuantityDimension;
|
|
150
|
+
/** IfcPhysicalComplexQuantity children, in source order. */
|
|
151
|
+
HasQuantities?: number[];
|
|
152
|
+
/** The source aggregate contained a non-reference member. */
|
|
153
|
+
InvalidHasQuantities?: boolean;
|
|
87
154
|
}
|
|
88
|
-
export interface
|
|
155
|
+
export interface CostUnitInfo {
|
|
89
156
|
expressId: number;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
157
|
+
Type: string;
|
|
158
|
+
UnitType?: string;
|
|
159
|
+
Prefix?: string;
|
|
160
|
+
Name?: string;
|
|
161
|
+
Symbol?: string;
|
|
162
|
+
Currency?: string;
|
|
163
|
+
Dimension?: CostQuantityDimension;
|
|
164
|
+
/** Decimal multiplier into the dimension's canonical SI unit. */
|
|
165
|
+
Scale?: string;
|
|
166
|
+
}
|
|
167
|
+
export interface CostMeasureWithUnitInfo {
|
|
168
|
+
expressId: number;
|
|
169
|
+
ValueComponent: string;
|
|
170
|
+
UnitComponent: number;
|
|
171
|
+
ValueType?: string;
|
|
172
|
+
ValueDimension?: CostQuantityDimension;
|
|
98
173
|
}
|
|
174
|
+
export type CostRelationshipType = 'IfcRelAssignsToControl' | 'IfcRelAssignsToProduct' | 'IfcRelAssignsToProcess' | 'IfcRelNests' | 'IfcRelDeclares' | 'IfcRelAssociatesAppliedValue' | 'IfcRelSchedulesCostItems' | 'IfcAppliedValueRelationship';
|
|
175
|
+
/**
|
|
176
|
+
* Exact relationship endpoints are retained instead of flattened ID arrays.
|
|
177
|
+
* Only attributes present on a relationship kind are populated.
|
|
178
|
+
*/
|
|
179
|
+
export interface CostRelationshipInfo {
|
|
180
|
+
expressId: number;
|
|
181
|
+
Type: CostRelationshipType;
|
|
182
|
+
GlobalId?: string;
|
|
183
|
+
Name?: string;
|
|
184
|
+
Description?: string;
|
|
185
|
+
RelatedObjects?: number[];
|
|
186
|
+
/** The source RelatedObjects aggregate contained a non-reference member. */
|
|
187
|
+
InvalidRelatedObjects?: boolean;
|
|
188
|
+
/** One or more source endpoints were present but not STEP references. */
|
|
189
|
+
InvalidReferences?: boolean;
|
|
190
|
+
RelatedDefinitions?: number[];
|
|
191
|
+
RelatingControl?: number;
|
|
192
|
+
RelatingObject?: number;
|
|
193
|
+
RelatingProduct?: number;
|
|
194
|
+
RelatingProcess?: number;
|
|
195
|
+
RelatingContext?: number;
|
|
196
|
+
RelatingAppliedValue?: number;
|
|
197
|
+
ComponentOfTotal?: number;
|
|
198
|
+
Components?: number[];
|
|
199
|
+
ArithmeticOperator?: string;
|
|
200
|
+
}
|
|
201
|
+
/** Backward-compatible normalized extraction shape. */
|
|
99
202
|
export interface CostExtraction {
|
|
100
203
|
costSchedules: CostScheduleInfo[];
|
|
101
204
|
costItems: CostItemInfo[];
|
|
102
|
-
/** True if we encountered any costing entity (useful for empty-state UI). */
|
|
103
205
|
hasCost: boolean;
|
|
206
|
+
SchemaVersion?: CostSchemaVersion;
|
|
207
|
+
CostSchedules?: CostScheduleInfo[];
|
|
208
|
+
CostItems?: CostItemInfo[];
|
|
209
|
+
CostValues?: CostValueInfo[];
|
|
210
|
+
CostQuantities?: CostQuantityInfo[];
|
|
211
|
+
Units?: CostUnitInfo[];
|
|
212
|
+
MeasuresWithUnit?: CostMeasureWithUnitInfo[];
|
|
213
|
+
ProjectUnits?: Partial<Record<CostQuantityDimension, number>>;
|
|
214
|
+
Relationships?: CostRelationshipInfo[];
|
|
215
|
+
Diagnostics?: CostDiagnostic[];
|
|
216
|
+
HasCostData?: boolean;
|
|
217
|
+
Currency?: string;
|
|
218
|
+
}
|
|
219
|
+
/** Complete schema-aware graph returned by {@link extractCostOnDemand}. */
|
|
220
|
+
export interface CostGraphExtraction extends CostExtraction {
|
|
221
|
+
SchemaVersion: CostSchemaVersion;
|
|
222
|
+
CostSchedules: CostScheduleInfo[];
|
|
223
|
+
CostItems: CostItemInfo[];
|
|
224
|
+
CostValues: CostValueInfo[];
|
|
225
|
+
CostQuantities: CostQuantityInfo[];
|
|
226
|
+
Units: CostUnitInfo[];
|
|
227
|
+
MeasuresWithUnit: CostMeasureWithUnitInfo[];
|
|
228
|
+
ProjectUnits: Partial<Record<CostQuantityDimension, number>>;
|
|
229
|
+
Relationships: CostRelationshipInfo[];
|
|
230
|
+
Diagnostics: CostDiagnostic[];
|
|
231
|
+
HasCostData: boolean;
|
|
232
|
+
/** Project currency, when supplied by IfcUnitAssignment. */
|
|
233
|
+
Currency?: string;
|
|
234
|
+
}
|
|
235
|
+
export interface CostEvaluationResult {
|
|
236
|
+
expressId: number;
|
|
237
|
+
Amount?: string;
|
|
238
|
+
Currency?: string;
|
|
239
|
+
Dimension?: CostQuantityDimension | 'ratio';
|
|
240
|
+
QuantityApplied?: string;
|
|
241
|
+
Diagnostics: CostDiagnostic[];
|
|
242
|
+
}
|
|
243
|
+
export interface CostEvaluationOptions {
|
|
244
|
+
/** Decimal significant-digit precision from 1 through 10,000. Defaults to 34 (decimal128). */
|
|
245
|
+
Precision?: number;
|
|
104
246
|
}
|
|
105
247
|
//# sourceMappingURL=cost-types.d.ts.map
|
package/dist/cost-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cost-types.d.ts","sourceRoot":"","sources":["../src/cost-types.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"cost-types.d.ts","sourceRoot":"","sources":["../src/cost-types.ts"],"names":[],"mappings":"AAIA,oDAAoD;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG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AAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,cAAc,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,EACvB,qBAAqB,EACrB,YAAY,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAoB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAuEtE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC;AAED,MAAM,WAAW,4BAA4B;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAeD,qBAAa,gBAAgB;IASzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAT9B,QAAQ,CAAC,KAAK,4BAAmC;IACjD,QAAQ,CAAC,gBAAgB,uCAA8C;IACvE,QAAQ,CAAC,YAAY,2CAAkD;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,mBAAmB,CAAK;IAChC,OAAO,CAAC,6BAA6B,CAAS;gBAG3B,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,cAAc,EAAE;IAKhD,OAAO,CAAC,SAAS,EAAE,MAAM,GA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