lineadraw 0.6.0 → 0.7.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/dist/sdk.d.ts CHANGED
@@ -92,11 +92,11 @@ declare const TextStyleSchema: z.ZodObject<{
92
92
  italic: z.ZodOptional<z.ZodBoolean>;
93
93
  textHeight: z.ZodDefault<z.ZodNumber>;
94
94
  arrowType: z.ZodDefault<z.ZodEnum<{
95
+ dot: "dot";
95
96
  filled: "filled";
97
+ none: "none";
96
98
  open: "open";
97
99
  tick: "tick";
98
- dot: "dot";
99
- none: "none";
100
100
  }>>;
101
101
  arrowSize: z.ZodDefault<z.ZodNumber>;
102
102
  }, z.core.$strip>;
@@ -132,17 +132,17 @@ declare const TextSchema: z.ZodObject<{
132
132
  right: "right";
133
133
  }>>;
134
134
  vAlign: z.ZodDefault<z.ZodEnum<{
135
- center: "center";
136
135
  bottom: "bottom";
136
+ center: "center";
137
137
  top: "top";
138
138
  }>>;
139
139
  frame: z.ZodOptional<z.ZodEnum<{
140
+ bottom: "bottom";
140
141
  circle: "circle";
142
+ firstLine: "firstLine";
141
143
  none: "none";
142
- bottom: "bottom";
143
144
  rectangle: "rectangle";
144
145
  slot: "slot";
145
- firstLine: "firstLine";
146
146
  }>>;
147
147
  styleId: z.ZodOptional<z.ZodString>;
148
148
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -152,11 +152,11 @@ declare const TextSchema: z.ZodObject<{
152
152
  italic: z.ZodOptional<z.ZodBoolean>;
153
153
  textHeight: z.ZodOptional<z.ZodNumber>;
154
154
  arrowType: z.ZodOptional<z.ZodEnum<{
155
+ dot: "dot";
155
156
  filled: "filled";
157
+ none: "none";
156
158
  open: "open";
157
159
  tick: "tick";
158
- dot: "dot";
159
- none: "none";
160
160
  }>>;
161
161
  arrowSize: z.ZodOptional<z.ZodNumber>;
162
162
  }, z.core.$strip>>;
@@ -176,11 +176,11 @@ declare const DimStyleSchema: z.ZodObject<{
176
176
  textHeight: z.ZodDefault<z.ZodNumber>;
177
177
  textOffset: z.ZodDefault<z.ZodNumber>;
178
178
  arrowType: z.ZodDefault<z.ZodEnum<{
179
+ dot: "dot";
179
180
  filled: "filled";
181
+ none: "none";
180
182
  open: "open";
181
183
  tick: "tick";
182
- dot: "dot";
183
- none: "none";
184
184
  }>>;
185
185
  arrowSize: z.ZodDefault<z.ZodNumber>;
186
186
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -204,10 +204,10 @@ declare const DimensionSchema: z.ZodObject<{
204
204
  opacity: z.ZodOptional<z.ZodNumber>;
205
205
  type: z.ZodLiteral<"dimension">;
206
206
  kind: z.ZodDefault<z.ZodEnum<{
207
- linear: "linear";
208
- radial: "radial";
209
207
  angular: "angular";
210
208
  diameter: "diameter";
209
+ linear: "linear";
210
+ radial: "radial";
211
211
  }>>;
212
212
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
213
213
  x: z.ZodNumber;
@@ -227,11 +227,11 @@ declare const DimensionSchema: z.ZodObject<{
227
227
  textHeight: z.ZodOptional<z.ZodNumber>;
228
228
  textOffset: z.ZodOptional<z.ZodNumber>;
229
229
  arrowType: z.ZodOptional<z.ZodEnum<{
230
+ dot: "dot";
230
231
  filled: "filled";
232
+ none: "none";
231
233
  open: "open";
232
234
  tick: "tick";
233
- dot: "dot";
234
- none: "none";
235
235
  }>>;
236
236
  arrowSize: z.ZodOptional<z.ZodNumber>;
237
237
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -260,12 +260,12 @@ declare const ReferenceSchema: z.ZodObject<{
260
260
  opacity: z.ZodOptional<z.ZodNumber>;
261
261
  type: z.ZodLiteral<"reference">;
262
262
  format: z.ZodEnum<{
263
- linea: "linea";
264
- dxf: "dxf";
265
263
  dwg: "dwg";
264
+ dxf: "dxf";
265
+ jpg: "jpg";
266
+ linea: "linea";
266
267
  pdf: "pdf";
267
268
  png: "png";
268
- jpg: "jpg";
269
269
  }>;
270
270
  name: z.ZodString;
271
271
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -285,8 +285,8 @@ declare const ReferenceSchema: z.ZodObject<{
285
285
  mirrored: z.ZodOptional<z.ZodBoolean>;
286
286
  pdfPage: z.ZodOptional<z.ZodNumber>;
287
287
  pdfMode: z.ZodOptional<z.ZodEnum<{
288
- vector: "vector";
289
288
  raster: "raster";
289
+ vector: "vector";
290
290
  }>>;
291
291
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
292
292
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -463,17 +463,17 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
463
463
  right: "right";
464
464
  }>>;
465
465
  vAlign: z.ZodDefault<z.ZodEnum<{
466
- center: "center";
467
466
  bottom: "bottom";
467
+ center: "center";
468
468
  top: "top";
469
469
  }>>;
470
470
  frame: z.ZodOptional<z.ZodEnum<{
471
+ bottom: "bottom";
471
472
  circle: "circle";
473
+ firstLine: "firstLine";
472
474
  none: "none";
473
- bottom: "bottom";
474
475
  rectangle: "rectangle";
475
476
  slot: "slot";
476
- firstLine: "firstLine";
477
477
  }>>;
478
478
  styleId: z.ZodOptional<z.ZodString>;
479
479
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -483,11 +483,11 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
483
483
  italic: z.ZodOptional<z.ZodBoolean>;
484
484
  textHeight: z.ZodOptional<z.ZodNumber>;
485
485
  arrowType: z.ZodOptional<z.ZodEnum<{
486
+ dot: "dot";
486
487
  filled: "filled";
488
+ none: "none";
487
489
  open: "open";
488
490
  tick: "tick";
489
- dot: "dot";
490
- none: "none";
491
491
  }>>;
492
492
  arrowSize: z.ZodOptional<z.ZodNumber>;
493
493
  }, z.core.$strip>>;
@@ -503,10 +503,10 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
503
503
  opacity: z.ZodOptional<z.ZodNumber>;
504
504
  type: z.ZodLiteral<"dimension">;
505
505
  kind: z.ZodDefault<z.ZodEnum<{
506
- linear: "linear";
507
- radial: "radial";
508
506
  angular: "angular";
509
507
  diameter: "diameter";
508
+ linear: "linear";
509
+ radial: "radial";
510
510
  }>>;
511
511
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
512
512
  x: z.ZodNumber;
@@ -526,11 +526,11 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
526
526
  textHeight: z.ZodOptional<z.ZodNumber>;
527
527
  textOffset: z.ZodOptional<z.ZodNumber>;
528
528
  arrowType: z.ZodOptional<z.ZodEnum<{
529
+ dot: "dot";
529
530
  filled: "filled";
531
+ none: "none";
530
532
  open: "open";
531
533
  tick: "tick";
532
- dot: "dot";
533
- none: "none";
534
534
  }>>;
535
535
  arrowSize: z.ZodOptional<z.ZodNumber>;
536
536
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -644,8 +644,8 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
644
644
  right: "right";
645
645
  }>>;
646
646
  vAlign: z.ZodOptional<z.ZodEnum<{
647
- center: "center";
648
647
  bottom: "bottom";
648
+ center: "center";
649
649
  top: "top";
650
650
  }>>;
651
651
  styleId: z.ZodOptional<z.ZodString>;
@@ -656,11 +656,11 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
656
656
  italic: z.ZodOptional<z.ZodBoolean>;
657
657
  textHeight: z.ZodOptional<z.ZodNumber>;
658
658
  arrowType: z.ZodOptional<z.ZodEnum<{
659
+ dot: "dot";
659
660
  filled: "filled";
661
+ none: "none";
660
662
  open: "open";
661
663
  tick: "tick";
662
- dot: "dot";
663
- none: "none";
664
664
  }>>;
665
665
  arrowSize: z.ZodOptional<z.ZodNumber>;
666
666
  }, z.core.$strip>>;
@@ -669,10 +669,10 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
669
669
  headerRows: z.ZodDefault<z.ZodNumber>;
670
670
  cellMargin: z.ZodDefault<z.ZodNumber>;
671
671
  borders: z.ZodDefault<z.ZodEnum<{
672
- none: "none";
673
- rows: "rows";
674
672
  all: "all";
673
+ none: "none";
675
674
  outer: "outer";
675
+ rows: "rows";
676
676
  }>>;
677
677
  styleId: z.ZodOptional<z.ZodString>;
678
678
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -682,11 +682,11 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
682
682
  italic: z.ZodOptional<z.ZodBoolean>;
683
683
  textHeight: z.ZodOptional<z.ZodNumber>;
684
684
  arrowType: z.ZodOptional<z.ZodEnum<{
685
+ dot: "dot";
685
686
  filled: "filled";
687
+ none: "none";
686
688
  open: "open";
687
689
  tick: "tick";
688
- dot: "dot";
689
- none: "none";
690
690
  }>>;
691
691
  arrowSize: z.ZodOptional<z.ZodNumber>;
692
692
  }, z.core.$strip>>;
@@ -700,12 +700,12 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
700
700
  opacity: z.ZodOptional<z.ZodNumber>;
701
701
  type: z.ZodLiteral<"reference">;
702
702
  format: z.ZodEnum<{
703
- linea: "linea";
704
- dxf: "dxf";
705
703
  dwg: "dwg";
704
+ dxf: "dxf";
705
+ jpg: "jpg";
706
+ linea: "linea";
706
707
  pdf: "pdf";
707
708
  png: "png";
708
- jpg: "jpg";
709
709
  }>;
710
710
  name: z.ZodString;
711
711
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -725,8 +725,8 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
725
725
  mirrored: z.ZodOptional<z.ZodBoolean>;
726
726
  pdfPage: z.ZodOptional<z.ZodNumber>;
727
727
  pdfMode: z.ZodOptional<z.ZodEnum<{
728
- vector: "vector";
729
728
  raster: "raster";
729
+ vector: "vector";
730
730
  }>>;
731
731
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
732
732
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -939,17 +939,17 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
939
939
  right: "right";
940
940
  }>>;
941
941
  vAlign: z.ZodDefault<z.ZodEnum<{
942
- center: "center";
943
942
  bottom: "bottom";
943
+ center: "center";
944
944
  top: "top";
945
945
  }>>;
946
946
  frame: z.ZodOptional<z.ZodEnum<{
947
+ bottom: "bottom";
947
948
  circle: "circle";
949
+ firstLine: "firstLine";
948
950
  none: "none";
949
- bottom: "bottom";
950
951
  rectangle: "rectangle";
951
952
  slot: "slot";
952
- firstLine: "firstLine";
953
953
  }>>;
954
954
  styleId: z.ZodOptional<z.ZodString>;
955
955
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -959,11 +959,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
959
959
  italic: z.ZodOptional<z.ZodBoolean>;
960
960
  textHeight: z.ZodOptional<z.ZodNumber>;
961
961
  arrowType: z.ZodOptional<z.ZodEnum<{
962
+ dot: "dot";
962
963
  filled: "filled";
964
+ none: "none";
963
965
  open: "open";
964
966
  tick: "tick";
965
- dot: "dot";
966
- none: "none";
967
967
  }>>;
968
968
  arrowSize: z.ZodOptional<z.ZodNumber>;
969
969
  }, z.core.$strip>>;
@@ -979,10 +979,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
979
979
  opacity: z.ZodOptional<z.ZodNumber>;
980
980
  type: z.ZodLiteral<"dimension">;
981
981
  kind: z.ZodDefault<z.ZodEnum<{
982
- linear: "linear";
983
- radial: "radial";
984
982
  angular: "angular";
985
983
  diameter: "diameter";
984
+ linear: "linear";
985
+ radial: "radial";
986
986
  }>>;
987
987
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
988
988
  x: z.ZodNumber;
@@ -1002,11 +1002,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1002
1002
  textHeight: z.ZodOptional<z.ZodNumber>;
1003
1003
  textOffset: z.ZodOptional<z.ZodNumber>;
1004
1004
  arrowType: z.ZodOptional<z.ZodEnum<{
1005
+ dot: "dot";
1005
1006
  filled: "filled";
1007
+ none: "none";
1006
1008
  open: "open";
1007
1009
  tick: "tick";
1008
- dot: "dot";
1009
- none: "none";
1010
1010
  }>>;
1011
1011
  arrowSize: z.ZodOptional<z.ZodNumber>;
1012
1012
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -1120,8 +1120,8 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1120
1120
  right: "right";
1121
1121
  }>>;
1122
1122
  vAlign: z.ZodOptional<z.ZodEnum<{
1123
- center: "center";
1124
1123
  bottom: "bottom";
1124
+ center: "center";
1125
1125
  top: "top";
1126
1126
  }>>;
1127
1127
  styleId: z.ZodOptional<z.ZodString>;
@@ -1132,11 +1132,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1132
1132
  italic: z.ZodOptional<z.ZodBoolean>;
1133
1133
  textHeight: z.ZodOptional<z.ZodNumber>;
1134
1134
  arrowType: z.ZodOptional<z.ZodEnum<{
1135
+ dot: "dot";
1135
1136
  filled: "filled";
1137
+ none: "none";
1136
1138
  open: "open";
1137
1139
  tick: "tick";
1138
- dot: "dot";
1139
- none: "none";
1140
1140
  }>>;
1141
1141
  arrowSize: z.ZodOptional<z.ZodNumber>;
1142
1142
  }, z.core.$strip>>;
@@ -1145,10 +1145,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1145
1145
  headerRows: z.ZodDefault<z.ZodNumber>;
1146
1146
  cellMargin: z.ZodDefault<z.ZodNumber>;
1147
1147
  borders: z.ZodDefault<z.ZodEnum<{
1148
- none: "none";
1149
- rows: "rows";
1150
1148
  all: "all";
1149
+ none: "none";
1151
1150
  outer: "outer";
1151
+ rows: "rows";
1152
1152
  }>>;
1153
1153
  styleId: z.ZodOptional<z.ZodString>;
1154
1154
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -1158,11 +1158,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1158
1158
  italic: z.ZodOptional<z.ZodBoolean>;
1159
1159
  textHeight: z.ZodOptional<z.ZodNumber>;
1160
1160
  arrowType: z.ZodOptional<z.ZodEnum<{
1161
+ dot: "dot";
1161
1162
  filled: "filled";
1163
+ none: "none";
1162
1164
  open: "open";
1163
1165
  tick: "tick";
1164
- dot: "dot";
1165
- none: "none";
1166
1166
  }>>;
1167
1167
  arrowSize: z.ZodOptional<z.ZodNumber>;
1168
1168
  }, z.core.$strip>>;
@@ -1176,12 +1176,12 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1176
1176
  opacity: z.ZodOptional<z.ZodNumber>;
1177
1177
  type: z.ZodLiteral<"reference">;
1178
1178
  format: z.ZodEnum<{
1179
- linea: "linea";
1180
- dxf: "dxf";
1181
1179
  dwg: "dwg";
1180
+ dxf: "dxf";
1181
+ jpg: "jpg";
1182
+ linea: "linea";
1182
1183
  pdf: "pdf";
1183
1184
  png: "png";
1184
- jpg: "jpg";
1185
1185
  }>;
1186
1186
  name: z.ZodString;
1187
1187
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1201,8 +1201,8 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1201
1201
  mirrored: z.ZodOptional<z.ZodBoolean>;
1202
1202
  pdfPage: z.ZodOptional<z.ZodNumber>;
1203
1203
  pdfMode: z.ZodOptional<z.ZodEnum<{
1204
- vector: "vector";
1205
1204
  raster: "raster";
1205
+ vector: "vector";
1206
1206
  }>>;
1207
1207
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
1208
1208
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -1390,17 +1390,17 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1390
1390
  right: "right";
1391
1391
  }>>;
1392
1392
  vAlign: z.ZodDefault<z.ZodEnum<{
1393
- center: "center";
1394
1393
  bottom: "bottom";
1394
+ center: "center";
1395
1395
  top: "top";
1396
1396
  }>>;
1397
1397
  frame: z.ZodOptional<z.ZodEnum<{
1398
+ bottom: "bottom";
1398
1399
  circle: "circle";
1400
+ firstLine: "firstLine";
1399
1401
  none: "none";
1400
- bottom: "bottom";
1401
1402
  rectangle: "rectangle";
1402
1403
  slot: "slot";
1403
- firstLine: "firstLine";
1404
1404
  }>>;
1405
1405
  styleId: z.ZodOptional<z.ZodString>;
