@reekon-tools/boldr-utils 1.4.16 → 1.4.18
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.
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import { Units } from '../types/firestore.js';
|
|
2
2
|
import { create, all } from 'mathjs';
|
|
3
|
-
// Create a custom mathjs instance
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const degToRad = (degrees) => (degrees * Math.PI) / 180;
|
|
7
|
-
// Import degree-based trigonometric functions
|
|
8
|
-
math.import({
|
|
9
|
-
sin: (x) => Math.sin(degToRad(x)),
|
|
10
|
-
cos: (x) => Math.cos(degToRad(x)),
|
|
11
|
-
tan: (x) => Math.tan(degToRad(x)),
|
|
12
|
-
asin: (x) => (Math.asin(x) * 180) / Math.PI,
|
|
13
|
-
acos: (x) => (Math.acos(x) * 180) / Math.PI,
|
|
14
|
-
atan: (x) => (Math.atan(x) * 180) / Math.PI,
|
|
15
|
-
atan2: (y, x) => (Math.atan2(y, x) * 180) / Math.PI,
|
|
16
|
-
}, { override: true });
|
|
3
|
+
// Create a custom mathjs instance configured to use degrees instead of radians
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
const math = create(all, { angle: 'deg' });
|
|
17
6
|
const compile = math.compile.bind(math);
|
|
18
7
|
const mathUnit = math.unit.bind(math);
|
|
19
8
|
// Cache for evaluated formulas to improve performance
|
|
@@ -248,6 +248,29 @@ export interface Measurement extends FirestoreDoc, Timestamps, CreatedBy {
|
|
|
248
248
|
type?: MeasurementType;
|
|
249
249
|
note?: string;
|
|
250
250
|
}
|
|
251
|
+
export interface Label extends FirestoreDoc, Timestamps {
|
|
252
|
+
name: string;
|
|
253
|
+
projectId: string;
|
|
254
|
+
jobId: string;
|
|
255
|
+
rows: LabelRow[];
|
|
256
|
+
rowSizes: number[];
|
|
257
|
+
isPublic: boolean;
|
|
258
|
+
}
|
|
259
|
+
export interface LabelRow {
|
|
260
|
+
id: string;
|
|
261
|
+
cells: LabelCell[];
|
|
262
|
+
colSizes: number[];
|
|
263
|
+
}
|
|
264
|
+
export interface LabelCell {
|
|
265
|
+
id: string;
|
|
266
|
+
type: 'none' | 'image' | 'text' | 'qr' | 'company' | 'icon' | 'measurement';
|
|
267
|
+
fileId?: string;
|
|
268
|
+
value?: string;
|
|
269
|
+
groupId?: string;
|
|
270
|
+
columnId?: string;
|
|
271
|
+
index?: number;
|
|
272
|
+
columnType?: ColumnType;
|
|
273
|
+
}
|
|
251
274
|
export declare enum Units {
|
|
252
275
|
Centimeters = "cm",
|
|
253
276
|
Millimeters = "mm",
|