lineadraw 0.6.0 → 0.8.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
@@ -35,47 +35,6 @@ interface AABB {
35
35
  maxY: number;
36
36
  }
37
37
 
38
- /** Owns copied boundary geometry (non-associative). loops[0] outer, rest holes (even-odd). */
39
- declare const HatchSchema: z.ZodObject<{
40
- id: z.ZodString;
41
- layerId: z.ZodString;
42
- color: z.ZodOptional<z.ZodString>;
43
- lineType: z.ZodOptional<z.ZodString>;
44
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
45
- lineWidth: z.ZodOptional<z.ZodNumber>;
46
- opacity: z.ZodOptional<z.ZodNumber>;
47
- type: z.ZodLiteral<"hatch">;
48
- loops: z.ZodArray<z.ZodObject<{
49
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
50
- x: z.ZodNumber;
51
- y: z.ZodNumber;
52
- bulge: z.ZodDefault<z.ZodNumber>;
53
- }, z.core.$strip>, unknown>>;
54
- }, z.core.$strip>>;
55
- fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
56
- kind: z.ZodLiteral<"solid">;
57
- }, z.core.$strip>, z.ZodObject<{
58
- kind: z.ZodLiteral<"pattern">;
59
- name: z.ZodString;
60
- angle: z.ZodNumber;
61
- scale: z.ZodNumber;
62
- }, z.core.$strip>, z.ZodObject<{
63
- kind: z.ZodLiteral<"lines">;
64
- angle: z.ZodNumber;
65
- spacing: z.ZodNumber;
66
- }, z.core.$strip>, z.ZodObject<{
67
- kind: z.ZodLiteral<"gradient">;
68
- shape: z.ZodDefault<z.ZodEnum<{
69
- linear: "linear";
70
- radial: "radial";
71
- }>>;
72
- color1: z.ZodDefault<z.ZodString>;
73
- color2: z.ZodDefault<z.ZodString>;
74
- angle: z.ZodDefault<z.ZodNumber>;
75
- }, z.core.$strip>], "kind">>;
76
- scale: z.ZodDefault<z.ZodNumber>;
77
- }, z.core.$strip>;
78
- type Hatch = z.infer<typeof HatchSchema>;
79
38
  /**
80
39
  * A named document text style: everything a TEXT object inherits unless its
81
40
  * own `styleOverride` sets a key (same model as DimStyle for dimensions).
@@ -92,78 +51,15 @@ declare const TextStyleSchema: z.ZodObject<{
92
51
  italic: z.ZodOptional<z.ZodBoolean>;
93
52
  textHeight: z.ZodDefault<z.ZodNumber>;
94
53
  arrowType: z.ZodDefault<z.ZodEnum<{
54
+ dot: "dot";
95
55
  filled: "filled";
56
+ none: "none";
96
57
  open: "open";
97
58
  tick: "tick";
98
- dot: "dot";
99
- none: "none";
100
59
  }>>;
101
60
  arrowSize: z.ZodDefault<z.ZodNumber>;
102
61
  }, z.core.$strip>;
103
62
  type TextStyle = z.infer<typeof TextStyleSchema>;
104
- /**
105
- * Text, optionally annotated with leader lines (MLEADER-style — the old
106
- * standalone "leader" type merged in at document v6). Each leader line is a
107
- * polyline with its arrowhead at [0]; by convention lines join at the first
108
- * line's last point (the junction), near the text.
109
- */
110
- declare const TextSchema: z.ZodObject<{
111
- id: z.ZodString;
112
- layerId: z.ZodString;
113
- color: z.ZodOptional<z.ZodString>;
114
- lineType: z.ZodOptional<z.ZodString>;
115
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
116
- lineWidth: z.ZodOptional<z.ZodNumber>;
117
- opacity: z.ZodOptional<z.ZodNumber>;
118
- type: z.ZodLiteral<"text">;
119
- position: z.ZodPreprocess<z.ZodObject<{
120
- x: z.ZodNumber;
121
- y: z.ZodNumber;
122
- }, z.core.$strip>, unknown>;
123
- content: z.ZodString;
124
- leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
125
- x: z.ZodNumber;
126
- y: z.ZodNumber;
127
- }, z.core.$strip>, unknown>>>>;
128
- width: z.ZodOptional<z.ZodNumber>;
129
- hAlign: z.ZodDefault<z.ZodEnum<{
130
- center: "center";
131
- left: "left";
132
- right: "right";
133
- }>>;
134
- vAlign: z.ZodDefault<z.ZodEnum<{
135
- center: "center";
136
- bottom: "bottom";
137
- top: "top";
138
- }>>;
139
- frame: z.ZodOptional<z.ZodEnum<{
140
- circle: "circle";
141
- none: "none";
142
- bottom: "bottom";
143
- rectangle: "rectangle";
144
- slot: "slot";
145
- firstLine: "firstLine";
146
- }>>;
147
- styleId: z.ZodOptional<z.ZodString>;
148
- styleOverride: z.ZodOptional<z.ZodObject<{
149
- font: z.ZodOptional<z.ZodString>;
150
- widthFactor: z.ZodOptional<z.ZodNumber>;
151
- bold: z.ZodOptional<z.ZodBoolean>;
152
- italic: z.ZodOptional<z.ZodBoolean>;
153
- textHeight: z.ZodOptional<z.ZodNumber>;
154
- arrowType: z.ZodOptional<z.ZodEnum<{
155
- filled: "filled";
156
- open: "open";
157
- tick: "tick";
158
- dot: "dot";
159
- none: "none";
160
- }>>;
161
- arrowSize: z.ZodOptional<z.ZodNumber>;
162
- }, z.core.$strip>>;
163
- rotation: z.ZodDefault<z.ZodNumber>;
164
- scale: z.ZodDefault<z.ZodNumber>;
165
- }, z.core.$strip>;
166
- type Text = z.infer<typeof TextSchema>;
167
63
  /** A named document dimension style; documents carry an ARRAY of these and
168
64
  * dimensions reference one by `styleId` (absent/dangling = the first). */