1406
1406
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -1410,11 +1410,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1410
1410
  italic: z.ZodOptional<z.ZodBoolean>;
1411
1411
  textHeight: z.ZodOptional<z.ZodNumber>;
1412
1412
  arrowType: z.ZodOptional<z.ZodEnum<{
1413
+ dot: "dot";
1413
1414
  filled: "filled";
1415
+ none: "none";
1414
1416
  open: "open";
1415
1417
  tick: "tick";
1416
- dot: "dot";
1417
- none: "none";
1418
1418
  }>>;
1419
1419
  arrowSize: z.ZodOptional<z.ZodNumber>;
1420
1420
  }, z.core.$strip>>;
@@ -1430,10 +1430,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1430
1430
  opacity: z.ZodOptional<z.ZodNumber>;
1431
1431
  type: z.ZodLiteral<"dimension">;
1432
1432
  kind: z.ZodDefault<z.ZodEnum<{
1433
- linear: "linear";
1434
- radial: "radial";
1435
1433
  angular: "angular";
1436
1434
  diameter: "diameter";
1435
+ linear: "linear";
1436
+ radial: "radial";
1437
1437
  }>>;
1438
1438
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1439
1439
  x: z.ZodNumber;
@@ -1453,11 +1453,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1453
1453
  textHeight: z.ZodOptional<z.ZodNumber>;
1454
1454
  textOffset: z.ZodOptional<z.ZodNumber>;
1455
1455
  arrowType: z.ZodOptional<z.ZodEnum<{
1456
+ dot: "dot";
1456
1457
  filled: "filled";
1458
+ none: "none";
1457
1459
  open: "open";
1458
1460
  tick: "tick";
1459
- dot: "dot";
1460
- none: "none";
1461
1461
  }>>;
1462
1462
  arrowSize: z.ZodOptional<z.ZodNumber>;
1463
1463
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -1571,8 +1571,8 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1571
1571
  right: "right";
1572
1572
  }>>;
1573
1573
  vAlign: z.ZodOptional<z.ZodEnum<{
1574
- center: "center";
1575
1574
  bottom: "bottom";
1575
+ center: "center";
1576
1576
  top: "top";
1577
1577
  }>>;
1578
1578
  styleId: z.ZodOptional<z.ZodString>;
@@ -1583,11 +1583,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1583
1583
  italic: z.ZodOptional<z.ZodBoolean>;
1584
1584
  textHeight: z.ZodOptional<z.ZodNumber>;
1585
1585
  arrowType: z.ZodOptional<z.ZodEnum<{
1586
+ dot: "dot";
1586
1587
  filled: "filled";
1588
+ none: "none";
1587
1589
  open: "open";
1588
1590
  tick: "tick";
1589
- dot: "dot";
1590
- none: "none";
1591
1591
  }>>;
1592
1592
  arrowSize: z.ZodOptional<z.ZodNumber>;
1593
1593
  }, z.core.$strip>>;
@@ -1596,10 +1596,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1596
1596
  headerRows: z.ZodDefault<z.ZodNumber>;
1597
1597
  cellMargin: z.ZodDefault<z.ZodNumber>;
1598
1598
  borders: z.ZodDefault<z.ZodEnum<{
1599
- none: "none";
1600
- rows: "rows";
1601
1599
  all: "all";
1600
+ none: "none";
1602
1601
  outer: "outer";
1602
+ rows: "rows";
1603
1603
  }>>;
1604
1604
  styleId: z.ZodOptional<z.ZodString>;
1605
1605
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -1609,11 +1609,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1609
1609
  italic: z.ZodOptional<z.ZodBoolean>;
1610
1610
  textHeight: z.ZodOptional<z.ZodNumber>;
1611
1611
  arrowType: z.ZodOptional<z.ZodEnum<{
1612
+ dot: "dot";
1612
1613
  filled: "filled";
1614
+ none: "none";
1613
1615
  open: "open";
1614
1616
  tick: "tick";
1615
- dot: "dot";
1616
- none: "none";
1617
1617
  }>>;
1618
1618
  arrowSize: z.ZodOptional<z.ZodNumber>;
1619
1619
  }, z.core.$strip>>;
@@ -1627,12 +1627,12 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1627
1627
  opacity: z.ZodOptional<z.ZodNumber>;
1628
1628
  type: z.ZodLiteral<"reference">;
1629
1629
  format: z.ZodEnum<{
1630
- linea: "linea";
1631
- dxf: "dxf";
1632
1630
  dwg: "dwg";
1631
+ dxf: "dxf";
1632
+ jpg: "jpg";
1633
+ linea: "linea";
1633
1634
  pdf: "pdf";
1634
1635
  png: "png";
1635
- jpg: "jpg";
1636
1636
  }>;
1637
1637
  name: z.ZodString;
1638
1638
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1652,8 +1652,8 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1652
1652
  mirrored: z.ZodOptional<z.ZodBoolean>;
1653
1653
  pdfPage: z.ZodOptional<z.ZodNumber>;
1654
1654
  pdfMode: z.ZodOptional<z.ZodEnum<{
1655
- vector: "vector";
1656
1655
  raster: "raster";
1656
+ vector: "vector";
1657
1657
  }>>;
1658
1658
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
1659
1659
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -1681,11 +1681,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1681
1681
  italic: z.ZodOptional<z.ZodBoolean>;
1682
1682
  textHeight: z.ZodDefault<z.ZodNumber>;
1683
1683
  arrowType: z.ZodDefault<z.ZodEnum<{
1684
+ dot: "dot";
1684
1685
  filled: "filled";
1686
+ none: "none";
1685
1687
  open: "open";
1686
1688
  tick: "tick";
1687
- dot: "dot";
1688
- none: "none";
1689
1689
  }>>;
1690
1690
  arrowSize: z.ZodDefault<z.ZodNumber>;
1691
1691
  }, z.core.$strip>>>;
@@ -1699,11 +1699,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1699
1699
  textHeight: z.ZodDefault<z.ZodNumber>;
1700
1700
  textOffset: z.ZodDefault<z.ZodNumber>;
1701
1701
  arrowType: z.ZodDefault<z.ZodEnum<{
1702
+ dot: "dot";
1702
1703
  filled: "filled";
1704
+ none: "none";
1703
1705
  open: "open";
1704
1706
  tick: "tick";
1705
- dot: "dot";
1706
- none: "none";
1707
1707
  }>>;
1708
1708
  arrowSize: z.ZodDefault<z.ZodNumber>;
1709
1709
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -1721,6 +1721,9 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1721
1721
  type LineaDocument = z.infer<typeof LineaDocumentSchema>;
1722
1722
 
1723
1723
  declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1724
+ name: z.ZodString;
1725
+ label: z.ZodOptional<z.ZodString>;
1726
+ hint: z.ZodOptional<z.ZodString>;
1724
1727
  type: z.ZodLiteral<"number">;
1725
1728
  default: z.ZodNumber;
1726
1729
  min: z.ZodOptional<z.ZodNumber>;
@@ -1730,54 +1733,54 @@ declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1730
1733
  prefix: z.ZodOptional<z.ZodString>;
1731
1734
  suffix: z.ZodOptional<z.ZodString>;
1732
1735
  presets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1736
+ }, z.core.$strip>, z.ZodObject<{
1733
1737
  name: z.ZodString;
1734
1738
  label: z.ZodOptional<z.ZodString>;
1735
1739
  hint: z.ZodOptional<z.ZodString>;
1736
- }, z.core.$strip>, z.ZodObject<{
1737
1740
  type: z.ZodLiteral<"string">;
1738
1741
  default: z.ZodString;
1739
1742
  placeholder: z.ZodOptional<z.ZodString>;
1740
1743
  multiline: z.ZodOptional<z.ZodBoolean>;
1741
1744
  presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1745
+ }, z.core.$strip>, z.ZodObject<{
1742
1746
  name: z.ZodString;
1743
1747
  label: z.ZodOptional<z.ZodString>;
1744
1748
  hint: z.ZodOptional<z.ZodString>;
1745
- }, z.core.$strip>, z.ZodObject<{
1746
1749
  type: z.ZodLiteral<"boolean">;
1747
1750
  default: z.ZodBoolean;
1748
1751
  display: z.ZodOptional<z.ZodEnum<{
1749
1752
  switch: "switch";
1750
1753
  toggle: "toggle";
1751
1754
  }>>;
1755
+ }, z.core.$strip>, z.ZodObject<{
1752
1756
  name: z.ZodString;
1753
1757
  label: z.ZodOptional<z.ZodString>;
1754
1758
  hint: z.ZodOptional<z.ZodString>;
1755
- }, z.core.$strip>, z.ZodObject<{
1756
1759
  type: z.ZodLiteral<"numberList">;
1757
1760
  default: z.ZodArray<z.ZodNumber>;
1758
1761
  placeholder: z.ZodOptional<z.ZodString>;
1759
1762
  min: z.ZodOptional<z.ZodNumber>;
1760
1763
  max: z.ZodOptional<z.ZodNumber>;
1761
1764
  presets: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodNumber>>>;
1765
+ }, z.core.$strip>, z.ZodObject<{
1762
1766
  name: z.ZodString;
1763
1767
  label: z.ZodOptional<z.ZodString>;
1764
1768
  hint: z.ZodOptional<z.ZodString>;
1765
- }, z.core.$strip>, z.ZodObject<{
1766
1769
  type: z.ZodLiteral<"stringList">;
1767
1770
  default: z.ZodArray<z.ZodString>;
1768
1771
  placeholder: z.ZodOptional<z.ZodString>;
1769
1772
  presets: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
1773
+ }, z.core.$strip>, z.ZodObject<{
1770
1774
  name: z.ZodString;
1771
1775
  label: z.ZodOptional<z.ZodString>;
1772
1776
  hint: z.ZodOptional<z.ZodString>;
1773
- }, z.core.$strip>, z.ZodObject<{
1774
1777
  type: z.ZodLiteral<"color">;
1775
1778
  default: z.ZodString;
1776
1779
  presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1780
+ }, z.core.$strip>, z.ZodObject<{
1777
1781
  name: z.ZodString;
1778
1782
  label: z.ZodOptional<z.ZodString>;
1779
1783
  hint: z.ZodOptional<z.ZodString>;
1780
- }, z.core.$strip>, z.ZodObject<{
1781
1784
  type: z.ZodLiteral<"enum">;
1782
1785
  default: z.ZodString;
1783
1786
  options: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
@@ -1786,50 +1789,53 @@ declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1786
1789
  swatch: z.ZodOptional<z.ZodString>;
1787
1790
  }, z.core.$strip>, unknown>>;
1788
1791
  display: z.ZodOptional<z.ZodEnum<{
1789
- dropdown: "dropdown";
1790
1792
  buttons: "buttons";
1793
+ dropdown: "dropdown";
1791
1794
  }>>;
1795
+ }, z.core.$strip>, z.ZodObject<{
1792
1796
  name: z.ZodString;
1793
1797
  label: z.ZodOptional<z.ZodString>;
1794
1798
  hint: z.ZodOptional<z.ZodString>;
1795
- }, z.core.$strip>, z.ZodObject<{
1796
1799
  type: z.ZodLiteral<"textStyle">;
1797
1800
  default: z.ZodDefault<z.ZodString>;
1801
+ }, z.core.$strip>, z.ZodObject<{
1798
1802
  name: z.ZodString;
1799
1803
  label: z.ZodOptional<z.ZodString>;
1800
1804
  hint: z.ZodOptional<z.ZodString>;
1801
- }, z.core.$strip>, z.ZodObject<{
1802
1805
  type: z.ZodLiteral<"dimStyle">;
1803
1806
  default: z.ZodDefault<z.ZodString>;
1807
+ }, z.core.$strip>, z.ZodObject<{
1804
1808
  name: z.ZodString;
1805
1809
  label: z.ZodOptional<z.ZodString>;
1806
1810
  hint: z.ZodOptional<z.ZodString>;
1807
- }, z.core.$strip>, z.ZodObject<{
1808
1811
  type: z.ZodLiteral<"font">;
1809
1812
  default: z.ZodDefault<z.ZodString>;
1813
+ }, z.core.$strip>, z.ZodObject<{
1810
1814
  name: z.ZodString;
1811
1815
  label: z.ZodOptional<z.ZodString>;
1812
1816
  hint: z.ZodOptional<z.ZodString>;
1813
- }, z.core.$strip>, z.ZodObject<{
1814
1817
  type: z.ZodLiteral<"lineType">;
1815
1818
  default: z.ZodDefault<z.ZodString>;
1819
+ }, z.core.$strip>, z.ZodObject<{
1816
1820
  name: z.ZodString;
1817
1821
  label: z.ZodOptional<z.ZodString>;
1818
1822
  hint: z.ZodOptional<z.ZodString>;
1819
- }, z.core.$strip>, z.ZodObject<{
1820
1823
  type: z.ZodLiteral<"hatchPattern">;
1821
1824
  default: z.ZodDefault<z.ZodString>;
1825
+ }, z.core.$strip>, z.ZodObject<{
1822
1826
  name: z.ZodString;
1823
1827
  label: z.ZodOptional<z.ZodString>;
1824
1828
  hint: z.ZodOptional<z.ZodString>;
1825
- }, z.core.$strip>, z.ZodObject<{
1826
1829
  type: z.ZodLiteral<"label">;
1830
+ }, z.core.$strip>, z.ZodObject<{
1827
1831
  name: z.ZodString;
1828
1832
  label: z.ZodOptional<z.ZodString>;
1829
1833
  hint: z.ZodOptional<z.ZodString>;
1830
- }, z.core.$strip>, z.ZodObject<{
1831
1834
  type: z.ZodLiteral<"row">;
1832
1835
  items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1836
+ name: z.ZodString;
1837
+ label: z.ZodOptional<z.ZodString>;
1838
+ hint: z.ZodOptional<z.ZodString>;
1833
1839
  type: z.ZodLiteral<"number">;
1834
1840
  default: z.ZodNumber;
1835
1841
  min: z.ZodOptional<z.ZodNumber>;
@@ -1839,29 +1845,29 @@ declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1839
1845
  prefix: z.ZodOptional<z.ZodString>;
1840
1846
  suffix: z.ZodOptional<z.ZodString>;
1841
1847
  presets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1848
+ }, z.core.$strip>, z.ZodObject<{
1842
1849
  name: z.ZodString;
1843
1850
  label: z.ZodOptional<z.ZodString>;
1844
1851
  hint: z.ZodOptional<z.ZodString>;
1845
- }, z.core.$strip>, z.ZodObject<{
1846
1852
  type: z.ZodLiteral<"string">;
1847
1853
  default: z.ZodString;
1848
1854
  placeholder: z.ZodOptional<z.ZodString>;
1849
1855
  multiline: z.ZodOptional<z.ZodBoolean>;
1850
1856
  presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1857
+ }, z.core.$strip>, z.ZodObject<{
1851
1858
  name: z.ZodString;
1852
1859
  label: z.ZodOptional<z.ZodString>;
1853
1860
  hint: z.ZodOptional<z.ZodString>;
1854
- }, z.core.$strip>, z.ZodObject<{
1855
1861
  type: z.ZodLiteral<"boolean">;
1856
1862
  default: z.ZodBoolean;
1857
1863
  display: z.ZodOptional<z.ZodEnum<{
1858
1864
  switch: "switch";
1859
1865
  toggle: "toggle";
1860
1866
  }>>;
1867
+ }, z.core.$strip>, z.ZodObject<{
1861
1868
  name: z.ZodString;
1862
1869
  label: z.ZodOptional<z.ZodString>;
1863
1870
  hint: z.ZodOptional<z.ZodString>;
1864
- }, z.core.$strip>, z.ZodObject<{
1865
1871
  type: z.ZodLiteral<"enum">;
1866
1872
  default: z.ZodString;
1867
1873
  options: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
@@ -1870,53 +1876,47 @@ declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1870
1876
  swatch: z.ZodOptional<z.ZodString>;
1871
1877
  }, z.core.$strip>, unknown>>;
1872
1878
  display: z.ZodOptional<z.ZodEnum<{
1873
- dropdown: "dropdown";
1874
1879
  buttons: "buttons";
1880
+ dropdown: "dropdown";
1875
1881
  }>>;
