@build-qube/takeoff-calculator 2.3.0 → 3.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/index.d.ts +288 -0
- package/index.js +64 -52
- package/package.json +12 -11
package/index.d.ts
CHANGED
|
@@ -1,5 +1,289 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export declare class GeometryClient {
|
|
4
|
+
constructor(
|
|
5
|
+
svg: string,
|
|
6
|
+
pageBackgroundColor?: Array<number> | undefined | null,
|
|
7
|
+
);
|
|
8
|
+
/** Get the geometry stats */
|
|
9
|
+
getGeometryStats(): JsGeometryStats;
|
|
10
|
+
/** Initialize the geometry */
|
|
11
|
+
initializeGeometry(): Promise<JsGeometryStats>;
|
|
12
|
+
/** Query the snap points near a point */
|
|
13
|
+
querySnapPointsNear(x: number, y: number, radius: number): Array<JsSnapPoint>;
|
|
14
|
+
/** Query the nearest snap point */
|
|
15
|
+
queryNearestSnapPoint(x: number, y: number): JsSnapPoint | null;
|
|
16
|
+
queryNearestNSnapPoints(x: number, y: number, n: number): Array<JsSnapPoint>;
|
|
17
|
+
queryElementsNear(
|
|
18
|
+
x: number,
|
|
19
|
+
y: number,
|
|
20
|
+
radius: number,
|
|
21
|
+
): Array<JsGeometryElement>;
|
|
22
|
+
detectClosedRegionsAsync(
|
|
23
|
+
config?: JsMergeConfig | undefined | null,
|
|
24
|
+
): Promise<Array<JsDetectedPolygon>>;
|
|
25
|
+
detectClosedRegions(
|
|
26
|
+
config?: JsMergeConfig | undefined | null,
|
|
27
|
+
): Array<JsDetectedPolygon>;
|
|
28
|
+
identifyContourLine(
|
|
29
|
+
tracePoints: Array<JsTracePoint>,
|
|
30
|
+
config?: JsContourDetectConfig | undefined | null,
|
|
31
|
+
): JsContourDetectionResult;
|
|
32
|
+
detectContourAtPoint(
|
|
33
|
+
x: number,
|
|
34
|
+
y: number,
|
|
35
|
+
radius?: number | undefined | null,
|
|
36
|
+
config?: JsContourDetectConfig | undefined | null,
|
|
37
|
+
): JsDetectedContourLine | null;
|
|
38
|
+
clearContourSignature(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Build the topology graph off the main thread. Requires geometry to be
|
|
41
|
+
* initialized first. Idempotent: returns cached stats on later calls.
|
|
42
|
+
*/
|
|
43
|
+
initializeTopology(
|
|
44
|
+
config?: JsTopologyConfig | undefined | null,
|
|
45
|
+
): Promise<JsTopologyStats>;
|
|
46
|
+
/** Stats of the built topology graph, or None if not initialized yet. */
|
|
47
|
+
getTopologyStats(): JsTopologyStats | null;
|
|
48
|
+
/**
|
|
49
|
+
* Rank likely next drawing points from the node nearest (lastX, lastY),
|
|
50
|
+
* scored by cursor heading, style continuity with the arrival direction
|
|
51
|
+
* (prevX/prevY), and edge trust. Returns [] until topology is initialized.
|
|
52
|
+
*/
|
|
53
|
+
suggestNextPoints(
|
|
54
|
+
lastX: number,
|
|
55
|
+
lastY: number,
|
|
56
|
+
cursorX: number,
|
|
57
|
+
cursorY: number,
|
|
58
|
+
prevX?: number | undefined | null,
|
|
59
|
+
prevY?: number | undefined | null,
|
|
60
|
+
radius?: number | undefined | null,
|
|
61
|
+
maxResults?: number | undefined | null,
|
|
62
|
+
): Array<JsSuggestedPoint>;
|
|
63
|
+
/**
|
|
64
|
+
* Trace the closed region containing (x, y) by walking the topology
|
|
65
|
+
* graph's faces. Returns None until topology is initialized, if no edge
|
|
66
|
+
* lies within `radius`, or if the point is not inside a bounded region.
|
|
67
|
+
* The boundary is Douglas-Peucker simplified with `simplify_tolerance`
|
|
68
|
+
* (PDF units, 0 disables); area and perimeter reflect the full walk.
|
|
69
|
+
*/
|
|
70
|
+
detectFaceAtPoint(
|
|
71
|
+
x: number,
|
|
72
|
+
y: number,
|
|
73
|
+
radius?: number | undefined | null,
|
|
74
|
+
minArea?: number | undefined | null,
|
|
75
|
+
simplifyTolerance?: number | undefined | null,
|
|
76
|
+
): JsDetectedFace | null;
|
|
77
|
+
/**
|
|
78
|
+
* Detect door symbols (swing arc + leaf + jambs) across the page.
|
|
79
|
+
* Detection runs once and is cached; `min_confidence` (default 0.7)
|
|
80
|
+
* filters the cached results. Rotation-invariant; thresholds give the
|
|
81
|
+
* jamb-to-jamb opening segment in PDF units.
|
|
82
|
+
*/
|
|
83
|
+
detectDoors(minConfidence?: number | undefined | null): Array<JsDetectedDoor>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface ElementStyle {
|
|
87
|
+
stroke?: StrokeStyle;
|
|
88
|
+
fill?: FillStyle;
|
|
89
|
+
visible: boolean;
|
|
90
|
+
opacity: number;
|
|
91
|
+
strokeMatchesBackground: boolean;
|
|
92
|
+
fillMatchesBackground: boolean;
|
|
93
|
+
matchesBackground: boolean;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type FillRule = 'NonZero' | 'EvenOdd';
|
|
97
|
+
|
|
98
|
+
export interface FillStyle {
|
|
99
|
+
color: Array<number>;
|
|
100
|
+
opacity: number;
|
|
101
|
+
rule: FillRule;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface JsContourDetectConfig {
|
|
105
|
+
corridorWidth?: number;
|
|
106
|
+
colorTolerance?: number;
|
|
107
|
+
widthTolerance?: number;
|
|
108
|
+
dashRatioTolerance?: number;
|
|
109
|
+
directionThreshold?: number;
|
|
110
|
+
maxGapMultiplier?: number;
|
|
111
|
+
loopClosureTolerance?: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface JsContourDetectionResult {
|
|
115
|
+
detected: boolean;
|
|
116
|
+
contour?: JsDetectedContourLine;
|
|
117
|
+
mode: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface JsDetectedContourLine {
|
|
121
|
+
points: Array<Array<number>>;
|
|
122
|
+
elementIndices: Array<number>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface JsDetectedDoor {
|
|
126
|
+
/** "single" or "double". */
|
|
127
|
+
kind: string;
|
|
128
|
+
confidence: number;
|
|
129
|
+
/** Opening width (threshold length, PDF units). */
|
|
130
|
+
width: number;
|
|
131
|
+
/** Hinge-side jamb as [x, y]. */
|
|
132
|
+
hinge: Array<number>;
|
|
133
|
+
/**
|
|
134
|
+
* Jamb-to-jamb opening segment as [x1, y1, x2, y2] — the room boundary
|
|
135
|
+
* at this door.
|
|
136
|
+
*/
|
|
137
|
+
threshold: Array<number>;
|
|
138
|
+
/**
|
|
139
|
+
* Oriented box covering threshold plus swing: [cx, cy, ax, ay, hw, hh]
|
|
140
|
+
* where (ax, ay) is the unit threshold axis and hw/hh the half-extents
|
|
141
|
+
* along axis/normal (normal points toward the swing side).
|
|
142
|
+
*/
|
|
143
|
+
obb: Array<number>;
|
|
144
|
+
/** Indices of the elements whose swing arcs produced this door. */
|
|
145
|
+
arcElements: Array<number>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface JsDetectedFace {
|
|
149
|
+
/** Closed boundary ring as [x, y] pairs (first point repeated at the end). */
|
|
150
|
+
points: Array<Array<number>>;
|
|
151
|
+
sourceElements: Array<number>;
|
|
152
|
+
confidence: number;
|
|
153
|
+
area: number;
|
|
154
|
+
perimeter: number;
|
|
155
|
+
/** Gap spans synthesized to close the region, as [x1, y1, x2, y2]. */
|
|
156
|
+
bridgedSpans: Array<Array<number>>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface JsDetectedPolygon {
|
|
160
|
+
points: Array<Array<number>>;
|
|
161
|
+
sourceElements: Array<number>;
|
|
162
|
+
confidence: number;
|
|
163
|
+
area: number;
|
|
164
|
+
perimeter: number;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface JsGeometryElement {
|
|
168
|
+
id: string;
|
|
169
|
+
geometryType: JsGeometryType;
|
|
170
|
+
bbox: Array<number>;
|
|
171
|
+
style: ElementStyle;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface JsGeometryStats {
|
|
175
|
+
elementCount: number;
|
|
176
|
+
snapPointCount: number;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export type JsGeometryType =
|
|
180
|
+
| { type: 'Point'; points: [Point] }
|
|
181
|
+
| { type: 'LineString'; points: Array<Point> }
|
|
182
|
+
| { type: 'Polygon'; points: Array<Point> }
|
|
183
|
+
| { type: 'MultiLineString'; points: Array<Array<Point>> };
|
|
184
|
+
|
|
185
|
+
export interface JsMergeConfig {
|
|
186
|
+
endpointTolerance?: number;
|
|
187
|
+
minEdges?: number;
|
|
188
|
+
minArea?: number;
|
|
189
|
+
maxEdgeLength?: number;
|
|
190
|
+
minSegmentLength?: number;
|
|
191
|
+
styleMustMatch?: boolean;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface JsSnapPoint {
|
|
195
|
+
x: number;
|
|
196
|
+
y: number;
|
|
197
|
+
snapType: SnapType;
|
|
198
|
+
elementIndex: number;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface JsSuggestedPoint {
|
|
202
|
+
x: number;
|
|
203
|
+
y: number;
|
|
204
|
+
score: number;
|
|
205
|
+
bridged: boolean;
|
|
206
|
+
/** Source element index of the suggested edge; absent for bridged gaps. */
|
|
207
|
+
elementIndex?: number;
|
|
208
|
+
nodeDegree: number;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface JsTopologyConfig {
|
|
212
|
+
nodeTolerance?: number;
|
|
213
|
+
bridgeTolerance?: number;
|
|
214
|
+
extensionTolerance?: number;
|
|
215
|
+
bridgeStyleMatch?: boolean;
|
|
216
|
+
sealDoorways?: boolean;
|
|
217
|
+
doorwayMinConfidence?: number;
|
|
218
|
+
minElementExtent?: number;
|
|
219
|
+
simplifyTolerance?: number;
|
|
220
|
+
maxSegments?: number;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface JsTopologyStats {
|
|
224
|
+
nodeCount: number;
|
|
225
|
+
edgeCount: number;
|
|
226
|
+
bridgedEdges: number;
|
|
227
|
+
doorwayEdges: number;
|
|
228
|
+
tJunctions: number;
|
|
229
|
+
elementsUsed: number;
|
|
230
|
+
elementsFiltered: number;
|
|
231
|
+
buildMs: number;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface JsTracePoint {
|
|
235
|
+
x: number;
|
|
236
|
+
y: number;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export type LineCap = 'Butt' | 'Round' | 'Square';
|
|
240
|
+
|
|
241
|
+
export type LineJoin = 'Miter' | 'MiterClip' | 'Round' | 'Bevel';
|
|
242
|
+
|
|
243
|
+
export declare function scaleGeometry(
|
|
244
|
+
geometry: JsGeometryType,
|
|
245
|
+
x: number,
|
|
246
|
+
y: number,
|
|
247
|
+
): JsGeometryType;
|
|
248
|
+
|
|
249
|
+
export type SnapType = 'Endpoint' | 'Vertex' | 'Midpoint';
|
|
250
|
+
|
|
251
|
+
export interface StrokeStyle {
|
|
252
|
+
color: Array<number>;
|
|
253
|
+
width: number;
|
|
254
|
+
opacity: number;
|
|
255
|
+
linecap: LineCap;
|
|
256
|
+
linejoin: LineJoin;
|
|
257
|
+
dasharray?: Array<number>;
|
|
258
|
+
dashoffset: number;
|
|
259
|
+
}
|
|
260
|
+
export declare class PdfPage {
|
|
261
|
+
pageNumber: number;
|
|
262
|
+
get svg(): string;
|
|
263
|
+
getGeometryClient(
|
|
264
|
+
options?: JsGeometryClientOptions | undefined | null,
|
|
265
|
+
): GeometryClient;
|
|
266
|
+
renderPage(scale: number): Array<number>;
|
|
267
|
+
renderPageToBase64(scale: number): string;
|
|
268
|
+
getScaledDimensions(scale: number): [number, number];
|
|
269
|
+
renderPageWithOptions(
|
|
270
|
+
scale: number,
|
|
271
|
+
format: ImageOutputFormat,
|
|
272
|
+
quality: number,
|
|
273
|
+
): Array<number>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export declare class PdfReader {
|
|
277
|
+
constructor(blob: Uint8Array);
|
|
278
|
+
getPage(pageNumber: number): PdfPage;
|
|
279
|
+
get pageCount(): number;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export type ImageOutputFormat = 'Jpeg' | 'Png' | 'Webp';
|
|
283
|
+
|
|
284
|
+
export interface JsGeometryClientOptions {
|
|
285
|
+
backgroundColor?: Array<number>;
|
|
286
|
+
}
|
|
3
287
|
export declare class ContourWrapper {
|
|
4
288
|
/** Create a new contour wrapper from a contour input. */
|
|
5
289
|
constructor(contour: ContourInput);
|
|
@@ -235,6 +519,8 @@ export declare class VolumetricUnitResult {
|
|
|
235
519
|
get uncoveredArea(): UnitValue;
|
|
236
520
|
}
|
|
237
521
|
|
|
522
|
+
export declare function asyncMultiTwo(arg: number): Promise<number>;
|
|
523
|
+
|
|
238
524
|
/** Add 100 to the input */
|
|
239
525
|
export declare function plus100(input: number): number;
|
|
240
526
|
|
|
@@ -250,6 +536,8 @@ export type ReferenceSurfaceInputJs =
|
|
|
250
536
|
elevation: number;
|
|
251
537
|
unit: Unit;
|
|
252
538
|
};
|
|
539
|
+
|
|
540
|
+
export declare function withinAsyncRuntimeIfAvailable(): void;
|
|
253
541
|
export declare class UnitValue {
|
|
254
542
|
constructor(value: number, unit: Unit, magnitude: UnitValueItemType);
|
|
255
543
|
display(unit: Unit): string;
|
package/index.js
CHANGED
|
@@ -81,12 +81,12 @@ function requireNative() {
|
|
|
81
81
|
const bindingPackageVersion =
|
|
82
82
|
require('@build-qube/takeoff-calculator-android-arm64/package.json').version;
|
|
83
83
|
if (
|
|
84
|
-
bindingPackageVersion !== '2.
|
|
84
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
85
85
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
86
86
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
87
87
|
) {
|
|
88
88
|
throw new Error(
|
|
89
|
-
`Native binding package version mismatch, expected 2.
|
|
89
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
return binding;
|
|
@@ -104,12 +104,12 @@ function requireNative() {
|
|
|
104
104
|
const bindingPackageVersion =
|
|
105
105
|
require('@build-qube/takeoff-calculator-android-arm-eabi/package.json').version;
|
|
106
106
|
if (
|
|
107
|
-
bindingPackageVersion !== '2.
|
|
107
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
108
108
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
109
109
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
110
110
|
) {
|
|
111
111
|
throw new Error(
|
|
112
|
-
`Native binding package version mismatch, expected 2.
|
|
112
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
return binding;
|
|
@@ -137,12 +137,12 @@ function requireNative() {
|
|
|
137
137
|
const bindingPackageVersion =
|
|
138
138
|
require('@build-qube/takeoff-calculator-win32-x64-gnu/package.json').version;
|
|
139
139
|
if (
|
|
140
|
-
bindingPackageVersion !== '2.
|
|
140
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
141
141
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
142
142
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
143
143
|
) {
|
|
144
144
|
throw new Error(
|
|
145
|
-
`Native binding package version mismatch, expected 2.
|
|
145
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
148
|
return binding;
|
|
@@ -160,12 +160,12 @@ function requireNative() {
|
|
|
160
160
|
const bindingPackageVersion =
|
|
161
161
|
require('@build-qube/takeoff-calculator-win32-x64-msvc/package.json').version;
|
|
162
162
|
if (
|
|
163
|
-
bindingPackageVersion !== '2.
|
|
163
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
164
164
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
165
165
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
166
166
|
) {
|
|
167
167
|
throw new Error(
|
|
168
|
-
`Native binding package version mismatch, expected 2.
|
|
168
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
171
|
return binding;
|
|
@@ -184,12 +184,12 @@ function requireNative() {
|
|
|
184
184
|
const bindingPackageVersion =
|
|
185
185
|
require('@build-qube/takeoff-calculator-win32-ia32-msvc/package.json').version;
|
|
186
186
|
if (
|
|
187
|
-
bindingPackageVersion !== '2.
|
|
187
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
188
188
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
189
189
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
190
190
|
) {
|
|
191
191
|
throw new Error(
|
|
192
|
-
`Native binding package version mismatch, expected 2.
|
|
192
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
193
193
|
);
|
|
194
194
|
}
|
|
195
195
|
return binding;
|
|
@@ -207,12 +207,12 @@ function requireNative() {
|
|
|
207
207
|
const bindingPackageVersion =
|
|
208
208
|
require('@build-qube/takeoff-calculator-win32-arm64-msvc/package.json').version;
|
|
209
209
|
if (
|
|
210
|
-
bindingPackageVersion !== '2.
|
|
210
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
211
211
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
212
212
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
213
213
|
) {
|
|
214
214
|
throw new Error(
|
|
215
|
-
`Native binding package version mismatch, expected 2.
|
|
215
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
218
|
return binding;
|
|
@@ -235,12 +235,12 @@ function requireNative() {
|
|
|
235
235
|
const bindingPackageVersion =
|
|
236
236
|
require('@build-qube/takeoff-calculator-darwin-universal/package.json').version;
|
|
237
237
|
if (
|
|
238
|
-
bindingPackageVersion !== '2.
|
|
238
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
239
239
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
240
240
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
241
241
|
) {
|
|
242
242
|
throw new Error(
|
|
243
|
-
`Native binding package version mismatch, expected 2.
|
|
243
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
246
|
return binding;
|
|
@@ -258,12 +258,12 @@ function requireNative() {
|
|
|
258
258
|
const bindingPackageVersion =
|
|
259
259
|
require('@build-qube/takeoff-calculator-darwin-x64/package.json').version;
|
|
260
260
|
if (
|
|
261
|
-
bindingPackageVersion !== '2.
|
|
261
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
262
262
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
263
263
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
264
264
|
) {
|
|
265
265
|
throw new Error(
|
|
266
|
-
`Native binding package version mismatch, expected 2.
|
|
266
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
267
267
|
);
|
|
268
268
|
}
|
|
269
269
|
return binding;
|
|
@@ -281,12 +281,12 @@ function requireNative() {
|
|
|
281
281
|
const bindingPackageVersion =
|
|
282
282
|
require('@build-qube/takeoff-calculator-darwin-arm64/package.json').version;
|
|
283
283
|
if (
|
|
284
|
-
bindingPackageVersion !== '2.
|
|
284
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
285
285
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
286
286
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
287
287
|
) {
|
|
288
288
|
throw new Error(
|
|
289
|
-
`Native binding package version mismatch, expected 2.
|
|
289
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
290
290
|
);
|
|
291
291
|
}
|
|
292
292
|
return binding;
|
|
@@ -310,12 +310,12 @@ function requireNative() {
|
|
|
310
310
|
const bindingPackageVersion =
|
|
311
311
|
require('@build-qube/takeoff-calculator-freebsd-x64/package.json').version;
|
|
312
312
|
if (
|
|
313
|
-
bindingPackageVersion !== '2.
|
|
313
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
314
314
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
315
315
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
316
316
|
) {
|
|
317
317
|
throw new Error(
|
|
318
|
-
`Native binding package version mismatch, expected 2.
|
|
318
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
319
319
|
);
|
|
320
320
|
}
|
|
321
321
|
return binding;
|
|
@@ -333,12 +333,12 @@ function requireNative() {
|
|
|
333
333
|
const bindingPackageVersion =
|
|
334
334
|
require('@build-qube/takeoff-calculator-freebsd-arm64/package.json').version;
|
|
335
335
|
if (
|
|
336
|
-
bindingPackageVersion !== '2.
|
|
336
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
337
337
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
338
338
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
339
339
|
) {
|
|
340
340
|
throw new Error(
|
|
341
|
-
`Native binding package version mismatch, expected 2.
|
|
341
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
342
342
|
);
|
|
343
343
|
}
|
|
344
344
|
return binding;
|
|
@@ -363,12 +363,12 @@ function requireNative() {
|
|
|
363
363
|
const bindingPackageVersion =
|
|
364
364
|
require('@build-qube/takeoff-calculator-linux-x64-musl/package.json').version;
|
|
365
365
|
if (
|
|
366
|
-
bindingPackageVersion !== '2.
|
|
366
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
367
367
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
368
368
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
369
369
|
) {
|
|
370
370
|
throw new Error(
|
|
371
|
-
`Native binding package version mismatch, expected 2.
|
|
371
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
372
372
|
);
|
|
373
373
|
}
|
|
374
374
|
return binding;
|
|
@@ -386,12 +386,12 @@ function requireNative() {
|
|
|
386
386
|
const bindingPackageVersion =
|
|
387
387
|
require('@build-qube/takeoff-calculator-linux-x64-gnu/package.json').version;
|
|
388
388
|
if (
|
|
389
|
-
bindingPackageVersion !== '2.
|
|
389
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
390
390
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
391
391
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
392
392
|
) {
|
|
393
393
|
throw new Error(
|
|
394
|
-
`Native binding package version mismatch, expected 2.
|
|
394
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
395
395
|
);
|
|
396
396
|
}
|
|
397
397
|
return binding;
|
|
@@ -411,12 +411,12 @@ function requireNative() {
|
|
|
411
411
|
const bindingPackageVersion =
|
|
412
412
|
require('@build-qube/takeoff-calculator-linux-arm64-musl/package.json').version;
|
|
413
413
|
if (
|
|
414
|
-
bindingPackageVersion !== '2.
|
|
414
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
415
415
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
416
416
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
417
417
|
) {
|
|
418
418
|
throw new Error(
|
|
419
|
-
`Native binding package version mismatch, expected 2.
|
|
419
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
420
420
|
);
|
|
421
421
|
}
|
|
422
422
|
return binding;
|
|
@@ -434,12 +434,12 @@ function requireNative() {
|
|
|
434
434
|
const bindingPackageVersion =
|
|
435
435
|
require('@build-qube/takeoff-calculator-linux-arm64-gnu/package.json').version;
|
|
436
436
|
if (
|
|
437
|
-
bindingPackageVersion !== '2.
|
|
437
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
438
438
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
439
439
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
440
440
|
) {
|
|
441
441
|
throw new Error(
|
|
442
|
-
`Native binding package version mismatch, expected 2.
|
|
442
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
445
|
return binding;
|
|
@@ -459,12 +459,12 @@ function requireNative() {
|
|
|
459
459
|
const bindingPackageVersion =
|
|
460
460
|
require('@build-qube/takeoff-calculator-linux-arm-musleabihf/package.json').version;
|
|
461
461
|
if (
|
|
462
|
-
bindingPackageVersion !== '2.
|
|
462
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
463
463
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
464
464
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
465
465
|
) {
|
|
466
466
|
throw new Error(
|
|
467
|
-
`Native binding package version mismatch, expected 2.
|
|
467
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
468
468
|
);
|
|
469
469
|
}
|
|
470
470
|
return binding;
|
|
@@ -482,12 +482,12 @@ function requireNative() {
|
|
|
482
482
|
const bindingPackageVersion =
|
|
483
483
|
require('@build-qube/takeoff-calculator-linux-arm-gnueabihf/package.json').version;
|
|
484
484
|
if (
|
|
485
|
-
bindingPackageVersion !== '2.
|
|
485
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
486
486
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
487
487
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
488
488
|
) {
|
|
489
489
|
throw new Error(
|
|
490
|
-
`Native binding package version mismatch, expected 2.
|
|
490
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
491
491
|
);
|
|
492
492
|
}
|
|
493
493
|
return binding;
|
|
@@ -507,12 +507,12 @@ function requireNative() {
|
|
|
507
507
|
const bindingPackageVersion =
|
|
508
508
|
require('@build-qube/takeoff-calculator-linux-loong64-musl/package.json').version;
|
|
509
509
|
if (
|
|
510
|
-
bindingPackageVersion !== '2.
|
|
510
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
511
511
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
512
512
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
513
513
|
) {
|
|
514
514
|
throw new Error(
|
|
515
|
-
`Native binding package version mismatch, expected 2.
|
|
515
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
516
516
|
);
|
|
517
517
|
}
|
|
518
518
|
return binding;
|
|
@@ -530,12 +530,12 @@ function requireNative() {
|
|
|
530
530
|
const bindingPackageVersion =
|
|
531
531
|
require('@build-qube/takeoff-calculator-linux-loong64-gnu/package.json').version;
|
|
532
532
|
if (
|
|
533
|
-
bindingPackageVersion !== '2.
|
|
533
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
534
534
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
535
535
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
536
536
|
) {
|
|
537
537
|
throw new Error(
|
|
538
|
-
`Native binding package version mismatch, expected 2.
|
|
538
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
539
539
|
);
|
|
540
540
|
}
|
|
541
541
|
return binding;
|
|
@@ -555,12 +555,12 @@ function requireNative() {
|
|
|
555
555
|
const bindingPackageVersion =
|
|
556
556
|
require('@build-qube/takeoff-calculator-linux-riscv64-musl/package.json').version;
|
|
557
557
|
if (
|
|
558
|
-
bindingPackageVersion !== '2.
|
|
558
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
559
559
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
560
560
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
561
561
|
) {
|
|
562
562
|
throw new Error(
|
|
563
|
-
`Native binding package version mismatch, expected 2.
|
|
563
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
564
564
|
);
|
|
565
565
|
}
|
|
566
566
|
return binding;
|
|
@@ -578,12 +578,12 @@ function requireNative() {
|
|
|
578
578
|
const bindingPackageVersion =
|
|
579
579
|
require('@build-qube/takeoff-calculator-linux-riscv64-gnu/package.json').version;
|
|
580
580
|
if (
|
|
581
|
-
bindingPackageVersion !== '2.
|
|
581
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
582
582
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
583
583
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
584
584
|
) {
|
|
585
585
|
throw new Error(
|
|
586
|
-
`Native binding package version mismatch, expected 2.
|
|
586
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
587
587
|
);
|
|
588
588
|
}
|
|
589
589
|
return binding;
|
|
@@ -602,12 +602,12 @@ function requireNative() {
|
|
|
602
602
|
const bindingPackageVersion =
|
|
603
603
|
require('@build-qube/takeoff-calculator-linux-ppc64-gnu/package.json').version;
|
|
604
604
|
if (
|
|
605
|
-
bindingPackageVersion !== '2.
|
|
605
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
606
606
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
607
607
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
608
608
|
) {
|
|
609
609
|
throw new Error(
|
|
610
|
-
`Native binding package version mismatch, expected 2.
|
|
610
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
611
611
|
);
|
|
612
612
|
}
|
|
613
613
|
return binding;
|
|
@@ -625,12 +625,12 @@ function requireNative() {
|
|
|
625
625
|
const bindingPackageVersion =
|
|
626
626
|
require('@build-qube/takeoff-calculator-linux-s390x-gnu/package.json').version;
|
|
627
627
|
if (
|
|
628
|
-
bindingPackageVersion !== '2.
|
|
628
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
629
629
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
630
630
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
631
631
|
) {
|
|
632
632
|
throw new Error(
|
|
633
|
-
`Native binding package version mismatch, expected 2.
|
|
633
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
634
634
|
);
|
|
635
635
|
}
|
|
636
636
|
return binding;
|
|
@@ -654,12 +654,12 @@ function requireNative() {
|
|
|
654
654
|
const bindingPackageVersion =
|
|
655
655
|
require('@build-qube/takeoff-calculator-openharmony-arm64/package.json').version;
|
|
656
656
|
if (
|
|
657
|
-
bindingPackageVersion !== '2.
|
|
657
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
658
658
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
659
659
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
660
660
|
) {
|
|
661
661
|
throw new Error(
|
|
662
|
-
`Native binding package version mismatch, expected 2.
|
|
662
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
663
663
|
);
|
|
664
664
|
}
|
|
665
665
|
return binding;
|
|
@@ -677,12 +677,12 @@ function requireNative() {
|
|
|
677
677
|
const bindingPackageVersion =
|
|
678
678
|
require('@build-qube/takeoff-calculator-openharmony-x64/package.json').version;
|
|
679
679
|
if (
|
|
680
|
-
bindingPackageVersion !== '2.
|
|
680
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
681
681
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
682
682
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
683
683
|
) {
|
|
684
684
|
throw new Error(
|
|
685
|
-
`Native binding package version mismatch, expected 2.
|
|
685
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
688
|
return binding;
|
|
@@ -700,12 +700,12 @@ function requireNative() {
|
|
|
700
700
|
const bindingPackageVersion =
|
|
701
701
|
require('@build-qube/takeoff-calculator-openharmony-arm/package.json').version;
|
|
702
702
|
if (
|
|
703
|
-
bindingPackageVersion !== '2.
|
|
703
|
+
bindingPackageVersion !== '2.3.0' &&
|
|
704
704
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
705
705
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
706
706
|
) {
|
|
707
707
|
throw new Error(
|
|
708
|
-
`Native binding package version mismatch, expected 2.
|
|
708
|
+
`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
709
709
|
);
|
|
710
710
|
}
|
|
711
711
|
return binding;
|
|
@@ -781,13 +781,25 @@ if (!nativeBinding) {
|
|
|
781
781
|
}
|
|
782
782
|
|
|
783
783
|
module.exports = nativeBinding;
|
|
784
|
+
module.exports.GeometryClient = nativeBinding.GeometryClient;
|
|
785
|
+
module.exports.FillRule = nativeBinding.FillRule;
|
|
786
|
+
module.exports.LineCap = nativeBinding.LineCap;
|
|
787
|
+
module.exports.LineJoin = nativeBinding.LineJoin;
|
|
788
|
+
module.exports.scaleGeometry = nativeBinding.scaleGeometry;
|
|
789
|
+
module.exports.SnapType = nativeBinding.SnapType;
|
|
790
|
+
module.exports.PdfPage = nativeBinding.PdfPage;
|
|
791
|
+
module.exports.PdfReader = nativeBinding.PdfReader;
|
|
792
|
+
module.exports.ImageOutputFormat = nativeBinding.ImageOutputFormat;
|
|
784
793
|
module.exports.ContourWrapper = nativeBinding.ContourWrapper;
|
|
785
794
|
module.exports.GroupWrapper = nativeBinding.GroupWrapper;
|
|
786
795
|
module.exports.MeasurementWrapper = nativeBinding.MeasurementWrapper;
|
|
787
796
|
module.exports.TakeoffStateHandler = nativeBinding.TakeoffStateHandler;
|
|
788
797
|
module.exports.VolumetricUnitResult = nativeBinding.VolumetricUnitResult;
|
|
798
|
+
module.exports.asyncMultiTwo = nativeBinding.asyncMultiTwo;
|
|
789
799
|
module.exports.plus100 = nativeBinding.plus100;
|
|
790
800
|
module.exports.plus200 = nativeBinding.plus200;
|
|
801
|
+
module.exports.withinAsyncRuntimeIfAvailable =
|
|
802
|
+
nativeBinding.withinAsyncRuntimeIfAvailable;
|
|
791
803
|
module.exports.UnitValue = nativeBinding.UnitValue;
|
|
792
804
|
module.exports.distance = nativeBinding.distance;
|
|
793
805
|
module.exports.generateRandomId = nativeBinding.generateRandomId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@build-qube/takeoff-calculator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Template project for writing node package with napi-rs",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
+
"@types/node": "^24.10.1",
|
|
58
59
|
"@emnapi/core": "^1.5.0",
|
|
59
60
|
"@emnapi/runtime": "^1.5.0",
|
|
60
61
|
"@faker-js/faker": "^10.2.0",
|
|
@@ -72,16 +73,16 @@
|
|
|
72
73
|
"vitest": "^4.0.15"
|
|
73
74
|
},
|
|
74
75
|
"optionalDependencies": {
|
|
75
|
-
"@build-qube/takeoff-calculator-darwin-x64": "
|
|
76
|
-
"@build-qube/takeoff-calculator-darwin-arm64": "
|
|
77
|
-
"@build-qube/takeoff-calculator-linux-x64-gnu": "
|
|
78
|
-
"@build-qube/takeoff-calculator-win32-x64-msvc": "
|
|
79
|
-
"@build-qube/takeoff-calculator-linux-x64-musl": "
|
|
80
|
-
"@build-qube/takeoff-calculator-linux-arm64-gnu": "
|
|
81
|
-
"@build-qube/takeoff-calculator-linux-arm-gnueabihf": "
|
|
82
|
-
"@build-qube/takeoff-calculator-linux-arm64-musl": "
|
|
83
|
-
"@build-qube/takeoff-calculator-win32-arm64-msvc": "
|
|
84
|
-
"@build-qube/takeoff-calculator-wasm32-wasi": "
|
|
76
|
+
"@build-qube/takeoff-calculator-darwin-x64": "3.1.0",
|
|
77
|
+
"@build-qube/takeoff-calculator-darwin-arm64": "3.1.0",
|
|
78
|
+
"@build-qube/takeoff-calculator-linux-x64-gnu": "3.1.0",
|
|
79
|
+
"@build-qube/takeoff-calculator-win32-x64-msvc": "3.1.0",
|
|
80
|
+
"@build-qube/takeoff-calculator-linux-x64-musl": "3.1.0",
|
|
81
|
+
"@build-qube/takeoff-calculator-linux-arm64-gnu": "3.1.0",
|
|
82
|
+
"@build-qube/takeoff-calculator-linux-arm-gnueabihf": "3.1.0",
|
|
83
|
+
"@build-qube/takeoff-calculator-linux-arm64-musl": "3.1.0",
|
|
84
|
+
"@build-qube/takeoff-calculator-win32-arm64-msvc": "3.1.0",
|
|
85
|
+
"@build-qube/takeoff-calculator-wasm32-wasi": "3.1.0"
|
|
85
86
|
},
|
|
86
87
|
"scripts": {
|
|
87
88
|
"artifacts": "napi artifacts",
|