169
65
  declare const DimStyleSchema: z.ZodObject<{
@@ -176,11 +72,11 @@ declare const DimStyleSchema: z.ZodObject<{
176
72
  textHeight: z.ZodDefault<z.ZodNumber>;
177
73
  textOffset: z.ZodDefault<z.ZodNumber>;
178
74
  arrowType: z.ZodDefault<z.ZodEnum<{
75
+ dot: "dot";
179
76
  filled: "filled";
77
+ none: "none";
180
78
  open: "open";
181
79
  tick: "tick";
182
- dot: "dot";
183
- none: "none";
184
80
  }>>;
185
81
  arrowSize: z.ZodDefault<z.ZodNumber>;
186
82
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -192,59 +88,6 @@ declare const DimStyleSchema: z.ZodObject<{
192
88
  precision: z.ZodDefault<z.ZodNumber>;
193
89
  }, z.core.$strip>;
194
90
  type DimStyle = z.infer<typeof DimStyleSchema>;
195
- /** Static (non-associative) definition points. Linear measures point to
196
- * point (the pre-v9 "aligned" behavior; the axis-locked variant is gone). */
197
- declare const DimensionSchema: z.ZodObject<{
198
- id: z.ZodString;
199
- layerId: z.ZodString;
200
- color: z.ZodOptional<z.ZodString>;
201
- lineType: z.ZodOptional<z.ZodString>;
202
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
203
- lineWidth: z.ZodOptional<z.ZodNumber>;
204
- opacity: z.ZodOptional<z.ZodNumber>;
205
- type: z.ZodLiteral<"dimension">;
206
- kind: z.ZodDefault<z.ZodEnum<{
207
- linear: "linear";
208
- radial: "radial";
209
- angular: "angular";
210
- diameter: "diameter";
211
- }>>;
212
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
213
- x: z.ZodNumber;
214
- y: z.ZodNumber;
215
- }, z.core.$strip>, unknown>>;
216
- offset: z.ZodPreprocess<z.ZodObject<{
217
- x: z.ZodNumber;
218
- y: z.ZodNumber;
219
- }, z.core.$strip>, unknown>;
220
- textOverride: z.ZodOptional<z.ZodString>;
221
- styleId: z.ZodOptional<z.ZodString>;
222
- styleOverride: z.ZodOptional<z.ZodObject<{
223
- font: z.ZodOptional<z.ZodString>;
224
- widthFactor: z.ZodOptional<z.ZodNumber>;
225
- bold: z.ZodOptional<z.ZodBoolean>;
226
- italic: z.ZodOptional<z.ZodBoolean>;
227
- textHeight: z.ZodOptional<z.ZodNumber>;
228
- textOffset: z.ZodOptional<z.ZodNumber>;
229
- arrowType: z.ZodOptional<z.ZodEnum<{
230
- filled: "filled";
231
- open: "open";
232
- tick: "tick";
233
- dot: "dot";
234
- none: "none";
235
- }>>;
236
- arrowSize: z.ZodOptional<z.ZodNumber>;
237
- extensionType: z.ZodOptional<z.ZodEnum<{
238
- long: "long";
239
- short: "short";
240
- }>>;
241
- extensionOffset: z.ZodOptional<z.ZodNumber>;
242
- extensionOvershoot: z.ZodOptional<z.ZodNumber>;
243
- precision: z.ZodOptional<z.ZodNumber>;
244
- }, z.core.$strip>>;
245
- scale: z.ZodDefault<z.ZodNumber>;
246
- }, z.core.$strip>;
247
- type Dimension = z.infer<typeof DimensionSchema>;
248
91
  /**
249
92
  * A LINKED file drawn in place (an xref): the document holds this record,
250
93
  * never the file. The file's model space lands with its origin at
@@ -260,12 +103,12 @@ declare const ReferenceSchema: z.ZodObject<{
260
103
  opacity: z.ZodOptional<z.ZodNumber>;
261
104
  type: z.ZodLiteral<"reference">;
262
105
  format: z.ZodEnum<{
263
- linea: "linea";
264
- dxf: "dxf";
265
106
  dwg: "dwg";
107
+ dxf: "dxf";
108
+ jpg: "jpg";
109
+ linea: "linea";
266
110
  pdf: "pdf";
267
111
  png: "png";
268
- jpg: "jpg";
269
112
  }>;
270
113
  name: z.ZodString;
271
114
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -285,8 +128,8 @@ declare const ReferenceSchema: z.ZodObject<{
285
128
  mirrored: z.ZodOptional<z.ZodBoolean>;
286
129
  pdfPage: z.ZodOptional<z.ZodNumber>;
287
130
  pdfMode: z.ZodOptional<z.ZodEnum<{
288
- vector: "vector";
289
131
  raster: "raster";
132
+ vector: "vector";
290
133
  }>>;
291
134
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
292
135
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -423,6 +266,10 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
423
266
  name: z.ZodString;
424
267
  angle: z.ZodNumber;
425
268
  scale: z.ZodNumber;
269
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
270
+ x: z.ZodNumber;
271
+ y: z.ZodNumber;
272
+ }, z.core.$strip>, unknown>>;
426
273
  }, z.core.$strip>, z.ZodObject<{
427
274
  kind: z.ZodLiteral<"lines">;
428
275
  angle: z.ZodNumber;
@@ -452,6 +299,20 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
452
299
  y: z.ZodNumber;
453
300
  }, z.core.$strip>, unknown>;
454
301
  content: z.ZodString;
302
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
303
+ start: z.ZodNumber;
304
+ end: z.ZodNumber;
305
+ font: z.ZodOptional<z.ZodString>;
306
+ bold: z.ZodOptional<z.ZodBoolean>;
307
+ italic: z.ZodOptional<z.ZodBoolean>;
308
+ underline: z.ZodOptional<z.ZodBoolean>;
309
+ color: z.ZodOptional<z.ZodString>;
310
+ height: z.ZodOptional<z.ZodNumber>;
311
+ script: z.ZodOptional<z.ZodEnum<{
312
+ sub: "sub";
313
+ super: "super";
314
+ }>>;
315
+ }, z.core.$strip>>>;
455
316
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
456
317
  x: z.ZodNumber;
457
318
  y: z.ZodNumber;
@@ -463,17 +324,17 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
463
324
  right: "right";
464
325
  }>>;
465
326
  vAlign: z.ZodDefault<z.ZodEnum<{
466
- center: "center";
467
327
  bottom: "bottom";
328
+ center: "center";
468
329
  top: "top";
469
330
  }>>;
470
331
  frame: z.ZodOptional<z.ZodEnum<{
332
+ bottom: "bottom";
471
333
  circle: "circle";
334
+ firstLine: "firstLine";
472
335
  none: "none";
473
- bottom: "bottom";
474
336
  rectangle: "rectangle";
475
337
  slot: "slot";
476
- firstLine: "firstLine";
477
338
  }>>;
478
339
  styleId: z.ZodOptional<z.ZodString>;
479
340
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -483,11 +344,11 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
483
344
  italic: z.ZodOptional<z.ZodBoolean>;
484
345
  textHeight: z.ZodOptional<z.ZodNumber>;
485
346
  arrowType: z.ZodOptional<z.ZodEnum<{
347
+ dot: "dot";
486
348
  filled: "filled";
349
+ none: "none";
487
350
  open: "open";
488
351
  tick: "tick";
489
- dot: "dot";
490
- none: "none";
491
352
  }>>;
492
353
  arrowSize: z.ZodOptional<z.ZodNumber>;
493
354
  }, z.core.$strip>>;
@@ -503,20 +364,36 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
503
364
  opacity: z.ZodOptional<z.ZodNumber>;
504
365
  type: z.ZodLiteral<"dimension">;
505
366
  kind: z.ZodDefault<z.ZodEnum<{
506
- linear: "linear";
507
- radial: "radial";
508
367
  angular: "angular";
509
368
  diameter: "diameter";
369
+ linear: "linear";
370
+ radial: "radial";
510
371
  }>>;
511
372
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
512
373
  x: z.ZodNumber;
513
374
  y: z.ZodNumber;
514
375
  }, z.core.$strip>, unknown>>;
515
- offset: z.ZodPreprocess<z.ZodObject<{
516
- x: z.ZodNumber;
517
- y: z.ZodNumber;
518
- }, z.core.$strip>, unknown>;
519
- textOverride: z.ZodOptional<z.ZodString>;
376
+ rotation: z.ZodOptional<z.ZodNumber>;
377
+ offset: z.ZodOptional<z.ZodNumber>;
378
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
379
+ along: z.ZodOptional<z.ZodNumber>;
380
+ across: z.ZodOptional<z.ZodNumber>;
381
+ content: z.ZodOptional<z.ZodString>;
382
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
383
+ start: z.ZodNumber;
384
+ end: z.ZodNumber;
385
+ font: z.ZodOptional<z.ZodString>;
386
+ bold: z.ZodOptional<z.ZodBoolean>;
387
+ italic: z.ZodOptional<z.ZodBoolean>;
388
+ underline: z.ZodOptional<z.ZodBoolean>;
389
+ color: z.ZodOptional<z.ZodString>;
390
+ height: z.ZodOptional<z.ZodNumber>;
391
+ script: z.ZodOptional<z.ZodEnum<{
392
+ sub: "sub";
393
+ super: "super";
394
+ }>>;
395
+ }, z.core.$strip>>>;
396
+ }, z.core.$strip>>>;
520
397
  styleId: z.ZodOptional<z.ZodString>;
521
398
  styleOverride: z.ZodOptional<z.ZodObject<{
522
399
  font: z.ZodOptional<z.ZodString>;
@@ -526,11 +403,11 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
526
403
  textHeight: z.ZodOptional<z.ZodNumber>;
527
404
  textOffset: z.ZodOptional<z.ZodNumber>;
528
405
  arrowType: z.ZodOptional<z.ZodEnum<{
406
+ dot: "dot";
529
407
  filled: "filled";
408
+ none: "none";
530
409
  open: "open";
531
410
  tick: "tick";
532
- dot: "dot";
533
- none: "none";
534
411
  }>>;
535
412
  arrowSize: z.ZodOptional<z.ZodNumber>;
536
413
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -633,7 +510,21 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
633
510
  minHeight: z.ZodOptional<z.ZodNumber>;
634
511
  }, z.core.$strip>>, unknown>;
635
512
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
636
- text: z.ZodDefault<z.ZodString>;
513
+ content: z.ZodDefault<z.ZodString>;
514
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
515
+ start: z.ZodNumber;
516
+ end: z.ZodNumber;
517
+ font: z.ZodOptional<z.ZodString>;
518
+ bold: z.ZodOptional<z.ZodBoolean>;
519
+ italic: z.ZodOptional<z.ZodBoolean>;
520
+ underline: z.ZodOptional<z.ZodBoolean>;
521
+ color: z.ZodOptional<z.ZodString>;
522
+ height: z.ZodOptional<z.ZodNumber>;
523
+ script: z.ZodOptional<z.ZodEnum<{
524
+ sub: "sub";
525
+ super: "super";
526
+ }>>;
527
+ }, z.core.$strip>>>;
637
528
  span: z.ZodOptional<z.ZodObject<{
638
529
  cols: z.ZodNumber;
639
530
  rows: z.ZodNumber;
@@ -644,8 +535,8 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
644
535
  right: "right";
645
536
  }>>;
646
537
  vAlign: z.ZodOptional<z.ZodEnum<{
647
- center: "center";
648
538
  bottom: "bottom";
539
+ center: "center";
649
540
  top: "top";
650
541
  }>>;
651
542
  styleId: z.ZodOptional<z.ZodString>;
@@ -656,11 +547,11 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
656
547
  italic: z.ZodOptional<z.ZodBoolean>;
657
548
  textHeight: z.ZodOptional<z.ZodNumber>;
658
549
  arrowType: z.ZodOptional<z.ZodEnum<{
550
+ dot: "dot";
659
551
  filled: "filled";
552
+ none: "none";
660
553
  open: "open";
661
554
  tick: "tick";
662
- dot: "dot";
663
- none: "none";
664
555
  }>>;
665
556
  arrowSize: z.ZodOptional<z.ZodNumber>;
666
557
  }, z.core.$strip>>;
@@ -669,10 +560,10 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
669
560
  headerRows: z.ZodDefault<z.ZodNumber>;
670
561
  cellMargin: z.ZodDefault<z.ZodNumber>;
671
562
  borders: z.ZodDefault<z.ZodEnum<{
672
- none: "none";
673
- rows: "rows";
674
563
  all: "all";
564
+ none: "none";
675
565
  outer: "outer";
566
+ rows: "rows";
676
567
  }>>;
677
568
  styleId: z.ZodOptional<z.ZodString>;
678
569
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -682,11 +573,11 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
682
573
  italic: z.ZodOptional<z.ZodBoolean>;
683
574
  textHeight: z.ZodOptional<z.ZodNumber>;
684
575
  arrowType: z.ZodOptional<z.ZodEnum<{
576
+ dot: "dot";
685
577
  filled: "filled";
578
+ none: "none";
686
579
  open: "open";
687
580
  tick: "tick";
688
- dot: "dot";
689
- none: "none";
690
581
  }>>;
691
582
  arrowSize: z.ZodOptional<z.ZodNumber>;
692
583
  }, z.core.$strip>>;
@@ -700,12 +591,12 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
700
591
  opacity: z.ZodOptional<z.ZodNumber>;
701
592
  type: z.ZodLiteral<"reference">;
702
593
  format: z.ZodEnum<{
703
- linea: "linea";
704
- dxf: "dxf";
705
594
  dwg: "dwg";
595
+ dxf: "dxf";
596
+ jpg: "jpg";
597
+ linea: "linea";
706
598
  pdf: "pdf";
707
599
  png: "png";
708
- jpg: "jpg";
709
600
  }>;
710
601
  name: z.ZodString;
711
602
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -725,8 +616,8 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
725
616
  mirrored: z.ZodOptional<z.ZodBoolean>;
726
617
  pdfPage: z.ZodOptional<z.ZodNumber>;
727
618
  pdfMode: z.ZodOptional<z.ZodEnum<{
728
- vector: "vector";
729
619
  raster: "raster";
620
+ vector: "vector";
730
621
  }>>;
731
622
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
732
623
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -747,6 +638,29 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
747
638
  type ModelObject = z.infer<typeof ModelObjectSchema>;
748
639
  type ModelObjectType = ModelObject["type"];
749
640
 
641
+ declare const HatchPatternSchema: z.ZodObject<{
642
+ name: z.ZodString;
643
+ description: z.ZodOptional<z.ZodString>;
644
+ lines: z.ZodArray<z.ZodObject<{
645
+ angle: z.ZodNumber;
646
+ origin: z.ZodPreprocess<z.ZodObject<{
647
+ x: z.ZodNumber;
648
+ y: z.ZodNumber;
649
+ }, z.core.$strip>, unknown>;
650
+ deltaX: z.ZodNumber;
651
+ deltaY: z.ZodNumber;
652
+ dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
653
+ }, z.core.$strip>>;
654
+ }, z.core.$strip>;
655
+ type DocumentHatchPattern = z.infer<typeof HatchPatternSchema>;
656
+
657
+ declare const LineTypeSchema: z.ZodObject<{
658
+ name: z.ZodString;
659
+ description: z.ZodOptional<z.ZodString>;
660
+ dashesMm: z.ZodArray<z.ZodNumber>;
661
+ }, z.core.$strip>;
662
+ type LineType = z.infer<typeof LineTypeSchema>;
663
+
750
664
  declare const LayerSchema: z.ZodObject<{
751
665
  id: z.ZodDefault<z.ZodString>;
752
666
  name: z.ZodDefault<z.ZodString>;
@@ -762,7 +676,7 @@ type Layer = z.infer<typeof LayerSchema>;
762
676
  declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
763
677
  id: z.ZodDefault<z.ZodString>;
764
678
  type: z.ZodDefault<z.ZodLiteral<"lineadraw">>;
765
- version: z.ZodLiteral<20>;
679
+ version: z.ZodLiteral<22>;
766
680
  settings: z.ZodDefault<z.ZodObject<{
767
681
  units: z.ZodDefault<z.ZodEnum<{
768
682
  in: "in";
@@ -899,6 +813,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
899
813
  name: z.ZodString;
900
814
  angle: z.ZodNumber;
901
815
  scale: z.ZodNumber;
816
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
817
+ x: z.ZodNumber;
818
+ y: z.ZodNumber;
819
+ }, z.core.$strip>, unknown>>;
902
820
  }, z.core.$strip>, z.ZodObject<{
903
821
  kind: z.ZodLiteral<"lines">;
904
822
  angle: z.ZodNumber;
@@ -928,6 +846,20 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
928
846
  y: z.ZodNumber;
929
847
  }, z.core.$strip>, unknown>;
930
848
  content: z.ZodString;
849
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
850
+ start: z.ZodNumber;
851
+ end: z.ZodNumber;
852
+ font: z.ZodOptional<z.ZodString>;
853
+ bold: z.ZodOptional<z.ZodBoolean>;
854
+ italic: z.ZodOptional<z.ZodBoolean>;
855
+ underline: z.ZodOptional<z.ZodBoolean>;
856
+ color: z.ZodOptional<z.ZodString>;
857
+ height: z.ZodOptional<z.ZodNumber>;
858
+ script: z.ZodOptional<z.ZodEnum<{
859
+ sub: "sub";
860
+ super: "super";
861
+ }>>;
862
+ }, z.core.$strip>>>;
931
863
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
932
864
  x: z.ZodNumber;
933
865
  y: z.ZodNumber;
@@ -939,17 +871,17 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
939
871
  right: "right";
940
872
  }>>;
941
873
  vAlign: z.ZodDefault<z.ZodEnum<{
942
- center: "center";
943
874
  bottom: "bottom";
875
+ center: "center";
944
876
  top: "top";
945
877
  }>>;
946
878
  frame: z.ZodOptional<z.ZodEnum<{
879
+ bottom: "bottom";
947
880
  circle: "circle";
881
+ firstLine: "firstLine";
948
882
  none: "none";
949
- bottom: "bottom";
950
883
  rectangle: "rectangle";
951
884
  slot: "slot";
952
- firstLine: "firstLine";
953
885
  }>>;
954
886
  styleId: z.ZodOptional<z.ZodString>;
955
887
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -959,11 +891,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
959
891
  italic: z.ZodOptional<z.ZodBoolean>;
960
892
  textHeight: z.ZodOptional<z.ZodNumber>;
961
893
  arrowType: z.ZodOptional<z.ZodEnum<{
894
+ dot: "dot";
962
895
  filled: "filled";
896
+ none: "none";
963
897
  open: "open";
964
898
  tick: "tick";
965
- dot: "dot";
966
- none: "none";
967
899
  }>>;
968
900
  arrowSize: z.ZodOptional<z.ZodNumber>;
969
901
  }, z.core.$strip>>;
@@ -979,20 +911,36 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
979
911
  opacity: z.ZodOptional<z.ZodNumber>;
980
912
  type: z.ZodLiteral<"dimension">;
981
913
  kind: z.ZodDefault<z.ZodEnum<{
982
- linear: "linear";
983
- radial: "radial";
984
914
  angular: "angular";
985
915
  diameter: "diameter";
916
+ linear: "linear";
917
+ radial: "radial";
986
918
  }>>;
987
919
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
988
920
  x: z.ZodNumber;
989
921
  y: z.ZodNumber;
990
922
  }, z.core.$strip>, unknown>>;
991
- offset: z.ZodPreprocess<z.ZodObject<{
992
- x: z.ZodNumber;
993
- y: z.ZodNumber;
994
- }, z.core.$strip>, unknown>;
995
- textOverride: z.ZodOptional<z.ZodString>;
923
+ rotation: z.ZodOptional<z.ZodNumber>;
924
+ offset: z.ZodOptional<z.ZodNumber>;
925
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
926
+ along: z.ZodOptional<z.ZodNumber>;
927
+ across: z.ZodOptional<z.ZodNumber>;
928
+ content: z.ZodOptional<z.ZodString>;
929
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
930
+ start: z.ZodNumber;
931
+ end: z.ZodNumber;
932
+ font: z.ZodOptional<z.ZodString>;
933
+ bold: z.ZodOptional<z.ZodBoolean>;
934
+ italic: z.ZodOptional<z.ZodBoolean>;
935
+ underline: z.ZodOptional<z.ZodBoolean>;
936
+ color: z.ZodOptional<z.ZodString>;
937
+ height: z.ZodOptional<z.ZodNumber>;
938
+ script: z.ZodOptional<z.ZodEnum<{
939
+ sub: "sub";
940
+ super: "super";
941
+ }>>;
942
+ }, z.core.$strip>>>;
943
+ }, z.core.$strip>>>;
996
944
  styleId: z.ZodOptional<z.ZodString>;
997
945
  styleOverride: z.ZodOptional<z.ZodObject<{
998
946
  font: z.ZodOptional<z.ZodString>;
@@ -1002,11 +950,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1002
950
  textHeight: z.ZodOptional<z.ZodNumber>;
1003
951
  textOffset: z.ZodOptional<z.ZodNumber>;
1004
952
  arrowType: z.ZodOptional<z.ZodEnum<{
953
+ dot: "dot";
1005
954
  filled: "filled";
955
+ none: "none";
1006
956
  open: "open";
1007
957
  tick: "tick";
1008
- dot: "dot";
1009
- none: "none";
1010
958
  }>>;
1011
959
  arrowSize: z.ZodOptional<z.ZodNumber>;
1012
960
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -1109,7 +1057,21 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1109
1057
  minHeight: z.ZodOptional<z.ZodNumber>;
1110
1058
  }, z.core.$strip>>, unknown>;
1111
1059
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1112
- text: z.ZodDefault<z.ZodString>;
1060
+ content: z.ZodDefault<z.ZodString>;
1061
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
1062
+ start: z.ZodNumber;
1063
+ end: z.ZodNumber;
1064
+ font: z.ZodOptional<z.ZodString>;
1065
+ bold: z.ZodOptional<z.ZodBoolean>;
1066
+ italic: z.ZodOptional<z.ZodBoolean>;
1067
+ underline: z.ZodOptional<z.ZodBoolean>;
1068
+ color: z.ZodOptional<z.ZodString>;
1069
+ height: z.ZodOptional<z.ZodNumber>;
1070
+ script: z.ZodOptional<z.ZodEnum<{
1071
+ sub: "sub";
1072
+ super: "super";
1073
+ }>>;
1074
+ }, z.core.$strip>>>;
1113
1075
  span: z.ZodOptional<z.ZodObject<{
1114
1076
  cols: z.ZodNumber;
1115
1077
  rows: z.ZodNumber;
@@ -1120,8 +1082,8 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1120
1082
  right: "right";
1121
1083
  }>>;
1122
1084
  vAlign: z.ZodOptional<z.ZodEnum<{
1123
- center: "center";
1124
1085
  bottom: "bottom";
1086
+ center: "center";
1125
1087
  top: "top";
1126
1088
  }>>;
1127
1089
  styleId: z.ZodOptional<z.ZodString>;
@@ -1132,11 +1094,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1132
1094
  italic: z.ZodOptional<z.ZodBoolean>;
1133
1095
  textHeight: z.ZodOptional<z.ZodNumber>;
1134
1096
  arrowType: z.ZodOptional<z.ZodEnum<{
1097
+ dot: "dot";
1135
1098
  filled: "filled";
1099
+ none: "none";
1136
1100
  open: "open";
1137
1101
  tick: "tick";
1138
- dot: "dot";
1139
- none: "none";
1140
1102
  }>>;
1141
1103
  arrowSize: z.ZodOptional<z.ZodNumber>;
1142
1104
  }, z.core.$strip>>;
@@ -1145,10 +1107,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1145
1107
  headerRows: z.ZodDefault<z.ZodNumber>;
1146
1108
  cellMargin: z.ZodDefault<z.ZodNumber>;
1147
1109
  borders: z.ZodDefault<z.ZodEnum<{
1148
- none: "none";
1149
- rows: "rows";
1150
1110
  all: "all";
1111
+ none: "none";
1151
1112
  outer: "outer";
1113
+ rows: "rows";
1152
1114
  }>>;
1153
1115
  styleId: z.ZodOptional<z.ZodString>;
1154
1116
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -1158,11 +1120,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1158
1120
  italic: z.ZodOptional<z.ZodBoolean>;
1159
1121
  textHeight: z.ZodOptional<z.ZodNumber>;
1160
1122
  arrowType: z.ZodOptional<z.ZodEnum<{
1123
+ dot: "dot";
1161
1124
  filled: "filled";
1125
+ none: "none";
1162
1126
  open: "open";
1163
1127
  tick: "tick";
1164
- dot: "dot";
1165
- none: "none";
1166
1128
  }>>;
1167
1129
  arrowSize: z.ZodOptional<z.ZodNumber>;
1168
1130
  }, z.core.$strip>>;
@@ -1176,12 +1138,12 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1176
1138
  opacity: z.ZodOptional<z.ZodNumber>;
1177
1139
  type: z.ZodLiteral<"reference">;
1178
1140
  format: z.ZodEnum<{
1179
- linea: "linea";
1180
- dxf: "dxf";
1181
1141
  dwg: "dwg";
1142
+ dxf: "dxf";
1143
+ jpg: "jpg";
1144
+ linea: "linea";
1182
1145
  pdf: "pdf";
1183
1146
  png: "png";
1184
- jpg: "jpg";
1185
1147
  }>;
1186
1148
  name: z.ZodString;
1187
1149
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1201,8 +1163,8 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1201
1163
  mirrored: z.ZodOptional<z.ZodBoolean>;
1202
1164
  pdfPage: z.ZodOptional<z.ZodNumber>;
1203
1165
  pdfMode: z.ZodOptional<z.ZodEnum<{
1204
- vector: "vector";
1205
1166
  raster: "raster";
1167
+ vector: "vector";
1206
1168
  }>>;
1207
1169
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
1208
1170
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -1350,6 +1312,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1350
1312
  name: z.ZodString;
1351
1313
  angle: z.ZodNumber;
1352
1314
  scale: z.ZodNumber;
1315
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
1316
+ x: z.ZodNumber;
1317
+ y: z.ZodNumber;
1318
+ }, z.core.$strip>, unknown>>;
1353
1319
  }, z.core.$strip>, z.ZodObject<{
1354
1320
  kind: z.ZodLiteral<"lines">;
1355
1321
  angle: z.ZodNumber;
@@ -1379,6 +1345,20 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1379
1345
  y: z.ZodNumber;
1380
1346
  }, z.core.$strip>, unknown>;
1381
1347
  content: z.ZodString;
1348
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
1349
+ start: z.ZodNumber;
1350
+ end: z.ZodNumber;
1351
+ font: z.ZodOptional<z.ZodString>;
1352
+ bold: z.ZodOptional<z.ZodBoolean>;
1353
+ italic: z.ZodOptional<z.ZodBoolean>;
1354
+ underline: z.ZodOptional<z.ZodBoolean>;
1355
+ color: z.ZodOptional<z.ZodString>;
1356
+ height: z.ZodOptional<z.ZodNumber>;
1357
+ script: z.ZodOptional<z.ZodEnum<{
1358
+ sub: "sub";
1359
+ super: "super";
1360
+ }>>;
1361
+ }, z.core.$strip>>>;
1382
1362
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1383
1363
  x: z.ZodNumber;
1384
1364
  y: z.ZodNumber;
@@ -1390,17 +1370,17 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1390
1370
  right: "right";
1391
1371
  }>>;
1392
1372
  vAlign: z.ZodDefault<z.ZodEnum<{
1393
- center: "center";
1394
1373
  bottom: "bottom";
1374
+ center: "center";
1395
1375
  top: "top";
1396
1376
  }>>;
1397
1377
  frame: z.ZodOptional<z.ZodEnum<{
1378
+ bottom: "bottom";
1398
1379
  circle: "circle";
1380
+ firstLine: "firstLine";
1399
1381
  none: "none";
1400
- bottom: "bottom";
1401
1382
  rectangle: "rectangle";
1402
1383
  slot: "slot";
1403
- firstLine: "firstLine";
1404
1384
  }>>;
1405
1385
  styleId: z.ZodOptional<z.ZodString>;
1406
1386
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -1410,11 +1390,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1410
1390
  italic: z.ZodOptional<z.ZodBoolean>;
1411
1391
  textHeight: z.ZodOptional<z.ZodNumber>;
1412
1392
  arrowType: z.ZodOptional<z.ZodEnum<{
1393
+ dot: "dot";
1413
1394
  filled: "filled";
1395
+ none: "none";
1414
1396
  open: "open";
1415
1397
  tick: "tick";
1416
- dot: "dot";
1417
- none: "none";
1418
1398
  }>>;
1419
1399
  arrowSize: z.ZodOptional<z.ZodNumber>;
1420
1400
  }, z.core.$strip>>;
@@ -1430,20 +1410,36 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1430
1410
  opacity: z.ZodOptional<z.ZodNumber>;
1431
1411
  type: z.ZodLiteral<"dimension">;
1432
1412
  kind: z.ZodDefault<z.ZodEnum<{
1433
- linear: "linear";
1434
- radial: "radial";
1435
1413
  angular: "angular";
1436
1414
  diameter: "diameter";
1415
+ linear: "linear";
1416
+ radial: "radial";
1437
1417
  }>>;
1438
1418
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1439
1419
  x: z.ZodNumber;
1440
1420
  y: z.ZodNumber;
1441
1421
  }, z.core.$strip>, unknown>>;
1442
- offset: z.ZodPreprocess<z.ZodObject<{
1443
- x: z.ZodNumber;
1444
- y: z.ZodNumber;
1445
- }, z.core.$strip>, unknown>;
1446
- textOverride: z.ZodOptional<z.ZodString>;
1422
+ rotation: z.ZodOptional<z.ZodNumber>;
1423
+ offset: z.ZodOptional<z.ZodNumber>;
1424
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
1425
+ along: z.ZodOptional<z.ZodNumber>;
1426
+ across: z.ZodOptional<z.ZodNumber>;
1427
+ content: z.ZodOptional<z.ZodString>;
1428
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
1429
+ start: z.ZodNumber;
1430
+ end: z.ZodNumber;
1431
+ font: z.ZodOptional<z.ZodString>;
1432
+ bold: z.ZodOptional<z.ZodBoolean>;
1433
+ italic: z.ZodOptional<z.ZodBoolean>;
1434
+ underline: z.ZodOptional<z.ZodBoolean>;
1435
+ color: z.ZodOptional<z.ZodString>;
1436
+ height: z.ZodOptional<z.ZodNumber>;
1437
+ script: z.ZodOptional<z.ZodEnum<{
1438
+ sub: "sub";
1439
+ super: "super";
1440
+ }>>;
1441
+ }, z.core.$strip>>>;
1442
+ }, z.core.$strip>>>;
1447
1443
  styleId: z.ZodOptional<z.ZodString>;
1448
1444
  styleOverride: z.ZodOptional<z.ZodObject<{
1449
1445
  font: z.ZodOptional<z.ZodString>;
@@ -1453,11 +1449,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1453
1449
  textHeight: z.ZodOptional<z.ZodNumber>;
1454
1450
  textOffset: z.ZodOptional<z.ZodNumber>;
1455
1451
  arrowType: z.ZodOptional<z.ZodEnum<{
1452
+ dot: "dot";
1456
1453
  filled: "filled";
1454
+ none: "none";
1457
1455
  open: "open";
1458
1456
  tick: "tick";
1459
- dot: "dot";
1460
- none: "none";
1461
1457
  }>>;
1462
1458
  arrowSize: z.ZodOptional<z.ZodNumber>;
1463
1459
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -1560,7 +1556,21 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1560
1556
  minHeight: z.ZodOptional<z.ZodNumber>;
1561
1557
  }, z.core.$strip>>, unknown>;
1562
1558
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1563
- text: z.ZodDefault<z.ZodString>;
1559
+ content: z.ZodDefault<z.ZodString>;
1560
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
1561
+ start: z.ZodNumber;
1562
+ end: z.ZodNumber;
1563
+ font: z.ZodOptional<z.ZodString>;
1564
+ bold: z.ZodOptional<z.ZodBoolean>;
1565
+ italic: z.ZodOptional<z.ZodBoolean>;
1566
+ underline: z.ZodOptional<z.ZodBoolean>;
1567
+ color: z.ZodOptional<z.ZodString>;
1568
+ height: z.ZodOptional<z.ZodNumber>;
1569
+ script: z.ZodOptional<z.ZodEnum<{
1570
+ sub: "sub";
1571
+ super: "super";
1572
+ }>>;
1573
+ }, z.core.$strip>>>;
1564
1574
  span: z.ZodOptional<z.ZodObject<{
1565
1575
  cols: z.ZodNumber;
1566
1576
  rows: z.ZodNumber;
@@ -1571,8 +1581,8 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1571
1581
  right: "right";
1572
1582
  }>>;
1573
1583
  vAlign: z.ZodOptional<z.ZodEnum<{
1574
- center: "center";
1575
1584
  bottom: "bottom";
1585
+ center: "center";
1576
1586
  top: "top";
1577
1587
  }>>;
1578
1588
  styleId: z.ZodOptional<z.ZodString>;
@@ -1583,11 +1593,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1583
1593
  italic: z.ZodOptional<z.ZodBoolean>;
1584
1594
  textHeight: z.ZodOptional<z.ZodNumber>;
1585
1595
  arrowType: z.ZodOptional<z.ZodEnum<{
1596
+ dot: "dot";
1586
1597
  filled: "filled";
1598
+ none: "none";
1587
1599
  open: "open";
1588
1600
  tick: "tick";
1589
- dot: "dot";
1590
- none: "none";
1591
1601
  }>>;
1592
1602
  arrowSize: z.ZodOptional<z.ZodNumber>;
1593
1603
  }, z.core.$strip>>;
@@ -1596,10 +1606,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1596
1606
  headerRows: z.ZodDefault<z.ZodNumber>;
1597
1607
  cellMargin: z.ZodDefault<z.ZodNumber>;
1598
1608
  borders: z.ZodDefault<z.ZodEnum<{
1599
- none: "none";
1600
- rows: "rows";
1601
1609
  all: "all";
1610
+ none: "none";
1602
1611
  outer: "outer";
1612
+ rows: "rows";
1603
1613
  }>>;
1604
1614
  styleId: z.ZodOptional<z.ZodString>;
1605
1615
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -1609,11 +1619,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1609
1619
  italic: z.ZodOptional<z.ZodBoolean>;
1610
1620
  textHeight: z.ZodOptional<z.ZodNumber>;
1611
1621
  arrowType: z.ZodOptional<z.ZodEnum<{
1622
+ dot: "dot";
1612
1623
  filled: "filled";
1624
+ none: "none";
1613
1625
  open: "open";
1614
1626
  tick: "tick";
1615
- dot: "dot";
1616
- none: "none";
1617
1627
  }>>;
1618
1628
  arrowSize: z.ZodOptional<z.ZodNumber>;
1619
1629
  }, z.core.$strip>>;
@@ -1627,12 +1637,12 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1627
1637
  opacity: z.ZodOptional<z.ZodNumber>;
1628
1638
  type: z.ZodLiteral<"reference">;
1629
1639
  format: z.ZodEnum<{
1630
- linea: "linea";
1631
- dxf: "dxf";
1632
1640
  dwg: "dwg";
1641
+ dxf: "dxf";
1642
+ jpg: "jpg";
1643
+ linea: "linea";
1633
1644
  pdf: "pdf";
1634
1645
  png: "png";
1635
- jpg: "jpg";
1636
1646
  }>;
1637
1647
  name: z.ZodString;
1638
1648
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1652,8 +1662,8 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1652
1662
  mirrored: z.ZodOptional<z.ZodBoolean>;
1653
1663
  pdfPage: z.ZodOptional<z.ZodNumber>;
1654
1664
  pdfMode: z.ZodOptional<z.ZodEnum<{
1655
- vector: "vector";
1656
1665
  raster: "raster";
1666
+ vector: "vector";
1657
1667
  }>>;
1658
1668
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
1659
1669
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -1681,11 +1691,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1681
1691
  italic: z.ZodOptional<z.ZodBoolean>;
1682
1692
  textHeight: z.ZodDefault<z.ZodNumber>;
1683
1693
  arrowType: z.ZodDefault<z.ZodEnum<{
1694
+ dot: "dot";
1684
1695
  filled: "filled";
1696
+ none: "none";
1685
1697
  open: "open";
1686
1698
  tick: "tick";
1687
- dot: "dot";
1688
- none: "none";
1689
1699
  }>>;
1690
1700
  arrowSize: z.ZodDefault<z.ZodNumber>;
1691
1701
  }, z.core.$strip>>>;
@@ -1699,11 +1709,11 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1699
1709
  textHeight: z.ZodDefault<z.ZodNumber>;
1700
1710
  textOffset: z.ZodDefault<z.ZodNumber>;
1701
1711
  arrowType: z.ZodDefault<z.ZodEnum<{
1712
+ dot: "dot";
1702
1713
  filled: "filled";
1714
+ none: "none";
1703
1715
  open: "open";
1704
1716
  tick: "tick";
1705
- dot: "dot";
1706
- none: "none";
1707
1717
  }>>;
1708
1718
  arrowSize: z.ZodDefault<z.ZodNumber>;
1709
1719
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -1714,6 +1724,25 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1714
1724
  extensionOvershoot: z.ZodDefault<z.ZodNumber>;
1715
1725
  precision: z.ZodDefault<z.ZodNumber>;
1716
1726
  }, z.core.$strip>>>;
1727
+ lineTypes: z.ZodDefault<z.ZodArray<z.ZodObject<{
1728
+ name: z.ZodString;
1729
+ description: z.ZodOptional<z.ZodString>;
1730
+ dashesMm: z.ZodArray<z.ZodNumber>;
1731
+ }, z.core.$strip>>>;
1732
+ hatchPatterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
1733
+ name: z.ZodString;
1734
+ description: z.ZodOptional<z.ZodString>;
1735
+ lines: z.ZodArray<z.ZodObject<{
1736
+ angle: z.ZodNumber;
1737
+ origin: z.ZodPreprocess<z.ZodObject<{
1738
+ x: z.ZodNumber;
1739
+ y: z.ZodNumber;
1740
+ }, z.core.$strip>, unknown>;
1741
+ deltaX: z.ZodNumber;
1742
+ deltaY: z.ZodNumber;
1743
+ dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1744
+ }, z.core.$strip>>;
1745
+ }, z.core.$strip>>>;
1717
1746
  assets: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1718
1747
  blockDefinitions: z.ZodDefault<z.ZodArray<z.ZodString>>;
1719
1748
  commands: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1721,6 +1750,9 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1721
1750
  type LineaDocument = z.infer<typeof LineaDocumentSchema>;
1722
1751
 
1723
1752
  declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1753
+ name: z.ZodString;
1754
+ label: z.ZodOptional<z.ZodString>;
1755
+ hint: z.ZodOptional<z.ZodString>;
1724
1756
  type: z.ZodLiteral<"number">;
1725
1757
  default: z.ZodNumber;
1726
1758
  min: z.ZodOptional<z.ZodNumber>;
@@ -1730,54 +1762,54 @@ declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1730
1762
  prefix: z.ZodOptional<z.ZodString>;
1731
1763
  suffix: z.ZodOptional<z.ZodString>;
1732
1764
  presets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1765
+ }, z.core.$strip>, z.ZodObject<{
1733
1766
  name: z.ZodString;
1734
1767
  label: z.ZodOptional<z.ZodString>;
1735
1768
  hint: z.ZodOptional<z.ZodString>;
1736
- }, z.core.$strip>, z.ZodObject<{
1737
1769
  type: z.ZodLiteral<"string">;
1738
1770
  default: z.ZodString;
1739
1771
  placeholder: z.ZodOptional<z.ZodString>;
1740
1772
  multiline: z.ZodOptional<z.ZodBoolean>;
1741
1773
  presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1774
+ }, z.core.$strip>, z.ZodObject<{
1742
1775
  name: z.ZodString;
1743
1776
  label: z.ZodOptional<z.ZodString>;
1744
1777
  hint: z.ZodOptional<z.ZodString>;
1745
- }, z.core.$strip>, z.ZodObject<{
1746
1778
  type: z.ZodLiteral<"boolean">;
1747
1779
  default: z.ZodBoolean;
1748
1780
  display: z.ZodOptional<z.ZodEnum<{
1749
1781
  switch: "switch";
1750
1782
  toggle: "toggle";
1751
1783
  }>>;
1784
+ }, z.core.$strip>, z.ZodObject<{
1752
1785
  name: z.ZodString;
1753
1786
  label: z.ZodOptional<z.ZodString>;
1754
1787
  hint: z.ZodOptional<z.ZodString>;
1755
- }, z.core.$strip>, z.ZodObject<{
1756
1788
  type: z.ZodLiteral<"numberList">;
1757
1789
  default: z.ZodArray<z.ZodNumber>;
1758
1790
  placeholder: z.ZodOptional<z.ZodString>;
1759
1791
  min: z.ZodOptional<z.ZodNumber>;
1760
1792
  max: z.ZodOptional<z.ZodNumber>;
1761
1793
  presets: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodNumber>>>;
1794
+ }, z.core.$strip>, z.ZodObject<{
1762
1795
  name: z.ZodString;
1763
1796
  label: z.ZodOptional<z.ZodString>;
1764
1797
  hint: z.ZodOptional<z.ZodString>;
1765
- }, z.core.$strip>, z.ZodObject<{
1766
1798
  type: z.ZodLiteral<"stringList">;
1767
1799
  default: z.ZodArray<z.ZodString>;
1768
1800
  placeholder: z.ZodOptional<z.ZodString>;
1769
1801
  presets: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
1802
+ }, z.core.$strip>, z.ZodObject<{
1770
1803
  name: z.ZodString;
1771
1804
  label: z.ZodOptional<z.ZodString>;
1772
1805
  hint: z.ZodOptional<z.ZodString>;
1773
- }, z.core.$strip>, z.ZodObject<{
1774
1806
  type: z.ZodLiteral<"color">;
1775
1807
  default: z.ZodString;
1776
1808
  presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1809
+ }, z.core.$strip>, z.ZodObject<{
1777
1810
  name: z.ZodString;
1778
1811
  label: z.ZodOptional<z.ZodString>;
1779
1812
  hint: z.ZodOptional<z.ZodString>;
1780
- }, z.core.$strip>, z.ZodObject<{
1781
1813
  type: z.ZodLiteral<"enum">;
1782
1814
  default: z.ZodString;
1783
1815
  options: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
@@ -1786,50 +1818,53 @@ declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1786
1818
  swatch: z.ZodOptional<z.ZodString>;
1787
1819
  }, z.core.$strip>, unknown>>;
1788
1820
  display: z.ZodOptional<z.ZodEnum<{
1789
- dropdown: "dropdown";
1790
1821
  buttons: "buttons";
1822
+ dropdown: "dropdown";
1791
1823
  }>>;
1824
+ }, z.core.$strip>, z.ZodObject<{
1792
1825
  name: z.ZodString;
1793
1826
  label: z.ZodOptional<z.ZodString>;
1794
1827
  hint: z.ZodOptional<z.ZodString>;
1795
- }, z.core.$strip>, z.ZodObject<{
1796
1828
  type: z.ZodLiteral<"textStyle">;
1797
1829
  default: z.ZodDefault<z.ZodString>;
1830
+ }, z.core.$strip>, z.ZodObject<{
1798
1831
  name: z.ZodString;
1799
1832
  label: z.ZodOptional<z.ZodString>;
1800
1833
  hint: z.ZodOptional<z.ZodString>;
1801
- }, z.core.$strip>, z.ZodObject<{
1802
1834
  type: z.ZodLiteral<"dimStyle">;
1803
1835
  default: z.ZodDefault<z.ZodString>;
1836
+ }, z.core.$strip>, z.ZodObject<{
1804
1837
  name: z.ZodString;
1805
1838
  label: z.ZodOptional<z.ZodString>;
1806
1839
  hint: z.ZodOptional<z.ZodString>;
1807
- }, z.core.$strip>, z.ZodObject<{
1808
1840
  type: z.ZodLiteral<"font">;
1809
1841
  default: z.ZodDefault<z.ZodString>;
1842
+ }, z.core.$strip>, z.ZodObject<{
1810
1843
  name: z.ZodString;
1811
1844
  label: z.ZodOptional<z.ZodString>;
1812
1845
  hint: z.ZodOptional<z.ZodString>;
1813
- }, z.core.$strip>, z.ZodObject<{
1814
1846
  type: z.ZodLiteral<"lineType">;
1815
1847
  default: z.ZodDefault<z.ZodString>;
1848
+ }, z.core.$strip>, z.ZodObject<{
1816
1849
  name: z.ZodString;
1817
1850
  label: z.ZodOptional<z.ZodString>;
1818
1851
  hint: z.ZodOptional<z.ZodString>;
1819
- }, z.core.$strip>, z.ZodObject<{
1820
1852
  type: z.ZodLiteral<"hatchPattern">;
1821
1853
  default: z.ZodDefault<z.ZodString>;
1854
+ }, z.core.$strip>, z.ZodObject<{
1822
1855
  name: z.ZodString;
1823
1856
  label: z.ZodOptional<z.ZodString>;
1824
1857
  hint: z.ZodOptional<z.ZodString>;
1825
- }, z.core.$strip>, z.ZodObject<{
1826
1858
  type: z.ZodLiteral<"label">;
1859
+ }, z.core.$strip>, z.ZodObject<{
1827
1860
  name: z.ZodString;
1828
1861
  label: z.ZodOptional<z.ZodString>;
1829
1862
  hint: z.ZodOptional<z.ZodString>;
1830
- }, z.core.$strip>, z.ZodObject<{
1831
1863
  type: z.ZodLiteral<"row">;
1832
1864
  items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1865
+ name: z.ZodString;
1866
+ label: z.ZodOptional<z.ZodString>;
1867
+ hint: z.ZodOptional<z.ZodString>;
1833
1868
  type: z.ZodLiteral<"number">;
1834
1869
  default: z.ZodNumber;
1835
1870
  min: z.ZodOptional<z.ZodNumber>;
@@ -1839,29 +1874,29 @@ declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1839
1874
  prefix: z.ZodOptional<z.ZodString>;
1840
1875
  suffix: z.ZodOptional<z.ZodString>;
1841
1876
  presets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1877
+ }, z.core.$strip>, z.ZodObject<{
1842
1878
  name: z.ZodString;
1843
1879
  label: z.ZodOptional<z.ZodString>;
1844
1880
  hint: z.ZodOptional<z.ZodString>;
1845
- }, z.core.$strip>, z.ZodObject<{
1846
1881
  type: z.ZodLiteral<"string">;
1847
1882
  default: z.ZodString;
1848
1883
  placeholder: z.ZodOptional<z.ZodString>;
1849
1884
  multiline: z.ZodOptional<z.ZodBoolean>;
1850
1885
  presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1886
+ }, z.core.$strip>, z.ZodObject<{
1851
1887
  name: z.ZodString;
1852
1888
  label: z.ZodOptional<z.ZodString>;
1853
1889
  hint: z.ZodOptional<z.ZodString>;
1854
- }, z.core.$strip>, z.ZodObject<{
1855
1890
  type: z.ZodLiteral<"boolean">;
1856
1891
  default: z.ZodBoolean;
1857
1892
  display: z.ZodOptional<z.ZodEnum<{
1858
1893
  switch: "switch";
1859
1894
  toggle: "toggle";
1860
1895
  }>>;
1896
+ }, z.core.$strip>, z.ZodObject<{
1861
1897
  name: z.ZodString;
1862
1898
  label: z.ZodOptional<z.ZodString>;
1863
1899
  hint: z.ZodOptional<z.ZodString>;
1864
- }, z.core.$strip>, z.ZodObject<{
1865
1900
  type: z.ZodLiteral<"enum">;
1866
1901
  default: z.ZodString;
1867
1902
  options: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
@@ -1870,53 +1905,47 @@ declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1870
1905
  swatch: z.ZodOptional<z.ZodString>;
1871
1906
  }, z.core.$strip>, unknown>>;
1872
1907
  display: z.ZodOptional<z.ZodEnum<{
1873
- dropdown: "dropdown";
1874
1908
  buttons: "buttons";
1909
+ dropdown: "dropdown";
1875
1910
  }>>;
1911
+ }, z.core.$strip>, z.ZodObject<{
1876
1912
  name: z.ZodString;
1877
1913
  label: z.ZodOptional<z.ZodString>;
1878
1914
  hint: z.ZodOptional<z.ZodString>;
1879
- }, z.core.$strip>, z.ZodObject<{
1880
1915
  type: z.ZodLiteral<"color">;
1881
1916
  default: z.ZodString;
1882
1917
  presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1918
+ }, z.core.$strip>, z.ZodObject<{
1883
1919
  name: z.ZodString;
1884
1920
  label: z.ZodOptional<z.ZodString>;
1885
1921
  hint: z.ZodOptional<z.ZodString>;
1886
- }, z.core.$strip>, z.ZodObject<{
1887
1922
  type: z.ZodLiteral<"textStyle">;
1888
1923
  default: z.ZodDefault<z.ZodString>;
1924
+ }, z.core.$strip>, z.ZodObject<{
1889
1925
  name: z.ZodString;
1890
1926
  label: z.ZodOptional<z.ZodString>;
1891
1927
  hint: z.ZodOptional<z.ZodString>;
1892
- }, z.core.$strip>, z.ZodObject<{
1893
1928
  type: z.ZodLiteral<"dimStyle">;
1894
1929
  default: z.ZodDefault<z.ZodString>;
1930
+ }, z.core.$strip>, z.ZodObject<{
1895
1931
  name: z.ZodString;
1896
1932
  label: z.ZodOptional<z.ZodString>;
1897
1933
  hint: z.ZodOptional<z.ZodString>;
1898
- }, z.core.$strip>, z.ZodObject<{
1899
1934
  type: z.ZodLiteral<"font">;
1900
1935
  default: z.ZodDefault<z.ZodString>;
1936
+ }, z.core.$strip>, z.ZodObject<{
1901
1937
  name: z.ZodString;
1902
1938
  label: z.ZodOptional<z.ZodString>;
1903
1939
  hint: z.ZodOptional<z.ZodString>;
1904
- }, z.core.$strip>, z.ZodObject<{
1905
1940
  type: z.ZodLiteral<"lineType">;
1906
1941
  default: z.ZodDefault<z.ZodString>;
1942
+ }, z.core.$strip>, z.ZodObject<{
1907
1943
  name: z.ZodString;
1908
1944
  label: z.ZodOptional<z.ZodString>;
1909
1945
  hint: z.ZodOptional<z.ZodString>;
1910
- }, z.core.$strip>, z.ZodObject<{
1911
1946
  type: z.ZodLiteral<"hatchPattern">;
1912
1947
  default: z.ZodDefault<z.ZodString>;
1913
- name: z.ZodString;
1914
- label: z.ZodOptional<z.ZodString>;
1915
- hint: z.ZodOptional<z.ZodString>;
1916
1948
  }, z.core.$strip>], "type">>;
1917
- name: z.ZodString;
1918
- label: z.ZodOptional<z.ZodString>;
1919
- hint: z.ZodOptional<z.ZodString>;
1920
1949
  }, z.core.$strip>], "type">;
1921
1950
  type BlockParameter = z.infer<typeof BlockParamSchema>;
1922
1951
 
@@ -2087,6 +2116,10 @@ declare const PaperLayoutSchema: z.ZodObject<{
2087
2116
  name: z.ZodString;
2088
2117
  angle: z.ZodNumber;
2089
2118
  scale: z.ZodNumber;
2119
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
2120
+ x: z.ZodNumber;
2121
+ y: z.ZodNumber;
2122
+ }, z.core.$strip>, unknown>>;
2090
2123
  }, z.core.$strip>, z.ZodObject<{
2091
2124
  kind: z.ZodLiteral<"lines">;
2092
2125
  angle: z.ZodNumber;
@@ -2116,6 +2149,20 @@ declare const PaperLayoutSchema: z.ZodObject<{
2116
2149
  y: z.ZodNumber;
2117
2150
  }, z.core.$strip>, unknown>;
2118
2151
  content: z.ZodString;
2152
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
2153
+ start: z.ZodNumber;
2154
+ end: z.ZodNumber;
2155
+ font: z.ZodOptional<z.ZodString>;
2156
+ bold: z.ZodOptional<z.ZodBoolean>;
2157
+ italic: z.ZodOptional<z.ZodBoolean>;
2158
+ underline: z.ZodOptional<z.ZodBoolean>;
2159
+ color: z.ZodOptional<z.ZodString>;
2160
+ height: z.ZodOptional<z.ZodNumber>;
2161
+ script: z.ZodOptional<z.ZodEnum<{
2162
+ sub: "sub";
2163
+ super: "super";
2164
+ }>>;
2165
+ }, z.core.$strip>>>;
2119
2166
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2120
2167
  x: z.ZodNumber;
2121
2168
  y: z.ZodNumber;
@@ -2127,17 +2174,17 @@ declare const PaperLayoutSchema: z.ZodObject<{
2127
2174
  right: "right";
2128
2175
  }>>;
2129
2176
  vAlign: z.ZodDefault<z.ZodEnum<{
2130
- center: "center";
2131
2177
  bottom: "bottom";
2178
+ center: "center";
2132
2179
  top: "top";
2133
2180
  }>>;
2134
2181
  frame: z.ZodOptional<z.ZodEnum<{
2182
+ bottom: "bottom";
2135
2183
  circle: "circle";
2184
+ firstLine: "firstLine";
2136
2185
  none: "none";
2137
- bottom: "bottom";
2138
2186
  rectangle: "rectangle";
2139
2187
  slot: "slot";
2140
- firstLine: "firstLine";
2141
2188
  }>>;
2142
2189
  styleId: z.ZodOptional<z.ZodString>;
2143
2190
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -2147,11 +2194,11 @@ declare const PaperLayoutSchema: z.ZodObject<{
2147
2194
  italic: z.ZodOptional<z.ZodBoolean>;
2148
2195
  textHeight: z.ZodOptional<z.ZodNumber>;
2149
2196
  arrowType: z.ZodOptional<z.ZodEnum<{
2197
+ dot: "dot";
2150
2198
  filled: "filled";
2199
+ none: "none";
2151
2200
  open: "open";
2152
2201
  tick: "tick";
2153
- dot: "dot";
2154
- none: "none";
2155
2202
  }>>;
2156
2203
  arrowSize: z.ZodOptional<z.ZodNumber>;
2157
2204
  }, z.core.$strip>>;
@@ -2167,20 +2214,36 @@ declare const PaperLayoutSchema: z.ZodObject<{
2167
2214
  opacity: z.ZodOptional<z.ZodNumber>;
2168
2215
  type: z.ZodLiteral<"dimension">;
2169
2216
  kind: z.ZodDefault<z.ZodEnum<{
2170
- linear: "linear";
2171
- radial: "radial";
2172
2217
  angular: "angular";
2173
2218
  diameter: "diameter";
2219
+ linear: "linear";
2220
+ radial: "radial";
2174
2221
  }>>;
2175
2222
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2176
2223
  x: z.ZodNumber;
2177
2224
  y: z.ZodNumber;
2178
2225
  }, z.core.$strip>, unknown>>;
2179
- offset: z.ZodPreprocess<z.ZodObject<{
2180
- x: z.ZodNumber;
2181
- y: z.ZodNumber;
2182
- }, z.core.$strip>, unknown>;
2183
- textOverride: z.ZodOptional<z.ZodString>;
2226
+ rotation: z.ZodOptional<z.ZodNumber>;
2227
+ offset: z.ZodOptional<z.ZodNumber>;
2228
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
2229
+ along: z.ZodOptional<z.ZodNumber>;
2230
+ across: z.ZodOptional<z.ZodNumber>;
2231
+ content: z.ZodOptional<z.ZodString>;
2232
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
2233
+ start: z.ZodNumber;
2234
+ end: z.ZodNumber;
2235
+ font: z.ZodOptional<z.ZodString>;
2236
+ bold: z.ZodOptional<z.ZodBoolean>;
2237
+ italic: z.ZodOptional<z.ZodBoolean>;
2238
+ underline: z.ZodOptional<z.ZodBoolean>;
2239
+ color: z.ZodOptional<z.ZodString>;
2240
+ height: z.ZodOptional<z.ZodNumber>;
2241
+ script: z.ZodOptional<z.ZodEnum<{
2242
+ sub: "sub";
2243
+ super: "super";
2244
+ }>>;
2245
+ }, z.core.$strip>>>;
2246
+ }, z.core.$strip>>>;
2184
2247
  styleId: z.ZodOptional<z.ZodString>;
2185
2248
  styleOverride: z.ZodOptional<z.ZodObject<{
2186
2249
  font: z.ZodOptional<z.ZodString>;
@@ -2190,11 +2253,11 @@ declare const PaperLayoutSchema: z.ZodObject<{
2190
2253
  textHeight: z.ZodOptional<z.ZodNumber>;
2191
2254
  textOffset: z.ZodOptional<z.ZodNumber>;
2192
2255
  arrowType: z.ZodOptional<z.ZodEnum<{
2256
+ dot: "dot";
2193
2257
  filled: "filled";
2258
+ none: "none";
2194
2259
  open: "open";
2195
2260
  tick: "tick";
2196
- dot: "dot";
2197
- none: "none";
2198
2261
  }>>;
2199
2262
  arrowSize: z.ZodOptional<z.ZodNumber>;
2200
2263
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -2297,7 +2360,21 @@ declare const PaperLayoutSchema: z.ZodObject<{
2297
2360
  minHeight: z.ZodOptional<z.ZodNumber>;
2298
2361
  }, z.core.$strip>>, unknown>;
2299
2362
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2300
- text: z.ZodDefault<z.ZodString>;
2363
+ content: z.ZodDefault<z.ZodString>;
2364
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
2365
+ start: z.ZodNumber;
2366
+ end: z.ZodNumber;
2367
+ font: z.ZodOptional<z.ZodString>;
2368
+ bold: z.ZodOptional<z.ZodBoolean>;
2369
+ italic: z.ZodOptional<z.ZodBoolean>;
2370
+ underline: z.ZodOptional<z.ZodBoolean>;
2371
+ color: z.ZodOptional<z.ZodString>;
2372
+ height: z.ZodOptional<z.ZodNumber>;
2373
+ script: z.ZodOptional<z.ZodEnum<{
2374
+ sub: "sub";
2375
+ super: "super";
2376
+ }>>;
2377
+ }, z.core.$strip>>>;
2301
2378
  span: z.ZodOptional<z.ZodObject<{
2302
2379
  cols: z.ZodNumber;
2303
2380
  rows: z.ZodNumber;
@@ -2308,8 +2385,8 @@ declare const PaperLayoutSchema: z.ZodObject<{
2308
2385
  right: "right";
2309
2386
  }>>;
2310
2387
  vAlign: z.ZodOptional<z.ZodEnum<{
2311
- center: "center";
2312
2388
  bottom: "bottom";
2389
+ center: "center";
2313
2390
  top: "top";
2314
2391
  }>>;
2315
2392
  styleId: z.ZodOptional<z.ZodString>;
@@ -2320,11 +2397,11 @@ declare const PaperLayoutSchema: z.ZodObject<{
2320
2397
  italic: z.ZodOptional<z.ZodBoolean>;
2321
2398
  textHeight: z.ZodOptional<z.ZodNumber>;
2322
2399
  arrowType: z.ZodOptional<z.ZodEnum<{
2400
+ dot: "dot";
2323
2401
  filled: "filled";
2402
+ none: "none";
2324
2403
  open: "open";
2325
2404
  tick: "tick";
2326
- dot: "dot";
2327
- none: "none";
2328
2405
  }>>;
2329
2406
  arrowSize: z.ZodOptional<z.ZodNumber>;
2330
2407
  }, z.core.$strip>>;
@@ -2333,10 +2410,10 @@ declare const PaperLayoutSchema: z.ZodObject<{
2333
2410
  headerRows: z.ZodDefault<z.ZodNumber>;
2334
2411
  cellMargin: z.ZodDefault<z.ZodNumber>;
2335
2412
  borders: z.ZodDefault<z.ZodEnum<{
2336
- none: "none";
2337
- rows: "rows";
2338
2413
  all: "all";
2414
+ none: "none";
2339
2415
  outer: "outer";
2416
+ rows: "rows";
2340
2417
  }>>;
2341
2418
  styleId: z.ZodOptional<z.ZodString>;
2342
2419
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -2346,11 +2423,11 @@ declare const PaperLayoutSchema: z.ZodObject<{
2346
2423
  italic: z.ZodOptional<z.ZodBoolean>;
2347
2424
  textHeight: z.ZodOptional<z.ZodNumber>;
2348
2425
  arrowType: z.ZodOptional<z.ZodEnum<{
2426
+ dot: "dot";
2349
2427
  filled: "filled";
2428
+ none: "none";
2350
2429
  open: "open";
2351
2430
  tick: "tick";
2352
- dot: "dot";
2353
- none: "none";
2354
2431
  }>>;
2355
2432
  arrowSize: z.ZodOptional<z.ZodNumber>;
2356
2433
  }, z.core.$strip>>;
@@ -2364,12 +2441,12 @@ declare const PaperLayoutSchema: z.ZodObject<{
2364
2441
  opacity: z.ZodOptional<z.ZodNumber>;
2365
2442
  type: z.ZodLiteral<"reference">;
2366
2443
  format: z.ZodEnum<{
2367
- linea: "linea";
2368
- dxf: "dxf";
2369
2444
  dwg: "dwg";
2445
+ dxf: "dxf";
2446
+ jpg: "jpg";
2447
+ linea: "linea";
2370
2448
  pdf: "pdf";
2371
2449
  png: "png";
2372
- jpg: "jpg";
2373
2450
  }>;
2374
2451
  name: z.ZodString;
2375
2452
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2389,8 +2466,8 @@ declare const PaperLayoutSchema: z.ZodObject<{
2389
2466
  mirrored: z.ZodOptional<z.ZodBoolean>;
2390
2467
  pdfPage: z.ZodOptional<z.ZodNumber>;
2391
2468
  pdfMode: z.ZodOptional<z.ZodEnum<{
2392
- vector: "vector";
2393
2469
  raster: "raster";
2470
+ vector: "vector";
2394
2471
  }>>;
2395
2472
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
2396
2473
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -2413,7 +2490,8 @@ type PaperLayout = z.infer<typeof PaperLayoutSchema>;
2413
2490
 
2414
2491
  /**
2415
2492
  * Drawing scale → the stored 1:N denominator (model mm per paper mm):
2416
- * `"1:50"` → 50, `"2:1"` → 0.5; numbers pass through (50 means 1:50).
2493
+ * `"1:50"` → 50, `"2:1"` → 0.5; numbers pass through (50 means 1:50), as
2494
+ * does a plain numeric string (`"50"`).
2417
2495
  */
2418
2496
  declare const parseScale: (scale: number | string) => number;
2419
2497
 
@@ -2468,6 +2546,10 @@ interface BlockThumbnailOptions {
2468
2546
  /** Skip (return null) when the SVG exceeds this many characters — a
2469
2547
  * manifest should stay a light index, not an asset bundle. */
2470
2548
  maxChars?: number;
2549
+ /** The document's own line types / hatch patterns, when the block's
2550
+ * children reference them by name (the catalogue needs no help). */
2551
+ lineTypes?: readonly LineType[];
2552
+ hatchPatterns?: readonly DocumentHatchPattern[];
2471
2553
  }
2472
2554
  /**
2473
2555
  * Render a block module to a small standalone SVG (viewBox-sized, strokes
@@ -2476,7 +2558,7 @@ interface BlockThumbnailOptions {
2476
2558
  * module itself fails its dry run (same errors testBlockDefinition
2477
2559
  * reports).
2478
2560
  */
2479
- declare const renderBlockThumbnailSvg: (script: string, { definitions, maxChars }?: BlockThumbnailOptions) => Promise<string | null>;
2561
+ declare const renderBlockThumbnailSvg: (script: string, { definitions, maxChars, lineTypes, hatchPatterns, }?: BlockThumbnailOptions) => Promise<string | null>;
2480
2562
 
2481
2563
  interface MergeModulesResult<M> {
2482
2564
  /** The full library to install (replacements in place + new appended). */
@@ -2500,23 +2582,162 @@ interface MergeModulesResult<M> {
2500
2582
  }[];
2501
2583
  }
2502
2584
 
2503
- /** Identity + metadata derived from a command module's exports. */
2504
- interface CommandMeta {
2505
- id: string;
2506
- name: string;
2507
- description?: string;
2508
- version?: string;
2509
- authors?: string[];
2510
- tags?: string[];
2511
- /** Declared point inputs (labels): picked one by one in the editor before
2512
- * `run`, or supplied up front by a headless/remote caller. */
2513
- inputs?: string[];
2514
- /** Declared parameters (the blocks' ParamDef table): prompted in the
2515
- * editor before `run`, or passed by a headless caller; arrive as
2516
- * `ctx.params`. Absent when the command declares none. */
2517
- params?: BlockParameter[];
2518
- }
2519
- /** Non-throwing meta lookup for list UIs. */
2585
+ /** One configured marketplace. `kind` discriminates so new source types
2586
+ * are one more variant; identity (for dedupe/remove/reorder) is
2587
+ * `marketplaceKey`. The built-in public collection is always present
2588
+ * exactly once (`normalizeMarketplaces`). Tokens never enter a document. */
2589
+ declare const MarketplaceConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2590
+ kind: z.ZodLiteral<"builtin">;
2591
+ }, z.core.$strip>, z.ZodObject<{
2592
+ kind: z.ZodLiteral<"github">;
2593
+ spec: z.ZodString;
2594
+ token: z.ZodOptional<z.ZodString>;
2595
+ }, z.core.$strip>, z.ZodObject<{
2596
+ kind: z.ZodLiteral<"folder">;
2597
+ folder: z.ZodString;
2598
+ }, z.core.$strip>], "kind">;
2599
+ type MarketplaceConfig = z.infer<typeof MarketplaceConfigSchema>;
2600
+ /** What agents and the SDK see of a configured marketplace — never the
2601
+ * token itself. */
2602
+ interface MarketplaceInfo {
2603
+ key: string;
2604
+ kind: MarketplaceConfig["kind"];
2605
+ label: string;
2606
+ spec?: string;
2607
+ folder?: string;
2608
+ hasToken: boolean;
2609
+ }
2610
+ /** One manifest row — the minimal-manifest scheme (docs/marketplace-devx.md)
2611
+ * with the legacy pinned-URL fields still accepted. Exported so tooling
2612
+ * tests can verify generated manifests parse. */
2613
+ declare const MarketplaceEntrySchema: z.ZodObject<{
2614
+ kind: z.ZodEnum<{
2615
+ block: "block";
2616
+ command: "command";
2617
+ }>;
2618
+ id: z.ZodString;
2619
+ name: z.ZodString;
2620
+ version: z.ZodString;
2621
+ description: z.ZodOptional<z.ZodString>;
2622
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
2623
+ authors: z.ZodDefault<z.ZodArray<z.ZodString>>;
2624
+ dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
2625
+ source: z.ZodOptional<z.ZodString>;
2626
+ sourceUrl: z.ZodOptional<z.ZodString>;
2627
+ contentHash: z.ZodOptional<z.ZodString>;
2628
+ thumbnailSvg: z.ZodOptional<z.ZodString>;
2629
+ }, z.core.$strip>;
2630
+ type MarketplaceEntry = z.infer<typeof MarketplaceEntrySchema>;
2631
+ type MarketplaceCatalog = {
2632
+ state: "ready";
2633
+ name?: string;
2634
+ entries: MarketplaceEntry[];
2635
+ } | {
2636
+ state: "unavailable";
2637
+ reason: string;
2638
+ };
2639
+ /** How a catalog entry relates to what the document already has. */
2640
+ type InstallStatus = {
2641
+ kind: "absent";
2642
+ } | {
2643
+ kind: "installed";
2644
+ version?: string;
2645
+ } | {
2646
+ kind: "update";
2647
+ from?: string;
2648
+ };
2649
+ /** The document's module sources an install compares against. */
2650
+ interface VendoredModules {
2651
+ blockDefinitions: readonly string[];
2652
+ commands: readonly string[];
2653
+ }
2654
+ /** What a host lends the client: the platform's fetch (default
2655
+ * `globalThis.fetch`) and, for folder marketplaces, a reader of UTF-8
2656
+ * files by folder key + folder-relative POSIX path (reject when missing).
2657
+ * Without a reader, folder marketplaces report themselves unavailable. */
2658
+ interface MarketplaceIO {
2659
+ fetch?: typeof globalThis.fetch;
2660
+ readFile?: (folderKey: string, relPath: string) => Promise<string>;
2661
+ }
2662
+ /** A search hit: the entry, where it came from, and its install status. */
2663
+ interface MarketplaceHit extends MarketplaceEntry {
2664
+ marketplace: MarketplaceInfo;
2665
+ status: InstallStatus;
2666
+ }
2667
+ interface MarketplaceQuery {
2668
+ /** Case-insensitive substring over name, id, description and tags. */
2669
+ query?: string;
2670
+ kind?: MarketplaceEntry["kind"];
2671
+ /** Restrict to one marketplace — by key, spec, folder or label. */
2672
+ marketplace?: string;
2673
+ }
2674
+ /**
2675
+ * Catalog + source access over configured marketplaces, with per-instance
2676
+ * caches: one download of a module serves preview and install, and a
2677
+ * catalog is fetched once until `refresh`. One instance per host.
2678
+ */
2679
+ declare class MarketplaceClient {
2680
+ private readonly catalogs;
2681
+ private readonly sources;
2682
+ private readonly io;
2683
+ constructor(io?: MarketplaceIO);
2684
+ private fetch;
2685
+ private cacheKey;
2686
+ private loadFolderCatalog;
2687
+ private loadCatalog;
2688
+ /** Fetch (and cache) a marketplace's catalog; `refresh` bypasses the
2689
+ * cache AND drops the marketplace's cached module sources — `source`
2690
+ * rows track a branch ref, so they are only immutable within one catalog
2691
+ * snapshot. */
2692
+ catalog(m: MarketplaceConfig, refresh?: boolean): Promise<MarketplaceCatalog>;
2693
+ /** An entry's module source. `source` rows resolve against the
2694
+ * marketplace repo at the manifest's ref; with a token the contents API
2695
+ * serves them instead of the raw host. */
2696
+ source(m: MarketplaceConfig, entry: MarketplaceEntry): Promise<string>;
2697
+ /**
2698
+ * Sources of an entry's declared dependency CLOSURE (the entry itself
2699
+ * excluded), resolved from the catalog recursively — what a preview
2700
+ * needs so nested instances (Grid → Axis) evaluate before anything is
2701
+ * installed. Missing catalog entries are skipped (the preview then shows
2702
+ * the eval error for that id, same as a dangling reference).
2703
+ */
2704
+ closureSources(m: MarketplaceConfig, entry: MarketplaceEntry): Promise<string[]>;
2705
+ /**
2706
+ * The module sources an install of `entry` merges, in order: declared
2707
+ * block dependencies first (resolved from the catalog, recursively,
2708
+ * skipping ids the document already vendors — a dependency is never
2709
+ * force-updated), the entry itself last. Throws when a dependency is
2710
+ * missing from the catalog.
2711
+ */
2712
+ installSources(m: MarketplaceConfig, entry: MarketplaceEntry, vendored: VendoredModules, visited?: Set<string>): Promise<string[]>;
2713
+ /** Entries across the configured marketplaces (priority order; the first
2714
+ * marketplace publishing an id wins), filtered by the query. */
2715
+ search(configs: readonly MarketplaceConfig[], q: MarketplaceQuery, vendored: VendoredModules): Promise<MarketplaceHit[]>;
2716
+ /** The first marketplace (in priority order, or the named one) that
2717
+ * publishes `id`, with its entry; null when none does. */
2718
+ find(configs: readonly MarketplaceConfig[], id: string, marketplace?: string): Promise<{
2719
+ config: MarketplaceConfig;
2720
+ entry: MarketplaceEntry;
2721
+ } | null>;
2722
+ }
2723
+
2724
+ /** Identity + metadata derived from a command module's exports. */
2725
+ interface CommandMeta {
2726
+ id: string;
2727
+ name: string;
2728
+ description?: string;
2729
+ version?: string;
2730
+ authors?: string[];
2731
+ tags?: string[];
2732
+ /** Declared point inputs (labels): picked one by one in the editor before
2733
+ * `run`, or supplied up front by a headless/remote caller. */
2734
+ inputs?: string[];
2735
+ /** Declared parameters (the blocks' ParamDef table): prompted in the
2736
+ * editor before `run`, or passed by a headless caller; arrive as
2737
+ * `ctx.params`. Absent when the command declares none. */
2738
+ params?: BlockParameter[];
2739
+ }
2740
+ /** Non-throwing meta lookup for list UIs. */
2520
2741
  type CommandMetaResult = {
2521
2742
  ok: true;
2522
2743
  meta: CommandMeta;
@@ -2535,80 +2756,79 @@ interface TextMeasurer {
2535
2756
  * (horizontal glyph scale) when provided. */
2536
2757
  measureTextWidth(text: string, heightMm: number, font?: string, widthFactor?: number): number;
2537
2758
  }
2538
- interface TextBlock {
2539
- lines: string[];
2540
- /** Widest line, mm. */
2541
- width: number;
2542
- /** Total block height, mm. */
2543
- height: number;
2544
- lineHeight: number;
2545
- }
2546
2759
 
2547
2760
  type SnapPointType = "endpoint" | "midpoint" | "center" | "quadrant";
2548
-
2549
- interface ResolvedStyle {
2550
- color: string;
2551
- widthMm: number;
2552
- /** Dash pattern in mm (undefined = continuous). */
2553
- dashMm?: number[];
2554
- /** Paint opacity 0..1 (undefined = opaque). */
2555
- opacity?: number;
2556
- }
2557
-
2558
- interface DimArc {
2559
- center: Vec2;
2560
- radius: number;
2561
- /** Radians, CCW from startAngle to endAngle (canvas/DXF convention). */
2562
- startAngle: number;
2563
- endAngle: number;
2564
- }
2565
- interface DimText {
2566
- content: string;
2567
- anchor: Vec2;
2568
- rotation: number;
2569
- height: number;
2570
- /** Font id + width factor from the resolved dimension style. */
2571
- font?: string;
2572
- widthFactor?: number;
2761
+ interface SnapPoint {
2762
+ p: Vec2;
2763
+ type: SnapPointType;
2573
2764
  }
2574
- interface DimGeometry {
2575
- extensionLines: Segment[];
2576
- dimLines: Segment[];
2577
- /** Angular dimensions draw an arc instead of a straight dimension line. */
2578
- dimArc: DimArc | null;
2579
- arrows: {
2580
- tip: Vec2;
2581
- toward: Vec2;
2582
- size: number;
2583
- }[];
2584
- arrowType: DimStyle["arrowType"];
2585
- /** One entry per measured segment (chains carry several). */
2586
- texts: DimText[];
2587
- /** Primary measurement: total span / angle in radians / radius / diameter. */
2588
- value: number;
2765
+ /** A cached segment; tessellation chords of curves are marked as such. */
2766
+ interface SnapSegment extends Segment {
2767
+ /**
2768
+ * True for chords approximating a curve (ellipse tessellation): they serve
2769
+ * hit-testing, selection, and intersections, but are excluded from
2770
+ * extension snapping (a curve has no per-facet extensions) and lose to the
2771
+ * exact curve in the nearest tier.
2772
+ */
2773
+ chord?: boolean;
2589
2774
  }
2590
-
2591
- interface PaintGeometryCache {
2592
- hatchLines: WeakMap<Hatch, Segment[]>;
2593
- /** Guarded by `base` — a dim-styles edit replaces the array. */
2594
- dimGeometry: WeakMap<Dimension, {
2595
- base: readonly DimStyle[];
2596
- geom: DimGeometry | null;
2597
- }>;
2598
- /** Guarded by `base` — a text-styles edit rewraps inheriting text. */
2599
- textBlocks: WeakMap<Text, {
2600
- base: readonly TextStyle[];
2601
- block: TextBlock;
2602
- }>;
2775
+ /** Cached per-object snap geometry (also serves hit-testing). */
2776
+ interface SnapCacheEntry {
2777
+ bounds: AABB;
2778
+ /**
2779
+ * `bounds` unioned with every snap point — the candidate-query box for
2780
+ * snapping. Off-curve snap points (an arc's center) lie outside the tight
2781
+ * curve bounds; without this a cursor near them would never consider the
2782
+ * object. Window/crossing selection keeps using the tight `bounds`.
2783
+ */
2784
+ pointBounds: AABB;
2785
+ points: SnapPoint[];
2786
+ /** Exact straight segments (curved geometry contributes tessellated runs). */
2787
+ segments: SnapSegment[];
2788
+ /** Analytic arcs (circles are full-sweep arcs). */
2789
+ arcs: ArcGeom[];
2790
+ /**
2791
+ * Analytic ellipses. Their tessellation still lives in `segments` (for
2792
+ * hit-testing, intersections, marquee selection); the nearest tier prefers
2793
+ * the exact curve over the chords.
2794
+ */
2795
+ ellipses?: EllipseGeom[];
2796
+ /** Closed tessellated rings (hatch interiors, for inside hit-testing). */
2797
+ rings?: Vec2[][];
2798
+ /**
2799
+ * Filled regions of NESTED content — a block's hatch children — each its
2800
+ * own even-odd ring set (so two overlapping fills don't cancel). An
2801
+ * inside hit on one ranks like a hatch hit: below geometry drawn over it.
2802
+ */
2803
+ regions?: Vec2[][][];
2804
+ /**
2805
+ * Huge entries (a referenced site plan: 10⁵+ segments) answer "what is in
2806
+ * this box" from a spatial index, so snapping and picking near the cursor
2807
+ * stay cheap; absent → scan the whole entry. The result has this shape.
2808
+ */
2809
+ near?: (box: AABB) => SnapCacheEntry;
2603
2810
  }
2604
2811
 
2605
- /** Environment passed to painters — style already resolved by the caller. */
2606
- interface PaintEnv {
2607
- style: ResolvedStyle;
2812
+ /**
2813
+ * The document half of a paint environment: everything a painter resolves
2814
+ * by id or name against the document. The array fields are REQUIRED so a
2815
+ * caller can't drop one by accident (an omitted `hatchPatterns` silently
2816
+ * painted the catalogue fallback); consumers without a document pass [].
2817
+ * `LayoutModelContext` and `ReferenceContent` extend it, so a paint env
2818
+ * spreads either one whole.
2819
+ */
2820
+ interface DocumentPaintResources {
2821
+ /** Document layers — a block child that names its OWN layer hides with
2822
+ * it (its color still follows the instance unless it sets one). */
2823
+ layers: readonly Layer[];
2608
2824
  /** Document dimension styles — dimensions pick theirs by styleId. */
2609
2825
  dimStyles: readonly DimStyle[];
2610
2826
  /** Document text styles — texts pick theirs by styleId. */
2611
2827
  textStyles: readonly TextStyle[];
2828
+ /** Document-defined line types / hatch patterns, resolved by NAME ahead
2829
+ * of the built-in catalogue (block children and hatch fills). */
2830
+ lineTypes: readonly LineType[];
2831
+ hatchPatterns: readonly DocumentHatchPattern[];
2612
2832
  /**
2613
2833
  * The document's block definitions — the block painter evaluates instance
2614
2834
  * children against these. The kernel holds no store, so they are threaded
@@ -2627,27 +2847,12 @@ interface PaintEnv {
2627
2847
  * images (or documents without any) paint a crossed placeholder frame.
2628
2848
  */
2629
2849
  assets?: Readonly<Record<string, string>>;
2630
- /**
2631
- * Optional cache for camera-independent derived geometry (hatch lines,
2632
- * dimension geometry, text blocks). Supply one per long-lived consumer
2633
- * (the canvas renderer keeps one across frames); omit for one-shot paints.
2634
- */
2635
- cache?: PaintGeometryCache;
2636
- /**
2637
- * Paint everything in `style` verbatim, ignoring per-child style overrides
2638
- * (block children carrying their own color/lineType). Selection/hover
2639
- * highlights set this so a block highlights as one uniform silhouette.
2640
- */
2641
- forceStyle?: boolean;
2642
2850
  /**
2643
2851
  * A reference's loaded file content (docs/references.md) — the host owns
2644
2852
  * loading and caching. Absent, or null for a file not loaded (yet), → the
2645
2853
  * reference paints as a dashed frame.
2646
2854
  */
2647
2855
  resolveReference?: (ref: ReferenceObject) => ReferenceContent | null;
2648
- /** The output medium's color map (print palettes): content painted with
2649
- * its OWN styles (a reference's file) maps through it too. */
2650
- mapColor?: (color: string) => string;
2651
2856
  }
2652
2857
 
2653
2858
  /**
@@ -2655,21 +2860,8 @@ interface PaintEnv {
2655
2860
  * store, so it is passed in (the editor sources it from useModel; a headless
2656
2861
  * caller from the loaded document).
2657
2862
  */
2658
- interface LayoutModelContext {
2659
- objects: ModelObject[];
2660
- layers: Layer[];
2661
- dimStyles: readonly DimStyle[];
2662
- textStyles: readonly TextStyle[];
2663
- blockDefinitions: readonly string[];
2664
- /**
2665
- * Document-wide object lookup for block object-reference inputs; absent →
2666
- * referenced inputs evaluate as null (see BlockObjectResolver).
2667
- */
2668
- resolveObject?: (id: string) => ModelObject | undefined;
2669
- /** Embedded image assets (hash → data URL); absent = placeholder frames. */
2670
- assets?: Readonly<Record<string, string>>;
2671
- /** Loaded reference content (see PaintEnv.resolveReference). */
2672
- resolveReference?: PaintEnv["resolveReference"];
2863
+ interface LayoutModelContext extends DocumentPaintResources {
2864
+ objects: readonly ModelObject[];
2673
2865
  }
2674
2866
 
2675
2867
  /** A loaded reference: the file's model space as Linea objects (ids
@@ -2709,13 +2901,6 @@ interface ReferenceSnap {
2709
2901
  })[];
2710
2902
  }
2711
2903
 
2712
- type DwgVersion = "AC1015" | "AC1018" | "AC1021" | "AC1024" | "AC1027" | "AC1032";
2713
-
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
2904
  /**
2720
2905
  * Where a reorder places the moved objects: the top/bottom of the space's
2721
2906
  * draw order, or immediately above/below a reference object (by id).
@@ -2849,6 +3034,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2849
3034
  name: z.ZodString;
2850
3035
  angle: z.ZodNumber;
2851
3036
  scale: z.ZodNumber;
3037
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
3038
+ x: z.ZodNumber;
3039
+ y: z.ZodNumber;
3040
+ }, z.core.$strip>, unknown>>;
2852
3041
  }, z.core.$strip>, z.ZodObject<{
2853
3042
  kind: z.ZodLiteral<"lines">;
2854
3043
  angle: z.ZodNumber;
@@ -2878,6 +3067,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2878
3067
  y: z.ZodNumber;
2879
3068
  }, z.core.$strip>, unknown>;
2880
3069
  content: z.ZodString;
3070
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3071
+ start: z.ZodNumber;
3072
+ end: z.ZodNumber;
3073
+ font: z.ZodOptional<z.ZodString>;
3074
+ bold: z.ZodOptional<z.ZodBoolean>;
3075
+ italic: z.ZodOptional<z.ZodBoolean>;
3076
+ underline: z.ZodOptional<z.ZodBoolean>;
3077
+ color: z.ZodOptional<z.ZodString>;
3078
+ height: z.ZodOptional<z.ZodNumber>;
3079
+ script: z.ZodOptional<z.ZodEnum<{
3080
+ sub: "sub";
3081
+ super: "super";
3082
+ }>>;
3083
+ }, z.core.$strip>>>;
2881
3084
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2882
3085
  x: z.ZodNumber;
2883
3086
  y: z.ZodNumber;
@@ -2889,17 +3092,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2889
3092
  right: "right";
2890
3093
  }>>;
2891
3094
  vAlign: z.ZodDefault<z.ZodEnum<{
2892
- center: "center";
2893
3095
  bottom: "bottom";
3096
+ center: "center";
2894
3097
  top: "top";
2895
3098
  }>>;
2896
3099
  frame: z.ZodOptional<z.ZodEnum<{
3100
+ bottom: "bottom";
2897
3101
  circle: "circle";
3102
+ firstLine: "firstLine";
2898
3103
  none: "none";
2899
- bottom: "bottom";
2900
3104
  rectangle: "rectangle";
2901
3105
  slot: "slot";
2902
- firstLine: "firstLine";
2903
3106
  }>>;
2904
3107
  styleId: z.ZodOptional<z.ZodString>;
2905
3108
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -2909,11 +3112,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2909
3112
  italic: z.ZodOptional<z.ZodBoolean>;
2910
3113
  textHeight: z.ZodOptional<z.ZodNumber>;
2911
3114
  arrowType: z.ZodOptional<z.ZodEnum<{
3115
+ dot: "dot";
2912
3116
  filled: "filled";
3117
+ none: "none";
2913
3118
  open: "open";
2914
3119
  tick: "tick";
2915
- dot: "dot";
2916
- none: "none";
2917
3120
  }>>;
2918
3121
  arrowSize: z.ZodOptional<z.ZodNumber>;
2919
3122
  }, z.core.$strip>>;
@@ -2929,20 +3132,36 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2929
3132
  opacity: z.ZodOptional<z.ZodNumber>;
2930
3133
  type: z.ZodLiteral<"dimension">;
2931
3134
  kind: z.ZodDefault<z.ZodEnum<{
2932
- linear: "linear";
2933
- radial: "radial";
2934
3135
  angular: "angular";
2935
3136
  diameter: "diameter";
3137
+ linear: "linear";
3138
+ radial: "radial";
2936
3139
  }>>;
2937
3140
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2938
3141
  x: z.ZodNumber;
2939
3142
  y: z.ZodNumber;
2940
3143
  }, z.core.$strip>, unknown>>;
2941
- offset: z.ZodPreprocess<z.ZodObject<{
2942
- x: z.ZodNumber;
2943
- y: z.ZodNumber;
2944
- }, z.core.$strip>, unknown>;
2945
- textOverride: z.ZodOptional<z.ZodString>;
3144
+ rotation: z.ZodOptional<z.ZodNumber>;
3145
+ offset: z.ZodOptional<z.ZodNumber>;
3146
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
3147
+ along: z.ZodOptional<z.ZodNumber>;
3148
+ across: z.ZodOptional<z.ZodNumber>;
3149
+ content: z.ZodOptional<z.ZodString>;
3150
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3151
+ start: z.ZodNumber;
3152
+ end: z.ZodNumber;
3153
+ font: z.ZodOptional<z.ZodString>;
3154
+ bold: z.ZodOptional<z.ZodBoolean>;
3155
+ italic: z.ZodOptional<z.ZodBoolean>;
3156
+ underline: z.ZodOptional<z.ZodBoolean>;
3157
+ color: z.ZodOptional<z.ZodString>;
3158
+ height: z.ZodOptional<z.ZodNumber>;
3159
+ script: z.ZodOptional<z.ZodEnum<{
3160
+ sub: "sub";
3161
+ super: "super";
3162
+ }>>;
3163
+ }, z.core.$strip>>>;
3164
+ }, z.core.$strip>>>;
2946
3165
  styleId: z.ZodOptional<z.ZodString>;
2947
3166
  styleOverride: z.ZodOptional<z.ZodObject<{
2948
3167
  font: z.ZodOptional<z.ZodString>;
@@ -2952,11 +3171,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2952
3171
  textHeight: z.ZodOptional<z.ZodNumber>;
2953
3172
  textOffset: z.ZodOptional<z.ZodNumber>;
2954
3173
  arrowType: z.ZodOptional<z.ZodEnum<{
3174
+ dot: "dot";
2955
3175
  filled: "filled";
3176
+ none: "none";
2956
3177
  open: "open";
2957
3178
  tick: "tick";
2958
- dot: "dot";
2959
- none: "none";
2960
3179
  }>>;
2961
3180
  arrowSize: z.ZodOptional<z.ZodNumber>;
2962
3181
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -3059,7 +3278,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3059
3278
  minHeight: z.ZodOptional<z.ZodNumber>;
3060
3279
  }, z.core.$strip>>, unknown>;
3061
3280
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3062
- text: z.ZodDefault<z.ZodString>;
3281
+ content: z.ZodDefault<z.ZodString>;
3282
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3283
+ start: z.ZodNumber;
3284
+ end: z.ZodNumber;
3285
+ font: z.ZodOptional<z.ZodString>;
3286
+ bold: z.ZodOptional<z.ZodBoolean>;
3287
+ italic: z.ZodOptional<z.ZodBoolean>;
3288
+ underline: z.ZodOptional<z.ZodBoolean>;
3289
+ color: z.ZodOptional<z.ZodString>;
3290
+ height: z.ZodOptional<z.ZodNumber>;
3291
+ script: z.ZodOptional<z.ZodEnum<{
3292
+ sub: "sub";
3293
+ super: "super";
3294
+ }>>;
3295
+ }, z.core.$strip>>>;
3063
3296
  span: z.ZodOptional<z.ZodObject<{
3064
3297
  cols: z.ZodNumber;
3065
3298
  rows: z.ZodNumber;
@@ -3070,8 +3303,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3070
3303
  right: "right";
3071
3304
  }>>;
3072
3305
  vAlign: z.ZodOptional<z.ZodEnum<{
3073
- center: "center";
3074
3306
  bottom: "bottom";
3307
+ center: "center";
3075
3308
  top: "top";
3076
3309
  }>>;
3077
3310
  styleId: z.ZodOptional<z.ZodString>;
@@ -3082,11 +3315,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3082
3315
  italic: z.ZodOptional<z.ZodBoolean>;
3083
3316
  textHeight: z.ZodOptional<z.ZodNumber>;
3084
3317
  arrowType: z.ZodOptional<z.ZodEnum<{
3318
+ dot: "dot";
3085
3319
  filled: "filled";
3320
+ none: "none";
3086
3321
  open: "open";
3087
3322
  tick: "tick";
3088
- dot: "dot";
3089
- none: "none";
3090
3323
  }>>;
3091
3324
  arrowSize: z.ZodOptional<z.ZodNumber>;
3092
3325
  }, z.core.$strip>>;
@@ -3095,10 +3328,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3095
3328
  headerRows: z.ZodDefault<z.ZodNumber>;
3096
3329
  cellMargin: z.ZodDefault<z.ZodNumber>;
3097
3330
  borders: z.ZodDefault<z.ZodEnum<{
3098
- none: "none";
3099
- rows: "rows";
3100
3331
  all: "all";
3332
+ none: "none";
3101
3333
  outer: "outer";
3334
+ rows: "rows";
3102
3335
  }>>;
3103
3336
  styleId: z.ZodOptional<z.ZodString>;
3104
3337
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -3108,11 +3341,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3108
3341
  italic: z.ZodOptional<z.ZodBoolean>;
3109
3342
  textHeight: z.ZodOptional<z.ZodNumber>;
3110
3343
  arrowType: z.ZodOptional<z.ZodEnum<{
3344
+ dot: "dot";
3111
3345
  filled: "filled";
3346
+ none: "none";
3112
3347
  open: "open";
3113
3348
  tick: "tick";
3114
- dot: "dot";
3115
- none: "none";
3116
3349
  }>>;
3117
3350
  arrowSize: z.ZodOptional<z.ZodNumber>;
3118
3351
  }, z.core.$strip>>;
@@ -3126,12 +3359,12 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3126
3359
  opacity: z.ZodOptional<z.ZodNumber>;
3127
3360
  type: z.ZodLiteral<"reference">;
3128
3361
  format: z.ZodEnum<{
3129
- linea: "linea";
3130
- dxf: "dxf";
3131
3362
  dwg: "dwg";
3363
+ dxf: "dxf";
3364
+ jpg: "jpg";
3365
+ linea: "linea";
3132
3366
  pdf: "pdf";
3133
3367
  png: "png";
3134
- jpg: "jpg";
3135
3368
  }>;
3136
3369
  name: z.ZodString;
3137
3370
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -3151,8 +3384,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3151
3384
  mirrored: z.ZodOptional<z.ZodBoolean>;
3152
3385
  pdfPage: z.ZodOptional<z.ZodNumber>;
3153
3386
  pdfMode: z.ZodOptional<z.ZodEnum<{
3154
- vector: "vector";
3155
3387
  raster: "raster";
3388
+ vector: "vector";
3156
3389
  }>>;
3157
3390
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
3158
3391
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -3294,6 +3527,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3294
3527
  name: z.ZodString;
3295
3528
  angle: z.ZodNumber;
3296
3529
  scale: z.ZodNumber;
3530
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
3531
+ x: z.ZodNumber;
3532
+ y: z.ZodNumber;
3533
+ }, z.core.$strip>, unknown>>;
3297
3534
  }, z.core.$strip>, z.ZodObject<{
3298
3535
  kind: z.ZodLiteral<"lines">;
3299
3536
  angle: z.ZodNumber;
@@ -3323,6 +3560,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3323
3560
  y: z.ZodNumber;
3324
3561
  }, z.core.$strip>, unknown>;
3325
3562
  content: z.ZodString;
3563
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3564
+ start: z.ZodNumber;
3565
+ end: z.ZodNumber;
3566
+ font: z.ZodOptional<z.ZodString>;
3567
+ bold: z.ZodOptional<z.ZodBoolean>;
3568
+ italic: z.ZodOptional<z.ZodBoolean>;
3569
+ underline: z.ZodOptional<z.ZodBoolean>;
3570
+ color: z.ZodOptional<z.ZodString>;
3571
+ height: z.ZodOptional<z.ZodNumber>;
3572
+ script: z.ZodOptional<z.ZodEnum<{
3573
+ sub: "sub";
3574
+ super: "super";
3575
+ }>>;
3576
+ }, z.core.$strip>>>;
3326
3577
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3327
3578
  x: z.ZodNumber;
3328
3579
  y: z.ZodNumber;
@@ -3334,17 +3585,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3334
3585
  right: "right";
3335
3586
  }>>;
3336
3587
  vAlign: z.ZodDefault<z.ZodEnum<{
3337
- center: "center";
3338
3588
  bottom: "bottom";
3589
+ center: "center";
3339
3590
  top: "top";
3340
3591
  }>>;
3341
3592
  frame: z.ZodOptional<z.ZodEnum<{
3593
+ bottom: "bottom";
3342
3594
  circle: "circle";
3595
+ firstLine: "firstLine";
3343
3596
  none: "none";
3344
- bottom: "bottom";
3345
3597
  rectangle: "rectangle";
3346
3598
  slot: "slot";
3347
- firstLine: "firstLine";
3348
3599
  }>>;
3349
3600
  styleId: z.ZodOptional<z.ZodString>;
3350
3601
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -3354,11 +3605,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3354
3605
  italic: z.ZodOptional<z.ZodBoolean>;
3355
3606
  textHeight: z.ZodOptional<z.ZodNumber>;
3356
3607
  arrowType: z.ZodOptional<z.ZodEnum<{
3608
+ dot: "dot";
3357
3609
  filled: "filled";
3610
+ none: "none";
3358
3611
  open: "open";
3359
3612
  tick: "tick";
3360
- dot: "dot";
3361
- none: "none";
3362
3613
  }>>;
3363
3614
  arrowSize: z.ZodOptional<z.ZodNumber>;
3364
3615
  }, z.core.$strip>>;
@@ -3374,20 +3625,36 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3374
3625
  opacity: z.ZodOptional<z.ZodNumber>;
3375
3626
  type: z.ZodLiteral<"dimension">;
3376
3627
  kind: z.ZodDefault<z.ZodEnum<{
3377
- linear: "linear";
3378
- radial: "radial";
3379
3628
  angular: "angular";
3380
3629
  diameter: "diameter";
3630
+ linear: "linear";
3631
+ radial: "radial";
3381
3632
  }>>;
3382
3633
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3383
3634
  x: z.ZodNumber;
3384
3635
  y: z.ZodNumber;
3385
3636
  }, z.core.$strip>, unknown>>;
3386
- offset: z.ZodPreprocess<z.ZodObject<{
3387
- x: z.ZodNumber;
3388
- y: z.ZodNumber;
3389
- }, z.core.$strip>, unknown>;
3390
- textOverride: z.ZodOptional<z.ZodString>;
3637
+ rotation: z.ZodOptional<z.ZodNumber>;
3638
+ offset: z.ZodOptional<z.ZodNumber>;
3639
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
3640
+ along: z.ZodOptional<z.ZodNumber>;
3641
+ across: z.ZodOptional<z.ZodNumber>;
3642
+ content: z.ZodOptional<z.ZodString>;
3643
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3644
+ start: z.ZodNumber;
3645
+ end: z.ZodNumber;
3646
+ font: z.ZodOptional<z.ZodString>;
3647
+ bold: z.ZodOptional<z.ZodBoolean>;
3648
+ italic: z.ZodOptional<z.ZodBoolean>;
3649
+ underline: z.ZodOptional<z.ZodBoolean>;
3650
+ color: z.ZodOptional<z.ZodString>;
3651
+ height: z.ZodOptional<z.ZodNumber>;
3652
+ script: z.ZodOptional<z.ZodEnum<{
3653
+ sub: "sub";
3654
+ super: "super";
3655
+ }>>;
3656
+ }, z.core.$strip>>>;
3657
+ }, z.core.$strip>>>;
3391
3658
  styleId: z.ZodOptional<z.ZodString>;
3392
3659
  styleOverride: z.ZodOptional<z.ZodObject<{
3393
3660
  font: z.ZodOptional<z.ZodString>;
@@ -3397,11 +3664,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3397
3664
  textHeight: z.ZodOptional<z.ZodNumber>;
3398
3665
  textOffset: z.ZodOptional<z.ZodNumber>;
3399
3666
  arrowType: z.ZodOptional<z.ZodEnum<{
3667
+ dot: "dot";
3400
3668
  filled: "filled";
3669
+ none: "none";
3401
3670
  open: "open";
3402
3671
  tick: "tick";
3403
- dot: "dot";
3404
- none: "none";
3405
3672
  }>>;
3406
3673
  arrowSize: z.ZodOptional<z.ZodNumber>;
3407
3674
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -3504,7 +3771,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3504
3771
  minHeight: z.ZodOptional<z.ZodNumber>;
3505
3772
  }, z.core.$strip>>, unknown>;
3506
3773
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3507
- text: z.ZodDefault<z.ZodString>;
3774
+ content: z.ZodDefault<z.ZodString>;
3775
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3776
+ start: z.ZodNumber;
3777
+ end: z.ZodNumber;
3778
+ font: z.ZodOptional<z.ZodString>;
3779
+ bold: z.ZodOptional<z.ZodBoolean>;
3780
+ italic: z.ZodOptional<z.ZodBoolean>;
3781
+ underline: z.ZodOptional<z.ZodBoolean>;
3782
+ color: z.ZodOptional<z.ZodString>;
3783
+ height: z.ZodOptional<z.ZodNumber>;
3784
+ script: z.ZodOptional<z.ZodEnum<{
3785
+ sub: "sub";
3786
+ super: "super";
3787
+ }>>;
3788
+ }, z.core.$strip>>>;
3508
3789
  span: z.ZodOptional<z.ZodObject<{
3509
3790
  cols: z.ZodNumber;
3510
3791
  rows: z.ZodNumber;
@@ -3515,8 +3796,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3515
3796
  right: "right";
3516
3797
  }>>;
3517
3798
  vAlign: z.ZodOptional<z.ZodEnum<{
3518
- center: "center";
3519
3799
  bottom: "bottom";
3800
+ center: "center";
3520
3801
  top: "top";
3521
3802
  }>>;
3522
3803
  styleId: z.ZodOptional<z.ZodString>;
@@ -3527,11 +3808,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3527
3808
  italic: z.ZodOptional<z.ZodBoolean>;
3528
3809
  textHeight: z.ZodOptional<z.ZodNumber>;
3529
3810
  arrowType: z.ZodOptional<z.ZodEnum<{
3811
+ dot: "dot";
3530
3812
  filled: "filled";
3813
+ none: "none";
3531
3814
  open: "open";
3532
3815
  tick: "tick";
3533
- dot: "dot";
3534
- none: "none";
3535
3816
  }>>;
3536
3817
  arrowSize: z.ZodOptional<z.ZodNumber>;
3537
3818
  }, z.core.$strip>>;
@@ -3540,10 +3821,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3540
3821
  headerRows: z.ZodDefault<z.ZodNumber>;
3541
3822
  cellMargin: z.ZodDefault<z.ZodNumber>;
3542
3823
  borders: z.ZodDefault<z.ZodEnum<{
3543
- none: "none";
3544
- rows: "rows";
3545
3824
  all: "all";
3825
+ none: "none";
3546
3826
  outer: "outer";
3827
+ rows: "rows";
3547
3828
  }>>;
3548
3829
  styleId: z.ZodOptional<z.ZodString>;
3549
3830
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -3553,11 +3834,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3553
3834
  italic: z.ZodOptional<z.ZodBoolean>;
3554
3835
  textHeight: z.ZodOptional<z.ZodNumber>;
3555
3836
  arrowType: z.ZodOptional<z.ZodEnum<{
3837
+ dot: "dot";
3556
3838
  filled: "filled";
3839
+ none: "none";
3557
3840
  open: "open";
3558
3841
  tick: "tick";
3559
- dot: "dot";
3560
- none: "none";
3561
3842
  }>>;
3562
3843
  arrowSize: z.ZodOptional<z.ZodNumber>;
3563
3844
  }, z.core.$strip>>;
@@ -3571,12 +3852,12 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3571
3852
  opacity: z.ZodOptional<z.ZodNumber>;
3572
3853
  type: z.ZodLiteral<"reference">;
3573
3854
  format: z.ZodEnum<{
3574
- linea: "linea";
3575
- dxf: "dxf";
3576
3855
  dwg: "dwg";
3856
+ dxf: "dxf";
3857
+ jpg: "jpg";
3858
+ linea: "linea";
3577
3859
  pdf: "pdf";
3578
3860
  png: "png";
3579
- jpg: "jpg";
3580
3861
  }>;
3581
3862
  name: z.ZodString;
3582
3863
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -3596,8 +3877,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3596
3877
  mirrored: z.ZodOptional<z.ZodBoolean>;
3597
3878
  pdfPage: z.ZodOptional<z.ZodNumber>;
3598
3879
  pdfMode: z.ZodOptional<z.ZodEnum<{
3599
- vector: "vector";
3600
3880
  raster: "raster";
3881
+ vector: "vector";
3601
3882
  }>>;
3602
3883
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
3603
3884
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -3681,6 +3962,14 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3681
3962
  }, z.core.$strip>, z.ZodObject<{
3682
3963
  type: z.ZodLiteral<"set-current-layer">;
3683
3964
  id: z.ZodString;
3965
+ }, z.core.$strip>, z.ZodObject<{
3966
+ type: z.ZodLiteral<"set-document-settings">;
3967
+ settings: z.ZodObject<{
3968
+ units: z.ZodDefault<z.ZodEnum<{
3969
+ in: "in";
3970
+ mm: "mm";
3971
+ }>>;
3972
+ }, z.core.$strip>;
3684
3973
  }, z.core.$strip>, z.ZodObject<{
3685
3974
  type: z.ZodLiteral<"add-layout">;
3686
3975
  layout: z.ZodObject<{
@@ -3813,6 +4102,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3813
4102
  name: z.ZodString;
3814
4103
  angle: z.ZodNumber;
3815
4104
  scale: z.ZodNumber;
4105
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
4106
+ x: z.ZodNumber;
4107
+ y: z.ZodNumber;
4108
+ }, z.core.$strip>, unknown>>;
3816
4109
  }, z.core.$strip>, z.ZodObject<{
3817
4110
  kind: z.ZodLiteral<"lines">;
3818
4111
  angle: z.ZodNumber;
@@ -3842,6 +4135,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3842
4135
  y: z.ZodNumber;
3843
4136
  }, z.core.$strip>, unknown>;
3844
4137
  content: z.ZodString;
4138
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4139
+ start: z.ZodNumber;
4140
+ end: z.ZodNumber;
4141
+ font: z.ZodOptional<z.ZodString>;
4142
+ bold: z.ZodOptional<z.ZodBoolean>;
4143
+ italic: z.ZodOptional<z.ZodBoolean>;
4144
+ underline: z.ZodOptional<z.ZodBoolean>;
4145
+ color: z.ZodOptional<z.ZodString>;
4146
+ height: z.ZodOptional<z.ZodNumber>;
4147
+ script: z.ZodOptional<z.ZodEnum<{
4148
+ sub: "sub";
4149
+ super: "super";
4150
+ }>>;
4151
+ }, z.core.$strip>>>;
3845
4152
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3846
4153
  x: z.ZodNumber;
3847
4154
  y: z.ZodNumber;
@@ -3853,17 +4160,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3853
4160
  right: "right";
3854
4161
  }>>;
3855
4162
  vAlign: z.ZodDefault<z.ZodEnum<{
3856
- center: "center";
3857
4163
  bottom: "bottom";
4164
+ center: "center";
3858
4165
  top: "top";
3859
4166
  }>>;
3860
4167
  frame: z.ZodOptional<z.ZodEnum<{
4168
+ bottom: "bottom";
3861
4169
  circle: "circle";
4170
+ firstLine: "firstLine";
3862
4171
  none: "none";
3863
- bottom: "bottom";
3864
4172
  rectangle: "rectangle";
3865
4173
  slot: "slot";
3866
- firstLine: "firstLine";
3867
4174
  }>>;
3868
4175
  styleId: z.ZodOptional<z.ZodString>;
3869
4176
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -3873,11 +4180,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3873
4180
  italic: z.ZodOptional<z.ZodBoolean>;
3874
4181
  textHeight: z.ZodOptional<z.ZodNumber>;
3875
4182
  arrowType: z.ZodOptional<z.ZodEnum<{
4183
+ dot: "dot";
3876
4184
  filled: "filled";
4185
+ none: "none";
3877
4186
  open: "open";
3878
4187
  tick: "tick";
3879
- dot: "dot";
3880
- none: "none";
3881
4188
  }>>;
3882
4189
  arrowSize: z.ZodOptional<z.ZodNumber>;
3883
4190
  }, z.core.$strip>>;
@@ -3893,20 +4200,36 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3893
4200
  opacity: z.ZodOptional<z.ZodNumber>;
3894
4201
  type: z.ZodLiteral<"dimension">;
3895
4202
  kind: z.ZodDefault<z.ZodEnum<{
3896
- linear: "linear";
3897
- radial: "radial";
3898
4203
  angular: "angular";
3899
4204
  diameter: "diameter";
4205
+ linear: "linear";
4206
+ radial: "radial";
3900
4207
  }>>;
3901
4208
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3902
4209
  x: z.ZodNumber;
3903
4210
  y: z.ZodNumber;
3904
4211
  }, z.core.$strip>, unknown>>;
3905
- offset: z.ZodPreprocess<z.ZodObject<{
3906
- x: z.ZodNumber;
3907
- y: z.ZodNumber;
3908
- }, z.core.$strip>, unknown>;
3909
- textOverride: z.ZodOptional<z.ZodString>;
4212
+ rotation: z.ZodOptional<z.ZodNumber>;
4213
+ offset: z.ZodOptional<z.ZodNumber>;
4214
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
4215
+ along: z.ZodOptional<z.ZodNumber>;
4216
+ across: z.ZodOptional<z.ZodNumber>;
4217
+ content: z.ZodOptional<z.ZodString>;
4218
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4219
+ start: z.ZodNumber;
4220
+ end: z.ZodNumber;
4221
+ font: z.ZodOptional<z.ZodString>;
4222
+ bold: z.ZodOptional<z.ZodBoolean>;
4223
+ italic: z.ZodOptional<z.ZodBoolean>;
4224
+ underline: z.ZodOptional<z.ZodBoolean>;
4225
+ color: z.ZodOptional<z.ZodString>;
4226
+ height: z.ZodOptional<z.ZodNumber>;
4227
+ script: z.ZodOptional<z.ZodEnum<{
4228
+ sub: "sub";
4229
+ super: "super";
4230
+ }>>;
4231
+ }, z.core.$strip>>>;
4232
+ }, z.core.$strip>>>;
3910
4233
  styleId: z.ZodOptional<z.ZodString>;
3911
4234
  styleOverride: z.ZodOptional<z.ZodObject<{
3912
4235
  font: z.ZodOptional<z.ZodString>;
@@ -3916,11 +4239,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3916
4239
  textHeight: z.ZodOptional<z.ZodNumber>;
3917
4240
  textOffset: z.ZodOptional<z.ZodNumber>;
3918
4241
  arrowType: z.ZodOptional<z.ZodEnum<{
4242
+ dot: "dot";
3919
4243
  filled: "filled";
4244
+ none: "none";
3920
4245
  open: "open";
3921
4246
  tick: "tick";
3922
- dot: "dot";
3923
- none: "none";
3924
4247
  }>>;
3925
4248
  arrowSize: z.ZodOptional<z.ZodNumber>;
3926
4249
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -4023,10 +4346,24 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4023
4346
  minHeight: z.ZodOptional<z.ZodNumber>;
4024
4347
  }, z.core.$strip>>, unknown>;
4025
4348
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4026
- text: z.ZodDefault<z.ZodString>;
4027
- span: z.ZodOptional<z.ZodObject<{
4028
- cols: z.ZodNumber;
4029
- rows: z.ZodNumber;
4349
+ content: z.ZodDefault<z.ZodString>;
4350
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4351
+ start: z.ZodNumber;
4352
+ end: z.ZodNumber;
4353
+ font: z.ZodOptional<z.ZodString>;
4354
+ bold: z.ZodOptional<z.ZodBoolean>;
4355
+ italic: z.ZodOptional<z.ZodBoolean>;
4356
+ underline: z.ZodOptional<z.ZodBoolean>;
4357
+ color: z.ZodOptional<z.ZodString>;
4358
+ height: z.ZodOptional<z.ZodNumber>;
4359
+ script: z.ZodOptional<z.ZodEnum<{
4360
+ sub: "sub";
4361
+ super: "super";
4362
+ }>>;
4363
+ }, z.core.$strip>>>;
4364
+ span: z.ZodOptional<z.ZodObject<{
4365
+ cols: z.ZodNumber;
4366
+ rows: z.ZodNumber;
4030
4367
  }, z.core.$strip>>;
4031
4368
  hAlign: z.ZodOptional<z.ZodEnum<{
4032
4369
  center: "center";
@@ -4034,8 +4371,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4034
4371
  right: "right";
4035
4372
  }>>;
4036
4373
  vAlign: z.ZodOptional<z.ZodEnum<{
4037
- center: "center";
4038
4374
  bottom: "bottom";
4375
+ center: "center";
4039
4376
  top: "top";
4040
4377
  }>>;
4041
4378
  styleId: z.ZodOptional<z.ZodString>;
@@ -4046,11 +4383,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4046
4383
  italic: z.ZodOptional<z.ZodBoolean>;
4047
4384
  textHeight: z.ZodOptional<z.ZodNumber>;
4048
4385
  arrowType: z.ZodOptional<z.ZodEnum<{
4386
+ dot: "dot";
4049
4387
  filled: "filled";
4388
+ none: "none";
4050
4389
  open: "open";
4051
4390
  tick: "tick";
4052
- dot: "dot";
4053
- none: "none";
4054
4391
  }>>;
4055
4392
  arrowSize: z.ZodOptional<z.ZodNumber>;
4056
4393
  }, z.core.$strip>>;
@@ -4059,10 +4396,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4059
4396
  headerRows: z.ZodDefault<z.ZodNumber>;
4060
4397
  cellMargin: z.ZodDefault<z.ZodNumber>;
4061
4398
  borders: z.ZodDefault<z.ZodEnum<{
4062
- none: "none";
4063
- rows: "rows";
4064
4399
  all: "all";
4400
+ none: "none";
4065
4401
  outer: "outer";
4402
+ rows: "rows";
4066
4403
  }>>;
4067
4404
  styleId: z.ZodOptional<z.ZodString>;
4068
4405
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -4072,11 +4409,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4072
4409
  italic: z.ZodOptional<z.ZodBoolean>;
4073
4410
  textHeight: z.ZodOptional<z.ZodNumber>;
4074
4411
  arrowType: z.ZodOptional<z.ZodEnum<{
4412
+ dot: "dot";
4075
4413
  filled: "filled";
4414
+ none: "none";
4076
4415
  open: "open";
4077
4416
  tick: "tick";
4078
- dot: "dot";
4079
- none: "none";
4080
4417
  }>>;
4081
4418
  arrowSize: z.ZodOptional<z.ZodNumber>;
4082
4419
  }, z.core.$strip>>;
@@ -4090,12 +4427,12 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4090
4427
  opacity: z.ZodOptional<z.ZodNumber>;
4091
4428
  type: z.ZodLiteral<"reference">;
4092
4429
  format: z.ZodEnum<{
4093
- linea: "linea";
4094
- dxf: "dxf";
4095
4430
  dwg: "dwg";
4431
+ dxf: "dxf";
4432
+ jpg: "jpg";
4433
+ linea: "linea";
4096
4434
  pdf: "pdf";
4097
4435
  png: "png";
4098
- jpg: "jpg";
4099
4436
  }>;
4100
4437
  name: z.ZodString;
4101
4438
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -4115,8 +4452,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4115
4452
  mirrored: z.ZodOptional<z.ZodBoolean>;
4116
4453
  pdfPage: z.ZodOptional<z.ZodNumber>;
4117
4454
  pdfMode: z.ZodOptional<z.ZodEnum<{
4118
- vector: "vector";
4119
4455
  raster: "raster";
4456
+ vector: "vector";
4120
4457
  }>>;
4121
4458
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
4122
4459
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -4287,6 +4624,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4287
4624
  name: z.ZodString;
4288
4625
  angle: z.ZodNumber;
4289
4626
  scale: z.ZodNumber;
4627
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
4628
+ x: z.ZodNumber;
4629
+ y: z.ZodNumber;
4630
+ }, z.core.$strip>, unknown>>;
4290
4631
  }, z.core.$strip>, z.ZodObject<{
4291
4632
  kind: z.ZodLiteral<"lines">;
4292
4633
  angle: z.ZodNumber;
@@ -4316,6 +4657,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4316
4657
  y: z.ZodNumber;
4317
4658
  }, z.core.$strip>, unknown>;
4318
4659
  content: z.ZodString;
4660
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4661
+ start: z.ZodNumber;
4662
+ end: z.ZodNumber;
4663
+ font: z.ZodOptional<z.ZodString>;
4664
+ bold: z.ZodOptional<z.ZodBoolean>;
4665
+ italic: z.ZodOptional<z.ZodBoolean>;
4666
+ underline: z.ZodOptional<z.ZodBoolean>;
4667
+ color: z.ZodOptional<z.ZodString>;
4668
+ height: z.ZodOptional<z.ZodNumber>;
4669
+ script: z.ZodOptional<z.ZodEnum<{
4670
+ sub: "sub";
4671
+ super: "super";
4672
+ }>>;
4673
+ }, z.core.$strip>>>;
4319
4674
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4320
4675
  x: z.ZodNumber;
4321
4676
  y: z.ZodNumber;
@@ -4327,17 +4682,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4327
4682
  right: "right";
4328
4683
  }>>;
4329
4684
  vAlign: z.ZodDefault<z.ZodEnum<{
4330
- center: "center";
4331
4685
  bottom: "bottom";
4686
+ center: "center";
4332
4687
  top: "top";
4333
4688
  }>>;
4334
4689
  frame: z.ZodOptional<z.ZodEnum<{
4690
+ bottom: "bottom";
4335
4691
  circle: "circle";
4692
+ firstLine: "firstLine";
4336
4693
  none: "none";
4337
- bottom: "bottom";
4338
4694
  rectangle: "rectangle";
4339
4695
  slot: "slot";
4340
- firstLine: "firstLine";
4341
4696
  }>>;
4342
4697
  styleId: z.ZodOptional<z.ZodString>;
4343
4698
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -4347,11 +4702,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4347
4702
  italic: z.ZodOptional<z.ZodBoolean>;
4348
4703
  textHeight: z.ZodOptional<z.ZodNumber>;
4349
4704
  arrowType: z.ZodOptional<z.ZodEnum<{
4705
+ dot: "dot";
4350
4706
  filled: "filled";
4707
+ none: "none";
4351
4708
  open: "open";
4352
4709
  tick: "tick";
4353
- dot: "dot";
4354
- none: "none";
4355
4710
  }>>;
4356
4711
  arrowSize: z.ZodOptional<z.ZodNumber>;
4357
4712
  }, z.core.$strip>>;
@@ -4367,20 +4722,36 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4367
4722
  opacity: z.ZodOptional<z.ZodNumber>;
4368
4723
  type: z.ZodLiteral<"dimension">;
4369
4724
  kind: z.ZodDefault<z.ZodEnum<{
4370
- linear: "linear";
4371
- radial: "radial";
4372
4725
  angular: "angular";
4373
4726
  diameter: "diameter";
4727
+ linear: "linear";
4728
+ radial: "radial";
4374
4729
  }>>;
4375
4730
  points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4376
4731
  x: z.ZodNumber;
4377
4732
  y: z.ZodNumber;
4378
4733
  }, z.core.$strip>, unknown>>;
4379
- offset: z.ZodPreprocess<z.ZodObject<{
4380
- x: z.ZodNumber;
4381
- y: z.ZodNumber;
4382
- }, z.core.$strip>, unknown>;
4383
- textOverride: z.ZodOptional<z.ZodString>;
4734
+ rotation: z.ZodOptional<z.ZodNumber>;
4735
+ offset: z.ZodOptional<z.ZodNumber>;
4736
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
4737
+ along: z.ZodOptional<z.ZodNumber>;
4738
+ across: z.ZodOptional<z.ZodNumber>;
4739
+ content: z.ZodOptional<z.ZodString>;
4740
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4741
+ start: z.ZodNumber;
4742
+ end: z.ZodNumber;
4743
+ font: z.ZodOptional<z.ZodString>;
4744
+ bold: z.ZodOptional<z.ZodBoolean>;
4745
+ italic: z.ZodOptional<z.ZodBoolean>;
4746
+ underline: z.ZodOptional<z.ZodBoolean>;
4747
+ color: z.ZodOptional<z.ZodString>;
4748
+ height: z.ZodOptional<z.ZodNumber>;
4749
+ script: z.ZodOptional<z.ZodEnum<{
4750
+ sub: "sub";
4751
+ super: "super";
4752
+ }>>;
4753
+ }, z.core.$strip>>>;
4754
+ }, z.core.$strip>>>;
4384
4755
  styleId: z.ZodOptional<z.ZodString>;
4385
4756
  styleOverride: z.ZodOptional<z.ZodObject<{
4386
4757
  font: z.ZodOptional<z.ZodString>;
@@ -4390,11 +4761,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4390
4761
  textHeight: z.ZodOptional<z.ZodNumber>;
4391
4762
  textOffset: z.ZodOptional<z.ZodNumber>;
4392
4763
  arrowType: z.ZodOptional<z.ZodEnum<{
4764
+ dot: "dot";
4393
4765
  filled: "filled";
4766
+ none: "none";
4394
4767
  open: "open";
4395
4768
  tick: "tick";
4396
- dot: "dot";
4397
- none: "none";
4398
4769
  }>>;
4399
4770
  arrowSize: z.ZodOptional<z.ZodNumber>;
4400
4771
  extensionType: z.ZodOptional<z.ZodEnum<{
@@ -4497,7 +4868,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4497
4868
  minHeight: z.ZodOptional<z.ZodNumber>;
4498
4869
  }, z.core.$strip>>, unknown>;
4499
4870
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4500
- text: z.ZodDefault<z.ZodString>;
4871
+ content: z.ZodDefault<z.ZodString>;
4872
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4873
+ start: z.ZodNumber;
4874
+ end: z.ZodNumber;
4875
+ font: z.ZodOptional<z.ZodString>;
4876
+ bold: z.ZodOptional<z.ZodBoolean>;
4877
+ italic: z.ZodOptional<z.ZodBoolean>;
4878
+ underline: z.ZodOptional<z.ZodBoolean>;
4879
+ color: z.ZodOptional<z.ZodString>;
4880
+ height: z.ZodOptional<z.ZodNumber>;
4881
+ script: z.ZodOptional<z.ZodEnum<{
4882
+ sub: "sub";
4883
+ super: "super";
4884
+ }>>;
4885
+ }, z.core.$strip>>>;
4501
4886
  span: z.ZodOptional<z.ZodObject<{
4502
4887
  cols: z.ZodNumber;
4503
4888
  rows: z.ZodNumber;
@@ -4508,8 +4893,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4508
4893
  right: "right";
4509
4894
  }>>;
4510
4895
  vAlign: z.ZodOptional<z.ZodEnum<{
4511
- center: "center";
4512
4896
  bottom: "bottom";
4897
+ center: "center";
4513
4898
  top: "top";
4514
4899
  }>>;
4515
4900
  styleId: z.ZodOptional<z.ZodString>;
@@ -4520,11 +4905,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4520
4905
  italic: z.ZodOptional<z.ZodBoolean>;
4521
4906
  textHeight: z.ZodOptional<z.ZodNumber>;
4522
4907
  arrowType: z.ZodOptional<z.ZodEnum<{
4908
+ dot: "dot";
4523
4909
  filled: "filled";
4910
+ none: "none";
4524
4911
  open: "open";
4525
4912
  tick: "tick";
4526
- dot: "dot";
4527
- none: "none";
4528
4913
  }>>;
4529
4914
  arrowSize: z.ZodOptional<z.ZodNumber>;
4530
4915
  }, z.core.$strip>>;
@@ -4533,10 +4918,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4533
4918
  headerRows: z.ZodDefault<z.ZodNumber>;
4534
4919
  cellMargin: z.ZodDefault<z.ZodNumber>;
4535
4920
  borders: z.ZodDefault<z.ZodEnum<{
4536
- none: "none";
4537
- rows: "rows";
4538
4921
  all: "all";
4922
+ none: "none";
4539
4923
  outer: "outer";
4924
+ rows: "rows";
4540
4925
  }>>;
4541
4926
  styleId: z.ZodOptional<z.ZodString>;
4542
4927
  styleOverride: z.ZodOptional<z.ZodObject<{
@@ -4546,11 +4931,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4546
4931
  italic: z.ZodOptional<z.ZodBoolean>;
4547
4932
  textHeight: z.ZodOptional<z.ZodNumber>;
4548
4933
  arrowType: z.ZodOptional<z.ZodEnum<{
4934
+ dot: "dot";
4549
4935
  filled: "filled";
4936
+ none: "none";
4550
4937
  open: "open";
4551
4938
  tick: "tick";
4552
- dot: "dot";
4553
- none: "none";
4554
4939
  }>>;
4555
4940
  arrowSize: z.ZodOptional<z.ZodNumber>;
4556
4941
  }, z.core.$strip>>;
@@ -4564,12 +4949,12 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4564
4949
  opacity: z.ZodOptional<z.ZodNumber>;
4565
4950
  type: z.ZodLiteral<"reference">;
4566
4951
  format: z.ZodEnum<{
4567
- linea: "linea";
4568
- dxf: "dxf";
4569
4952
  dwg: "dwg";
4953
+ dxf: "dxf";
4954
+ jpg: "jpg";
4955
+ linea: "linea";
4570
4956
  pdf: "pdf";
4571
4957
  png: "png";
4572
- jpg: "jpg";
4573
4958
  }>;
4574
4959
  name: z.ZodString;
4575
4960
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -4589,8 +4974,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4589
4974
  mirrored: z.ZodOptional<z.ZodBoolean>;
4590
4975
  pdfPage: z.ZodOptional<z.ZodNumber>;
4591
4976
  pdfMode: z.ZodOptional<z.ZodEnum<{
4592
- vector: "vector";
4593
4977
  raster: "raster";
4978
+ vector: "vector";
4594
4979
  }>>;
4595
4980
  hiddenLayers: z.ZodDefault<z.ZodArray<z.ZodString>>;
4596
4981
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -4620,11 +5005,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4620
5005
  italic: z.ZodOptional<z.ZodBoolean>;
4621
5006
  textHeight: z.ZodDefault<z.ZodNumber>;
4622
5007
  arrowType: z.ZodDefault<z.ZodEnum<{
5008
+ dot: "dot";
4623
5009
  filled: "filled";
5010
+ none: "none";
4624
5011
  open: "open";
4625
5012
  tick: "tick";
4626
- dot: "dot";
4627
- none: "none";
4628
5013
  }>>;
4629
5014
  arrowSize: z.ZodDefault<z.ZodNumber>;
4630
5015
  }, z.core.$strip>;
@@ -4640,11 +5025,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4640
5025
  italic: z.ZodOptional<z.ZodBoolean>;
4641
5026
  textHeight: z.ZodDefault<z.ZodNumber>;
4642
5027
  arrowType: z.ZodDefault<z.ZodEnum<{
5028
+ dot: "dot";
4643
5029
  filled: "filled";
5030
+ none: "none";
4644
5031
  open: "open";
4645
5032
  tick: "tick";
4646
- dot: "dot";
4647
- none: "none";
4648
5033
  }>>;
4649
5034
  arrowSize: z.ZodDefault<z.ZodNumber>;
4650
5035
  }, z.core.$strip>;
@@ -4665,14 +5050,68 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4665
5050
  italic: z.ZodOptional<z.ZodBoolean>;
4666
5051
  textHeight: z.ZodDefault<z.ZodNumber>;
4667
5052
  arrowType: z.ZodDefault<z.ZodEnum<{
5053
+ dot: "dot";
4668
5054
  filled: "filled";
5055
+ none: "none";
4669
5056
  open: "open";
4670
5057
  tick: "tick";
4671
- dot: "dot";
4672
- none: "none";
4673
5058
  }>>;
4674
5059
  arrowSize: z.ZodDefault<z.ZodNumber>;
4675
5060
  }, z.core.$strip>>;
5061
+ }, z.core.$strip>, z.ZodObject<{
5062
+ type: z.ZodLiteral<"add-line-type">;
5063
+ lineType: z.ZodObject<{
5064
+ name: z.ZodString;
5065
+ description: z.ZodOptional<z.ZodString>;
5066
+ dashesMm: z.ZodArray<z.ZodNumber>;
5067
+ }, z.core.$strip>;
5068
+ index: z.ZodOptional<z.ZodNumber>;
5069
+ }, z.core.$strip>, z.ZodObject<{
5070
+ type: z.ZodLiteral<"update-line-type">;
5071
+ lineType: z.ZodObject<{
5072
+ name: z.ZodString;
5073
+ description: z.ZodOptional<z.ZodString>;
5074
+ dashesMm: z.ZodArray<z.ZodNumber>;
5075
+ }, z.core.$strip>;
5076
+ }, z.core.$strip>, z.ZodObject<{
5077
+ type: z.ZodLiteral<"remove-line-type">;
5078
+ name: z.ZodString;
5079
+ }, z.core.$strip>, z.ZodObject<{
5080
+ type: z.ZodLiteral<"add-hatch-pattern">;
5081
+ hatchPattern: z.ZodObject<{
5082
+ name: z.ZodString;
5083
+ description: z.ZodOptional<z.ZodString>;
5084
+ lines: z.ZodArray<z.ZodObject<{
5085
+ angle: z.ZodNumber;
5086
+ origin: z.ZodPreprocess<z.ZodObject<{
5087
+ x: z.ZodNumber;
5088
+ y: z.ZodNumber;
5089
+ }, z.core.$strip>, unknown>;
5090
+ deltaX: z.ZodNumber;
5091
+ deltaY: z.ZodNumber;
5092
+ dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
5093
+ }, z.core.$strip>>;
5094
+ }, z.core.$strip>;
5095
+ index: z.ZodOptional<z.ZodNumber>;
5096
+ }, z.core.$strip>, z.ZodObject<{
5097
+ type: z.ZodLiteral<"update-hatch-pattern">;
5098
+ hatchPattern: z.ZodObject<{
5099
+ name: z.ZodString;
5100
+ description: z.ZodOptional<z.ZodString>;
5101
+ lines: z.ZodArray<z.ZodObject<{
5102
+ angle: z.ZodNumber;
5103
+ origin: z.ZodPreprocess<z.ZodObject<{
5104
+ x: z.ZodNumber;
5105
+ y: z.ZodNumber;
5106
+ }, z.core.$strip>, unknown>;
5107
+ deltaX: z.ZodNumber;
5108
+ deltaY: z.ZodNumber;
5109
+ dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
5110
+ }, z.core.$strip>>;
5111
+ }, z.core.$strip>;
5112
+ }, z.core.$strip>, z.ZodObject<{
5113
+ type: z.ZodLiteral<"remove-hatch-pattern">;
5114
+ name: z.ZodString;
4676
5115
  }, z.core.$strip>, z.ZodObject<{
4677
5116
  type: z.ZodLiteral<"add-dim-style">;
4678
5117
  style: z.ZodObject<{
@@ -4685,11 +5124,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4685
5124
  textHeight: z.ZodDefault<z.ZodNumber>;
4686
5125
  textOffset: z.ZodDefault<z.ZodNumber>;
4687
5126
  arrowType: z.ZodDefault<z.ZodEnum<{
5127
+ dot: "dot";
4688
5128
  filled: "filled";
5129
+ none: "none";
4689
5130
  open: "open";
4690
5131
  tick: "tick";
4691
- dot: "dot";
4692
- none: "none";
4693
5132
  }>>;
4694
5133
  arrowSize: z.ZodDefault<z.ZodNumber>;
4695
5134
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -4713,11 +5152,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4713
5152
  textHeight: z.ZodDefault<z.ZodNumber>;
4714
5153
  textOffset: z.ZodDefault<z.ZodNumber>;
4715
5154
  arrowType: z.ZodDefault<z.ZodEnum<{
5155
+ dot: "dot";
4716
5156
  filled: "filled";
5157
+ none: "none";
4717
5158
  open: "open";
4718
5159
  tick: "tick";
4719
- dot: "dot";
4720
- none: "none";
4721
5160
  }>>;
4722
5161
  arrowSize: z.ZodDefault<z.ZodNumber>;
4723
5162
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -4746,11 +5185,11 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4746
5185
  textHeight: z.ZodDefault<z.ZodNumber>;
4747
5186
  textOffset: z.ZodDefault<z.ZodNumber>;
4748
5187
  arrowType: z.ZodDefault<z.ZodEnum<{
5188
+ dot: "dot";
4749
5189
  filled: "filled";
5190
+ none: "none";
4750
5191
  open: "open";
4751
5192
  tick: "tick";
4752
- dot: "dot";
4753
- none: "none";
4754
5193
  }>>;
4755
5194
  arrowSize: z.ZodDefault<z.ZodNumber>;
4756
5195
  extensionType: z.ZodDefault<z.ZodEnum<{
@@ -4805,351 +5244,107 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4805
5244
  }, z.core.$strip>], "type">;
4806
5245
  type Operation = z.infer<typeof OperationSchema>;
4807
5246
 
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;
4852
- }
5247
+ type DwgVersion = "AC1015" | "AC1018" | "AC1021" | "AC1024" | "AC1027" | "AC1032";
4853
5248
 
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;
4884
- }
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;
5249
+ interface DxfImportOptions {
5250
+ /** mm per drawing unit; overrides the file's $INSUNITS header. */
5251
+ unitOverride?: number;
4890
5252
  }
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
- }[];
5253
+ interface DxfImportReport {
5254
+ objects: number;
5255
+ layers: number;
5256
+ layouts: number;
5257
+ objectIds: string[];
5258
+ layoutIds: string[];
5259
+ /** `SOURCE→what` → entities imported as an approximation. */
5260
+ degraded: Record<string, number>;
5261
+ /** Entity type or reason → entities that produced nothing. */
5262
+ skipped: Record<string, number>;
5263
+ /** Text / dimension styles the file's STYLE / DIMSTYLE tables added
5264
+ * (styles matching an existing one by name and values are reused). */
5265
+ textStyles: number;
5266
+ dimStyles: number;
5267
+ /** Block definitions generated for the file's INSERTs (uniform-scale
5268
+ * inserts become instances of them). */
5269
+ blockDefinitions: number;
5270
+ /** Line type / hatch pattern definitions the file added (LTYPE table
5271
+ * entries the catalogue lacks; HATCH definition lines). */
5272
+ lineTypes: number;
5273
+ hatchPatterns: number;
4906
5274
  }
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;
5275
+ interface PdfImportReport {
5276
+ objects: number;
5277
+ pageCount: number;
5278
+ objectIds: string[];
4918
5279
  }
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;
5280
+ interface PdfImportOptions {
5281
+ /** "vectors" (default): lines and text runs. "image": every page
5282
+ * rasterized and placed as an image at true page scale — a host
5283
+ * capability (`rasterizePdf`), refused where it is missing. */
5284
+ as?: "vectors" | "image";
5285
+ /** Bottom-left corner of the first page (image mode; default 0,0). Pages
5286
+ * line up to the right. */
5287
+ origin?: PointInput;
4925
5288
  }
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;
5289
+ /** One PDF page rasterized: PNG pixels plus its true size in mm. */
5290
+ interface RasterPdfPage {
5291
+ dataUrl: string;
5292
+ widthMm: number;
5293
+ heightMm: number;
4932
5294
  }
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;
5295
+ /** An embedded image asset as `listAssets` reports it. */
5296
+ interface AssetInfo {
5297
+ id: string;
5298
+ /** From the data URL, e.g. "image/png". */
5299
+ mimeType: string;
5300
+ /** Decoded size in bytes. */
5301
+ bytes: number;
5302
+ /** Image objects (every space) that show it. */
5303
+ users: number;
4945
5304
  }
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;
4956
- }
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;
4963
- }
4964
- interface AddOptions {
4965
- /** Target paper layout (name or id); default: model space. */
4966
- layout?: string;
4967
- }
4968
- /** Result of installing module sources (blocks or commands). */
4969
- type MergeReport = MergeModulesResult<{
4970
- id: string;
4971
- name: string;
4972
- }>;
4973
5305
  /**
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.
5306
+ * Where a LocalDrawing's document lives and how its edits are recorded. Absent
5307
+ * (constructed from a document), LocalDrawing owns a kernel and its own undo
5308
+ * stacks; the editor passes hooks over its live stores so agent and script
5309
+ * edits go through the mutation funnel and the user's history.
4978
5310
  */
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). */
5311
+ interface DrawingHooks {
5312
+ /** The live document — read only, never handed out. */
5313
+ document(): LineaDocument;
5314
+ /** Apply one validated op (throws when refused). */
5315
+ apply(op: Operation): void;
5316
+ /** One undo step for everything `fn` applies; a throw (or rejection)
5317
+ * rolls it back and rethrows. Nested calls join the outer step. */
5318
+ transaction<T>(fn: () => T): T;
5319
+ inTransaction(): boolean;
5077
5320
  undo(): boolean;
5078
5321
  redo(): boolean;
5322
+ canUndo(): boolean;
5323
+ canRedo(): boolean;
5324
+ /** Bumped by every change the drawing should report (agents poll it). */
5325
+ revision(): number;
5326
+ /** Text metrics for bounds and DXF (default: approximate font metrics). */
5327
+ measure?: TextMeasurer;
5328
+ /** Document-wide object lookup for block reference inputs. */
5329
+ resolveObject?: (id: string) => ModelObject | undefined;
5330
+ /** Loaded reference content (default: the drawing's referenceContent). */
5331
+ resolveReference?: (ref: ReferenceObject) => ReferenceContent | null;
5332
+ /** Snap/hit-test geometry, e.g. from a cache (default: built per call). */
5333
+ snapEntry?: (obj: ModelObject) => SnapCacheEntry;
5334
+ /** Where the host keeps its marketplace list and how it reaches them
5335
+ * (default: an in-memory list holding the public collection, fetched
5336
+ * with the platform's fetch — folder marketplaces then need a reader). */
5337
+ marketplaces?: MarketplaceHost;
5079
5338
  }
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[];
5339
+ /** A host's marketplace configuration: the list (the editor's settings, a
5340
+ * process's config) and the client that fetches from it. */
5341
+ interface MarketplaceHost {
5342
+ list(): MarketplaceConfig[];
5343
+ set(list: MarketplaceConfig[]): void;
5344
+ client: MarketplaceClient;
5146
5345
  }
5147
5346
  declare class LocalDrawing implements Drawing$1 {
5148
- protected kernel: DocumentKernel;
5149
- private undoStack;
5150
- private redoStack;
5151
- private txn;
5152
- private rev;
5347
+ private hooks;
5153
5348
  /** Schema-version migration applied on open; null when none was needed. */
5154
5349
  readonly migration: {
5155
5350
  from: number;
@@ -5163,11 +5358,13 @@ declare class LocalDrawing implements Drawing$1 {
5163
5358
  * snap as frames. docs/references.md. */
5164
5359
  protected referenceContent: Map<string, ReferenceContent>;
5165
5360
  private resolveReference;
5166
- constructor(doc: LineaDocument, migration?: {
5361
+ /** A document (owned here: kernel + undo stacks), or hooks over a document
5362
+ * that lives elsewhere (the editor's stores). */
5363
+ constructor(source: LineaDocument | DrawingHooks, migration?: {
5167
5364
  from: number;
5168
5365
  to: number;
5169
5366
  } | null);
5170
- /** The live kernel state — internal reads only; NEVER handed out. */
5367
+ /** The live document — internal reads only; NEVER handed out. */
5171
5368
  protected get state(): LineaDocument;
5172
5369
  get id(): string;
5173
5370
  get revision(): number;
@@ -5214,6 +5411,7 @@ declare class LocalDrawing implements Drawing$1 {
5214
5411
  reorderLayers(order: readonly string[]): void;
5215
5412
  /** The layer newly added objects default to. */
5216
5413
  setCurrentLayer(nameOrId: string): void;
5414
+ updateSettings(patch: Partial<LineaDocument["settings"]>): void;
5217
5415
  /**
5218
5416
  * Embed image pixels (a data URL) and return the assetId that `image`
5219
5417
  * objects reference. Content-keyed: the same data reuses one entry.
@@ -5221,13 +5419,63 @@ declare class LocalDrawing implements Drawing$1 {
5221
5419
  addAsset(dataUrl: string): string;
5222
5420
  /** Remove an asset (the kernel refuses while an image references it). */
5223
5421
  removeAsset(id: string): void;
5224
- private patchedStyle;
5225
- /** Patch a document dimension style (default: the first). */
5422
+ listAssets(): AssetInfo[];
5423
+ /** Merge DXF text into the document (new layers, objects, layouts). */
5424
+ importDxfText(text: string, opts?: DxfImportOptions): DxfImportReport;
5425
+ /** Merge DWG bytes into the document (wasm transcode → the DXF path). */
5426
+ importDwgData(data: Uint8Array, opts?: DxfImportOptions): Promise<DxfImportReport>;
5427
+ /** Merge a PDF: its vector/text content onto the current layer, or
5428
+ * (`as: "image"`) every page as an image at true page scale. */
5429
+ importPdfData(data: ArrayBuffer | Uint8Array, opts?: PdfImportOptions): Promise<PdfImportReport>;
5430
+ /** Host capability: every PDF page rasterized. Absent → PDF-as-image
5431
+ * import is refused (headless Node, until it has a rasterizer). */
5432
+ rasterizePdf?(data: ArrayBuffer | Uint8Array): Promise<RasterPdfPage[]>;
5433
+ /** pdf.js worker URL for hosts that need one (the browser). */
5434
+ protected pdfWorkerSrc?: string;
5435
+ private resolveStyle;
5436
+ private assertStyleName;
5437
+ /** Layouts are addressed by name everywhere (`layout` on the object
5438
+ * tools, remove, reorder, render) — a duplicate would silently resolve to
5439
+ * the first match. */
5440
+ private assertLayoutName;
5441
+ /** Objects reference styles by id, but callers often pass the NAME:
5442
+ * resolve it (text/table → text styles, dimension → dim styles). An
5443
+ * unknown value is refused rather than stored dangling — a dangling
5444
+ * reference renders with the first style and nothing says why. */
5445
+ private styleRef;
5446
+ listTextStyles(): TextStyle[];
5447
+ listDimStyles(): DimStyle[];
5448
+ /** Create a text style (unique name; unset fields take the defaults);
5449
+ * returns its id. */
5450
+ addTextStyle(props: {
5451
+ name: string;
5452
+ } & Partial<Omit<TextStyle, "id">>): string;
5453
+ updateTextStyle(nameOrId: string, patch: Partial<Omit<TextStyle, "id">>): void;
5454
+ listLineTypes(): LineType[];
5455
+ addLineTypes(lineTypes: readonly LineType[]): void;
5456
+ updateLineType(name: string, patch: Partial<LineType>): void;
5457
+ removeLineType(name: string): void;
5458
+ listHatchPatterns(): DocumentHatchPattern[];
5459
+ addHatchPatterns(patterns: readonly DocumentHatchPattern[]): void;
5460
+ updateHatchPattern(name: string, patch: Partial<DocumentHatchPattern>): void;
5461
+ removeHatchPattern(name: string): void;
5462
+ /** Remove a text style no object uses (the kernel refuses otherwise). */
5463
+ removeTextStyle(nameOrId: string): void;
5464
+ /** Create a dimension style (unique name; unset fields take the
5465
+ * defaults); returns its id. */
5466
+ addDimStyle(props: {
5467
+ name: string;
5468
+ } & Partial<Omit<DimStyle, "id">>): string;
5469
+ updateDimStyle(nameOrId: string, patch: Partial<Omit<DimStyle, "id">>): void;
5470
+ /** Remove a dimension style no dimension uses (the kernel refuses
5471
+ * otherwise). */
5472
+ removeDimStyle(nameOrId: string): void;
5473
+ /** @deprecated Use updateDimStyle (default here: the first style). */
5226
5474
  setDimStyle(patch: Partial<DimStyle>, styleId?: string): void;
5227
5475
  /** Replace the document's dimension styles (min 1; objects reference by
5228
5476
  * id). Diffed into granular per-style ops. */
5229
5477
  setDimStyles(styles: DimStyle[]): void;
5230
- /** Patch a document text style (default: the first). */
5478
+ /** @deprecated Use updateTextStyle (default here: the first style). */
5231
5479
  setTextStyle(patch: Partial<TextStyle>, styleId?: string): void;
5232
5480
  /** Replace the document's text styles (min 1; objects reference by id).
5233
5481
  * Diffed into granular per-style ops. */
@@ -5243,15 +5491,25 @@ declare class LocalDrawing implements Drawing$1 {
5243
5491
  /** Replace the document's command modules (same rules as blocks). */
5244
5492
  setCommands(defs: unknown[]): Promise<void>;
5245
5493
  /** Compilable block definitions (broken modules are skipped). */
5246
- listBlocks(): BlockMeta[];
5494
+ listBlockDefinitions(): BlockMeta[];
5247
5495
  /** Compilable document commands (broken modules are skipped). */
5248
- listCommands(): CommandMeta[];
5249
- installBlocks(sources: readonly string[]): Promise<MergeReport>;
5250
- installCommands(sources: readonly string[]): Promise<MergeReport>;
5496
+ listUserCommands(): CommandMeta[];
5497
+ addBlockDefinitions(sources: readonly string[]): Promise<MergeReport>;
5498
+ addUserCommands(sources: readonly string[]): Promise<MergeReport>;
5499
+ /** The host's marketplace list + client; a bare drawing gets an in-memory
5500
+ * list holding the public collection. */
5501
+ protected get marketplaceHost(): MarketplaceHost;
5502
+ /** Replace the host's marketplace configuration (SDK / server config). */
5503
+ setMarketplaceHost(host: MarketplaceHost): void;
5504
+ listMarketplaces(): MarketplaceInfo[];
5505
+ addMarketplaces(list: readonly MarketplaceConfig[]): Promise<MarketplaceInfo[]>;
5506
+ removeMarketplaces(names: readonly string[]): MarketplaceInfo[];
5507
+ searchMarketplaces(q?: MarketplaceQuery): Promise<MarketplaceHit[]>;
5508
+ installMarketplaceEntries(ids: readonly string[], marketplace?: string): Promise<MergeReport>;
5251
5509
  /** Remove a block module by its exported id (unknown id → error). */
5252
- removeBlock(id: string): void;
5510
+ removeBlockDefinition(id: string): void;
5253
5511
  /** Remove a command module by its exported id (unknown id → error). */
5254
- removeCommand(id: string): void;
5512
+ removeUserCommand(id: string): void;
5255
5513
  /**
5256
5514
  * Resolves when block scripts evaluate definitively (the transpiler is
5257
5515
  * loaded). Await this before sync reads/renders of a document that was
@@ -5267,7 +5525,7 @@ declare class LocalDrawing implements Drawing$1 {
5267
5525
  * Create a paper layout — by default A3 landscape with one viewport fitted
5268
5526
  * to the model extents. Returns the layout id.
5269
5527
  */
5270
- createLayout(name: string, opts?: LayoutOptions): string;
5528
+ addLayout(name: string, opts?: LayoutOptions): string;
5271
5529
  /** Remove a layout by name or id. */
5272
5530
  removeLayout(nameOrId: string): void;
5273
5531
  /** Reorder the layouts (names or ids, every layout exactly once). Layout
@@ -5310,7 +5568,10 @@ declare class LocalDrawing implements Drawing$1 {
5310
5568
  * by `delta`. Returns the new ids, one batch per step, in one undo step.
5311
5569
  */
5312
5570
  array(ids: readonly string[], count: number, delta: PointInput): string[];
5571
+ private get measurer();
5572
+ private resolveObject;
5313
5573
  private ctx;
5574
+ private entryOf;
5314
5575
  private boundsOf;
5315
5576
  /** Union bounds of the given objects; null when nothing has bounds. */
5316
5577
  bboxOf(ids: readonly string[]): AABB | null;
@@ -5330,25 +5591,37 @@ declare class LocalDrawing implements Drawing$1 {
5330
5591
  private distanceTo;
5331
5592
  /** Query model-space objects — or one paper layout's sheet objects
5332
5593
  * (viewports, annotations) via `filter.layout`. */
5333
- query(filter?: QueryFilter): ModelObject[];
5594
+ listObjects(filter?: QueryFilter): ModelObject[];
5334
5595
  summary(): DocumentSummary;
5335
5596
  protected paintContext(): {
5597
+ layers: readonly Layer[];
5598
+ dimStyles: readonly DimStyle[];
5599
+ textStyles: readonly TextStyle[];
5600
+ lineTypes: readonly LineType[];
5601
+ hatchPatterns: readonly DocumentHatchPattern[];
5602
+ blockDefinitions: readonly string[];
5603
+ assets?: Readonly<Record<string, string>>;
5336
5604
  objects: ({
5337
5605
  id: string;
5338
5606
  layerId: string;
5607
+ color?: string | undefined;
5608
+ lineType?: string | undefined;
5609
+ lineTypeScale?: number | undefined;
5610
+ lineWidth?: number | undefined;
5611
+ opacity?: number | undefined;
5339
5612
  type: "point";
5340
5613
  p: {
5341
5614
  x: number;
5342
5615
  y: number;
5343
5616
  };
5617
+ } | {
5618
+ id: string;
5619
+ layerId: string;
5344
5620
  color?: string | undefined;
5345
5621
  lineType?: string | undefined;
5346
5622
  lineTypeScale?: number | undefined;
5347
5623
  lineWidth?: number | undefined;
5348
5624
  opacity?: number | undefined;
5349
- } | {
5350
- id: string;
5351
- layerId: string;
5352
5625
  type: "line";
5353
5626
  a: {
5354
5627
  x: number;
@@ -5358,14 +5631,14 @@ declare class LocalDrawing implements Drawing$1 {
5358
5631
  x: number;
5359
5632
  y: number;
5360
5633
  };
5634
+ } | {
5635
+ id: string;
5636
+ layerId: string;
5361
5637
  color?: string | undefined;
5362
5638
  lineType?: string | undefined;
5363
5639
  lineTypeScale?: number | undefined;
5364
5640
  lineWidth?: number | undefined;
5365
5641
  opacity?: number | undefined;
5366
- } | {
5367
- id: string;
5368
- layerId: string;
5369
5642
  type: "polyline";
5370
5643
  points: {
5371
5644
  x: number;
@@ -5373,28 +5646,28 @@ declare class LocalDrawing implements Drawing$1 {
5373
5646
  bulge: number;
5374
5647
  }[];
5375
5648
  closed: boolean;
5649
+ } | {
5650
+ id: string;
5651
+ layerId: string;
5376
5652
  color?: string | undefined;
5377
5653
  lineType?: string | undefined;
5378
5654
  lineTypeScale?: number | undefined;
5379
5655
  lineWidth?: number | undefined;
5380
5656
  opacity?: number | undefined;
5381
- } | {
5382
- id: string;
5383
- layerId: string;
5384
5657
  type: "circle";
5385
5658
  center: {
5386
5659
  x: number;
5387
5660
  y: number;
5388
5661
  };
5389
5662
  radius: number;
5663
+ } | {
5664
+ id: string;
5665
+ layerId: string;
5390
5666
  color?: string | undefined;
5391
5667
  lineType?: string | undefined;
5392
5668
  lineTypeScale?: number | undefined;
5393
5669
  lineWidth?: number | undefined;
5394
5670
  opacity?: number | undefined;
5395
- } | {
5396
- id: string;
5397
- layerId: string;
5398
5671
  type: "arc";
5399
5672
  center: {
5400
5673
  x: number;
@@ -5403,14 +5676,14 @@ declare class LocalDrawing implements Drawing$1 {
5403
5676
  radius: number;
5404
5677
  startAngle: number;
5405
5678
  endAngle: number;
5679
+ } | {
5680
+ id: string;
5681
+ layerId: string;
5406
5682
  color?: string | undefined;
5407
5683
  lineType?: string | undefined;
5408
5684
  lineTypeScale?: number | undefined;
5409
5685
  lineWidth?: number | undefined;
5410
5686
  opacity?: number | undefined;
5411
- } | {
5412
- id: string;
5413
- layerId: string;
5414
5687
  type: "ellipse";
5415
5688
  center: {
5416
5689
  x: number;
@@ -5423,14 +5696,14 @@ declare class LocalDrawing implements Drawing$1 {
5423
5696
  ratio: number;
5424
5697
  startAngle: number;
5425
5698
  endAngle: number;
5699
+ } | {
5700
+ id: string;
5701
+ layerId: string;
5426
5702
  color?: string | undefined;
5427
5703
  lineType?: string | undefined;
5428
5704
  lineTypeScale?: number | undefined;
5429
5705
  lineWidth?: number | undefined;
5430
5706
  opacity?: number | undefined;
5431
- } | {
5432
- id: string;
5433
- layerId: string;
5434
5707
  type: "hatch";
5435
5708
  loops: {
5436
5709
  points: {
@@ -5446,6 +5719,10 @@ declare class LocalDrawing implements Drawing$1 {
5446
5719
  name: string;
5447
5720
  angle: number;
5448
5721
  scale: number;
5722
+ origin?: {
5723
+ x: number;
5724
+ y: number;
5725
+ } | undefined;
5449
5726
  } | {
5450
5727
  kind: "lines";
5451
5728
  angle: number;
@@ -5458,35 +5735,39 @@ declare class LocalDrawing implements Drawing$1 {
5458
5735
  angle: number;
5459
5736
  };
5460
5737
  scale: number;
5738
+ } | {
5739
+ id: string;
5740
+ layerId: string;
5461
5741
  color?: string | undefined;
5462
5742
  lineType?: string | undefined;
5463
5743
  lineTypeScale?: number | undefined;
5464
5744
  lineWidth?: number | undefined;
5465
5745
  opacity?: number | undefined;
5466
- } | {
5467
- id: string;
5468
- layerId: string;
5469
5746
  type: "text";
5470
5747
  position: {
5471
5748
  x: number;
5472
5749
  y: number;
5473
5750
  };
5474
5751
  content: string;
5752
+ spans?: {
5753
+ start: number;
5754
+ end: number;
5755
+ font?: string | undefined;
5756
+ bold?: boolean | undefined;
5757
+ italic?: boolean | undefined;
5758
+ underline?: boolean | undefined;
5759
+ color?: string | undefined;
5760
+ height?: number | undefined;
5761
+ script?: "sub" | "super" | undefined;
5762
+ }[] | undefined;
5475
5763
  leaderLines: {
5476
5764
  x: number;
5477
5765
  y: number;
5478
5766
  }[][];
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
5767
  width?: number | undefined;
5489
- frame?: "circle" | "none" | "bottom" | "rectangle" | "slot" | "firstLine" | undefined;
5768
+ hAlign: "center" | "left" | "right";
5769
+ vAlign: "bottom" | "center" | "top";
5770
+ frame?: "bottom" | "circle" | "firstLine" | "none" | "rectangle" | "slot" | undefined;
5490
5771
  styleId?: string | undefined;
5491
5772
  styleOverride?: {
5492
5773
  font?: string | undefined;
@@ -5494,29 +5775,43 @@ declare class LocalDrawing implements Drawing$1 {
5494
5775
  bold?: boolean | undefined;
5495
5776
  italic?: boolean | undefined;
5496
5777
  textHeight?: number | undefined;
5497
- arrowType?: "filled" | "open" | "tick" | "dot" | "none" | undefined;
5778
+ arrowType?: "dot" | "filled" | "none" | "open" | "tick" | undefined;
5498
5779
  arrowSize?: number | undefined;
5499
5780
  } | undefined;
5781
+ rotation: number;
5782
+ scale: number;
5500
5783
  } | {
5501
5784
  id: string;
5502
5785
  layerId: string;
5503
- type: "dimension";
5504
- kind: "linear" | "radial" | "angular" | "diameter";
5505
- points: {
5506
- x: number;
5507
- y: number;
5508
- }[];
5509
- offset: {
5510
- x: number;
5511
- y: number;
5512
- };
5513
- scale: number;
5514
5786
  color?: string | undefined;
5515
5787
  lineType?: string | undefined;
5516
5788
  lineTypeScale?: number | undefined;
5517
5789
  lineWidth?: number | undefined;
5518
5790
  opacity?: number | undefined;
5519
- textOverride?: string | undefined;
5791
+ type: "dimension";
5792
+ kind: "angular" | "diameter" | "linear" | "radial";
5793
+ points: {
5794
+ x: number;
5795
+ y: number;
5796
+ }[];
5797
+ rotation?: number | undefined;
5798
+ offset?: number | undefined;
5799
+ labels: {
5800
+ along?: number | undefined;
5801
+ across?: number | undefined;
5802
+ content?: string | undefined;
5803
+ spans?: {
5804
+ start: number;
5805
+ end: number;
5806
+ font?: string | undefined;
5807
+ bold?: boolean | undefined;
5808
+ italic?: boolean | undefined;
5809
+ underline?: boolean | undefined;
5810
+ color?: string | undefined;
5811
+ height?: number | undefined;
5812
+ script?: "sub" | "super" | undefined;
5813
+ }[] | undefined;
5814
+ }[];
5520
5815
  styleId?: string | undefined;
5521
5816
  styleOverride?: {
5522
5817
  font?: string | undefined;
@@ -5525,16 +5820,22 @@ declare class LocalDrawing implements Drawing$1 {
5525
5820
  italic?: boolean | undefined;
5526
5821
  textHeight?: number | undefined;
5527
5822
  textOffset?: number | undefined;
5528
- arrowType?: "filled" | "open" | "tick" | "dot" | "none" | undefined;
5823
+ arrowType?: "dot" | "filled" | "none" | "open" | "tick" | undefined;
5529
5824
  arrowSize?: number | undefined;
5530
5825
  extensionType?: "long" | "short" | undefined;
5531
5826
  extensionOffset?: number | undefined;
5532
5827
  extensionOvershoot?: number | undefined;
5533
5828
  precision?: number | undefined;
5534
5829
  } | undefined;
5830
+ scale: number;
5535
5831
  } | {
5536
5832
  id: string;
5537
5833
  layerId: string;
5834
+ color?: string | undefined;
5835
+ lineType?: string | undefined;
5836
+ lineTypeScale?: number | undefined;
5837
+ lineWidth?: number | undefined;
5838
+ opacity?: number | undefined;
5538
5839
  type: "block";
5539
5840
  definitionId: string;
5540
5841
  rotation: number;
@@ -5544,14 +5845,53 @@ declare class LocalDrawing implements Drawing$1 {
5544
5845
  x: number;
5545
5846
  y: number;
5546
5847
  })[];
5848
+ } | {
5849
+ id: string;
5850
+ layerId: string;
5547
5851
  color?: string | undefined;
5548
5852
  lineType?: string | undefined;
5549
5853
  lineTypeScale?: number | undefined;
5550
5854
  lineWidth?: number | undefined;
5551
5855
  opacity?: number | undefined;
5856
+ type: "image";
5857
+ assetId: string;
5858
+ origin: {
5859
+ x: number;
5860
+ y: number;
5861
+ };
5862
+ width: number;
5863
+ height: number;
5864
+ rotation: number;
5865
+ } | {
5866
+ id: string;
5867
+ layerId: string;
5868
+ color?: string | undefined;
5869
+ lineType?: string | undefined;
5870
+ lineTypeScale?: number | undefined;
5871
+ lineWidth?: number | undefined;
5872
+ opacity?: number | undefined;
5873
+ type: "viewport";
5874
+ rect: {
5875
+ x: number;
5876
+ y: number;
5877
+ w: number;
5878
+ h: number;
5879
+ };
5880
+ modelCenter: {
5881
+ x: number;
5882
+ y: number;
5883
+ };
5884
+ scale: number;
5885
+ locked: boolean;
5886
+ hiddenLayerIds: string[];
5552
5887
  } | {
5553
5888
  id: string;
5554
5889
  layerId: string;
5890
+ color?: string | undefined;
5891
+ lineType?: string | undefined;
5892
+ lineTypeScale?: number | undefined;
5893
+ lineWidth?: number | undefined;
5894
+ opacity?: number | undefined;
5555
5895
  type: "comment";
5556
5896
  position: {
5557
5897
  x: number;
@@ -5559,14 +5899,14 @@ declare class LocalDrawing implements Drawing$1 {
5559
5899
  };
5560
5900
  text: string;
5561
5901
  tags: string[];
5902
+ } | {
5903
+ id: string;
5904
+ layerId: string;
5562
5905
  color?: string | undefined;
5563
5906
  lineType?: string | undefined;
5564
5907
  lineTypeScale?: number | undefined;
5565
5908
  lineWidth?: number | undefined;
5566
5909
  opacity?: number | undefined;
5567
- } | {
5568
- id: string;
5569
- layerId: string;
5570
5910
  type: "table";
5571
5911
  position: {
5572
5912
  x: number;
@@ -5579,13 +5919,24 @@ declare class LocalDrawing implements Drawing$1 {
5579
5919
  minHeight?: number | undefined;
5580
5920
  }[];
5581
5921
  cells: {
5582
- text: string;
5922
+ content: string;
5923
+ spans?: {
5924
+ start: number;
5925
+ end: number;
5926
+ font?: string | undefined;
5927
+ bold?: boolean | undefined;
5928
+ italic?: boolean | undefined;
5929
+ underline?: boolean | undefined;
5930
+ color?: string | undefined;
5931
+ height?: number | undefined;
5932
+ script?: "sub" | "super" | undefined;
5933
+ }[] | undefined;
5583
5934
  span?: {
5584
5935
  cols: number;
5585
5936
  rows: number;
5586
5937
  } | undefined;
5587
5938
  hAlign?: "center" | "left" | "right" | undefined;
5588
- vAlign?: "center" | "bottom" | "top" | undefined;
5939
+ vAlign?: "bottom" | "center" | "top" | undefined;
5589
5940
  styleId?: string | undefined;
5590
5941
  styleOverride?: {
5591
5942
  font?: string | undefined;
@@ -5593,19 +5944,14 @@ declare class LocalDrawing implements Drawing$1 {
5593
5944
  bold?: boolean | undefined;
5594
5945
  italic?: boolean | undefined;
5595
5946
  textHeight?: number | undefined;
5596
- arrowType?: "filled" | "open" | "tick" | "dot" | "none" | undefined;
5947
+ arrowType?: "dot" | "filled" | "none" | "open" | "tick" | undefined;
5597
5948
  arrowSize?: number | undefined;
5598
5949
  } | undefined;
5599
5950
  color?: string | undefined;
5600
5951
  }[][];
5601
5952
  headerRows: number;
5602
5953
  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;
5954
+ borders: "all" | "none" | "outer" | "rows";
5609
5955
  styleId?: string | undefined;
5610
5956
  styleOverride?: {
5611
5957
  font?: string | undefined;
@@ -5613,53 +5959,19 @@ declare class LocalDrawing implements Drawing$1 {
5613
5959
  bold?: boolean | undefined;
5614
5960
  italic?: boolean | undefined;
5615
5961
  textHeight?: number | undefined;
5616
- arrowType?: "filled" | "open" | "tick" | "dot" | "none" | undefined;
5962
+ arrowType?: "dot" | "filled" | "none" | "open" | "tick" | undefined;
5617
5963
  arrowSize?: number | undefined;
5618
5964
  } | undefined;
5619
5965
  } | {
5620
5966
  id: string;
5621
5967
  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
- color?: string | undefined;
5637
- lineType?: string | undefined;
5638
- lineTypeScale?: number | undefined;
5639
- lineWidth?: number | undefined;
5640
- 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
5968
  color?: string | undefined;
5654
5969
  lineType?: string | undefined;
5655
5970
  lineTypeScale?: number | undefined;
5656
5971
  lineWidth?: number | undefined;
5657
5972
  opacity?: number | undefined;
5658
- } | {
5659
- id: string;
5660
- layerId: string;
5661
5973
  type: "reference";
5662
- format: "linea" | "dxf" | "dwg" | "pdf" | "png" | "jpg";
5974
+ format: "dwg" | "dxf" | "jpg" | "linea" | "pdf" | "png";
5663
5975
  name: string;
5664
5976
  source: {
5665
5977
  kind: "path";
@@ -5675,15 +5987,10 @@ declare class LocalDrawing implements Drawing$1 {
5675
5987
  };
5676
5988
  rotation: number;
5677
5989
  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
5990
  mirrored?: boolean | undefined;
5685
5991
  pdfPage?: number | undefined;
5686
- pdfMode?: "vector" | "raster" | undefined;
5992
+ pdfMode?: "raster" | "vector" | undefined;
5993
+ hiddenLayers: string[];
5687
5994
  hidden?: boolean | undefined;
5688
5995
  locked?: boolean | undefined;
5689
5996
  clip?: {
@@ -5699,45 +6006,6 @@ declare class LocalDrawing implements Drawing$1 {
5699
6006
  maxY: number;
5700
6007
  } | undefined;
5701
6008
  })[];
5702
- layers: {
5703
- id: string;
5704
- name: string;
5705
- color: string;
5706
- lineType: string;
5707
- lineWidth: number;
5708
- opacity: number;
5709
- visible: boolean;
5710
- locked: boolean;
5711
- print: boolean;
5712
- }[];
5713
- dimStyles: {
5714
- id: string;
5715
- name: string;
5716
- font: string;
5717
- widthFactor: number;
5718
- textHeight: number;
5719
- textOffset: number;
5720
- arrowType: "filled" | "open" | "tick" | "dot" | "none";
5721
- arrowSize: number;
5722
- extensionType: "long" | "short";
5723
- extensionOffset: number;
5724
- extensionOvershoot: number;
5725
- precision: number;
5726
- bold?: boolean | undefined;
5727
- italic?: boolean | undefined;
5728
- }[];
5729
- textStyles: {
5730
- id: string;
5731
- name: string;
5732
- font: string;
5733
- widthFactor: number;
5734
- textHeight: number;
5735
- arrowType: "filled" | "open" | "tick" | "dot" | "none";
5736
- arrowSize: number;
5737
- bold?: boolean | undefined;
5738
- italic?: boolean | undefined;
5739
- }[];
5740
- blockDefinitions: string[];
5741
6009
  resolveObject: (id: string) => ModelObject | undefined;
5742
6010
  resolveReference: (ref: ReferenceObject) => ReferenceContent | null;
5743
6011
  };
@@ -5754,13 +6022,355 @@ declare class LocalDrawing implements Drawing$1 {
5754
6022
  toDwg(opts?: {
5755
6023
  version?: DwgVersion;
5756
6024
  }): Promise<Uint8Array>;
5757
- toJson(): string;
5758
- /** Merge DXF text into the document (new layers, objects, layouts). */
6025
+ toLinea(): string;
6026
+ }
6027
+
6028
+ /** A world point in mm, as `[x, y]` or `{x, y}`. */
6029
+ type PointInput = Vec2 | readonly [number, number];
6030
+ /** Loose object input: model fields + `layer` (name) / `layerId` / `id`. */
6031
+ type ObjectInput = {
6032
+ type: ModelObjectType;
6033
+ } & Record<string, unknown>;
6034
+ /** Semantic, filtered read over one space's objects (all filters AND). */
6035
+ interface QueryFilter {
6036
+ ids?: readonly string[];
6037
+ type?: ModelObjectType;
6038
+ /** Layer name or id. */
6039
+ layer?: string;
6040
+ /** Own (override) color; objects inheriting by layer have none. */
6041
+ color?: string;
6042
+ /** Own (override) line type name. */
6043
+ lineType?: string;
6044
+ /** Substring match on text content. */
6045
+ content?: string;
6046
+ /** Bounds intersect this box. */
6047
+ bbox?: AABB;
6048
+ /** Bounds entirely inside this box. */
6049
+ inside?: AABB;
6050
+ /** Geometry within `tol` mm of `point`. */
6051
+ near?: {
6052
+ point: PointInput;
6053
+ tol: number;
6054
+ };
6055
+ /** Search this paper layout's sheet objects (name or id — viewports,
6056
+ * sheet annotations) instead of model space. */
6057
+ layout?: string;
6058
+ }
6059
+ /** Per-object measurements; null where the type has no natural value. */
6060
+ interface Measurement {
6061
+ bbox: AABB | null;
6062
+ length: number | null;
6063
+ area: number | null;
6064
+ }
6065
+ /** A layer row as agents see it (full metadata + the current-layer flag). */
6066
+ type LayerInfo = Layer & {
6067
+ current: boolean;
6068
+ };
6069
+ interface DocumentSummary {
6070
+ name: string;
6071
+ objectCount: number;
6072
+ byType: Record<string, number>;
6073
+ byLayer: Record<string, number>;
6074
+ bbox: AABB | null;
6075
+ layers: string[];
6076
+ layouts: {
6077
+ name: string;
6078
+ objectCount: number;
6079
+ }[];
6080
+ /** Document-wide settings (`units`). */
6081
+ settings: LineaDocument["settings"];
6082
+ }
6083
+ interface RenderSvgOptions {
6084
+ /** Render this paper layout (name or id) instead of model space. */
6085
+ layout?: string;
6086
+ bbox?: AABB;
6087
+ measure?: TextMeasurer;
6088
+ /** Padding around the content bbox, world mm (default 5). */
6089
+ padding?: number;
6090
+ /** Print-style color remap ("monochrome" = everything black — use with a
6091
+ * white background so light editor-theme layers stay visible). Default:
6092
+ * "color" for model renders, the layout's own printPalette for layouts. */
6093
+ palette?: PrintPalette;
6094
+ }
6095
+ interface RenderPngOptions extends RenderSvgOptions {
6096
+ /** Output width in px (height follows the aspect ratio). Default 1024. */
6097
+ width?: number;
6098
+ /** Background fill. Default matches the dark canvas so as-authored colors
6099
+ * stay visible; pass "#ffffff" / "transparent" to change. */
6100
+ background?: string;
6101
+ }
6102
+ interface RenderPdfOptions {
6103
+ /** Layouts (by name or id) to print, in page order. Default: every layout
6104
+ * in document order (a layout-less document prints one auto-fitted A3). */
6105
+ layouts?: readonly string[];
6106
+ /** Override every page's print palette (default: each layout's own). */
6107
+ palette?: PrintPalette;
6108
+ }
6109
+ interface ViewportOptions {
6110
+ /** Frame on the sheet, mm; default: the sheet minus a 20 mm margin. */
6111
+ rect?: {
6112
+ x: number;
6113
+ y: number;
6114
+ w: number;
6115
+ h: number;
6116
+ };
6117
+ /** `"1:50"` or the denominator; default: smallest preset that fits. */
6118
+ scale?: number | string;
6119
+ /** World point at the frame center; default: the model extents center. */
6120
+ center?: PointInput;
6121
+ }
6122
+ interface LayoutOptions {
6123
+ /** `"A3"` (landscape, like the editor's New Layout), `{ name, orientation }`,
6124
+ * or explicit mm; default A3 landscape. */
6125
+ sheet?: SheetSpec;
6126
+ /** Shorthand for `viewport: { scale }` — `"1:50"` or the denominator. */
6127
+ scale?: number | string;
6128
+ /** One model viewport (default), or `false` for a bare sheet. */
6129
+ viewport?: ViewportOptions | false;
6130
+ /** Tab position; default: append. */
6131
+ index?: number;
6132
+ }
6133
+ interface LayoutPatch {
6134
+ name?: string;
6135
+ /** `"A3"` (keeps the layout's current orientation), `{ name, orientation }`,
6136
+ * or explicit mm. */
6137
+ sheet?: SheetSpec;
6138
+ printPalette?: PrintPalette;
6139
+ }
6140
+ interface AddOptions {
6141
+ /** Target paper layout (name or id); default: model space. */
6142
+ layout?: string;
6143
+ }
6144
+ /** Result of installing module sources (blocks or commands). */
6145
+ type MergeReport = MergeModulesResult<{
6146
+ id: string;
6147
+ name: string;
6148
+ }>;
6149
+ /**
6150
+ * One editable document. Every write is one validated kernel op batch; a
6151
+ * `transaction` folds several into ONE undo step for whoever owns history
6152
+ * (the editor when attached to one). Object writes go to model space unless
6153
+ * `layout` names a paper layout — in every host, whatever the user has open
6154
+ * (docs/adr/0003). One implementation: LocalDrawing.
6155
+ */
6156
+ interface Drawing$1 {
6157
+ /** The document's own id (uuid stored in the .linea file). */
6158
+ readonly id: string;
6159
+ /** Monotonic change counter (every origin) — viewers compare to refresh. */
6160
+ readonly revision: number;
6161
+ /** The full validated document — a detached snapshot. */
6162
+ readonly document: LineaDocument;
6163
+ summary(): DocumentSummary;
6164
+ /** Filtered objects — model space, or one layout via `filter.layout`. */
6165
+ listObjects(filter?: QueryFilter): ModelObject[];
6166
+ /** Look up an object in ANY space. */
6167
+ getObject(id: string): ModelObject | undefined;
6168
+ /** bbox / curve length / enclosed area of one object (any space). */
6169
+ measure(id: string): Measurement;
6170
+ listLayers(): LayerInfo[];
6171
+ listLayouts(): PaperLayout[];
6172
+ /** Compilable block definitions (broken modules are skipped). */
6173
+ listBlockDefinitions(): BlockMeta[];
6174
+ /** Compilable document commands (macros travelling with the file). */
6175
+ listUserCommands(): CommandMeta[];
6176
+ /** Model space (or a layout) as an SVG string. */
6177
+ renderSvg(opts?: RenderSvgOptions): string;
6178
+ /** PNG bytes — optional capability (SDK: resvg; editor: browser canvas). */
6179
+ renderPng?(opts?: RenderPngOptions): Promise<Uint8Array>;
6180
+ /** Multi-page PDF of the layouts — optional capability (needs the host's
6181
+ * fonts: the SDK and the editor have them, a bare LocalDrawing does not). */
6182
+ renderPdf?(opts?: RenderPdfOptions): Promise<Uint8Array>;
6183
+ /** The whole document as DXF text (async: hosts load the writer lazily). */
6184
+ toDxf(): Promise<string>;
6185
+ /** DWG bytes (the DXF content, wasm-transcoded; default AC1027). */
6186
+ toDwg(opts?: {
6187
+ version?: DwgVersion;
6188
+ }): Promise<Uint8Array>;
6189
+ /** The `.linea` file text. */
6190
+ toLinea(): string;
6191
+ /** Add objects (points may be `[x, y]`; `layer` resolves by name);
6192
+ * returns the created ids. */
6193
+ add(objects: readonly ObjectInput[], opts?: AddOptions): string[];
6194
+ /** Apply per-object patches (`{id, ...fields}`) in one undo step. */
6195
+ update(entries: readonly ({
6196
+ id: string;
6197
+ } & Record<string, unknown>)[]): void;
6198
+ /** Delete objects by id; unknown ids are skipped. Returns how many went. */
6199
+ remove(ids: readonly string[]): number;
6200
+ /** Draw order: move the given objects (bottom → top) to a placement. */
6201
+ reorder(ids: readonly string[], placement: ReorderPlacement): void;
6202
+ move(ids: readonly string[], delta: PointInput): void;
6203
+ rotate(ids: readonly string[], angleRad: number, center?: PointInput): void;
6204
+ scale(ids: readonly string[], factor: number, center?: PointInput): void;
6205
+ mirror(ids: readonly string[], axisA: PointInput, axisB: PointInput): void;
6206
+ /** Duplicate displaced by delta; returns the new ids. */
6207
+ copy(ids: readonly string[], delta: PointInput): string[];
6208
+ /** count TOTAL copies at multiples of delta; returns the new ids. */
6209
+ array(ids: readonly string[], count: number, delta: PointInput): string[];
6210
+ /** Create a paper layout; returns its id. */
6211
+ addLayout(name: string, opts?: LayoutOptions): string;
6212
+ /** Patch a layout's name / sheet size (mm) / print palette. */
6213
+ updateLayout(nameOrId: string, patch: LayoutPatch): void;
6214
+ removeLayout(nameOrId: string): void;
6215
+ /** Explicit total order (names or ids) — the PDF page order. */
6216
+ reorderLayouts(order: readonly string[]): void;
6217
+ /** Create a layer (name unique, case-insensitive); returns its id. */
6218
+ addLayer(props: {
6219
+ name: string;
6220
+ } & Partial<Omit<Layer, "id">>): string;
6221
+ updateLayer(nameOrId: string, patch: Partial<Omit<Layer, "id">>): void;
6222
+ /** Remove an EMPTY, non-current layer. */
6223
+ removeLayer(nameOrId: string): void;
6224
+ /** Explicit total order (names or ids, every layer exactly once). */
6225
+ reorderLayers(order: readonly string[]): void;
6226
+ /** The layer newly added objects default to (a mode, not an edit). */
6227
+ setCurrentLayer(nameOrId: string): void;
6228
+ /** Document-wide settings, merged over the current record (`units` is
6229
+ * declarative for now: everything is stored in mm). */
6230
+ updateSettings(patch: Partial<LineaDocument["settings"]>): void;
6231
+ listTextStyles(): TextStyle[];
6232
+ listDimStyles(): DimStyle[];
6233
+ /** Create a style (name unique, case-insensitive; unset fields take the
6234
+ * defaults); returns its id. Styles are addressed by name or id. */
6235
+ addTextStyle(props: {
6236
+ name: string;
6237
+ } & Partial<Omit<TextStyle, "id">>): string;
6238
+ updateTextStyle(nameOrId: string, patch: Partial<Omit<TextStyle, "id">>): void;
6239
+ /** Remove a style no object resolves to (else refused, with a count). */
6240
+ removeTextStyle(nameOrId: string): void;
6241
+ addDimStyle(props: {
6242
+ name: string;
6243
+ } & Partial<Omit<DimStyle, "id">>): string;
6244
+ updateDimStyle(nameOrId: string, patch: Partial<Omit<DimStyle, "id">>): void;
6245
+ removeDimStyle(nameOrId: string): void;
6246
+ /** @deprecated Use updateDimStyle (default here: the first style). */
6247
+ setDimStyle(patch: Partial<DimStyle>, styleId?: string): void;
6248
+ /** @deprecated Use updateTextStyle (default here: the first style). */
6249
+ setTextStyle(patch: Partial<TextStyle>, styleId?: string): void;
6250
+ /** The document's own line type definitions (name-keyed; objects and
6251
+ * layers reference line types by NAME, these ahead of the built-in
6252
+ * catalogue). */
6253
+ listLineTypes(): LineType[];
6254
+ /** Add definitions (names unique, case-insensitive; a clash is refused).
6255
+ * `dashesMm`: signed dash cycle per 1 mm of line width — >0 dash, <0 gap,
6256
+ * 0 dot. */
6257
+ addLineTypes(lineTypes: readonly LineType[]): void;
6258
+ updateLineType(name: string, patch: Partial<LineType>): void;
6259
+ /** Remove a definition; objects still naming it fall back to the
6260
+ * catalogue or continuous. */
6261
+ removeLineType(name: string): void;
6262
+ /** The document's own hatch pattern definitions (same model: fills
6263
+ * reference patterns by NAME, these ahead of the catalogue). */
6264
+ listHatchPatterns(): DocumentHatchPattern[];
6265
+ addHatchPatterns(patterns: readonly DocumentHatchPattern[]): void;
6266
+ updateHatchPattern(name: string, patch: Partial<DocumentHatchPattern>): void;
6267
+ removeHatchPattern(name: string): void;
6268
+ /** Embed image pixels (a data URL); returns the content-keyed assetId. */
6269
+ addAsset(dataUrl: string): string;
6270
+ /** Remove an asset (refused while an image references it). */
6271
+ removeAsset(id: string): void;
6272
+ /** Embedded image assets: id, mime type, bytes, how many images use it. */
6273
+ listAssets(): AssetInfo[];
6274
+ /** DXF text → new layers, objects, layouts. */
5759
6275
  importDxfText(text: string, opts?: DxfImportOptions): DxfImportReport;
5760
- /** Merge DWG bytes into the document (wasm transcode → the DXF path). */
6276
+ /** DWG bytes (wasm transcode → the DXF path). */
5761
6277
  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>;
6278
+ /** PDF vectors/text onto the current layer, or (`as: "image"`, a host
6279
+ * capability) every page as an image at true scale. */
6280
+ importPdfData(data: ArrayBuffer | Uint8Array, opts?: PdfImportOptions): Promise<PdfImportReport>;
6281
+ /** Merge block module sources into the document library (verbatim →
6282
+ * skip, same id → replace in place, name clash → suffix). Async: awaits
6283
+ * the lazy transpiler so evaluation is definitive on return. */
6284
+ addBlockDefinitions(sources: readonly string[]): Promise<MergeReport>;
6285
+ removeBlockDefinition(id: string): void;
6286
+ addUserCommands(sources: readonly string[]): Promise<MergeReport>;
6287
+ removeUserCommand(id: string): void;
6288
+ /** The host's configured marketplaces, priority order, tokens hidden. */
6289
+ listMarketplaces(): MarketplaceInfo[];
6290
+ /** Add marketplaces at the top of the priority list (a repeated key
6291
+ * replaces in place, e.g. to update a token). Each catalog must be
6292
+ * fetchable, else the call throws with the reason. */
6293
+ addMarketplaces(list: readonly MarketplaceConfig[]): Promise<MarketplaceInfo[]>;
6294
+ /** Remove by key, spec, folder or label; the built-in collection stays. */
6295
+ removeMarketplaces(names: readonly string[]): MarketplaceInfo[];
6296
+ /** Entries across the configured marketplaces (first publisher of an id
6297
+ * wins), with each one's install status against this document. */
6298
+ searchMarketplaces(q?: MarketplaceQuery): Promise<MarketplaceHit[]>;
6299
+ /** Install (or update) entries by id — declared block dependencies
6300
+ * first, from the first marketplace publishing the id (or the named
6301
+ * one) — as one undo step. */
6302
+ installMarketplaceEntries(ids: readonly string[], marketplace?: string): Promise<MergeReport>;
6303
+ /** Escape hatch: apply an already-shaped op batch (validated, atomic,
6304
+ * one undo step). */
6305
+ applyOps(ops: readonly Operation[]): void;
6306
+ /**
6307
+ * Group edits into ONE undo step. A sync `fn` commits on return, an
6308
+ * async one on settle. A throw ROLLS BACK everything the transaction
6309
+ * applied and rethrows. Nested calls join the outer transaction.
6310
+ */
6311
+ transaction<T>(fn: () => T, label?: string): T;
6312
+ /** Revert / re-apply one step; false when there is nothing to do. Throws
6313
+ * inside an open transaction (return or throw to roll back instead). */
6314
+ undo(): boolean;
6315
+ redo(): boolean;
6316
+ }
6317
+ /** Present only when the Drawing is attached to a live editor: the parts of
6318
+ * the interaction a headless host cannot offer. */
6319
+ interface EditorSurface {
6320
+ state(): EditorState;
6321
+ setActiveSpace(space: "model" | {
6322
+ layout: string;
6323
+ }): void;
6324
+ setSelection(ids: readonly string[]): void;
6325
+ zoom(to: ZoomTarget): void;
6326
+ /** Await one snapped world point; rejects when the user cancels. */
6327
+ pickPoint(opts?: PickPointOptions): Promise<Vec2>;
6328
+ /** Await one object click; resolves the object's id. */
6329
+ pickObject(opts?: {
6330
+ label?: string;
6331
+ }): Promise<string>;
6332
+ /** Await a typed value from a small input dialog; rejects on cancel. */
6333
+ prompt(message: string, opts?: {
6334
+ initial?: string;
6335
+ placeholder?: string;
6336
+ }): Promise<string>;
6337
+ toast(message: string, kind?: "info" | "success" | "error"): void;
6338
+ /** Registry commands + macros + insert-block entries (ids for runCommand). */
6339
+ listCommands(): EditorCommandInfo[];
6340
+ /** Trigger a command by id (interactive tools start and wait for the
6341
+ * user; macros with declared inputs / params accept them up front —
6342
+ * params passed skip the params dialog). */
6343
+ runCommand(id: string, inputs?: readonly PointInput[], params?: Readonly<Record<string, unknown>>): Promise<void>;
6344
+ }
6345
+ /** Where `EditorSurface.zoom` moves the camera: everything in the active
6346
+ * space, the selection, some objects' extents, or a window (world mm; sheet
6347
+ * mm in a layout). */
6348
+ type ZoomTarget = "fit" | "selection" | {
6349
+ ids: readonly string[];
6350
+ } | {
6351
+ bbox: AABB;
6352
+ };
6353
+ interface PickPointOptions {
6354
+ label?: string;
6355
+ /** Rubber-band + relative typed entry from here (the previous pick). */
6356
+ referencePoint?: PointInput;
6357
+ }
6358
+ interface EditorState {
6359
+ documentId: string;
6360
+ documentName: string;
6361
+ space: "model" | {
6362
+ layout: string;
6363
+ };
6364
+ selectedIds: string[];
6365
+ readOnly: boolean;
6366
+ canUndo: boolean;
6367
+ canRedo: boolean;
6368
+ }
6369
+ interface EditorCommandInfo {
6370
+ id: string;
6371
+ label: string;
6372
+ group: string;
6373
+ hotkey?: string;
5764
6374
  }
5765
6375
 
5766
6376
  declare class Drawing extends LocalDrawing {
@@ -5769,6 +6379,10 @@ declare class Drawing extends LocalDrawing {
5769
6379
  from: number;
5770
6380
  to: number;
5771
6381
  } | null);
6382
+ /** The marketplaces this drawing searches and installs from, in priority
6383
+ * order (the public collection is always present, last by default) —
6384
+ * process configuration, nothing is written to the file. */
6385
+ configureMarketplaces(list: readonly MarketplaceConfig[]): void;
5772
6386
  /** The file this drawing was opened from / last saved to, if any. */
5773
6387
  get filePath(): string | undefined;
5774
6388
  /** Block scripts compiled AND referenced files loaded (relative paths
@@ -5796,21 +6410,27 @@ declare class Drawing extends LocalDrawing {
5796
6410
  save(path?: string): Promise<string>;
5797
6411
  importDxf(path: string, opts?: DxfImportOptions): Promise<DxfImportReport>;
5798
6412
  importDwg(path: string, opts?: DxfImportOptions): Promise<DxfImportReport>;
5799
- importPdf(path: string): Promise<PdfImportReport>;
6413
+ importPdf(path: string, opts?: PdfImportOptions): Promise<PdfImportReport>;
5800
6414
  /** Run a command module source (`defineCommand`) against this drawing as
5801
6415
  * ONE undo step, headlessly: declared `inputs` must be supplied; declared
5802
6416
  * `params` take their defaults unless given by name (unknown names and
5803
6417
  * wrong types throw). Resolves with the script's return value. */
5804
6418
  runScript(source: string, inputs?: readonly PointInput[], params?: Readonly<Record<string, unknown>>): Promise<unknown>;
5805
6419
  /** 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>;
6420
+ runUserCommand(id: string, inputs?: readonly PointInput[], params?: Readonly<Record<string, unknown>>): Promise<unknown>;
5807
6421
  }
5808
6422
  /** A fresh empty document, optionally named (until saved to a file, whose
5809
6423
  * name then takes over). */
5810
- declare function newDrawing(name?: string): Drawing;
6424
+ interface DrawingOptions {
6425
+ /** Marketplaces to search and install from, in priority order (the
6426
+ * public collection is appended when missing). Default: the public
6427
+ * collection alone. */
6428
+ marketplaces?: readonly MarketplaceConfig[];
6429
+ }
6430
+ declare function newDrawing(name?: string, options?: DrawingOptions): Drawing;
5811
6431
  /** Parse a `.linea` JSON string. */
5812
6432
  declare function drawingFromJson(text: string): Drawing;
5813
6433
  /** Open a `.linea` file (parse + migrate) into an in-process kernel. */
5814
- declare function openDrawing(path: string): Promise<Drawing>;
6434
+ declare function openDrawing(path: string, options?: DrawingOptions): Promise<Drawing>;
5815
6435
 
5816
- export { type AABB, type AddOptions, type BlockMeta, type CommandMeta, type DimStyle, type DocumentSummary, Drawing, type Drawing$1 as DrawingApi, type DxfImportOptions, type DxfImportReport, type EditorSurface, type Layer, type LayerInfo, type LayoutOptions, type LayoutPatch, type LineaDocument, type Measurement, type MergeReport, type ModelObject, type ModelObjectType, type ObjectInput, type Operation, type PaperLayout, type PdfImportReport, type RenderPdfOptions as PdfOptions, type RenderPngOptions as PngOptions, type PointInput, type PrintPalette, type QueryFilter, type SheetName, type RenderSvgOptions as SvgOptions, type TextMeasurer, type TextStyle, type Vec2, type ViewportOptions, drawingFromJson, ensureScriptTranspiler, getBlockMetaResult, getCommandMetaResult, newDrawing, openDrawing, parseScale, renderBlockThumbnailSvg, testBlockDefinition };
6436
+ export { type AABB, type AddOptions, type BlockMeta, type CommandMeta, type DimStyle, type DocumentSummary, Drawing, type Drawing$1 as DrawingApi, type DrawingOptions, type DxfImportOptions, type DxfImportReport, type EditorSurface, type Layer, type LayerInfo, type LayoutOptions, type LayoutPatch, type LineaDocument, type MarketplaceConfig, type MarketplaceHit, type MarketplaceInfo, type MarketplaceQuery, type Measurement, type MergeReport, type ModelObject, type ModelObjectType, type ObjectInput, type Operation, type PaperLayout, type PdfImportReport, type RenderPdfOptions as PdfOptions, type RenderPngOptions as PngOptions, type PointInput, type PrintPalette, type QueryFilter, type SheetName, type RenderSvgOptions as SvgOptions, type TextMeasurer, type TextStyle, type Vec2, type ViewportOptions, drawingFromJson, ensureScriptTranspiler, getBlockMetaResult, getCommandMetaResult, newDrawing, openDrawing, parseScale, renderBlockThumbnailSvg, testBlockDefinition };