1882
+ }, z.core.$strip>, z.ZodObject<{
1876
1883
  name: z.ZodString;
1877
1884
  label: z.ZodOptional<z.ZodString>;
1878
1885
  hint: z.ZodOptional<z.ZodString>;
1879
- }, z.core.$strip>, z.ZodObject<{
1880
1886
  type: z.ZodLiteral<"color">;
1881
1887
  default: z.ZodString;
1882
1888
  presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1889
+ }, z.core.$strip>, z.ZodObject<{
1883
1890
  name: z.ZodString;
1884
1891
  label: z.ZodOptional<z.ZodString>;
1885
1892
  hint: z.ZodOptional<z.ZodString>;
1886
- }, z.core.$strip>, z.ZodObject<{
1887
1893
  type: z.ZodLiteral<"textStyle">;
1888
1894
  default: z.ZodDefault<z.ZodString>;
1895
+ }, z.core.$strip>, z.ZodObject<{
1889
1896
  name: z.ZodString;
1890
1897
  label: z.ZodOptional<z.ZodString>;
1891
1898
  hint: z.ZodOptional<z.ZodString>;
1892
- }, z.core.$strip>, z.ZodObject<{
1893
1899
  type: z.ZodLiteral<"dimStyle">;
1894
1900
  default: z.ZodDefault<z.ZodString>;
1901
+ }, z.core.$strip>, z.ZodObject<{
1895
1902
  name: z.ZodString;
1896
1903
  label: z.ZodOptional<z.ZodString>;
1897
1904
  hint: z.ZodOptional<z.ZodString>;
1898
- }, z.core.$strip>, z.ZodObject<{
1899
1905
  type: z.ZodLiteral<"font">;
1900
1906
  default: z.ZodDefault<z.ZodString>;
1907
+ }, z.core.$strip>, z.ZodObject<{
1901
1908
  name: z.ZodString;
1902
1909
  label: z.ZodOptional<z.ZodString>;
1903
1910
  hint: z.ZodOptional<z.ZodString>;
1904
- }, z.core.$strip>, z.ZodObject<{
1905
1911
  type: z.ZodLiteral<"lineType">;
1906
1912
  default: z.ZodDefault<z.ZodString>;
1913
+ }, z.core.$strip>, z.ZodObject<{
1907
1914
  name: z.ZodString;
1908
1915
  label: z.ZodOptional<z.ZodString>;
1909
1916
  hint: z.ZodOptional<z.ZodString>;
1910
- }, z.core.$strip>, z.ZodObject<{
1911
1917
  type: z.ZodLiteral<"hatchPattern">;
1912
1918
  default: z.ZodDefault<z.ZodString>;
1913
- name: z.ZodString;
1914
- label: z.ZodOptional<z.ZodString>;
1915
- hint: z.ZodOptional<z.ZodString>;
1916
1919
  }, z.core.$strip>], "type">>;
1917
- name: z.ZodString;
1918
- label: z.ZodOptional<z.ZodString>;
1919
- hint: z.ZodOptional<z.ZodString>;
1920
1920
  }, z.core.$strip>], "type">;
1921
1921
  type BlockParameter = z.infer<typeof BlockParamSchema>;
1922
1922
 
@@ -2127,17 +2127,17 @@ declare const PaperLayoutSchema: z.ZodObject<{
2127
2127
  right: "right";
2128
2128
  }>>;
2129
2129
  vAlign: z.ZodDefault<z.ZodEnum<{
2130
- center: "center";
2131
2130
  bottom: "bottom";
2131
+ center: "center";
2132
2132
  top: "top";
2133
2133
  }>>;
2134
2134
  frame: z.ZodOptional<z.ZodEnum<{
2135
+ bottom: "bottom";
2135
2136
  circle: "circle";
2137
+ firstLine: "firstLine";
2136
2138
  none: "none";
2137
- bottom: "bottom";
2138
2139
  rectangle: "rectangle";
2139
2140
  slot: "slot";
2140
- firstLine: "firstLine";
2141
2141
  }>>;
2142
2142
  styleId: z.ZodOptional<z.ZodString>;
2143
2143
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -2147,11 +2147,11 @@ declare const PaperLayoutSchema: z.ZodObject<{
2147
2147
  italic: z.ZodOptional<z.ZodBoolean>;
2148
2148
  textHeight: z.ZodOptional<z.ZodNumber>;
2149
2149
  arrowType: z.ZodOptional<z.ZodEnum<{
2150
+ dot: "dot";
2150
2151
  filled: "filled";
2152
+ none: "none";
2151
2153
  open: "open";
2152
2154
  tick: "tick";
2153
- dot: "dot";
2154
- none: "none";
2155
2155
  }>>;
2156
2156
  arrowSize: z.ZodOptional<z.ZodNumber>;
2157
2157
  }, z.core.$strip>>;
@@ -2167,10 +2167,10 @@ declare const PaperLayoutSchema: z.ZodObject<{
2167
2167
  opacity: z.ZodOptional<z.ZodNumber>;
2168
2168
  type: z.ZodLiteral<"dimension">;
2169
2169
  kind: z.ZodDefault<z.ZodEnum<{
2170
- linear: "linear";
2171
- radial: "radial";
2172
2170
  angular: "angular";
2173
2171
  diameter: "diameter";
2172
+ linear: "linear";
2173
+ radial: "radial";
2174
2174
  }>>;
2175
2175
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2176
2176
  x: z.ZodNumber;
@@ -2190,11 +2190,11 @@ declare const PaperLayoutSchema: z.ZodObject<{
2190
2190
  textHeight: z.ZodOptional<z.ZodNumber>;
2191
2191
  textOffset: z.ZodOptional<z.ZodNumber>;
2192
2192
  arrowType: z.ZodOptional<z.ZodEnum<{
2193
+ dot: "dot";
2193
2194
  filled: "filled";
2195
+ none: "none";
2194
2196
  open: "open";
2195
2197
  tick: "tick";
2196
- dot: "dot";
2197
- none: "none";
2198
2198
  }>>;
2199
2199
  arrowSize: z.ZodOptional<z.ZodNumber>;
2200
2200
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -2308,8 +2308,8 @@ declare const PaperLayoutSchema: z.ZodObject<{
2308
2308
  right: "right";
2309
2309
  }>>;
2310
2310
  vAlign: z.ZodOptional<z.ZodEnum<{
2311
- center: "center";
2312
2311
  bottom: "bottom";
2312
+ center: "center";
2313
2313
  top: "top";
2314
2314
  }>>;
2315
2315
  styleId: z.ZodOptional<z.ZodString>;
@@ -2320,11 +2320,11 @@ declare const PaperLayoutSchema: z.ZodObject<{
2320
2320
  italic: z.ZodOptional<z.ZodBoolean>;
2321
2321
  textHeight: z.ZodOptional<z.ZodNumber>;
2322
2322
  arrowType: z.ZodOptional<z.ZodEnum<{
2323
+ dot: "dot";
2323
2324
  filled: "filled";
2325
+ none: "none";
2324
2326
  open: "open";
2325
2327
  tick: "tick";
2326
- dot: "dot";
2327
- none: "none";
2328
2328
  }>>;
2329
2329
  arrowSize: z.ZodOptional<z.ZodNumber>;
2330
2330
  }, z.core.$strip>>;
@@ -2333,10 +2333,10 @@ declare const PaperLayoutSchema: z.ZodObject<{
2333
2333
  headerRows: z.ZodDefault<z.ZodNumber>;
2334
2334
  cellMargin: z.ZodDefault<z.ZodNumber>;
2335
2335
  borders: z.ZodDefault<z.ZodEnum<{
2336
- none: "none";
2337
- rows: "rows";
2338
2336
  all: "all";
2337
+ none: "none";
2339
2338
  outer: "outer";
2339
+ rows: "rows";
2340
2340
  }>>;
2341
2341
  styleId: z.ZodOptional<z.ZodString>;
2342
2342
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -2346,11 +2346,11 @@ declare const PaperLayoutSchema: z.ZodObject<{
2346
2346
  italic: z.ZodOptional<z.ZodBoolean>;
2347
2347
  textHeight: z.ZodOptional<z.ZodNumber>;
2348
2348
  arrowType: z.ZodOptional<z.ZodEnum<{
2349
+ dot: "dot";
2349
2350
  filled: "filled";
2351
+ none: "none";
2350
2352
  open: "open";
2351
2353
  tick: "tick";
2352
- dot: "dot";
2353
- none: "none";
2354
2354
  }>>;
2355
2355
  arrowSize: z.ZodOptional<z.ZodNumber>;
2356
2356
  }, z.core.$strip>>;
@@ -2364,12 +2364,12 @@ declare const PaperLayoutSchema: z.ZodObject<{
2364
2364
  opacity: z.ZodOptional<z.ZodNumber>;
2365
2365
  type: z.ZodLiteral<"reference">;
2366
2366
  format: z.ZodEnum<{
2367
- linea: "linea";
2368
- dxf: "dxf";
2369
2367
  dwg: "dwg";
2368
+ dxf: "dxf";
2369
+ jpg: "jpg";
2370
+ linea: "linea";
2370
2371
  pdf: "pdf";
2371
2372
  png: "png";
2372
- jpg: "jpg";
2373
2373
  }>;
2374
2374
  name: z.ZodString;
2375
2375
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2389,8 +2389,8 @@ declare const PaperLayoutSchema: z.ZodObject<{
2389
2389
  mirrored: z.ZodOptional<z.ZodBoolean>;
2390
2390
  pdfPage: z.ZodOptional<z.ZodNumber>;
2391
2391
  pdfMode: z.ZodOptional<z.ZodEnum<{
2392
- vector: "vector";
2393
2392
  raster: "raster";
2393
+ vector: "vector";
2394
2394
  }>>;
2395
2395
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
2396
2396
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -2545,6 +2545,50 @@ interface TextBlock {
2545
2545
  }
2546
2546
 
2547
2547
  type SnapPointType = "endpoint" | "midpoint" | "center" | "quadrant";
2548
+ interface SnapPoint {
2549
+ p: Vec2;
2550
+ type: SnapPointType;
2551
+ }
2552
+ /** A cached segment; tessellation chords of curves are marked as such. */
2553
+ interface SnapSegment extends Segment {
2554
+ /**
2555
+ * True for chords approximating a curve (ellipse tessellation): they serve
2556
+ * hit-testing, selection, and intersections, but are excluded from
2557
+ * extension snapping (a curve has no per-facet extensions) and lose to the
2558
+ * exact curve in the nearest tier.
2559
+ */
2560
+ chord?: boolean;
2561
+ }
2562
+ /** Cached per-object snap geometry (also serves hit-testing). */
2563
+ interface SnapCacheEntry {
2564
+ bounds: AABB;
2565
+ /**
2566
+ * `bounds` unioned with every snap point — the candidate-query box for
2567
+ * snapping. Off-curve snap points (an arc's center) lie outside the tight
2568
+ * curve bounds; without this a cursor near them would never consider the
2569
+ * object. Window/crossing selection keeps using the tight `bounds`.
2570
+ */
2571
+ pointBounds: AABB;
2572
+ points: SnapPoint[];
2573
+ /** Exact straight segments (curved geometry contributes tessellated runs). */
2574
+ segments: SnapSegment[];
2575
+ /** Analytic arcs (circles are full-sweep arcs). */
2576
+ arcs: ArcGeom[];
2577
+ /**
2578
+ * Analytic ellipses. Their tessellation still lives in `segments` (for
2579
+ * hit-testing, intersections, marquee selection); the nearest tier prefers
2580
+ * the exact curve over the chords.
2581
+ */
2582
+ ellipses?: EllipseGeom[];
2583
+ /** Closed tessellated rings (hatch interiors, for inside hit-testing). */
2584
+ rings?: Vec2[][];
2585
+ /**
2586
+ * Huge entries (a referenced site plan: 10⁵+ segments) answer "what is in
2587
+ * this box" from a spatial index, so snapping and picking near the cursor
2588
+ * stay cheap; absent → scan the whole entry. The result has this shape.
2589
+ */
2590
+ near?: (box: AABB) => SnapCacheEntry;
2591
+ }
2548
2592
 
2549
2593
  interface ResolvedStyle {
2550
2594
  color: string;
@@ -2711,11 +2755,6 @@ interface ReferenceSnap {
2711
2755
 
2712
2756
  type DwgVersion = "AC1015" | "AC1018" | "AC1021" | "AC1024" | "AC1027" | "AC1032";
2713
2757
 
2714
- /** Target collection of an op: model space or a specific paper layout. */
2715
- declare const OpSpaceSchema: z.ZodUnion<readonly [z.ZodLiteral<"model">, z.ZodObject<{
2716
- layoutId: z.ZodString;
2717
- }, z.core.$strip>]>;
2718
- type OpSpace = z.infer<typeof OpSpaceSchema>;
2719
2758
  /**
2720
2759
  * Where a reorder places the moved objects: the top/bottom of the space's
2721
2760
  * draw order, or immediately above/below a reference object (by id).
@@ -2889,17 +2928,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2889
2928
  right: "right";
2890
2929
  }>>;
2891
2930
  vAlign: z.ZodDefault<z.ZodEnum<{
2892
- center: "center";
2893
2931
  bottom: "bottom";
2932
+ center: "center";
2894
2933
  top: "top";
2895
2934
  }>>;
2896
2935
  frame: z.ZodOptional<z.ZodEnum<{
2936
+ bottom: "bottom";
2897
2937
  circle: "circle";
2938
+ firstLine: "firstLine";
2898
2939
  none: "none";
2899
- bottom: "bottom";
2900
2940
  rectangle: "rectangle";
2901
2941
  slot: "slot";
2902
- firstLine: "firstLine";
2903
2942
  }>>;
2904
2943
  styleId: z.ZodOptional<z.ZodString>;
2905
2944
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -2909,11 +2948,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2909
2948
  italic: z.ZodOptional<z.ZodBoolean>;
2910
2949
  textHeight: z.ZodOptional<z.ZodNumber>;
2911
2950
  arrowType: z.ZodOptional<z.ZodEnum<{
2951
+ dot: "dot";
2912
2952
  filled: "filled";
2953
+ none: "none";
2913
2954
  open: "open";
2914
2955
  tick: "tick";
2915
- dot: "dot";
2916
- none: "none";
2917
2956
  }>>;
2918
2957
  arrowSize: z.ZodOptional<z.ZodNumber>;
2919
2958
  }, z.core.$strip>>;
@@ -2929,10 +2968,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2929
2968
  opacity: z.ZodOptional<z.ZodNumber>;
2930
2969
  type: z.ZodLiteral<"dimension">;
2931
2970
  kind: z.ZodDefault<z.ZodEnum<{
2932
- linear: "linear";
2933
- radial: "radial";
2934
2971
  angular: "angular";
2935
2972
  diameter: "diameter";
2973
+ linear: "linear";
2974
+ radial: "radial";
2936
2975
  }>>;
2937
2976
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2938
2977
  x: z.ZodNumber;
@@ -2952,11 +2991,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2952
2991
  textHeight: z.ZodOptional<z.ZodNumber>;
2953
2992
  textOffset: z.ZodOptional<z.ZodNumber>;
2954
2993
  arrowType: z.ZodOptional<z.ZodEnum<{
2994
+ dot: "dot";
2955
2995
  filled: "filled";
2996
+ none: "none";
2956
2997
  open: "open";
2957
2998
  tick: "tick";
2958
- dot: "dot";
2959
- none: "none";
2960
2999
  }>>;
2961
3000
  arrowSize: z.ZodOptional<z.ZodNumber>;
2962
3001
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -3070,8 +3109,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3070
3109
  right: "right";
3071
3110
  }>>;
3072
3111
  vAlign: z.ZodOptional<z.ZodEnum<{
3073
- center: "center";
3074
3112
  bottom: "bottom";
3113
+ center: "center";
3075
3114
  top: "top";
3076
3115
  }>>;
3077
3116
  styleId: z.ZodOptional<z.ZodString>;
@@ -3082,11 +3121,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3082
3121
  italic: z.ZodOptional<z.ZodBoolean>;
3083
3122
  textHeight: z.ZodOptional<z.ZodNumber>;
3084
3123
  arrowType: z.ZodOptional<z.ZodEnum<{
3124
+ dot: "dot";
3085
3125
  filled: "filled";
3126
+ none: "none";
3086
3127
  open: "open";
3087
3128
  tick: "tick";
3088
- dot: "dot";
3089
- none: "none";
3090
3129
  }>>;
3091
3130
  arrowSize: z.ZodOptional<z.ZodNumber>;
3092
3131
  }, z.core.$strip>>;
@@ -3095,10 +3134,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3095
3134
  headerRows: z.ZodDefault<z.ZodNumber>;
3096
3135
  cellMargin: z.ZodDefault<z.ZodNumber>;
3097
3136
  borders: z.ZodDefault<z.ZodEnum<{
3098
- none: "none";
3099
- rows: "rows";
3100
3137
  all: "all";
3138
+ none: "none";
3101
3139
  outer: "outer";
3140
+ rows: "rows";
3102
3141
  }>>;
3103
3142
  styleId: z.ZodOptional<z.ZodString>;
3104
3143
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -3108,11 +3147,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3108
3147
  italic: z.ZodOptional<z.ZodBoolean>;
3109
3148
  textHeight: z.ZodOptional<z.ZodNumber>;
3110
3149
  arrowType: z.ZodOptional<z.ZodEnum<{
3150
+ dot: "dot";
3111
3151
  filled: "filled";
3152
+ none: "none";
3112
3153
  open: "open";
3113
3154
  tick: "tick";
3114
- dot: "dot";
3115
- none: "none";
3116
3155
  }>>;
3117
3156
  arrowSize: z.ZodOptional<z.ZodNumber>;
3118
3157
  }, z.core.$strip>>;
@@ -3126,12 +3165,12 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3126
3165
  opacity: z.ZodOptional<z.ZodNumber>;
3127
3166
  type: z.ZodLiteral<"reference">;
3128
3167
  format: z.ZodEnum<{
3129
- linea: "linea";
3130
- dxf: "dxf";
3131
3168
  dwg: "dwg";
3169
+ dxf: "dxf";
3170
+ jpg: "jpg";
3171
+ linea: "linea";
3132
3172
  pdf: "pdf";
3133
3173
  png: "png";
3134
- jpg: "jpg";
3135
3174
  }>;
3136
3175
  name: z.ZodString;
3137
3176
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -3151,8 +3190,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3151
3190
  mirrored: z.ZodOptional<z.ZodBoolean>;
3152
3191
  pdfPage: z.ZodOptional<z.ZodNumber>;
3153
3192
  pdfMode: z.ZodOptional<z.ZodEnum<{
3154
- vector: "vector";
3155
3193
  raster: "raster";
3194
+ vector: "vector";
3156
3195
  }>>;
3157
3196
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
3158
3197
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -3334,17 +3373,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3334
3373
  right: "right";
3335
3374
  }>>;
3336
3375
  vAlign: z.ZodDefault<z.ZodEnum<{
3337
- center: "center";
3338
3376
  bottom: "bottom";
3377
+ center: "center";
3339
3378
  top: "top";
3340
3379
  }>>;
3341
3380
  frame: z.ZodOptional<z.ZodEnum<{
3381
+ bottom: "bottom";
3342
3382
  circle: "circle";
3383
+ firstLine: "firstLine";
3343
3384
  none: "none";
3344
- bottom: "bottom";
3345
3385
  rectangle: "rectangle";
3346
3386
  slot: "slot";
3347
- firstLine: "firstLine";
3348
3387
  }>>;
3349
3388
  styleId: z.ZodOptional<z.ZodString>;
3350
3389
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -3354,11 +3393,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3354
3393
  italic: z.ZodOptional<z.ZodBoolean>;
3355
3394
  textHeight: z.ZodOptional<z.ZodNumber>;
3356
3395
  arrowType: z.ZodOptional<z.ZodEnum<{
3396
+ dot: "dot";
3357
3397
  filled: "filled";
3398
+ none: "none";
3358
3399
  open: "open";
3359
3400
  tick: "tick";
3360
- dot: "dot";
3361
- none: "none";
3362
3401
  }>>;
3363
3402
  arrowSize: z.ZodOptional<z.ZodNumber>;
3364
3403
  }, z.core.$strip>>;
@@ -3374,10 +3413,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3374
3413
  opacity: z.ZodOptional<z.ZodNumber>;
3375
3414
  type: z.ZodLiteral<"dimension">;
3376
3415
  kind: z.ZodDefault<z.ZodEnum<{
3377
- linear: "linear";
3378
- radial: "radial";
3379
3416
  angular: "angular";
3380
3417
  diameter: "diameter";
3418
+ linear: "linear";
3419
+ radial: "radial";
3381
3420
  }>>;
3382
3421
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3383
3422
  x: z.ZodNumber;
@@ -3397,11 +3436,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3397
3436
  textHeight: z.ZodOptional<z.ZodNumber>;
3398
3437
  textOffset: z.ZodOptional<z.ZodNumber>;
3399
3438
  arrowType: z.ZodOptional<z.ZodEnum<{
3439
+ dot: "dot";
3400
3440
  filled: "filled";
3441
+ none: "none";
3401
3442
  open: "open";
3402
3443
  tick: "tick";
3403
- dot: "dot";
3404
- none: "none";
3405
3444
  }>>;
3406
3445
  arrowSize: z.ZodOptional<z.ZodNumber>;
3407
3446
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -3515,8 +3554,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3515
3554
  right: "right";
3516
3555
  }>>;
3517
3556
  vAlign: z.ZodOptional<z.ZodEnum<{
3518
- center: "center";
3519
3557
  bottom: "bottom";
3558
+ center: "center";
3520
3559
  top: "top";
3521
3560
  }>>;
3522
3561
  styleId: z.ZodOptional<z.ZodString>;
@@ -3527,11 +3566,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3527
3566
  italic: z.ZodOptional<z.ZodBoolean>;
3528
3567
  textHeight: z.ZodOptional<z.ZodNumber>;
3529
3568
  arrowType: z.ZodOptional<z.ZodEnum<{
3569
+ dot: "dot";
3530
3570
  filled: "filled";
3571
+ none: "none";
3531
3572
  open: "open";
3532
3573
  tick: "tick";
3533
- dot: "dot";
3534
- none: "none";
3535
3574
  }>>;
3536
3575
  arrowSize: z.ZodOptional<z.ZodNumber>;
3537
3576
  }, z.core.$strip>>;
@@ -3540,10 +3579,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3540
3579
  headerRows: z.ZodDefault<z.ZodNumber>;
3541
3580
  cellMargin: z.ZodDefault<z.ZodNumber>;
3542
3581
  borders: z.ZodDefault<z.ZodEnum<{
3543
- none: "none";
3544
- rows: "rows";
3545
3582
  all: "all";
3583
+ none: "none";
3546
3584
  outer: "outer";
3585
+ rows: "rows";
3547
3586
  }>>;
3548
3587
  styleId: z.ZodOptional<z.ZodString>;
3549
3588
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -3553,11 +3592,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3553
3592
  italic: z.ZodOptional<z.ZodBoolean>;
3554
3593
  textHeight: z.ZodOptional<z.ZodNumber>;
3555
3594
  arrowType: z.ZodOptional<z.ZodEnum<{
3595
+ dot: "dot";
3556
3596
  filled: "filled";
3597
+ none: "none";
3557
3598
  open: "open";
3558
3599
  tick: "tick";
3559
- dot: "dot";
3560
- none: "none";
3561
3600
  }>>;
3562
3601
  arrowSize: z.ZodOptional<z.ZodNumber>;
3563
3602
  }, z.core.$strip>>;
@@ -3571,12 +3610,12 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3571
3610
  opacity: z.ZodOptional<z.ZodNumber>;
3572
3611
  type: z.ZodLiteral<"reference">;
3573
3612
  format: z.ZodEnum<{
3574
- linea: "linea";
3575
- dxf: "dxf";
3576
3613
  dwg: "dwg";
3614
+ dxf: "dxf";
3615
+ jpg: "jpg";
3616
+ linea: "linea";
3577
3617
  pdf: "pdf";
3578
3618
  png: "png";
3579
- jpg: "jpg";
3580
3619
  }>;
3581
3620
  name: z.ZodString;
3582
3621
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -3596,8 +3635,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3596
3635
  mirrored: z.ZodOptional<z.ZodBoolean>;
3597
3636
  pdfPage: z.ZodOptional<z.ZodNumber>;
3598
3637
  pdfMode: z.ZodOptional<z.ZodEnum<{
3599
- vector: "vector";
3600
3638
  raster: "raster";
3639
+ vector: "vector";
3601
3640
  }>>;
3602
3641
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
3603
3642
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -3853,17 +3892,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3853
3892
  right: "right";
3854
3893
  }>>;
3855
3894
  vAlign: z.ZodDefault<z.ZodEnum<{
3856
- center: "center";
3857
3895
  bottom: "bottom";
3896
+ center: "center";
3858
3897
  top: "top";
3859
3898
  }>>;
3860
3899
  frame: z.ZodOptional<z.ZodEnum<{
3900
+ bottom: "bottom";
3861
3901
  circle: "circle";
3902
+ firstLine: "firstLine";
3862
3903
  none: "none";
3863
- bottom: "bottom";
3864
3904
  rectangle: "rectangle";
3865
3905
  slot: "slot";
3866
- firstLine: "firstLine";
3867
3906
  }>>;
3868
3907
  styleId: z.ZodOptional<z.ZodString>;
3869
3908
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -3873,11 +3912,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3873
3912
  italic: z.ZodOptional<z.ZodBoolean>;
3874
3913
  textHeight: z.ZodOptional<z.ZodNumber>;
3875
3914
  arrowType: z.ZodOptional<z.ZodEnum<{
3915
+ dot: "dot";
3876
3916
  filled: "filled";
3917
+ none: "none";
3877
3918
  open: "open";
3878
3919
  tick: "tick";
3879
- dot: "dot";
3880
- none: "none";
3881
3920
  }>>;
3882
3921
  arrowSize: z.ZodOptional<z.ZodNumber>;
3883
3922
  }, z.core.$strip>>;
@@ -3893,10 +3932,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3893
3932
  opacity: z.ZodOptional<z.ZodNumber>;
3894
3933
  type: z.ZodLiteral<"dimension">;
3895
3934
  kind: z.ZodDefault<z.ZodEnum<{
3896
- linear: "linear";
3897
- radial: "radial";
3898
3935
  angular: "angular";
3899
3936
  diameter: "diameter";
3937
+ linear: "linear";
3938
+ radial: "radial";
3900
3939
  }>>;
3901
3940
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3902
3941
  x: z.ZodNumber;
@@ -3916,11 +3955,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3916
3955
  textHeight: z.ZodOptional<z.ZodNumber>;
3917
3956
  textOffset: z.ZodOptional<z.ZodNumber>;
3918
3957
  arrowType: z.ZodOptional<z.ZodEnum<{
3958
+ dot: "dot";
3919
3959
  filled: "filled";
3960
+ none: "none";
3920
3961
  open: "open";
3921
3962
  tick: "tick";
3922
- dot: "dot";
3923
- none: "none";
3924
3963
  }>>;
3925
3964
  arrowSize: z.ZodOptional<z.ZodNumber>;
3926
3965
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -4034,8 +4073,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4034
4073
  right: "right";
4035
4074
  }>>;
4036
4075
  vAlign: z.ZodOptional<z.ZodEnum<{
4037
- center: "center";
4038
4076
  bottom: "bottom";
4077
+ center: "center";
4039
4078
  top: "top";
4040
4079
  }>>;
4041
4080
  styleId: z.ZodOptional<z.ZodString>;
@@ -4046,11 +4085,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4046
4085
  italic: z.ZodOptional<z.ZodBoolean>;
4047
4086
  textHeight: z.ZodOptional<z.ZodNumber>;
4048
4087
  arrowType: z.ZodOptional<z.ZodEnum<{
4088
+ dot: "dot";
4049
4089
  filled: "filled";
4090
+ none: "none";
4050
4091
  open: "open";
4051
4092
  tick: "tick";
4052
- dot: "dot";
4053
- none: "none";
4054
4093
  }>>;
4055
4094
  arrowSize: z.ZodOptional<z.ZodNumber>;
4056
4095
  }, z.core.$strip>>;
@@ -4059,10 +4098,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4059
4098
  headerRows: z.ZodDefault<z.ZodNumber>;
4060
4099
  cellMargin: z.ZodDefault<z.ZodNumber>;
4061
4100
  borders: z.ZodDefault<z.ZodEnum<{
4062
- none: "none";
4063
- rows: "rows";
4064
4101
  all: "all";
4102
+ none: "none";
4065
4103
  outer: "outer";
4104
+ rows: "rows";
4066
4105
  }>>;
4067
4106
  styleId: z.ZodOptional<z.ZodString>;
4068
4107
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -4072,11 +4111,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4072
4111
  italic: z.ZodOptional<z.ZodBoolean>;
4073
4112
  textHeight: z.ZodOptional<z.ZodNumber>;
4074
4113
  arrowType: z.ZodOptional<z.ZodEnum<{
4114
+ dot: "dot";
4075
4115
  filled: "filled";
4116
+ none: "none";
4076
4117
  open: "open";
4077
4118
  tick: "tick";
4078
- dot: "dot";
4079
- none: "none";
4080
4119
  }>>;
4081
4120
  arrowSize: z.ZodOptional<z.ZodNumber>;
4082
4121
  }, z.core.$strip>>;
@@ -4090,12 +4129,12 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4090
4129
  opacity: z.ZodOptional<z.ZodNumber>;
4091
4130
  type: z.ZodLiteral<"reference">;
4092
4131
  format: z.ZodEnum<{
4093
- linea: "linea";
4094
- dxf: "dxf";
4095
4132
  dwg: "dwg";
4133
+ dxf: "dxf";
4134
+ jpg: "jpg";
4135
+ linea: "linea";
4096
4136
  pdf: "pdf";
4097
4137
  png: "png";
4098
- jpg: "jpg";
4099
4138
  }>;
4100
4139
  name: z.ZodString;
4101
4140
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -4115,8 +4154,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4115
4154
  mirrored: z.ZodOptional<z.ZodBoolean>;
4116
4155
  pdfPage: z.ZodOptional<z.ZodNumber>;
4117
4156
  pdfMode: z.ZodOptional<z.ZodEnum<{
4118
- vector: "vector";
4119
4157
  raster: "raster";
4158
+ vector: "vector";
4120
4159
  }>>;
4121
4160
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
4122
4161
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -4327,17 +4366,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4327
4366
  right: "right";
4328
4367
  }>>;
4329
4368
  vAlign: z.ZodDefault<z.ZodEnum<{
4330
- center: "center";
4331
4369
  bottom: "bottom";
4370
+ center: "center";
4332
4371
  top: "top";
4333
4372
  }>>;
4334
4373
  frame: z.ZodOptional<z.ZodEnum<{
4374
+ bottom: "bottom";
4335
4375
  circle: "circle";
4376
+ firstLine: "firstLine";
4336
4377
  none: "none";
4337
- bottom: "bottom";
4338
4378
  rectangle: "rectangle";
4339
4379
  slot: "slot";
4340
- firstLine: "firstLine";
4341
4380
  }>>;
4342
4381
  styleId: z.ZodOptional<z.ZodString>;
4343
4382
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -4347,11 +4386,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4347
4386
  italic: z.ZodOptional<z.ZodBoolean>;
4348
4387
  textHeight: z.ZodOptional<z.ZodNumber>;
4349
4388
  arrowType: z.ZodOptional<z.ZodEnum<{
4389
+ dot: "dot";
4350
4390
  filled: "filled";
4391
+ none: "none";
4351
4392
  open: "open";
4352
4393
  tick: "tick";
4353
- dot: "dot";
4354
- none: "none";
4355
4394
  }>>;
4356
4395
  arrowSize: z.ZodOptional<z.ZodNumber>;
4357
4396
  }, z.core.$strip>>;
@@ -4367,10 +4406,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4367
4406
  opacity: z.ZodOptional<z.ZodNumber>;
4368
4407
  type: z.ZodLiteral<"dimension">;
4369
4408
  kind: z.ZodDefault<z.ZodEnum<{
4370
- linear: "linear";
4371
- radial: "radial";
4372
4409
  angular: "angular";
4373
4410
  diameter: "diameter";
4411
+ linear: "linear";
4412
+ radial: "radial";
4374
4413
  }>>;
4375
4414
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4376
4415
  x: z.ZodNumber;
@@ -4390,11 +4429,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4390
4429
  textHeight: z.ZodOptional<z.ZodNumber>;
4391
4430
  textOffset: z.ZodOptional<z.ZodNumber>;
4392
4431
  arrowType: z.ZodOptional<z.ZodEnum<{
4432
+ dot: "dot";
4393
4433
  filled: "filled";
4434
+ none: "none";
4394
4435
  open: "open";
4395
4436
  tick: "tick";
4396
- dot: "dot";
4397
- none: "none";
4398
4437
  }>>;
4399
4438
  arrowSize: z.ZodOptional<z.ZodNumber>;
4400
4439
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -4508,8 +4547,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4508
4547
  right: "right";
4509
4548
  }>>;
4510
4549
  vAlign: z.ZodOptional<z.ZodEnum<{
4511
- center: "center";
4512
4550
  bottom: "bottom";
4551
+ center: "center";
4513
4552
  top: "top";
4514
4553
  }>>;
4515
4554
  styleId: z.ZodOptional<z.ZodString>;
@@ -4520,11 +4559,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4520
4559
  italic: z.ZodOptional<z.ZodBoolean>;
4521
4560
  textHeight: z.ZodOptional<z.ZodNumber>;
4522
4561
  arrowType: z.ZodOptional<z.ZodEnum<{
4562
+ dot: "dot";
4523
4563
  filled: "filled";
4564
+ none: "none";
4524
4565
  open: "open";
4525
4566
  tick: "tick";
4526
- dot: "dot";
4527
- none: "none";
4528
4567
  }>>;
4529
4568
  arrowSize: z.ZodOptional<z.ZodNumber>;
4530
4569
  }, z.core.$strip>>;
@@ -4533,10 +4572,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4533
4572
  headerRows: z.ZodDefault<z.ZodNumber>;
4534
4573
  cellMargin: z.ZodDefault<z.ZodNumber>;
4535
4574
  borders: z.ZodDefault<z.ZodEnum<{
4536
- none: "none";
4537
- rows: "rows";
4538
4575
  all: "all";
4576
+ none: "none";
4539
4577
  outer: "outer";
4578
+ rows: "rows";
4540
4579
  }>>;
4541
4580
  styleId: z.ZodOptional<z.ZodString>;
4542
4581
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -4546,11 +4585,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4546
4585
  italic: z.ZodOptional<z.ZodBoolean>;
4547
4586
  textHeight: z.ZodOptional<z.ZodNumber>;
4548
4587
  arrowType: z.ZodOptional<z.ZodEnum<{
4588
+ dot: "dot";
4549
4589
  filled: "filled";
4590
+ none: "none";
4550
4591
  open: "open";
4551
4592
  tick: "tick";
4552
- dot: "dot";
4553
- none: "none";
4554
4593
  }>>;
4555
4594
  arrowSize: z.ZodOptional<z.ZodNumber>;
4556
4595
  }, z.core.$strip>>;
@@ -4564,12 +4603,12 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4564
4603
  opacity: z.ZodOptional<z.ZodNumber>;
4565
4604
  type: z.ZodLiteral<"reference">;
4566
4605
  format: z.ZodEnum<{
4567
- linea: "linea";
4568
- dxf: "dxf";
4569
4606
  dwg: "dwg";
4607
+ dxf: "dxf";
4608
+ jpg: "jpg";
4609
+ linea: "linea";
4570
4610
  pdf: "pdf";
4571
4611
  png: "png";
4572
- jpg: "jpg";
4573
4612
  }>;
4574
4613
  name: z.ZodString;
4575
4614
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -4589,8 +4628,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4589
4628
  mirrored: z.ZodOptional<z.ZodBoolean>;
4590
4629
  pdfPage: z.ZodOptional<z.ZodNumber>;
4591
4630
  pdfMode: z.ZodOptional<z.ZodEnum<{
4592
- vector: "vector";
4593
4631
  raster: "raster";
4632
+ vector: "vector";
4594
4633
  }>>;
4595
4634
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
4596
4635
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -4620,11 +4659,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4620
4659
  italic: z.ZodOptional<z.ZodBoolean>;
4621
4660
  textHeight: z.ZodDefault<z.ZodNumber>;
4622
4661
  arrowType: z.ZodDefault<z.ZodEnum<{
4662
+ dot: "dot";
4623
4663
  filled: "filled";
4664
+ none: "none";
4624
4665
  open: "open";
4625
4666
  tick: "tick";
4626
- dot: "dot";
4627
- none: "none";
4628
4667
  }>>;
4629
4668
  arrowSize: z.ZodDefault<z.ZodNumber>;
4630
4669
  }, z.core.$strip>;
@@ -4640,11 +4679,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4640
4679
  italic: z.ZodOptional<z.ZodBoolean>;
4641
4680
  textHeight: z.ZodDefault<z.ZodNumber>;
4642
4681
  arrowType: z.ZodDefault<z.ZodEnum<{
4682
+ dot: "dot";
4643
4683
  filled: "filled";
4684
+ none: "none";
4644
4685
  open: "open";
4645
4686
  tick: "tick";
4646
- dot: "dot";
4647
- none: "none";
4648
4687
  }>>;
4649
4688
  arrowSize: z.ZodDefault<z.ZodNumber>;
4650
4689
  }, z.core.$strip>;
@@ -4665,11 +4704,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4665
4704
  italic: z.ZodOptional<z.ZodBoolean>;
4666
4705
  textHeight: z.ZodDefault<z.ZodNumber>;
4667
4706
  arrowType: z.ZodDefault<z.ZodEnum<{
4707
+ dot: "dot";
4668
4708
  filled: "filled";
4709
+ none: "none";
4669
4710
  open: "open";
4670
4711
  tick: "tick";
4671
- dot: "dot";
4672
- none: "none";
4673
4712
  }>>;
4674
4713
  arrowSize: z.ZodDefault<z.ZodNumber>;
4675
4714
  }, z.core.$strip>>;
@@ -4685,11 +4724,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4685
4724
  textHeight: z.ZodDefault<z.ZodNumber>;
4686
4725
  textOffset: z.ZodDefault<z.ZodNumber>;
4687
4726
  arrowType: z.ZodDefault<z.ZodEnum<{
4727
+ dot: "dot";
4688
4728
  filled: "filled";
4729
+ none: "none";
4689
4730
  open: "open";
4690
4731
  tick: "tick";
4691
- dot: "dot";
4692
- none: "none";
4693
4732
  }>>;
4694
4733
  arrowSize: z.ZodDefault<z.ZodNumber>;
4695
4734
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -4713,11 +4752,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4713
4752
  textHeight: z.ZodDefault<z.ZodNumber>;
4714
4753
  textOffset: z.ZodDefault<z.ZodNumber>;
4715
4754
  arrowType: z.ZodDefault<z.ZodEnum<{
4755
+ dot: "dot";
4716
4756
  filled: "filled";
4757
+ none: "none";
4717
4758
  open: "open";
4718
4759
  tick: "tick";
4719
- dot: "dot";
4720
- none: "none";
4721
4760
  }>>;
4722
4761
  arrowSize: z.ZodDefault<z.ZodNumber>;
4723
4762
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -4746,11 +4785,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4746
4785
  textHeight: z.ZodDefault<z.ZodNumber>;
4747
4786
  textOffset: z.ZodDefault<z.ZodNumber>;
4748
4787
  arrowType: z.ZodDefault<z.ZodEnum<{
4788
+ dot: "dot";
4749
4789
  filled: "filled";
4790
+ none: "none";
4750
4791
  open: "open";
4751
4792
  tick: "tick";
4752
- dot: "dot";
4753
- none: "none";
4754
4793
  }>>;
4755
4794
  arrowSize: z.ZodDefault<z.ZodNumber>;
4756
4795
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -4805,351 +4844,79 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4805
4844
  }, z.core.$strip>], "type">;
4806
4845
  type Operation = z.infer<typeof OperationSchema>;
4807
4846
 
4808
- type InvalidationListener = (ids: string[] | null) => void;
4809
- declare class DocumentKernel {
4810
- private doc;
4811
- private activeSpace;
4812
- private idIndex;
4813
- private typeIndex;
4814
- private listeners;
4815
- constructor(doc: LineaDocument);
4816
- get document(): LineaDocument;
4817
- get space(): OpSpace;
4818
- /** Replace the whole document (file open / new). Rebuilds, invalidates all. */
4819
- load(doc: LineaDocument): void;
4820
- /** Switch the active space the indexes target (model or a layout). */
4821
- setActiveSpace(space: OpSpace): void;
4822
- onInvalidate(fn: InvalidationListener): () => void;
4823
- getObject(id: string): ModelObject | undefined;
4824
- getObjectsByType<T extends ModelObjectType>(type: T): Extract<ModelObject, {
4825
- type: T;
4826
- }>[];
4827
- getLayer(id: string): Layer | undefined;
4828
- /** Objects of the active space (the index source). */
4829
- activeObjects(): ModelObject[];
4830
- /**
4831
- * Validate + apply one op, refresh indexes/caches, return the INVERSE op.
4832
- * Throws `OpError` (document untouched) on an integrity violation.
4833
- */
4834
- apply(op: Operation): Operation;
4835
- /**
4836
- * Apply a batch: validates + applies in order; on any `OpError` rolls the
4837
- * document back to the pre-batch snapshot and rethrows (nothing partially
4838
- * applied). Returns inverse ops in REVERSE order, so applying them in turn
4839
- * undoes the whole batch.
4840
- */
4841
- applyMany(ops: Operation[]): Operation[];
4842
- private rebuildIndexes;
4843
- private indexAdd;
4844
- private indexRemoveById;
4845
- private opTargetsActiveSpace;
4846
- /**
4847
- * Incrementally maintain the active-space index after an op — O(changed)
4848
- * for object ops (the interactive hot path) rather than a full rebuild.
4849
- */
4850
- private reindexForOp;
4851
- private invalidate;
4847
+ interface DxfImportOptions {
4848
+ /** mm per drawing unit; overrides the file's $INSUNITS header. */
4849
+ unitOverride?: number;
4852
4850
  }
4853
-
4854
- /** A world point in mm, as `[x, y]` or `{x, y}`. */
4855
- type PointInput = Vec2 | readonly [number, number];
4856
- /** Loose object input: model fields + `layer` (name) / `layerId` / `id`. */
4857
- type ObjectInput = {
4858
- type: ModelObjectType;
4859
- } & Record<string, unknown>;
4860
- /** Semantic, filtered read over one space's objects (all filters AND). */
4861
- interface QueryFilter {
4862
- ids?: readonly string[];
4863
- type?: ModelObjectType;
4864
- /** Layer name or id. */
4865
- layer?: string;
4866
- /** Own (override) color; objects inheriting by layer have none. */
4867
- color?: string;
4868
- /** Own (override) line type name. */
4869
- lineType?: string;
4870
- /** Substring match on text content. */
4871
- content?: string;
4872
- /** Bounds intersect this box. */
4873
- bbox?: AABB;
4874
- /** Bounds entirely inside this box. */
4875
- inside?: AABB;
4876
- /** Geometry within `tol` mm of `point`. */
4877
- near?: {
4878
- point: PointInput;
4879
- tol: number;
4880
- };
4881
- /** Search this paper layout's sheet objects (name or id — viewports,
4882
- * sheet annotations) instead of model space. */
4883
- layout?: string;
4851
+ interface DxfImportReport {
4852
+ objects: number;
4853
+ layers: number;
4854
+ layouts: number;
4855
+ objectIds: string[];
4856
+ layoutIds: string[];
4884
4857
  }
4885
- /** Per-object measurements; null where the type has no natural value. */
4886
- interface Measurement {
4887
- bbox: AABB | null;
4888
- length: number | null;
4889
- area: number | null;
4890
- }
4891
- /** A layer row as agents see it (full metadata + the current-layer flag). */
4892
- type LayerInfo = Layer & {
4893
- current: boolean;
4894
- };
4895
- interface DocumentSummary {
4896
- name: string;
4897
- objectCount: number;
4898
- byType: Record<string, number>;
4899
- byLayer: Record<string, number>;
4900
- bbox: AABB | null;
4901
- layers: string[];
4902
- layouts: {
4903
- name: string;
4904
- objectCount: number;
4905
- }[];
4906
- }
4907
- interface RenderSvgOptions {
4908
- /** Render this paper layout (name or id) instead of model space. */
4909
- layout?: string;
4910
- bbox?: AABB;
4911
- measure?: TextMeasurer;
4912
- /** Padding around the content bbox, world mm (default 5). */
4913
- padding?: number;
4914
- /** Print-style color remap ("monochrome" = everything black — use with a
4915
- * white background so light editor-theme layers stay visible). Default:
4916
- * "color" for model renders, the layout's own printPalette for layouts. */
4917
- palette?: PrintPalette;
4918
- }
4919
- interface RenderPngOptions extends RenderSvgOptions {
4920
- /** Output width in px (height follows the aspect ratio). Default 1024. */
4921
- width?: number;
4922
- /** Background fill. Default matches the dark canvas so as-authored colors
4923
- * stay visible; pass "#ffffff" / "transparent" to change. */
4924
- background?: string;
4925
- }
4926
- interface RenderPdfOptions {
4927
- /** Layouts (by name or id) to print, in page order. Default: every layout
4928
- * in document order (a layout-less document prints one auto-fitted A3). */
4929
- layouts?: readonly string[];
4930
- /** Override every page's print palette (default: each layout's own). */
4931
- palette?: PrintPalette;
4932
- }
4933
- interface ViewportOptions {
4934
- /** Frame on the sheet, mm; default: the sheet minus a 20 mm margin. */
4935
- rect?: {
4936
- x: number;
4937
- y: number;
4938
- w: number;
4939
- h: number;
4940
- };
4941
- /** `"1:50"` or the denominator; default: smallest preset that fits. */
4942
- scale?: number | string;
4943
- /** World point at the frame center; default: the model extents center. */
4944
- center?: PointInput;
4945
- }
4946
- interface LayoutOptions {
4947
- /** `"A3"` (landscape, like the editor's New Layout), `{ name, orientation }`,
4948
- * or explicit mm; default A3 landscape. */
4949
- sheet?: SheetSpec;
4950
- /** Shorthand for `viewport: { scale }` — `"1:50"` or the denominator. */
4951
- scale?: number | string;
4952
- /** One model viewport (default), or `false` for a bare sheet. */
4953
- viewport?: ViewportOptions | false;
4954
- /** Tab position; default: append. */
4955
- index?: number;
4858
+ interface PdfImportReport {
4859
+ objects: number;
4860
+ pageCount: number;
4861
+ objectIds: string[];
4956
4862
  }
4957
- interface LayoutPatch {
4958
- name?: string;
4959
- /** `"A3"` (keeps the layout's current orientation), `{ name, orientation }`,
4960
- * or explicit mm. */
4961
- sheet?: SheetSpec;
4962
- printPalette?: PrintPalette;
4863
+ interface PdfImportOptions {
4864
+ /** "vectors" (default): lines and text runs. "image": every page
4865
+ * rasterized and placed as an image at true page scale — a host
4866
+ * capability (`rasterizePdf`), refused where it is missing. */
4867
+ as?: "vectors" | "image";
4868
+ /** Bottom-left corner of the first page (image mode; default 0,0). Pages
4869
+ * line up to the right. */
4870
+ origin?: PointInput;
4963
4871
  }
4964
- interface AddOptions {
4965
- /** Target paper layout (name or id); default: model space. */
4966
- layout?: string;
4872
+ /** One PDF page rasterized: PNG pixels plus its true size in mm. */
4873
+ interface RasterPdfPage {
4874
+ dataUrl: string;
4875
+ widthMm: number;
4876
+ heightMm: number;
4967
4877
  }
4968
- /** Result of installing module sources (blocks or commands). */
4969
- type MergeReport = MergeModulesResult<{
4878
+ /** An embedded image asset as `listAssets` reports it. */
4879
+ interface AssetInfo {
4970
4880
  id: string;
4971
- name: string;
4972
- }>;
4881
+ /** From the data URL, e.g. "image/png". */
4882
+ mimeType: string;
4883
+ /** Decoded size in bytes. */
4884
+ bytes: number;
4885
+ /** Image objects (every space) that show it. */
4886
+ users: number;
4887
+ }
4973
4888
  /**
4974
- * One editable document. Every write is one validated kernel op batch; a
4975
- * `transaction` folds several into ONE undo step for whoever owns history
4976
- * (the editor when attached to one). Object writes on an editor-attached
4977
- * Drawing target the ACTIVE space unless `layout` says otherwise.
4889
+ * Where a LocalDrawing's document lives and how its edits are recorded. Absent
4890
+ * (constructed from a document), LocalDrawing owns a kernel and its own undo
4891
+ * stacks; the editor passes hooks over its live stores so agent and script
4892
+ * edits go through the mutation funnel and the user's history.
4978
4893
  */
4979
- interface Drawing$1 {
4980
- /** The document's own id (uuid stored in the .linea file). */
4981
- readonly id: string;
4982
- /** Monotonic change counter (every origin) — viewers compare to refresh. */
4983
- readonly revision: number;
4984
- /** The full validated document — a detached snapshot. */
4985
- readonly document: LineaDocument;
4986
- summary(): DocumentSummary;
4987
- /** Filtered objects — model space, or one layout via `filter.layout`. */
4988
- query(filter?: QueryFilter): ModelObject[];
4989
- /** Look up an object in ANY space. */
4990
- getObject(id: string): ModelObject | undefined;
4991
- /** bbox / curve length / enclosed area of one object (any space). */
4992
- measure(id: string): Measurement;
4993
- listLayers(): LayerInfo[];
4994
- listLayouts(): PaperLayout[];
4995
- /** Compilable block definitions (broken modules are skipped). */
4996
- listBlocks(): BlockMeta[];
4997
- /** Compilable document commands (macros travelling with the file). */
4998
- listCommands(): CommandMeta[];
4999
- /** Model space (or a layout) as an SVG string. */
5000
- renderSvg(opts?: RenderSvgOptions): string;
5001
- /** PNG bytes — optional capability (SDK: resvg; editor: browser canvas). */
5002
- renderPng?(opts?: RenderPngOptions): Promise<Uint8Array>;
5003
- /** Multi-page PDF of the layouts — optional capability (needs the host's
5004
- * fonts: the SDK and the editor have them, a bare LocalDrawing does not). */
5005
- renderPdf?(opts?: RenderPdfOptions): Promise<Uint8Array>;
5006
- /** The whole document as DXF text (async: hosts load the writer lazily). */
5007
- toDxf(): Promise<string>;
5008
- /** DWG bytes (the DXF content, wasm-transcoded; default AC1027). */
5009
- toDwg(opts?: {
5010
- version?: DwgVersion;
5011
- }): Promise<Uint8Array>;
5012
- /** The `.linea` file text. */
5013
- toJson(): string;
5014
- /** Add objects (points may be `[x, y]`; `layer` resolves by name);
5015
- * returns the created ids. */
5016
- add(objects: readonly ObjectInput[], opts?: AddOptions): string[];
5017
- /** Apply per-object patches (`{id, ...fields}`) in one undo step. */
5018
- update(entries: readonly ({
5019
- id: string;
5020
- } & Record<string, unknown>)[]): void;
5021
- /** Delete objects by id; unknown ids are skipped. Returns how many went. */
5022
- remove(ids: readonly string[]): number;
5023
- /** Draw order: move the given objects (bottom → top) to a placement. */
5024
- reorder(ids: readonly string[], placement: ReorderPlacement): void;
5025
- move(ids: readonly string[], delta: PointInput): void;
5026
- rotate(ids: readonly string[], angleRad: number, center?: PointInput): void;
5027
- scale(ids: readonly string[], factor: number, center?: PointInput): void;
5028
- mirror(ids: readonly string[], axisA: PointInput, axisB: PointInput): void;
5029
- /** Duplicate displaced by delta; returns the new ids. */
5030
- copy(ids: readonly string[], delta: PointInput): string[];
5031
- /** count TOTAL copies at multiples of delta; returns the new ids. */
5032
- array(ids: readonly string[], count: number, delta: PointInput): string[];
5033
- /** Create a paper layout; returns its id. */
5034
- createLayout(name: string, opts?: LayoutOptions): string;
5035
- /** Patch a layout's name / sheet size (mm) / print palette. */
5036
- updateLayout(nameOrId: string, patch: LayoutPatch): void;
5037
- removeLayout(nameOrId: string): void;
5038
- /** Explicit total order (names or ids) — the PDF page order. */
5039
- reorderLayouts(order: readonly string[]): void;
5040
- /** Create a layer (name unique, case-insensitive); returns its id. */
5041
- addLayer(props: {
5042
- name: string;
5043
- } & Partial<Omit<Layer, "id">>): string;
5044
- updateLayer(nameOrId: string, patch: Partial<Omit<Layer, "id">>): void;
5045
- /** Remove an EMPTY, non-current layer. */
5046
- removeLayer(nameOrId: string): void;
5047
- /** Explicit total order (names or ids, every layer exactly once). */
5048
- reorderLayers(order: readonly string[]): void;
5049
- /** The layer newly added objects default to (a mode, not an edit). */
5050
- setCurrentLayer(nameOrId: string): void;
5051
- /** Patch a document dimension style (default: the first). */
5052
- setDimStyle(patch: Partial<DimStyle>, styleId?: string): void;
5053
- /** Patch a document text style (default: the first). */
5054
- setTextStyle(patch: Partial<TextStyle>, styleId?: string): void;
5055
- /** Embed image pixels (a data URL); returns the content-keyed assetId. */
5056
- addAsset(dataUrl: string): string;
5057
- /** Remove an asset (refused while an image references it). */
5058
- removeAsset(id: string): void;
5059
- /** Merge block module sources into the document library (verbatim →
5060
- * skip, same id → replace in place, name clash → suffix). Async: awaits
5061
- * the lazy transpiler so evaluation is definitive on return. */
5062
- installBlocks(sources: readonly string[]): Promise<MergeReport>;
5063
- removeBlock(id: string): void;
5064
- installCommands(sources: readonly string[]): Promise<MergeReport>;
5065
- removeCommand(id: string): void;
5066
- /** Escape hatch: apply an already-shaped op batch (validated, atomic,
5067
- * one undo step). */
5068
- applyOps(ops: readonly Operation[]): void;
5069
- /**
5070
- * Group edits into ONE undo step. A sync `fn` commits on return, an
5071
- * async one on settle. A throw ROLLS BACK everything the transaction
5072
- * applied and rethrows. Nested calls join the outer transaction.
5073
- */
5074
- transaction<T>(fn: () => T, label?: string): T;
5075
- /** Revert / re-apply one step; false when there is nothing to do. Throws
5076
- * inside an open transaction (return or throw to roll back instead). */
4894
+ interface DrawingHooks {
4895
+ /** The live document — read only, never handed out. */
4896
+ document(): LineaDocument;
4897
+ /** Apply one validated op (throws when refused). */
4898
+ apply(op: Operation): void;
4899
+ /** One undo step for everything `fn` applies; a throw (or rejection)
4900
+ * rolls it back and rethrows. Nested calls join the outer step. */
4901
+ transaction<T>(fn: () => T): T;
4902
+ inTransaction(): boolean;
5077
4903
  undo(): boolean;
5078
4904
  redo(): boolean;
5079
- }
5080
- /** Present only when the Drawing is attached to a live editor: the parts of
5081
- * the interaction a headless host cannot offer. */
5082
- interface EditorSurface {
5083
- state(): EditorState;
5084
- setActiveSpace(space: "model" | {
5085
- layout: string;
5086
- }): void;
5087
- setSelection(ids: readonly string[]): void;
5088
- zoom(to: "fit" | "selection"): void;
5089
- /** Await one snapped world point; rejects when the user cancels. */
5090
- pickPoint(opts?: PickPointOptions): Promise<Vec2>;
5091
- /** Await one object click; resolves the object's id. */
5092
- pickObject(opts?: {
5093
- label?: string;
5094
- }): Promise<string>;
5095
- /** Await a typed value from a small input dialog; rejects on cancel. */
5096
- prompt(message: string, opts?: {
5097
- initial?: string;
5098
- placeholder?: string;
5099
- }): Promise<string>;
5100
- toast(message: string, kind?: "info" | "success" | "error"): void;
5101
- /** Registry commands + macros + insert-block entries (ids for runCommand). */
5102
- listCommands(): EditorCommandInfo[];
5103
- /** Trigger a command by id (interactive tools start and wait for the
5104
- * user; macros with declared inputs / params accept them up front —
5105
- * params passed skip the params dialog). */
5106
- runCommand(id: string, inputs?: readonly PointInput[], params?: Readonly<Record<string, unknown>>): Promise<void>;
5107
- }
5108
- interface PickPointOptions {
5109
- label?: string;
5110
- /** Rubber-band + relative typed entry from here (the previous pick). */
5111
- referencePoint?: PointInput;
5112
- }
5113
- interface EditorState {
5114
- documentId: string;
5115
- documentName: string;
5116
- space: "model" | {
5117
- layout: string;
5118
- };
5119
- selectedIds: string[];
5120
- readOnly: boolean;
5121
- canUndo: boolean;
5122
- canRedo: boolean;
5123
- }
5124
- interface EditorCommandInfo {
5125
- id: string;
5126
- label: string;
5127
- group: string;
5128
- hotkey?: string;
5129
- }
5130
-
5131
- interface DxfImportOptions {
5132
- /** mm per drawing unit; overrides the file's $INSUNITS header. */
5133
- unitOverride?: number;
5134
- }
5135
- interface DxfImportReport {
5136
- objects: number;
5137
- layers: number;
5138
- layouts: number;
5139
- objectIds: string[];
5140
- layoutIds: string[];
5141
- }
5142
- interface PdfImportReport {
5143
- objects: number;
5144
- pageCount: number;
5145
- objectIds: string[];
4905
+ canUndo(): boolean;
4906
+ canRedo(): boolean;
4907
+ /** Bumped by every change the drawing should report (agents poll it). */
4908
+ revision(): number;
4909
+ /** Text metrics for bounds and DXF (default: approximate font metrics). */
4910
+ measure?: TextMeasurer;
4911
+ /** Document-wide object lookup for block reference inputs. */
4912
+ resolveObject?: (id: string) => ModelObject | undefined;
4913
+ /** Loaded reference content (default: the drawing's referenceContent). */
4914
+ resolveReference?: (ref: ReferenceObject) => ReferenceContent | null;
4915
+ /** Snap/hit-test geometry, e.g. from a cache (default: built per call). */
4916
+ snapEntry?: (obj: ModelObject) => SnapCacheEntry;
5146
4917
  }
5147
4918
  declare class LocalDrawing implements Drawing$1 {
5148
- protected kernel: DocumentKernel;
5149
- private undoStack;
5150
- private redoStack;
5151
- private txn;
5152
- private rev;
4919
+ private hooks;
5153
4920
  /** Schema-version migration applied on open; null when none was needed. */
5154
4921
  readonly migration: {
5155
4922
  from: number;
@@ -5163,11 +4930,13 @@ declare class LocalDrawing implements Drawing$1 {
5163
4930
  * snap as frames. docs/references.md. */
5164
4931
  protected referenceContent: Map<string, ReferenceContent>;
5165
4932
  private resolveReference;
5166
- constructor(doc: LineaDocument, migration?: {
4933
+ /** A document (owned here: kernel + undo stacks), or hooks over a document
4934
+ * that lives elsewhere (the editor's stores). */
4935
+ constructor(source: LineaDocument | DrawingHooks, migration?: {
5167
4936
  from: number;
5168
4937
  to: number;
5169
4938
  } | null);
5170
- /** The live kernel state — internal reads only; NEVER handed out. */
4939
+ /** The live document — internal reads only; NEVER handed out. */
5171
4940
  protected get state(): LineaDocument;
5172
4941
  get id(): string;
5173
4942
  get revision(): number;
@@ -5221,13 +4990,46 @@ declare class LocalDrawing implements Drawing$1 {
5221
4990
  addAsset(dataUrl: string): string;
5222
4991
  /** Remove an asset (the kernel refuses while an image references it). */
5223
4992
  removeAsset(id: string): void;
5224
- private patchedStyle;
5225
- /** Patch a document dimension style (default: the first). */
4993
+ listAssets(): AssetInfo[];
4994
+ /** Merge DXF text into the document (new layers, objects, layouts). */
4995
+ importDxfText(text: string, opts?: DxfImportOptions): DxfImportReport;
4996
+ /** Merge DWG bytes into the document (wasm transcode → the DXF path). */
4997
+ importDwgData(data: Uint8Array, opts?: DxfImportOptions): Promise<DxfImportReport>;
4998
+ /** Merge a PDF: its vector/text content onto the current layer, or
4999
+ * (`as: "image"`) every page as an image at true page scale. */
5000
+ importPdfData(data: ArrayBuffer | Uint8Array, opts?: PdfImportOptions): Promise<PdfImportReport>;
5001
+ /** Host capability: every PDF page rasterized. Absent → PDF-as-image
5002
+ * import is refused (headless Node, until it has a rasterizer). */
5003
+ rasterizePdf?(data: ArrayBuffer | Uint8Array): Promise<RasterPdfPage[]>;
5004
+ /** pdf.js worker URL for hosts that need one (the browser). */
5005
+ protected pdfWorkerSrc?: string;
5006
+ private resolveStyle;
5007
+ private assertStyleName;
5008
+ listTextStyles(): TextStyle[];
5009
+ listDimStyles(): DimStyle[];
5010
+ /** Create a text style (unique name; unset fields take the defaults);
5011
+ * returns its id. */
5012
+ addTextStyle(props: {
5013
+ name: string;
5014
+ } & Partial<Omit<TextStyle, "id">>): string;
5015
+ updateTextStyle(nameOrId: string, patch: Partial<Omit<TextStyle, "id">>): void;
5016
+ /** Remove a text style no object uses (the kernel refuses otherwise). */
5017
+ removeTextStyle(nameOrId: string): void;
5018
+ /** Create a dimension style (unique name; unset fields take the
5019
+ * defaults); returns its id. */
5020
+ addDimStyle(props: {
5021
+ name: string;
5022
+ } & Partial<Omit<DimStyle, "id">>): string;
5023
+ updateDimStyle(nameOrId: string, patch: Partial<Omit<DimStyle, "id">>): void;
5024
+ /** Remove a dimension style no dimension uses (the kernel refuses
5025
+ * otherwise). */
5026
+ removeDimStyle(nameOrId: string): void;
5027
+ /** @deprecated Use updateDimStyle (default here: the first style). */
5226
5028
  setDimStyle(patch: Partial<DimStyle>, styleId?: string): void;
5227
5029
  /** Replace the document's dimension styles (min 1; objects reference by
5228
5030
  * id). Diffed into granular per-style ops. */
5229
5031
  setDimStyles(styles: DimStyle[]): void;
5230
- /** Patch a document text style (default: the first). */
5032
+ /** @deprecated Use updateTextStyle (default here: the first style). */
5231
5033
  setTextStyle(patch: Partial<TextStyle>, styleId?: string): void;
5232
5034
  /** Replace the document's text styles (min 1; objects reference by id).
5233
5035
  * Diffed into granular per-style ops. */
@@ -5243,15 +5045,15 @@ declare class LocalDrawing implements Drawing$1 {
5243
5045
  /** Replace the document's command modules (same rules as blocks). */
5244
5046
  setCommands(defs: unknown[]): Promise<void>;
5245
5047
  /** Compilable block definitions (broken modules are skipped). */
5246
- listBlocks(): BlockMeta[];
5048
+ listBlockDefinitions(): BlockMeta[];
5247
5049
  /** Compilable document commands (broken modules are skipped). */
5248
- listCommands(): CommandMeta[];
5249
- installBlocks(sources: readonly string[]): Promise<MergeReport>;
5250
- installCommands(sources: readonly string[]): Promise<MergeReport>;
5050
+ listUserCommands(): CommandMeta[];
5051
+ addBlockDefinitions(sources: readonly string[]): Promise<MergeReport>;
5052
+ addUserCommands(sources: readonly string[]): Promise<MergeReport>;
5251
5053
  /** Remove a block module by its exported id (unknown id → error). */
5252
- removeBlock(id: string): void;
5054
+ removeBlockDefinition(id: string): void;
5253
5055
  /** Remove a command module by its exported id (unknown id → error). */
5254
- removeCommand(id: string): void;
5056
+ removeUserCommand(id: string): void;
5255
5057
  /**
5256
5058
  * Resolves when block scripts evaluate definitively (the transpiler is
5257
5059
  * loaded). Await this before sync reads/renders of a document that was
@@ -5267,7 +5069,7 @@ declare class LocalDrawing implements Drawing$1 {
5267
5069
  * Create a paper layout — by default A3 landscape with one viewport fitted
5268
5070
  * to the model extents. Returns the layout id.
5269
5071
  */
5270
- createLayout(name: string, opts?: LayoutOptions): string;
5072
+ addLayout(name: string, opts?: LayoutOptions): string;
5271
5073
  /** Remove a layout by name or id. */
5272
5074
  removeLayout(nameOrId: string): void;
5273
5075
  /** Reorder the layouts (names or ids, every layout exactly once). Layout
@@ -5310,7 +5112,10 @@ declare class LocalDrawing implements Drawing$1 {
5310
5112
  * by `delta`. Returns the new ids, one batch per step, in one undo step.
5311
5113
  */
5312
5114
  array(ids: readonly string[], count: number, delta: PointInput): string[];
5115
+ private get measurer();
5116
+ private resolveObject;
5313
5117
  private ctx;
5118
+ private entryOf;
5314
5119
  private boundsOf;
5315
5120
  /** Union bounds of the given objects; null when nothing has bounds. */
5316
5121
  bboxOf(ids: readonly string[]): AABB | null;
@@ -5330,25 +5135,17 @@ declare class LocalDrawing implements Drawing$1 {
5330
5135
  private distanceTo;
5331
5136
  /** Query model-space objects — or one paper layout's sheet objects
5332
5137
  * (viewports, annotations) via `filter.layout`. */
5333
- query(filter?: QueryFilter): ModelObject[];
5138
+ listObjects(filter?: QueryFilter): ModelObject[];
5334
5139
  summary(): DocumentSummary;
5335
5140
  protected paintContext(): {
5336
5141
  objects: ({
5337
5142
  id: string;
5338
5143
  layerId: string;
5339
- type: "point";
5340
- p: {
5341
- x: number;
5342
- y: number;
5343
- };
5344
5144
  color?: string | undefined;
5345
5145
  lineType?: string | undefined;
5346
5146
  lineTypeScale?: number | undefined;
5347
5147
  lineWidth?: number | undefined;
5348
5148
  opacity?: number | undefined;
5349
- } | {
5350
- id: string;
5351
- layerId: string;
5352
5149
  type: "line";
5353
5150
  a: {
5354
5151
  x: number;
@@ -5358,14 +5155,27 @@ declare class LocalDrawing implements Drawing$1 {
5358
5155
  x: number;
5359
5156
  y: number;
5360
5157
  };
5158
+ } | {
5159
+ id: string;
5160
+ layerId: string;
5361
5161
  color?: string | undefined;
5362
5162
  lineType?: string | undefined;
5363
5163
  lineTypeScale?: number | undefined;
5364
5164
  lineWidth?: number | undefined;
5365
5165
  opacity?: number | undefined;
5166
+ type: "point";
5167
+ p: {
5168
+ x: number;
5169
+ y: number;
5170
+ };
5366
5171
  } | {
5367
5172
  id: string;
5368
5173
  layerId: string;
5174
+ color?: string | undefined;
5175
+ lineType?: string | undefined;
5176
+ lineTypeScale?: number | undefined;
5177
+ lineWidth?: number | undefined;
5178
+ opacity?: number | undefined;
5369
5179
  type: "polyline";
5370
5180
  points: {
5371
5181
  x: number;
@@ -5373,28 +5183,28 @@ declare class LocalDrawing implements Drawing$1 {
5373
5183
  bulge: number;
5374
5184
  }[];
5375
5185
  closed: boolean;
5186
+ } | {
5187
+ id: string;
5188
+ layerId: string;
5376
5189
  color?: string | undefined;
5377
5190
  lineType?: string | undefined;
5378
5191
  lineTypeScale?: number | undefined;
5379
5192
  lineWidth?: number | undefined;
5380
5193
  opacity?: number | undefined;
5381
- } | {
5382
- id: string;
5383
- layerId: string;
5384
5194
  type: "circle";
5385
5195
  center: {
5386
5196
  x: number;
5387
5197
  y: number;
5388
5198
  };
5389
5199
  radius: number;
5200
+ } | {
5201
+ id: string;
5202
+ layerId: string;
5390
5203
  color?: string | undefined;
5391
5204
  lineType?: string | undefined;
5392
5205
  lineTypeScale?: number | undefined;
5393
5206
  lineWidth?: number | undefined;
5394
5207
  opacity?: number | undefined;
5395
- } | {
5396
- id: string;
5397
- layerId: string;
5398
5208
  type: "arc";
5399
5209
  center: {
5400
5210
  x: number;
@@ -5403,14 +5213,14 @@ declare class LocalDrawing implements Drawing$1 {
5403
5213
  radius: number;
5404
5214
  startAngle: number;
5405
5215
  endAngle: number;
5216
+ } | {
5217
+ id: string;
5218
+ layerId: string;
5406
5219
  color?: string | undefined;
5407
5220
  lineType?: string | undefined;
5408
5221
  lineTypeScale?: number | undefined;
5409
5222
  lineWidth?: number | undefined;
5410
5223
  opacity?: number | undefined;
5411
- } | {
5412
- id: string;
5413
- layerId: string;
5414
5224
  type: "ellipse";
5415
5225
  center: {
5416
5226
  x: number;
@@ -5423,14 +5233,14 @@ declare class LocalDrawing implements Drawing$1 {
5423
5233
  ratio: number;
5424
5234
  startAngle: number;
5425
5235
  endAngle: number;
5236
+ } | {
5237
+ id: string;
5238
+ layerId: string;
5426
5239
  color?: string | undefined;
5427
5240
  lineType?: string | undefined;
5428
5241
  lineTypeScale?: number | undefined;
5429
5242
  lineWidth?: number | undefined;
5430
5243
  opacity?: number | undefined;
5431
- } | {
5432
- id: string;
5433
- layerId: string;
5434
5244
  type: "hatch";
5435
5245
  loops: {
5436
5246
  points: {
@@ -5458,14 +5268,14 @@ declare class LocalDrawing implements Drawing$1 {
5458
5268
  angle: number;
5459
5269
  };
5460
5270
  scale: number;
5271
+ } | {
5272
+ id: string;
5273
+ layerId: string;
5461
5274
  color?: string | undefined;
5462
5275
  lineType?: string | undefined;
5463
5276
  lineTypeScale?: number | undefined;
5464
5277
  lineWidth?: number | undefined;
5465
5278
  opacity?: number | undefined;
5466
- } | {
5467
- id: string;
5468
- layerId: string;
5469
5279
  type: "text";
5470
5280
  position: {
5471
5281
  x: number;
@@ -5476,17 +5286,10 @@ declare class LocalDrawing implements Drawing$1 {
5476
5286
  x: number;
5477
5287
  y: number;
5478
5288
  }[][];
5479
- hAlign: "center" | "left" | "right";
5480
- vAlign: "center" | "bottom" | "top";
5481
- rotation: number;
5482
- scale: number;
5483
- color?: string | undefined;
5484
- lineType?: string | undefined;
5485
- lineTypeScale?: number | undefined;
5486
- lineWidth?: number | undefined;
5487
- opacity?: number | undefined;
5488
5289
  width?: number | undefined;
5489
- frame?: "circle" | "none" | "bottom" | "rectangle" | "slot" | "firstLine" | undefined;
5290
+ hAlign: "center" | "left" | "right";
5291
+ vAlign: "bottom" | "center" | "top";
5292
+ frame?: "bottom" | "circle" | "firstLine" | "none" | "rectangle" | "slot" | undefined;
5490
5293
  styleId?: string | undefined;
5491
5294
  styleOverride?: {
5492
5295
  font?: string | undefined;
@@ -5494,14 +5297,21 @@ declare class LocalDrawing implements Drawing$1 {
5494
5297
  bold?: boolean | undefined;
5495
5298
  italic?: boolean | undefined;
5496
5299
  textHeight?: number | undefined;
5497
- arrowType?: "filled" | "open" | "tick" | "dot" | "none" | undefined;
5300
+ arrowType?: "dot" | "filled" | "none" | "open" | "tick" | undefined;
5498
5301
  arrowSize?: number | undefined;
5499
5302
  } | undefined;
5303
+ rotation: number;
5304
+ scale: number;
5500
5305
  } | {
5501
5306
  id: string;
5502
5307
  layerId: string;
5308
+ color?: string | undefined;
5309
+ lineType?: string | undefined;
5310
+ lineTypeScale?: number | undefined;
5311
+ lineWidth?: number | undefined;
5312
+ opacity?: number | undefined;
5503
5313
  type: "dimension";
5504
- kind: "linear" | "radial" | "angular" | "diameter";
5314
+ kind: "angular" | "diameter" | "linear" | "radial";
5505
5315
  points: {
5506
5316
  x: number;
5507
5317
  y: number;
@@ -5510,12 +5320,6 @@ declare class LocalDrawing implements Drawing$1 {
5510
5320
  x: number;
5511
5321
  y: number;
5512
5322
  };
5513
- scale: number;
5514
- color?: string | undefined;
5515
- lineType?: string | undefined;
5516
- lineTypeScale?: number | undefined;
5517
- lineWidth?: number | undefined;
5518
- opacity?: number | undefined;
5519
5323
  textOverride?: string | undefined;
5520
5324
  styleId?: string | undefined;
5521
5325
  styleOverride?: {
@@ -5525,16 +5329,22 @@ declare class LocalDrawing implements Drawing$1 {
5525
5329
  italic?: boolean | undefined;
5526
5330
  textHeight?: number | undefined;
5527
5331
  textOffset?: number | undefined;
5528
- arrowType?: "filled" | "open" | "tick" | "dot" | "none" | undefined;
5332
+ arrowType?: "dot" | "filled" | "none" | "open" | "tick" | undefined;
5529
5333
  arrowSize?: number | undefined;
5530
5334
  extensionType?: "long" | "short" | undefined;
5531
5335
  extensionOffset?: number | undefined;
5532
5336
  extensionOvershoot?: number | undefined;
5533
5337
  precision?: number | undefined;
5534
5338
  } | undefined;
5339
+ scale: number;
5535
5340
  } | {
5536
5341
  id: string;
5537
5342
  layerId: string;
5343
+ color?: string | undefined;
5344
+ lineType?: string | undefined;
5345
+ lineTypeScale?: number | undefined;
5346
+ lineWidth?: number | undefined;
5347
+ opacity?: number | undefined;
5538
5348
  type: "block";
5539
5349
  definitionId: string;
5540
5350
  rotation: number;
@@ -5544,14 +5354,53 @@ declare class LocalDrawing implements Drawing$1 {
5544
5354
  x: number;
5545
5355
  y: number;
5546
5356
  })[];
5357
+ } | {
5358
+ id: string;
5359
+ layerId: string;
5547
5360
  color?: string | undefined;
5548
5361
  lineType?: string | undefined;
5549
5362
  lineTypeScale?: number | undefined;
5550
5363
  lineWidth?: number | undefined;
5551
5364
  opacity?: number | undefined;
5365
+ type: "image";
5366
+ assetId: string;
5367
+ origin: {
5368
+ x: number;
5369
+ y: number;
5370
+ };
5371
+ width: number;
5372
+ height: number;
5373
+ rotation: number;
5552
5374
  } | {
5553
5375
  id: string;
5554
5376
  layerId: string;
5377
+ color?: string | undefined;
5378
+ lineType?: string | undefined;
5379
+ lineTypeScale?: number | undefined;
5380
+ lineWidth?: number | undefined;
5381
+ opacity?: number | undefined;
5382
+ type: "viewport";
5383
+ rect: {
5384
+ x: number;
5385
+ y: number;
5386
+ w: number;
5387
+ h: number;
5388
+ };
5389
+ modelCenter: {
5390
+ x: number;
5391
+ y: number;
5392
+ };
5393
+ scale: number;
5394
+ locked: boolean;
5395
+ hiddenLayerIds: string[];
5396
+ } | {
5397
+ id: string;
5398
+ layerId: string;
5399
+ color?: string | undefined;
5400
+ lineType?: string | undefined;
5401
+ lineTypeScale?: number | undefined;
5402
+ lineWidth?: number | undefined;
5403
+ opacity?: number | undefined;
5555
5404
  type: "comment";
5556
5405
  position: {
5557
5406
  x: number;
@@ -5559,14 +5408,14 @@ declare class LocalDrawing implements Drawing$1 {
5559
5408
  };
5560
5409
  text: string;
5561
5410
  tags: string[];
5411
+ } | {
5412
+ id: string;
5413
+ layerId: string;
5562
5414
  color?: string | undefined;
5563
5415
  lineType?: string | undefined;
5564
5416
  lineTypeScale?: number | undefined;
5565
5417
  lineWidth?: number | undefined;
5566
5418
  opacity?: number | undefined;
5567
- } | {
5568
- id: string;
5569
- layerId: string;
5570
5419
  type: "table";
5571
5420
  position: {
5572
5421
  x: number;
@@ -5585,7 +5434,7 @@ declare class LocalDrawing implements Drawing$1 {
5585
5434
  rows: number;
5586
5435
  } | undefined;
5587
5436
  hAlign?: "center" | "left" | "right" | undefined;
5588
- vAlign?: "center" | "bottom" | "top" | undefined;
5437
+ vAlign?: "bottom" | "center" | "top" | undefined;
5589
5438
  styleId?: string | undefined;
5590
5439
  styleOverride?: {
5591
5440
  font?: string | undefined;
@@ -5593,19 +5442,14 @@ declare class LocalDrawing implements Drawing$1 {
5593
5442
  bold?: boolean | undefined;
5594
5443
  italic?: boolean | undefined;
5595
5444
  textHeight?: number | undefined;
5596
- arrowType?: "filled" | "open" | "tick" | "dot" | "none" | undefined;
5445
+ arrowType?: "dot" | "filled" | "none" | "open" | "tick" | undefined;
5597
5446
  arrowSize?: number | undefined;
5598
5447
  } | undefined;
5599
5448
  color?: string | undefined;
5600
5449
  }[][];
5601
5450
  headerRows: number;
5602
5451
  cellMargin: number;
5603
- borders: "none" | "rows" | "all" | "outer";
5604
- color?: string | undefined;
5605
- lineType?: string | undefined;
5606
- lineTypeScale?: number | undefined;
5607
- lineWidth?: number | undefined;
5608
- opacity?: number | undefined;
5452
+ borders: "all" | "none" | "outer" | "rows";
5609
5453
  styleId?: string | undefined;
5610
5454
  styleOverride?: {
5611
5455
  font?: string | undefined;
@@ -5613,53 +5457,19 @@ declare class LocalDrawing implements Drawing$1 {
5613
5457
  bold?: boolean | undefined;
5614
5458
  italic?: boolean | undefined;
5615
5459
  textHeight?: number | undefined;
5616
- arrowType?: "filled" | "open" | "tick" | "dot" | "none" | undefined;
5460
+ arrowType?: "dot" | "filled" | "none" | "open" | "tick" | undefined;
5617
5461
  arrowSize?: number | undefined;
5618
5462
  } | undefined;
5619
5463
  } | {
5620
5464
  id: string;
5621
5465
  layerId: string;
5622
- type: "viewport";
5623
- rect: {
5624
- x: number;
5625
- y: number;
5626
- w: number;
5627
- h: number;
5628
- };
5629
- modelCenter: {
5630
- x: number;
5631
- y: number;
5632
- };
5633
- scale: number;
5634
- locked: boolean;
5635
- hiddenLayerIds: string[];
5636
5466
  color?: string | undefined;
5637
5467
  lineType?: string | undefined;
5638
5468
  lineTypeScale?: number | undefined;
5639
5469
  lineWidth?: number | undefined;
5640
5470
  opacity?: number | undefined;
5641
- } | {
5642
- id: string;
5643
- layerId: string;
5644
- type: "image";
5645
- assetId: string;
5646
- origin: {
5647
- x: number;
5648
- y: number;
5649
- };
5650
- width: number;
5651
- height: number;
5652
- rotation: number;
5653
- color?: string | undefined;
5654
- lineType?: string | undefined;
5655
- lineTypeScale?: number | undefined;
5656
- lineWidth?: number | undefined;
5657
- opacity?: number | undefined;
5658
- } | {
5659
- id: string;
5660
- layerId: string;
5661
5471
  type: "reference";
5662
- format: "linea" | "dxf" | "dwg" | "pdf" | "png" | "jpg";
5472
+ format: "dwg" | "dxf" | "jpg" | "linea" | "pdf" | "png";
5663
5473
  name: string;
5664
5474
  source: {
5665
5475
  kind: "path";
@@ -5675,15 +5485,10 @@ declare class LocalDrawing implements Drawing$1 {
5675
5485
  };
5676
5486
  rotation: number;
5677
5487
  scale: number;
5678
- hiddenLayers: string[];
5679
- color?: string | undefined;
5680
- lineType?: string | undefined;
5681
- lineTypeScale?: number | undefined;
5682
- lineWidth?: number | undefined;
5683
- opacity?: number | undefined;
5684
5488
  mirrored?: boolean | undefined;
5685
5489
  pdfPage?: number | undefined;
5686
- pdfMode?: "vector" | "raster" | undefined;
5490
+ pdfMode?: "raster" | "vector" | undefined;
5491
+ hiddenLayers: string[];
5687
5492
  hidden?: boolean | undefined;
5688
5493
  locked?: boolean | undefined;
5689
5494
  clip?: {
@@ -5715,27 +5520,27 @@ declare class LocalDrawing implements Drawing$1 {
5715
5520
  name: string;
5716
5521
  font: string;
5717
5522
  widthFactor: number;
5523
+ bold?: boolean | undefined;
5524
+ italic?: boolean | undefined;
5718
5525
  textHeight: number;
5719
5526
  textOffset: number;
5720
- arrowType: "filled" | "open" | "tick" | "dot" | "none";
5527
+ arrowType: "dot" | "filled" | "none" | "open" | "tick";
5721
5528
  arrowSize: number;
5722
5529
  extensionType: "long" | "short";
5723
5530
  extensionOffset: number;
5724
5531
  extensionOvershoot: number;
5725
5532
  precision: number;
5726
- bold?: boolean | undefined;
5727
- italic?: boolean | undefined;
5728
5533
  }[];
5729
5534
  textStyles: {
5730
5535
  id: string;
5731
5536
  name: string;
5732
5537
  font: string;
5733
5538
  widthFactor: number;
5734
- textHeight: number;
5735
- arrowType: "filled" | "open" | "tick" | "dot" | "none";
5736
- arrowSize: number;
5737
5539
  bold?: boolean | undefined;
5738
5540
  italic?: boolean | undefined;
5541
+ textHeight: number;
5542
+ arrowType: "dot" | "filled" | "none" | "open" | "tick";
5543
+ arrowSize: number;
5739
5544
  }[];
5740
5545
  blockDefinitions: string[];
5741
5546
  resolveObject: (id: string) => ModelObject | undefined;
@@ -5754,13 +5559,317 @@ declare class LocalDrawing implements Drawing$1 {
5754
5559
  toDwg(opts?: {
5755
5560
  version?: DwgVersion;
5756
5561
  }): Promise<Uint8Array>;
5757
- toJson(): string;
5758
- /** Merge DXF text into the document (new layers, objects, layouts). */
5562
+ toLinea(): string;
5563
+ }
5564
+
5565
+ /** A world point in mm, as `[x, y]` or `{x, y}`. */
5566
+ type PointInput = Vec2 | readonly [number, number];
5567
+ /** Loose object input: model fields + `layer` (name) / `layerId` / `id`. */
5568
+ type ObjectInput = {
5569
+ type: ModelObjectType;
5570
+ } & Record<string, unknown>;
5571
+ /** Semantic, filtered read over one space's objects (all filters AND). */
5572
+ interface QueryFilter {
5573
+ ids?: readonly string[];
5574
+ type?: ModelObjectType;
5575
+ /** Layer name or id. */
5576
+ layer?: string;
5577
+ /** Own (override) color; objects inheriting by layer have none. */
5578
+ color?: string;
5579
+ /** Own (override) line type name. */
5580
+ lineType?: string;
5581
+ /** Substring match on text content. */
5582
+ content?: string;
5583
+ /** Bounds intersect this box. */
5584
+ bbox?: AABB;
5585
+ /** Bounds entirely inside this box. */
5586
+ inside?: AABB;
5587
+ /** Geometry within `tol` mm of `point`. */
5588
+ near?: {
5589
+ point: PointInput;
5590
+ tol: number;
5591
+ };
5592
+ /** Search this paper layout's sheet objects (name or id — viewports,
5593
+ * sheet annotations) instead of model space. */
5594
+ layout?: string;
5595
+ }
5596
+ /** Per-object measurements; null where the type has no natural value. */
5597
+ interface Measurement {
5598
+ bbox: AABB | null;
5599
+ length: number | null;
5600
+ area: number | null;
5601
+ }
5602
+ /** A layer row as agents see it (full metadata + the current-layer flag). */
5603
+ type LayerInfo = Layer & {
5604
+ current: boolean;
5605
+ };
5606
+ interface DocumentSummary {
5607
+ name: string;
5608
+ objectCount: number;
5609
+ byType: Record<string, number>;
5610
+ byLayer: Record<string, number>;
5611
+ bbox: AABB | null;
5612
+ layers: string[];
5613
+ layouts: {
5614
+ name: string;
5615
+ objectCount: number;
5616
+ }[];
5617
+ }
5618
+ interface RenderSvgOptions {
5619
+ /** Render this paper layout (name or id) instead of model space. */
5620
+ layout?: string;
5621
+ bbox?: AABB;
5622
+ measure?: TextMeasurer;
5623
+ /** Padding around the content bbox, world mm (default 5). */
5624
+ padding?: number;
5625
+ /** Print-style color remap ("monochrome" = everything black — use with a
5626
+ * white background so light editor-theme layers stay visible). Default:
5627
+ * "color" for model renders, the layout's own printPalette for layouts. */
5628
+ palette?: PrintPalette;
5629
+ }
5630
+ interface RenderPngOptions extends RenderSvgOptions {
5631
+ /** Output width in px (height follows the aspect ratio). Default 1024. */
5632
+ width?: number;
5633
+ /** Background fill. Default matches the dark canvas so as-authored colors
5634
+ * stay visible; pass "#ffffff" / "transparent" to change. */
5635
+ background?: string;
5636
+ }
5637
+ interface RenderPdfOptions {
5638
+ /** Layouts (by name or id) to print, in page order. Default: every layout
5639
+ * in document order (a layout-less document prints one auto-fitted A3). */
5640
+ layouts?: readonly string[];
5641
+ /** Override every page's print palette (default: each layout's own). */
5642
+ palette?: PrintPalette;
5643
+ }
5644
+ interface ViewportOptions {
5645
+ /** Frame on the sheet, mm; default: the sheet minus a 20 mm margin. */
5646
+ rect?: {
5647
+ x: number;
5648
+ y: number;
5649
+ w: number;
5650
+ h: number;
5651
+ };
5652
+ /** `"1:50"` or the denominator; default: smallest preset that fits. */
5653
+ scale?: number | string;
5654
+ /** World point at the frame center; default: the model extents center. */
5655
+ center?: PointInput;
5656
+ }
5657
+ interface LayoutOptions {
5658
+ /** `"A3"` (landscape, like the editor's New Layout), `{ name, orientation }`,
5659
+ * or explicit mm; default A3 landscape. */
5660
+ sheet?: SheetSpec;
5661
+ /** Shorthand for `viewport: { scale }` — `"1:50"` or the denominator. */
5662
+ scale?: number | string;
5663
+ /** One model viewport (default), or `false` for a bare sheet. */
5664
+ viewport?: ViewportOptions | false;
5665
+ /** Tab position; default: append. */
5666
+ index?: number;
5667
+ }
5668
+ interface LayoutPatch {
5669
+ name?: string;
5670
+ /** `"A3"` (keeps the layout's current orientation), `{ name, orientation }`,
5671
+ * or explicit mm. */
5672
+ sheet?: SheetSpec;
5673
+ printPalette?: PrintPalette;
5674
+ }
5675
+ interface AddOptions {
5676
+ /** Target paper layout (name or id); default: model space. */
5677
+ layout?: string;
5678
+ }
5679
+ /** Result of installing module sources (blocks or commands). */
5680
+ type MergeReport = MergeModulesResult<{
5681
+ id: string;
5682
+ name: string;
5683
+ }>;
5684
+ /**
5685
+ * One editable document. Every write is one validated kernel op batch; a
5686
+ * `transaction` folds several into ONE undo step for whoever owns history
5687
+ * (the editor when attached to one). Object writes go to model space unless
5688
+ * `layout` names a paper layout — in every host, whatever the user has open
5689
+ * (docs/adr/0003). One implementation: LocalDrawing.
5690
+ */
5691
+ interface Drawing$1 {
5692
+ /** The document's own id (uuid stored in the .linea file). */
5693
+ readonly id: string;
5694
+ /** Monotonic change counter (every origin) — viewers compare to refresh. */
5695
+ readonly revision: number;
5696
+ /** The full validated document — a detached snapshot. */
5697
+ readonly document: LineaDocument;
5698
+ summary(): DocumentSummary;
5699
+ /** Filtered objects — model space, or one layout via `filter.layout`. */
5700
+ listObjects(filter?: QueryFilter): ModelObject[];
5701
+ /** Look up an object in ANY space. */
5702
+ getObject(id: string): ModelObject | undefined;
5703
+ /** bbox / curve length / enclosed area of one object (any space). */
5704
+ measure(id: string): Measurement;
5705
+ listLayers(): LayerInfo[];
5706
+ listLayouts(): PaperLayout[];
5707
+ /** Compilable block definitions (broken modules are skipped). */
5708
+ listBlockDefinitions(): BlockMeta[];
5709
+ /** Compilable document commands (macros travelling with the file). */
5710
+ listUserCommands(): CommandMeta[];
5711
+ /** Model space (or a layout) as an SVG string. */
5712
+ renderSvg(opts?: RenderSvgOptions): string;
5713
+ /** PNG bytes — optional capability (SDK: resvg; editor: browser canvas). */
5714
+ renderPng?(opts?: RenderPngOptions): Promise<Uint8Array>;
5715
+ /** Multi-page PDF of the layouts — optional capability (needs the host's
5716
+ * fonts: the SDK and the editor have them, a bare LocalDrawing does not). */
5717
+ renderPdf?(opts?: RenderPdfOptions): Promise<Uint8Array>;
5718
+ /** The whole document as DXF text (async: hosts load the writer lazily). */
5719
+ toDxf(): Promise<string>;
5720
+ /** DWG bytes (the DXF content, wasm-transcoded; default AC1027). */
5721
+ toDwg(opts?: {
5722
+ version?: DwgVersion;
5723
+ }): Promise<Uint8Array>;
5724
+ /** The `.linea` file text. */
5725
+ toLinea(): string;
5726
+ /** Add objects (points may be `[x, y]`; `layer` resolves by name);
5727
+ * returns the created ids. */
5728
+ add(objects: readonly ObjectInput[], opts?: AddOptions): string[];
5729
+ /** Apply per-object patches (`{id, ...fields}`) in one undo step. */
5730
+ update(entries: readonly ({
5731
+ id: string;
5732
+ } & Record<string, unknown>)[]): void;
5733
+ /** Delete objects by id; unknown ids are skipped. Returns how many went. */
5734
+ remove(ids: readonly string[]): number;
5735
+ /** Draw order: move the given objects (bottom → top) to a placement. */
5736
+ reorder(ids: readonly string[], placement: ReorderPlacement): void;
5737
+ move(ids: readonly string[], delta: PointInput): void;
5738
+ rotate(ids: readonly string[], angleRad: number, center?: PointInput): void;
5739
+ scale(ids: readonly string[], factor: number, center?: PointInput): void;
5740
+ mirror(ids: readonly string[], axisA: PointInput, axisB: PointInput): void;
5741
+ /** Duplicate displaced by delta; returns the new ids. */
5742
+ copy(ids: readonly string[], delta: PointInput): string[];
5743
+ /** count TOTAL copies at multiples of delta; returns the new ids. */
5744
+ array(ids: readonly string[], count: number, delta: PointInput): string[];
5745
+ /** Create a paper layout; returns its id. */
5746
+ addLayout(name: string, opts?: LayoutOptions): string;
5747
+ /** Patch a layout's name / sheet size (mm) / print palette. */
5748
+ updateLayout(nameOrId: string, patch: LayoutPatch): void;
5749
+ removeLayout(nameOrId: string): void;
5750
+ /** Explicit total order (names or ids) — the PDF page order. */
5751
+ reorderLayouts(order: readonly string[]): void;
5752
+ /** Create a layer (name unique, case-insensitive); returns its id. */
5753
+ addLayer(props: {
5754
+ name: string;
5755
+ } & Partial<Omit<Layer, "id">>): string;
5756
+ updateLayer(nameOrId: string, patch: Partial<Omit<Layer, "id">>): void;
5757
+ /** Remove an EMPTY, non-current layer. */
5758
+ removeLayer(nameOrId: string): void;
5759
+ /** Explicit total order (names or ids, every layer exactly once). */
5760
+ reorderLayers(order: readonly string[]): void;
5761
+ /** The layer newly added objects default to (a mode, not an edit). */
5762
+ setCurrentLayer(nameOrId: string): void;
5763
+ listTextStyles(): TextStyle[];
5764
+ listDimStyles(): DimStyle[];
5765
+ /** Create a style (name unique, case-insensitive; unset fields take the
5766
+ * defaults); returns its id. Styles are addressed by name or id. */
5767
+ addTextStyle(props: {
5768
+ name: string;
5769
+ } & Partial<Omit<TextStyle, "id">>): string;
5770
+ updateTextStyle(nameOrId: string, patch: Partial<Omit<TextStyle, "id">>): void;
5771
+ /** Remove a style no object resolves to (else refused, with a count). */
5772
+ removeTextStyle(nameOrId: string): void;
5773
+ addDimStyle(props: {
5774
+ name: string;
5775
+ } & Partial<Omit<DimStyle, "id">>): string;
5776
+ updateDimStyle(nameOrId: string, patch: Partial<Omit<DimStyle, "id">>): void;
5777
+ removeDimStyle(nameOrId: string): void;
5778
+ /** @deprecated Use updateDimStyle (default here: the first style). */
5779
+ setDimStyle(patch: Partial<DimStyle>, styleId?: string): void;
5780
+ /** @deprecated Use updateTextStyle (default here: the first style). */
5781
+ setTextStyle(patch: Partial<TextStyle>, styleId?: string): void;
5782
+ /** Embed image pixels (a data URL); returns the content-keyed assetId. */
5783
+ addAsset(dataUrl: string): string;
5784
+ /** Remove an asset (refused while an image references it). */
5785
+ removeAsset(id: string): void;
5786
+ /** Embedded image assets: id, mime type, bytes, how many images use it. */
5787
+ listAssets(): AssetInfo[];
5788
+ /** DXF text → new layers, objects, layouts. */
5759
5789
  importDxfText(text: string, opts?: DxfImportOptions): DxfImportReport;
5760
- /** Merge DWG bytes into the document (wasm transcode → the DXF path). */
5790
+ /** DWG bytes (wasm transcode → the DXF path). */
5761
5791
  importDwgData(data: Uint8Array, opts?: DxfImportOptions): Promise<DxfImportReport>;
5762
- /** Merge a PDF's vector/text content onto the current layer. */
5763
- importPdfData(data: ArrayBuffer): Promise<PdfImportReport>;
5792
+ /** PDF vectors/text onto the current layer, or (`as: "image"`, a host
5793
+ * capability) every page as an image at true scale. */
5794
+ importPdfData(data: ArrayBuffer | Uint8Array, opts?: PdfImportOptions): Promise<PdfImportReport>;
5795
+ /** Merge block module sources into the document library (verbatim →
5796
+ * skip, same id → replace in place, name clash → suffix). Async: awaits
5797
+ * the lazy transpiler so evaluation is definitive on return. */
5798
+ addBlockDefinitions(sources: readonly string[]): Promise<MergeReport>;
5799
+ removeBlockDefinition(id: string): void;
5800
+ addUserCommands(sources: readonly string[]): Promise<MergeReport>;
5801
+ removeUserCommand(id: string): void;
5802
+ /** Escape hatch: apply an already-shaped op batch (validated, atomic,
5803
+ * one undo step). */
5804
+ applyOps(ops: readonly Operation[]): void;
5805
+ /**
5806
+ * Group edits into ONE undo step. A sync `fn` commits on return, an
5807
+ * async one on settle. A throw ROLLS BACK everything the transaction
5808
+ * applied and rethrows. Nested calls join the outer transaction.
5809
+ */
5810
+ transaction<T>(fn: () => T, label?: string): T;
5811
+ /** Revert / re-apply one step; false when there is nothing to do. Throws
5812
+ * inside an open transaction (return or throw to roll back instead). */
5813
+ undo(): boolean;
5814
+ redo(): boolean;
5815
+ }
5816
+ /** Present only when the Drawing is attached to a live editor: the parts of
5817
+ * the interaction a headless host cannot offer. */
5818
+ interface EditorSurface {
5819
+ state(): EditorState;
5820
+ setActiveSpace(space: "model" | {
5821
+ layout: string;
5822
+ }): void;
5823
+ setSelection(ids: readonly string[]): void;
5824
+ zoom(to: ZoomTarget): void;
5825
+ /** Await one snapped world point; rejects when the user cancels. */
5826
+ pickPoint(opts?: PickPointOptions): Promise<Vec2>;
5827
+ /** Await one object click; resolves the object's id. */
5828
+ pickObject(opts?: {
5829
+ label?: string;
5830
+ }): Promise<string>;
5831
+ /** Await a typed value from a small input dialog; rejects on cancel. */
5832
+ prompt(message: string, opts?: {
5833
+ initial?: string;
5834
+ placeholder?: string;
5835
+ }): Promise<string>;
5836
+ toast(message: string, kind?: "info" | "success" | "error"): void;
5837
+ /** Registry commands + macros + insert-block entries (ids for runCommand). */
5838
+ listCommands(): EditorCommandInfo[];
5839
+ /** Trigger a command by id (interactive tools start and wait for the
5840
+ * user; macros with declared inputs / params accept them up front —
5841
+ * params passed skip the params dialog). */
5842
+ runCommand(id: string, inputs?: readonly PointInput[], params?: Readonly<Record<string, unknown>>): Promise<void>;
5843
+ }
5844
+ /** Where `EditorSurface.zoom` moves the camera: everything in the active
5845
+ * space, the selection, some objects' extents, or a window (world mm; sheet
5846
+ * mm in a layout). */
5847
+ type ZoomTarget = "fit" | "selection" | {
5848
+ ids: readonly string[];
5849
+ } | {
5850
+ bbox: AABB;
5851
+ };
5852
+ interface PickPointOptions {
5853
+ label?: string;
5854
+ /** Rubber-band + relative typed entry from here (the previous pick). */
5855
+ referencePoint?: PointInput;
5856
+ }
5857
+ interface EditorState {
5858
+ documentId: string;
5859
+ documentName: string;
5860
+ space: "model" | {
5861
+ layout: string;
5862
+ };
5863
+ selectedIds: string[];
5864
+ readOnly: boolean;
5865
+ canUndo: boolean;
5866
+ canRedo: boolean;
5867
+ }
5868
+ interface EditorCommandInfo {
5869
+ id: string;
5870
+ label: string;
5871
+ group: string;
5872
+ hotkey?: string;
5764
5873
  }
5765
5874
 
5766
5875
  declare class Drawing extends LocalDrawing {
@@ -5796,14 +5905,14 @@ declare class Drawing extends LocalDrawing {
5796
5905
  save(path?: string): Promise<string>;
5797
5906
  importDxf(path: string, opts?: DxfImportOptions): Promise<DxfImportReport>;
5798
5907
  importDwg(path: string, opts?: DxfImportOptions): Promise<DxfImportReport>;
5799
- importPdf(path: string): Promise<PdfImportReport>;
5908
+ importPdf(path: string, opts?: PdfImportOptions): Promise<PdfImportReport>;
5800
5909
  /** Run a command module source (`defineCommand`) against this drawing as
5801
5910
  * ONE undo step, headlessly: declared `inputs` must be supplied; declared
5802
5911
  * `params` take their defaults unless given by name (unknown names and
5803
5912
  * wrong types throw). Resolves with the script's return value. */
5804
5913
  runScript(source: string, inputs?: readonly PointInput[], params?: Readonly<Record<string, unknown>>): Promise<unknown>;
5805
5914
  /** Run one of the document's own commands (by exported id). */
5806
- runCommand(id: string, inputs?: readonly PointInput[], params?: Readonly<Record<string, unknown>>): Promise<unknown>;
5915
+ runUserCommand(id: string, inputs?: readonly PointInput[], params?: Readonly<Record<string, unknown>>): Promise<unknown>;
5807
5916
  }
5808
5917
  /** A fresh empty document, optionally named (until saved to a file, whose
5809
5918
  * name then takes over). */