lineadraw 0.7.0 → 0.9.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
@@ -1,17 +1,18 @@
1
1
  import { z } from 'zod';
2
+ export { BridgeError, BridgeOptions, BridgeStatus, DEFAULT_BRIDGE_PORT, EditorHandle, EditorInfo, LineaBridge, bridgeFilePath, connectEditors, createBridge } from './bridge.js';
2
3
 
3
- interface Vec2 {
4
+ interface Vec2$1 {
4
5
  x: number;
5
6
  y: number;
6
7
  }
7
8
 
8
9
  interface Segment {
9
- a: Vec2;
10
- b: Vec2;
10
+ a: Vec2$1;
11
+ b: Vec2$1;
11
12
  }
12
13
 
13
14
  interface ArcGeom {
14
- center: Vec2;
15
+ center: Vec2$1;
15
16
  radius: number;
16
17
  /** Start angle, radians CCW from +X. */
17
18
  startAngle: number;
@@ -20,8 +21,8 @@ interface ArcGeom {
20
21
  }
21
22
 
22
23
  interface EllipseGeom {
23
- center: Vec2;
24
- majorAxis: Vec2;
24
+ center: Vec2$1;
25
+ majorAxis: Vec2$1;
25
26
  /** minor/major in (0, 1]. */
26
27
  ratio: number;
27
28
  startAngle: number;
@@ -35,47 +36,6 @@ interface AABB {
35
36
  maxY: number;
36
37
  }
37
38
 
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
39
  /**
80
40
  * A named document text style: everything a TEXT object inherits unless its
81
41
  * own `styleOverride` sets a key (same model as DimStyle for dimensions).
@@ -100,70 +60,7 @@ declare const TextStyleSchema: z.ZodObject<{
100
60
  }>>;
101
61
  arrowSize: z.ZodDefault<z.ZodNumber>;
102
62
  }, z.core.$strip>;
103
- 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
- bottom: "bottom";
136
- center: "center";
137
- top: "top";
138
- }>>;
139
- frame: z.ZodOptional<z.ZodEnum<{
140
- bottom: "bottom";
141
- circle: "circle";
142
- firstLine: "firstLine";
143
- none: "none";
144
- rectangle: "rectangle";
145
- slot: "slot";
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
- dot: "dot";
156
- filled: "filled";
157
- none: "none";
158
- open: "open";
159
- tick: "tick";
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>;
63
+ type TextStyle$1 = z.infer<typeof TextStyleSchema>;
167
64
  /** A named document dimension style; documents carry an ARRAY of these and
168
65
  * dimensions reference one by `styleId` (absent/dangling = the first). */
169
66
  declare const DimStyleSchema: z.ZodObject<{
@@ -191,60 +88,7 @@ declare const DimStyleSchema: z.ZodObject<{
191
88
  extensionOvershoot: z.ZodDefault<z.ZodNumber>;
192
89
  precision: z.ZodDefault<z.ZodNumber>;
193
90
  }, z.core.$strip>;
194
- 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
- angular: "angular";
208
- diameter: "diameter";
209
- linear: "linear";
210
- radial: "radial";
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
- dot: "dot";
231
- filled: "filled";
232
- none: "none";
233
- open: "open";
234
- tick: "tick";
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>;
91
+ type DimStyle$1 = z.infer<typeof DimStyleSchema>;
248
92
  /**
249
93
  * A LINKED file drawn in place (an xref): the document holds this record,
250
94
  * never the file. The file's model space lands with its origin at
@@ -275,6 +119,9 @@ declare const ReferenceSchema: z.ZodObject<{
275
119
  }, z.core.$strip>, z.ZodObject<{
276
120
  kind: z.ZodLiteral<"url">;
277
121
  url: z.ZodString;
122
+ }, z.core.$strip>, z.ZodObject<{
123
+ kind: z.ZodLiteral<"asset">;
124
+ assetId: z.ZodString;
278
125
  }, z.core.$strip>], "kind">;
279
126
  position: z.ZodPreprocess<z.ZodObject<{
280
127
  x: z.ZodNumber;
@@ -304,7 +151,7 @@ declare const ReferenceSchema: z.ZodObject<{
304
151
  maxY: z.ZodNumber;
305
152
  }, z.core.$strip>>;
306
153
  }, z.core.$strip>;
307
- type ReferenceObject = z.infer<typeof ReferenceSchema>;
154
+ type Reference = z.infer<typeof ReferenceSchema>;
308
155
  declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
309
156
  id: z.ZodString;
310
157
  layerId: z.ZodString;
@@ -423,6 +270,10 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
423
270
  name: z.ZodString;
424
271
  angle: z.ZodNumber;
425
272
  scale: z.ZodNumber;
273
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
274
+ x: z.ZodNumber;
275
+ y: z.ZodNumber;
276
+ }, z.core.$strip>, unknown>>;
426
277
  }, z.core.$strip>, z.ZodObject<{
427
278
  kind: z.ZodLiteral<"lines">;
428
279
  angle: z.ZodNumber;
@@ -452,6 +303,20 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
452
303
  y: z.ZodNumber;
453
304
  }, z.core.$strip>, unknown>;
454
305
  content: z.ZodString;
306
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
307
+ start: z.ZodNumber;
308
+ end: z.ZodNumber;
309
+ font: z.ZodOptional<z.ZodString>;
310
+ bold: z.ZodOptional<z.ZodBoolean>;
311
+ italic: z.ZodOptional<z.ZodBoolean>;
312
+ underline: z.ZodOptional<z.ZodBoolean>;
313
+ color: z.ZodOptional<z.ZodString>;
314
+ height: z.ZodOptional<z.ZodNumber>;
315
+ script: z.ZodOptional<z.ZodEnum<{
316
+ sub: "sub";
317
+ super: "super";
318
+ }>>;
319
+ }, z.core.$strip>>>;
455
320
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
456
321
  x: z.ZodNumber;
457
322
  y: z.ZodNumber;
@@ -512,11 +377,27 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
512
377
  x: z.ZodNumber;
513
378
  y: z.ZodNumber;
514
379
  }, 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>;
380
+ rotation: z.ZodOptional<z.ZodNumber>;
381
+ offset: z.ZodOptional<z.ZodNumber>;
382
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
383
+ along: z.ZodOptional<z.ZodNumber>;
384
+ across: z.ZodOptional<z.ZodNumber>;
385
+ content: z.ZodOptional<z.ZodString>;
386
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
387
+ start: z.ZodNumber;
388
+ end: z.ZodNumber;
389
+ font: z.ZodOptional<z.ZodString>;
390
+ bold: z.ZodOptional<z.ZodBoolean>;
391
+ italic: z.ZodOptional<z.ZodBoolean>;
392
+ underline: z.ZodOptional<z.ZodBoolean>;
393
+ color: z.ZodOptional<z.ZodString>;
394
+ height: z.ZodOptional<z.ZodNumber>;
395
+ script: z.ZodOptional<z.ZodEnum<{
396
+ sub: "sub";
397
+ super: "super";
398
+ }>>;
399
+ }, z.core.$strip>>>;
400
+ }, z.core.$strip>>>;
520
401
  styleId: z.ZodOptional<z.ZodString>;
521
402
  styleOverride: z.ZodOptional<z.ZodObject<{
522
403
  font: z.ZodOptional<z.ZodString>;
@@ -559,23 +440,6 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
559
440
  x: z.ZodNumber;
560
441
  y: z.ZodNumber;
561
442
  }, z.core.$strip>, unknown>, z.ZodString]>>>;
562
- }, z.core.$strip>, z.ZodObject<{
563
- id: z.ZodString;
564
- layerId: z.ZodString;
565
- color: z.ZodOptional<z.ZodString>;
566
- lineType: z.ZodOptional<z.ZodString>;
567
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
568
- lineWidth: z.ZodOptional<z.ZodNumber>;
569
- opacity: z.ZodOptional<z.ZodNumber>;
570
- type: z.ZodLiteral<"image">;
571
- assetId: z.ZodString;
572
- origin: z.ZodPreprocess<z.ZodObject<{
573
- x: z.ZodNumber;
574
- y: z.ZodNumber;
575
- }, z.core.$strip>, unknown>;
576
- width: z.ZodNumber;
577
- height: z.ZodNumber;
578
- rotation: z.ZodDefault<z.ZodNumber>;
579
443
  }, z.core.$strip>, z.ZodObject<{
580
444
  id: z.ZodString;
581
445
  layerId: z.ZodString;
@@ -633,7 +497,21 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
633
497
  minHeight: z.ZodOptional<z.ZodNumber>;
634
498
  }, z.core.$strip>>, unknown>;
635
499
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
636
- text: z.ZodDefault<z.ZodString>;
500
+ content: z.ZodDefault<z.ZodString>;
501
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
502
+ start: z.ZodNumber;
503
+ end: z.ZodNumber;
504
+ font: z.ZodOptional<z.ZodString>;
505
+ bold: z.ZodOptional<z.ZodBoolean>;
506
+ italic: z.ZodOptional<z.ZodBoolean>;
507
+ underline: z.ZodOptional<z.ZodBoolean>;
508
+ color: z.ZodOptional<z.ZodString>;
509
+ height: z.ZodOptional<z.ZodNumber>;
510
+ script: z.ZodOptional<z.ZodEnum<{
511
+ sub: "sub";
512
+ super: "super";
513
+ }>>;
514
+ }, z.core.$strip>>>;
637
515
  span: z.ZodOptional<z.ZodObject<{
638
516
  cols: z.ZodNumber;
639
517
  rows: z.ZodNumber;
@@ -715,6 +593,9 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
715
593
  }, z.core.$strip>, z.ZodObject<{
716
594
  kind: z.ZodLiteral<"url">;
717
595
  url: z.ZodString;
596
+ }, z.core.$strip>, z.ZodObject<{
597
+ kind: z.ZodLiteral<"asset">;
598
+ assetId: z.ZodString;
718
599
  }, z.core.$strip>], "kind">;
719
600
  position: z.ZodPreprocess<z.ZodObject<{
720
601
  x: z.ZodNumber;
@@ -747,6 +628,29 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
747
628
  type ModelObject = z.infer<typeof ModelObjectSchema>;
748
629
  type ModelObjectType = ModelObject["type"];
749
630
 
631
+ declare const HatchPatternSchema: z.ZodObject<{
632
+ name: z.ZodString;
633
+ description: z.ZodOptional<z.ZodString>;
634
+ lines: z.ZodArray<z.ZodObject<{
635
+ angle: z.ZodNumber;
636
+ origin: z.ZodPreprocess<z.ZodObject<{
637
+ x: z.ZodNumber;
638
+ y: z.ZodNumber;
639
+ }, z.core.$strip>, unknown>;
640
+ deltaX: z.ZodNumber;
641
+ deltaY: z.ZodNumber;
642
+ dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
643
+ }, z.core.$strip>>;
644
+ }, z.core.$strip>;
645
+ type DocumentHatchPattern = z.infer<typeof HatchPatternSchema>;
646
+
647
+ declare const LineTypeSchema: z.ZodObject<{
648
+ name: z.ZodString;
649
+ description: z.ZodOptional<z.ZodString>;
650
+ dashesMm: z.ZodArray<z.ZodNumber>;
651
+ }, z.core.$strip>;
652
+ type LineType = z.infer<typeof LineTypeSchema>;
653
+
750
654
  declare const LayerSchema: z.ZodObject<{
751
655
  id: z.ZodDefault<z.ZodString>;
752
656
  name: z.ZodDefault<z.ZodString>;
@@ -762,7 +666,7 @@ type Layer = z.infer<typeof LayerSchema>;
762
666
  declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
763
667
  id: z.ZodDefault<z.ZodString>;
764
668
  type: z.ZodDefault<z.ZodLiteral<"lineadraw">>;
765
- version: z.ZodLiteral<20>;
669
+ version: z.ZodLiteral<23>;
766
670
  settings: z.ZodDefault<z.ZodObject<{
767
671
  units: z.ZodDefault<z.ZodEnum<{
768
672
  in: "in";
@@ -899,6 +803,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
899
803
  name: z.ZodString;
900
804
  angle: z.ZodNumber;
901
805
  scale: z.ZodNumber;
806
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
807
+ x: z.ZodNumber;
808
+ y: z.ZodNumber;
809
+ }, z.core.$strip>, unknown>>;
902
810
  }, z.core.$strip>, z.ZodObject<{
903
811
  kind: z.ZodLiteral<"lines">;
904
812
  angle: z.ZodNumber;
@@ -928,6 +836,20 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
928
836
  y: z.ZodNumber;
929
837
  }, z.core.$strip>, unknown>;
930
838
  content: z.ZodString;
839
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
840
+ start: z.ZodNumber;
841
+ end: z.ZodNumber;
842
+ font: z.ZodOptional<z.ZodString>;
843
+ bold: z.ZodOptional<z.ZodBoolean>;
844
+ italic: z.ZodOptional<z.ZodBoolean>;
845
+ underline: z.ZodOptional<z.ZodBoolean>;
846
+ color: z.ZodOptional<z.ZodString>;
847
+ height: z.ZodOptional<z.ZodNumber>;
848
+ script: z.ZodOptional<z.ZodEnum<{
849
+ sub: "sub";
850
+ super: "super";
851
+ }>>;
852
+ }, z.core.$strip>>>;
931
853
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
932
854
  x: z.ZodNumber;
933
855
  y: z.ZodNumber;
@@ -988,11 +910,27 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
988
910
  x: z.ZodNumber;
989
911
  y: z.ZodNumber;
990
912
  }, 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>;
913
+ rotation: z.ZodOptional<z.ZodNumber>;
914
+ offset: z.ZodOptional<z.ZodNumber>;
915
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
916
+ along: z.ZodOptional<z.ZodNumber>;
917
+ across: z.ZodOptional<z.ZodNumber>;
918
+ content: z.ZodOptional<z.ZodString>;
919
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
920
+ start: z.ZodNumber;
921
+ end: z.ZodNumber;
922
+ font: z.ZodOptional<z.ZodString>;
923
+ bold: z.ZodOptional<z.ZodBoolean>;
924
+ italic: z.ZodOptional<z.ZodBoolean>;
925
+ underline: z.ZodOptional<z.ZodBoolean>;
926
+ color: z.ZodOptional<z.ZodString>;
927
+ height: z.ZodOptional<z.ZodNumber>;
928
+ script: z.ZodOptional<z.ZodEnum<{
929
+ sub: "sub";
930
+ super: "super";
931
+ }>>;
932
+ }, z.core.$strip>>>;
933
+ }, z.core.$strip>>>;
996
934
  styleId: z.ZodOptional<z.ZodString>;
997
935
  styleOverride: z.ZodOptional<z.ZodObject<{
998
936
  font: z.ZodOptional<z.ZodString>;
@@ -1035,23 +973,6 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1035
973
  x: z.ZodNumber;
1036
974
  y: z.ZodNumber;
1037
975
  }, z.core.$strip>, unknown>, z.ZodString]>>>;
1038
- }, z.core.$strip>, z.ZodObject<{
1039
- id: z.ZodString;
1040
- layerId: z.ZodString;
1041
- color: z.ZodOptional<z.ZodString>;
1042
- lineType: z.ZodOptional<z.ZodString>;
1043
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
1044
- lineWidth: z.ZodOptional<z.ZodNumber>;
1045
- opacity: z.ZodOptional<z.ZodNumber>;
1046
- type: z.ZodLiteral<"image">;
1047
- assetId: z.ZodString;
1048
- origin: z.ZodPreprocess<z.ZodObject<{
1049
- x: z.ZodNumber;
1050
- y: z.ZodNumber;
1051
- }, z.core.$strip>, unknown>;
1052
- width: z.ZodNumber;
1053
- height: z.ZodNumber;
1054
- rotation: z.ZodDefault<z.ZodNumber>;
1055
976
  }, z.core.$strip>, z.ZodObject<{
1056
977
  id: z.ZodString;
1057
978
  layerId: z.ZodString;
@@ -1109,7 +1030,21 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1109
1030
  minHeight: z.ZodOptional<z.ZodNumber>;
1110
1031
  }, z.core.$strip>>, unknown>;
1111
1032
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1112
- text: z.ZodDefault<z.ZodString>;
1033
+ content: z.ZodDefault<z.ZodString>;
1034
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
1035
+ start: z.ZodNumber;
1036
+ end: z.ZodNumber;
1037
+ font: z.ZodOptional<z.ZodString>;
1038
+ bold: z.ZodOptional<z.ZodBoolean>;
1039
+ italic: z.ZodOptional<z.ZodBoolean>;
1040
+ underline: z.ZodOptional<z.ZodBoolean>;
1041
+ color: z.ZodOptional<z.ZodString>;
1042
+ height: z.ZodOptional<z.ZodNumber>;
1043
+ script: z.ZodOptional<z.ZodEnum<{
1044
+ sub: "sub";
1045
+ super: "super";
1046
+ }>>;
1047
+ }, z.core.$strip>>>;
1113
1048
  span: z.ZodOptional<z.ZodObject<{
1114
1049
  cols: z.ZodNumber;
1115
1050
  rows: z.ZodNumber;
@@ -1191,6 +1126,9 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1191
1126
  }, z.core.$strip>, z.ZodObject<{
1192
1127
  kind: z.ZodLiteral<"url">;
1193
1128
  url: z.ZodString;
1129
+ }, z.core.$strip>, z.ZodObject<{
1130
+ kind: z.ZodLiteral<"asset">;
1131
+ assetId: z.ZodString;
1194
1132
  }, z.core.$strip>], "kind">;
1195
1133
  position: z.ZodPreprocess<z.ZodObject<{
1196
1134
  x: z.ZodNumber;
@@ -1350,6 +1288,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1350
1288
  name: z.ZodString;
1351
1289
  angle: z.ZodNumber;
1352
1290
  scale: z.ZodNumber;
1291
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
1292
+ x: z.ZodNumber;
1293
+ y: z.ZodNumber;
1294
+ }, z.core.$strip>, unknown>>;
1353
1295
  }, z.core.$strip>, z.ZodObject<{
1354
1296
  kind: z.ZodLiteral<"lines">;
1355
1297
  angle: z.ZodNumber;
@@ -1379,6 +1321,20 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1379
1321
  y: z.ZodNumber;
1380
1322
  }, z.core.$strip>, unknown>;
1381
1323
  content: z.ZodString;
1324
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
1325
+ start: z.ZodNumber;
1326
+ end: z.ZodNumber;
1327
+ font: z.ZodOptional<z.ZodString>;
1328
+ bold: z.ZodOptional<z.ZodBoolean>;
1329
+ italic: z.ZodOptional<z.ZodBoolean>;
1330
+ underline: z.ZodOptional<z.ZodBoolean>;
1331
+ color: z.ZodOptional<z.ZodString>;
1332
+ height: z.ZodOptional<z.ZodNumber>;
1333
+ script: z.ZodOptional<z.ZodEnum<{
1334
+ sub: "sub";
1335
+ super: "super";
1336
+ }>>;
1337
+ }, z.core.$strip>>>;
1382
1338
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1383
1339
  x: z.ZodNumber;
1384
1340
  y: z.ZodNumber;
@@ -1439,11 +1395,27 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1439
1395
  x: z.ZodNumber;
1440
1396
  y: z.ZodNumber;
1441
1397
  }, 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>;
1398
+ rotation: z.ZodOptional<z.ZodNumber>;
1399
+ offset: z.ZodOptional<z.ZodNumber>;
1400
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
1401
+ along: z.ZodOptional<z.ZodNumber>;
1402
+ across: z.ZodOptional<z.ZodNumber>;
1403
+ content: z.ZodOptional<z.ZodString>;
1404
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
1405
+ start: z.ZodNumber;
1406
+ end: z.ZodNumber;
1407
+ font: z.ZodOptional<z.ZodString>;
1408
+ bold: z.ZodOptional<z.ZodBoolean>;
1409
+ italic: z.ZodOptional<z.ZodBoolean>;
1410
+ underline: z.ZodOptional<z.ZodBoolean>;
1411
+ color: z.ZodOptional<z.ZodString>;
1412
+ height: z.ZodOptional<z.ZodNumber>;
1413
+ script: z.ZodOptional<z.ZodEnum<{
1414
+ sub: "sub";
1415
+ super: "super";
1416
+ }>>;
1417
+ }, z.core.$strip>>>;
1418
+ }, z.core.$strip>>>;
1447
1419
  styleId: z.ZodOptional<z.ZodString>;
1448
1420
  styleOverride: z.ZodOptional<z.ZodObject<{
1449
1421
  font: z.ZodOptional<z.ZodString>;
@@ -1486,23 +1458,6 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1486
1458
  x: z.ZodNumber;
1487
1459
  y: z.ZodNumber;
1488
1460
  }, z.core.$strip>, unknown>, z.ZodString]>>>;
1489
- }, z.core.$strip>, z.ZodObject<{
1490
- id: z.ZodString;
1491
- layerId: z.ZodString;
1492
- color: z.ZodOptional<z.ZodString>;
1493
- lineType: z.ZodOptional<z.ZodString>;
1494
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
1495
- lineWidth: z.ZodOptional<z.ZodNumber>;
1496
- opacity: z.ZodOptional<z.ZodNumber>;
1497
- type: z.ZodLiteral<"image">;
1498
- assetId: z.ZodString;
1499
- origin: z.ZodPreprocess<z.ZodObject<{
1500
- x: z.ZodNumber;
1501
- y: z.ZodNumber;
1502
- }, z.core.$strip>, unknown>;
1503
- width: z.ZodNumber;
1504
- height: z.ZodNumber;
1505
- rotation: z.ZodDefault<z.ZodNumber>;
1506
1461
  }, z.core.$strip>, z.ZodObject<{
1507
1462
  id: z.ZodString;
1508
1463
  layerId: z.ZodString;
@@ -1560,7 +1515,21 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1560
1515
  minHeight: z.ZodOptional<z.ZodNumber>;
1561
1516
  }, z.core.$strip>>, unknown>;
1562
1517
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1563
- text: z.ZodDefault<z.ZodString>;
1518
+ content: z.ZodDefault<z.ZodString>;
1519
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
1520
+ start: z.ZodNumber;
1521
+ end: z.ZodNumber;
1522
+ font: z.ZodOptional<z.ZodString>;
1523
+ bold: z.ZodOptional<z.ZodBoolean>;
1524
+ italic: z.ZodOptional<z.ZodBoolean>;
1525
+ underline: z.ZodOptional<z.ZodBoolean>;
1526
+ color: z.ZodOptional<z.ZodString>;
1527
+ height: z.ZodOptional<z.ZodNumber>;
1528
+ script: z.ZodOptional<z.ZodEnum<{
1529
+ sub: "sub";
1530
+ super: "super";
1531
+ }>>;
1532
+ }, z.core.$strip>>>;
1564
1533
  span: z.ZodOptional<z.ZodObject<{
1565
1534
  cols: z.ZodNumber;
1566
1535
  rows: z.ZodNumber;
@@ -1642,6 +1611,9 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1642
1611
  }, z.core.$strip>, z.ZodObject<{
1643
1612
  kind: z.ZodLiteral<"url">;
1644
1613
  url: z.ZodString;
1614
+ }, z.core.$strip>, z.ZodObject<{
1615
+ kind: z.ZodLiteral<"asset">;
1616
+ assetId: z.ZodString;
1645
1617
  }, z.core.$strip>], "kind">;
1646
1618
  position: z.ZodPreprocess<z.ZodObject<{
1647
1619
  x: z.ZodNumber;
@@ -1714,13 +1686,32 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1714
1686
  extensionOvershoot: z.ZodDefault<z.ZodNumber>;
1715
1687
  precision: z.ZodDefault<z.ZodNumber>;
1716
1688
  }, z.core.$strip>>>;
1689
+ lineTypes: z.ZodDefault<z.ZodArray<z.ZodObject<{
1690
+ name: z.ZodString;
1691
+ description: z.ZodOptional<z.ZodString>;
1692
+ dashesMm: z.ZodArray<z.ZodNumber>;
1693
+ }, z.core.$strip>>>;
1694
+ hatchPatterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
1695
+ name: z.ZodString;
1696
+ description: z.ZodOptional<z.ZodString>;
1697
+ lines: z.ZodArray<z.ZodObject<{
1698
+ angle: z.ZodNumber;
1699
+ origin: z.ZodPreprocess<z.ZodObject<{
1700
+ x: z.ZodNumber;
1701
+ y: z.ZodNumber;
1702
+ }, z.core.$strip>, unknown>;
1703
+ deltaX: z.ZodNumber;
1704
+ deltaY: z.ZodNumber;
1705
+ dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1706
+ }, z.core.$strip>>;
1707
+ }, z.core.$strip>>>;
1717
1708
  assets: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1718
1709
  blockDefinitions: z.ZodDefault<z.ZodArray<z.ZodString>>;
1719
1710
  commands: z.ZodDefault<z.ZodArray<z.ZodString>>;
1720
1711
  }, z.core.$strip>, unknown>;
1721
1712
  type LineaDocument = z.infer<typeof LineaDocumentSchema>;
1722
1713
 
1723
- declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1714
+ declare const ParamDefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1724
1715
  name: z.ZodString;
1725
1716
  label: z.ZodOptional<z.ZodString>;
1726
1717
  hint: z.ZodOptional<z.ZodString>;
@@ -1918,7 +1909,7 @@ declare const BlockParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1918
1909
  default: z.ZodDefault<z.ZodString>;
1919
1910
  }, z.core.$strip>], "type">>;
1920
1911
  }, z.core.$strip>], "type">;
1921
- type BlockParameter = z.infer<typeof BlockParamSchema>;
1912
+ type ParamDef = z.infer<typeof ParamDefSchema>;
1922
1913
 
1923
1914
  /** ISO A-series portrait sizes in mm [width, height]. */
1924
1915
  declare const SHEET_PRESETS: {
@@ -2087,6 +2078,10 @@ declare const PaperLayoutSchema: z.ZodObject<{
2087
2078
  name: z.ZodString;
2088
2079
  angle: z.ZodNumber;
2089
2080
  scale: z.ZodNumber;
2081
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
2082
+ x: z.ZodNumber;
2083
+ y: z.ZodNumber;
2084
+ }, z.core.$strip>, unknown>>;
2090
2085
  }, z.core.$strip>, z.ZodObject<{
2091
2086
  kind: z.ZodLiteral<"lines">;
2092
2087
  angle: z.ZodNumber;
@@ -2116,6 +2111,20 @@ declare const PaperLayoutSchema: z.ZodObject<{
2116
2111
  y: z.ZodNumber;
2117
2112
  }, z.core.$strip>, unknown>;
2118
2113
  content: z.ZodString;
2114
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
2115
+ start: z.ZodNumber;
2116
+ end: z.ZodNumber;
2117
+ font: z.ZodOptional<z.ZodString>;
2118
+ bold: z.ZodOptional<z.ZodBoolean>;
2119
+ italic: z.ZodOptional<z.ZodBoolean>;
2120
+ underline: z.ZodOptional<z.ZodBoolean>;
2121
+ color: z.ZodOptional<z.ZodString>;
2122
+ height: z.ZodOptional<z.ZodNumber>;
2123
+ script: z.ZodOptional<z.ZodEnum<{
2124
+ sub: "sub";
2125
+ super: "super";
2126
+ }>>;
2127
+ }, z.core.$strip>>>;
2119
2128
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2120
2129
  x: z.ZodNumber;
2121
2130
  y: z.ZodNumber;
@@ -2176,11 +2185,27 @@ declare const PaperLayoutSchema: z.ZodObject<{
2176
2185
  x: z.ZodNumber;
2177
2186
  y: z.ZodNumber;
2178
2187
  }, 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>;
2188
+ rotation: z.ZodOptional<z.ZodNumber>;
2189
+ offset: z.ZodOptional<z.ZodNumber>;
2190
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
2191
+ along: z.ZodOptional<z.ZodNumber>;
2192
+ across: z.ZodOptional<z.ZodNumber>;
2193
+ content: z.ZodOptional<z.ZodString>;
2194
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
2195
+ start: z.ZodNumber;
2196
+ end: z.ZodNumber;
2197
+ font: z.ZodOptional<z.ZodString>;
2198
+ bold: z.ZodOptional<z.ZodBoolean>;
2199
+ italic: z.ZodOptional<z.ZodBoolean>;
2200
+ underline: z.ZodOptional<z.ZodBoolean>;
2201
+ color: z.ZodOptional<z.ZodString>;
2202
+ height: z.ZodOptional<z.ZodNumber>;
2203
+ script: z.ZodOptional<z.ZodEnum<{
2204
+ sub: "sub";
2205
+ super: "super";
2206
+ }>>;
2207
+ }, z.core.$strip>>>;
2208
+ }, z.core.$strip>>>;
2184
2209
  styleId: z.ZodOptional<z.ZodString>;
2185
2210
  styleOverride: z.ZodOptional<z.ZodObject<{
2186
2211
  font: z.ZodOptional<z.ZodString>;
@@ -2223,23 +2248,6 @@ declare const PaperLayoutSchema: z.ZodObject<{
2223
2248
  x: z.ZodNumber;
2224
2249
  y: z.ZodNumber;
2225
2250
  }, z.core.$strip>, unknown>, z.ZodString]>>>;
2226
- }, z.core.$strip>, z.ZodObject<{
2227
- id: z.ZodString;
2228
- layerId: z.ZodString;
2229
- color: z.ZodOptional<z.ZodString>;
2230
- lineType: z.ZodOptional<z.ZodString>;
2231
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
2232
- lineWidth: z.ZodOptional<z.ZodNumber>;
2233
- opacity: z.ZodOptional<z.ZodNumber>;
2234
- type: z.ZodLiteral<"image">;
2235
- assetId: z.ZodString;
2236
- origin: z.ZodPreprocess<z.ZodObject<{
2237
- x: z.ZodNumber;
2238
- y: z.ZodNumber;
2239
- }, z.core.$strip>, unknown>;
2240
- width: z.ZodNumber;
2241
- height: z.ZodNumber;
2242
- rotation: z.ZodDefault<z.ZodNumber>;
2243
2251
  }, z.core.$strip>, z.ZodObject<{
2244
2252
  id: z.ZodString;
2245
2253
  layerId: z.ZodString;
@@ -2297,7 +2305,21 @@ declare const PaperLayoutSchema: z.ZodObject<{
2297
2305
  minHeight: z.ZodOptional<z.ZodNumber>;
2298
2306
  }, z.core.$strip>>, unknown>;
2299
2307
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2300
- text: z.ZodDefault<z.ZodString>;
2308
+ content: z.ZodDefault<z.ZodString>;
2309
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
2310
+ start: z.ZodNumber;
2311
+ end: z.ZodNumber;
2312
+ font: z.ZodOptional<z.ZodString>;
2313
+ bold: z.ZodOptional<z.ZodBoolean>;
2314
+ italic: z.ZodOptional<z.ZodBoolean>;
2315
+ underline: z.ZodOptional<z.ZodBoolean>;
2316
+ color: z.ZodOptional<z.ZodString>;
2317
+ height: z.ZodOptional<z.ZodNumber>;
2318
+ script: z.ZodOptional<z.ZodEnum<{
2319
+ sub: "sub";
2320
+ super: "super";
2321
+ }>>;
2322
+ }, z.core.$strip>>>;
2301
2323
  span: z.ZodOptional<z.ZodObject<{
2302
2324
  cols: z.ZodNumber;
2303
2325
  rows: z.ZodNumber;
@@ -2379,6 +2401,9 @@ declare const PaperLayoutSchema: z.ZodObject<{
2379
2401
  }, z.core.$strip>, z.ZodObject<{
2380
2402
  kind: z.ZodLiteral<"url">;
2381
2403
  url: z.ZodString;
2404
+ }, z.core.$strip>, z.ZodObject<{
2405
+ kind: z.ZodLiteral<"asset">;
2406
+ assetId: z.ZodString;
2382
2407
  }, z.core.$strip>], "kind">;
2383
2408
  position: z.ZodPreprocess<z.ZodObject<{
2384
2409
  x: z.ZodNumber;
@@ -2413,7 +2438,8 @@ type PaperLayout = z.infer<typeof PaperLayoutSchema>;
2413
2438
 
2414
2439
  /**
2415
2440
  * 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).
2441
+ * `"1:50"` → 50, `"2:1"` → 0.5; numbers pass through (50 means 1:50), as
2442
+ * does a plain numeric string (`"50"`).
2417
2443
  */
2418
2444
  declare const parseScale: (scale: number | string) => number;
2419
2445
 
@@ -2428,7 +2454,7 @@ declare const ensureScriptTranspiler: () => Promise<ModuleExecutor>;
2428
2454
  interface BlockMeta {
2429
2455
  id: string;
2430
2456
  name: string;
2431
- params: BlockParameter[];
2457
+ params: ParamDef[];
2432
2458
  description?: string;
2433
2459
  version?: string;
2434
2460
  authors?: string[];
@@ -2468,6 +2494,10 @@ interface BlockThumbnailOptions {
2468
2494
  /** Skip (return null) when the SVG exceeds this many characters — a
2469
2495
  * manifest should stay a light index, not an asset bundle. */
2470
2496
  maxChars?: number;
2497
+ /** The document's own line types / hatch patterns, when the block's
2498
+ * children reference them by name (the catalogue needs no help). */
2499
+ lineTypes?: readonly LineType[];
2500
+ hatchPatterns?: readonly DocumentHatchPattern[];
2471
2501
  }
2472
2502
  /**
2473
2503
  * Render a block module to a small standalone SVG (viewBox-sized, strokes
@@ -2476,7 +2506,7 @@ interface BlockThumbnailOptions {
2476
2506
  * module itself fails its dry run (same errors testBlockDefinition
2477
2507
  * reports).
2478
2508
  */
2479
- declare const renderBlockThumbnailSvg: (script: string, { definitions, maxChars }?: BlockThumbnailOptions) => Promise<string | null>;
2509
+ declare const renderBlockThumbnailSvg: (script: string, { definitions, maxChars, lineTypes, hatchPatterns, }?: BlockThumbnailOptions) => Promise<string | null>;
2480
2510
 
2481
2511
  interface MergeModulesResult<M> {
2482
2512
  /** The full library to install (replacements in place + new appended). */
@@ -2500,6 +2530,145 @@ interface MergeModulesResult<M> {
2500
2530
  }[];
2501
2531
  }
2502
2532
 
2533
+ /** One configured marketplace. `kind` discriminates so new source types
2534
+ * are one more variant; identity (for dedupe/remove/reorder) is
2535
+ * `marketplaceKey`. The built-in public collection is always present
2536
+ * exactly once (`normalizeMarketplaces`). Tokens never enter a document. */
2537
+ declare const MarketplaceConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2538
+ kind: z.ZodLiteral<"builtin">;
2539
+ }, z.core.$strip>, z.ZodObject<{
2540
+ kind: z.ZodLiteral<"github">;
2541
+ spec: z.ZodString;
2542
+ token: z.ZodOptional<z.ZodString>;
2543
+ }, z.core.$strip>, z.ZodObject<{
2544
+ kind: z.ZodLiteral<"folder">;
2545
+ folder: z.ZodString;
2546
+ }, z.core.$strip>], "kind">;
2547
+ type MarketplaceConfig = z.infer<typeof MarketplaceConfigSchema>;
2548
+ /** What agents and the SDK see of a configured marketplace — never the
2549
+ * token itself. */
2550
+ interface MarketplaceInfo {
2551
+ key: string;
2552
+ kind: MarketplaceConfig["kind"];
2553
+ label: string;
2554
+ spec?: string;
2555
+ folder?: string;
2556
+ hasToken: boolean;
2557
+ }
2558
+ /** One manifest row — the minimal-manifest scheme (docs/marketplace-devx.md)
2559
+ * with the legacy pinned-URL fields still accepted. Exported so tooling
2560
+ * tests can verify generated manifests parse. */
2561
+ declare const MarketplaceEntrySchema: z.ZodObject<{
2562
+ kind: z.ZodEnum<{
2563
+ block: "block";
2564
+ command: "command";
2565
+ }>;
2566
+ id: z.ZodString;
2567
+ name: z.ZodString;
2568
+ version: z.ZodString;
2569
+ description: z.ZodOptional<z.ZodString>;
2570
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
2571
+ authors: z.ZodDefault<z.ZodArray<z.ZodString>>;
2572
+ dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
2573
+ source: z.ZodOptional<z.ZodString>;
2574
+ sourceUrl: z.ZodOptional<z.ZodString>;
2575
+ contentHash: z.ZodOptional<z.ZodString>;
2576
+ thumbnailSvg: z.ZodOptional<z.ZodString>;
2577
+ }, z.core.$strip>;
2578
+ type MarketplaceEntry = z.infer<typeof MarketplaceEntrySchema>;
2579
+ type MarketplaceCatalog = {
2580
+ state: "ready";
2581
+ name?: string;
2582
+ entries: MarketplaceEntry[];
2583
+ } | {
2584
+ state: "unavailable";
2585
+ reason: string;
2586
+ };
2587
+ /** How a catalog entry relates to what the document already has. */
2588
+ type InstallStatus = {
2589
+ kind: "absent";
2590
+ } | {
2591
+ kind: "installed";
2592
+ version?: string;
2593
+ } | {
2594
+ kind: "update";
2595
+ from?: string;
2596
+ };
2597
+ /** The document's module sources an install compares against. */
2598
+ interface VendoredModules {
2599
+ blockDefinitions: readonly string[];
2600
+ commands: readonly string[];
2601
+ }
2602
+ /** What a host lends the client: the platform's fetch (default
2603
+ * `globalThis.fetch`) and, for folder marketplaces, a reader of UTF-8
2604
+ * files by folder key + folder-relative POSIX path (reject when missing).
2605
+ * Without a reader, folder marketplaces report themselves unavailable. */
2606
+ interface MarketplaceIO {
2607
+ fetch?: typeof globalThis.fetch;
2608
+ readFile?: (folderKey: string, relPath: string) => Promise<string>;
2609
+ }
2610
+ /** A search hit: the entry, where it came from, and its install status. */
2611
+ interface MarketplaceHit extends MarketplaceEntry {
2612
+ marketplace: MarketplaceInfo;
2613
+ status: InstallStatus;
2614
+ }
2615
+ interface MarketplaceQuery {
2616
+ /** Case-insensitive substring over name, id, description and tags. */
2617
+ query?: string;
2618
+ kind?: MarketplaceEntry["kind"];
2619
+ /** Restrict to one marketplace — by key, spec, folder or label. */
2620
+ marketplace?: string;
2621
+ }
2622
+ /**
2623
+ * Catalog + source access over configured marketplaces, with per-instance
2624
+ * caches: one download of a module serves preview and install, and a
2625
+ * catalog is fetched once until `refresh`. One instance per host.
2626
+ */
2627
+ declare class MarketplaceClient {
2628
+ private readonly catalogs;
2629
+ private readonly sources;
2630
+ private readonly io;
2631
+ constructor(io?: MarketplaceIO);
2632
+ private fetch;
2633
+ private cacheKey;
2634
+ private loadFolderCatalog;
2635
+ private loadCatalog;
2636
+ /** Fetch (and cache) a marketplace's catalog; `refresh` bypasses the
2637
+ * cache AND drops the marketplace's cached module sources — `source`
2638
+ * rows track a branch ref, so they are only immutable within one catalog
2639
+ * snapshot. */
2640
+ catalog(m: MarketplaceConfig, refresh?: boolean): Promise<MarketplaceCatalog>;
2641
+ /** An entry's module source. `source` rows resolve against the
2642
+ * marketplace repo at the manifest's ref; with a token the contents API
2643
+ * serves them instead of the raw host. */
2644
+ source(m: MarketplaceConfig, entry: MarketplaceEntry): Promise<string>;
2645
+ /**
2646
+ * Sources of an entry's declared dependency CLOSURE (the entry itself
2647
+ * excluded), resolved from the catalog recursively — what a preview
2648
+ * needs so nested instances (Grid → Axis) evaluate before anything is
2649
+ * installed. Missing catalog entries are skipped (the preview then shows
2650
+ * the eval error for that id, same as a dangling reference).
2651
+ */
2652
+ closureSources(m: MarketplaceConfig, entry: MarketplaceEntry): Promise<string[]>;
2653
+ /**
2654
+ * The module sources an install of `entry` merges, in order: declared
2655
+ * block dependencies first (resolved from the catalog, recursively,
2656
+ * skipping ids the document already vendors — a dependency is never
2657
+ * force-updated), the entry itself last. Throws when a dependency is
2658
+ * missing from the catalog.
2659
+ */
2660
+ installSources(m: MarketplaceConfig, entry: MarketplaceEntry, vendored: VendoredModules, visited?: Set<string>): Promise<string[]>;
2661
+ /** Entries across the configured marketplaces (priority order; the first
2662
+ * marketplace publishing an id wins), filtered by the query. */
2663
+ search(configs: readonly MarketplaceConfig[], q: MarketplaceQuery, vendored: VendoredModules): Promise<MarketplaceHit[]>;
2664
+ /** The first marketplace (in priority order, or the named one) that
2665
+ * publishes `id`, with its entry; null when none does. */
2666
+ find(configs: readonly MarketplaceConfig[], id: string, marketplace?: string): Promise<{
2667
+ config: MarketplaceConfig;
2668
+ entry: MarketplaceEntry;
2669
+ } | null>;
2670
+ }
2671
+
2503
2672
  /** Identity + metadata derived from a command module's exports. */
2504
2673
  interface CommandMeta {
2505
2674
  id: string;
@@ -2514,7 +2683,7 @@ interface CommandMeta {
2514
2683
  /** Declared parameters (the blocks' ParamDef table): prompted in the
2515
2684
  * editor before `run`, or passed by a headless caller; arrive as
2516
2685
  * `ctx.params`. Absent when the command declares none. */
2517
- params?: BlockParameter[];
2686
+ params?: ParamDef[];
2518
2687
  }
2519
2688
  /** Non-throwing meta lookup for list UIs. */
2520
2689
  type CommandMetaResult = {
@@ -2535,18 +2704,10 @@ interface TextMeasurer {
2535
2704
  * (horizontal glyph scale) when provided. */
2536
2705
  measureTextWidth(text: string, heightMm: number, font?: string, widthFactor?: number): number;
2537
2706
  }
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
2707
 
2547
2708
  type SnapPointType = "endpoint" | "midpoint" | "center" | "quadrant";
2548
2709
  interface SnapPoint {
2549
- p: Vec2;
2710
+ p: Vec2$1;
2550
2711
  type: SnapPointType;
2551
2712
  }
2552
2713
  /** A cached segment; tessellation chords of curves are marked as such. */
@@ -2581,7 +2742,13 @@ interface SnapCacheEntry {
2581
2742
  */
2582
2743
  ellipses?: EllipseGeom[];
2583
2744
  /** Closed tessellated rings (hatch interiors, for inside hit-testing). */
2584
- rings?: Vec2[][];
2745
+ rings?: Vec2$1[][];
2746
+ /**
2747
+ * Filled regions of NESTED content — a block's hatch children — each its
2748
+ * own even-odd ring set (so two overlapping fills don't cancel). An
2749
+ * inside hit on one ranks like a hatch hit: below geometry drawn over it.
2750
+ */
2751
+ regions?: Vec2$1[][][];
2585
2752
  /**
2586
2753
  * Huge entries (a referenced site plan: 10⁵+ segments) answer "what is in
2587
2754
  * this box" from a spatial index, so snapping and picking near the cursor
@@ -2590,69 +2757,26 @@ interface SnapCacheEntry {
2590
2757
  near?: (box: AABB) => SnapCacheEntry;
2591
2758
  }
2592
2759
 
2593
- interface ResolvedStyle {
2594
- color: string;
2595
- widthMm: number;
2596
- /** Dash pattern in mm (undefined = continuous). */
2597
- dashMm?: number[];
2598
- /** Paint opacity 0..1 (undefined = opaque). */
2599
- opacity?: number;
2600
- }
2601
-
2602
- interface DimArc {
2603
- center: Vec2;
2604
- radius: number;
2605
- /** Radians, CCW from startAngle to endAngle (canvas/DXF convention). */
2606
- startAngle: number;
2607
- endAngle: number;
2608
- }
2609
- interface DimText {
2610
- content: string;
2611
- anchor: Vec2;
2612
- rotation: number;
2613
- height: number;
2614
- /** Font id + width factor from the resolved dimension style. */
2615
- font?: string;
2616
- widthFactor?: number;
2617
- }
2618
- interface DimGeometry {
2619
- extensionLines: Segment[];
2620
- dimLines: Segment[];
2621
- /** Angular dimensions draw an arc instead of a straight dimension line. */
2622
- dimArc: DimArc | null;
2623
- arrows: {
2624
- tip: Vec2;
2625
- toward: Vec2;
2626
- size: number;
2627
- }[];
2628
- arrowType: DimStyle["arrowType"];
2629
- /** One entry per measured segment (chains carry several). */
2630
- texts: DimText[];
2631
- /** Primary measurement: total span / angle in radians / radius / diameter. */
2632
- value: number;
2633
- }
2634
-
2635
- interface PaintGeometryCache {
2636
- hatchLines: WeakMap<Hatch, Segment[]>;
2637
- /** Guarded by `base` — a dim-styles edit replaces the array. */
2638
- dimGeometry: WeakMap<Dimension, {
2639
- base: readonly DimStyle[];
2640
- geom: DimGeometry | null;
2641
- }>;
2642
- /** Guarded by `base` — a text-styles edit rewraps inheriting text. */
2643
- textBlocks: WeakMap<Text, {
2644
- base: readonly TextStyle[];
2645
- block: TextBlock;
2646
- }>;
2647
- }
2648
-
2649
- /** Environment passed to painters — style already resolved by the caller. */
2650
- interface PaintEnv {
2651
- style: ResolvedStyle;
2760
+ /**
2761
+ * The document half of a paint environment: everything a painter resolves
2762
+ * by id or name against the document. The array fields are REQUIRED so a
2763
+ * caller can't drop one by accident (an omitted `hatchPatterns` silently
2764
+ * painted the catalogue fallback); consumers without a document pass [].
2765
+ * `LayoutModelContext` and `ReferenceContent` extend it, so a paint env
2766
+ * spreads either one whole.
2767
+ */
2768
+ interface DocumentPaintResources {
2769
+ /** Document layers — a block child that names its OWN layer hides with
2770
+ * it (its color still follows the instance unless it sets one). */
2771
+ layers: readonly Layer[];
2652
2772
  /** Document dimension styles — dimensions pick theirs by styleId. */
2653
- dimStyles: readonly DimStyle[];
2773
+ dimStyles: readonly DimStyle$1[];
2654
2774
  /** Document text styles — texts pick theirs by styleId. */
2655
- textStyles: readonly TextStyle[];
2775
+ textStyles: readonly TextStyle$1[];
2776
+ /** Document-defined line types / hatch patterns, resolved by NAME ahead
2777
+ * of the built-in catalogue (block children and hatch fills). */
2778
+ lineTypes: readonly LineType[];
2779
+ hatchPatterns: readonly DocumentHatchPattern[];
2656
2780
  /**
2657
2781
  * The document's block definitions — the block painter evaluates instance
2658
2782
  * children against these. The kernel holds no store, so they are threaded
@@ -2666,32 +2790,16 @@ interface PaintEnv {
2666
2790
  */
2667
2791
  resolveObject?: (id: string) => ModelObject | undefined;
2668
2792
  /**
2669
- * The document's embedded assets (hash → data URL) — the image painter
2670
- * resolves `assetId` against these. Optional: consumers that can't show
2671
- * images (or documents without any) paint a crossed placeholder frame.
2793
+ * The document's embedded assets (hash → data URL) — the bytes behind
2794
+ * `asset`-source references, which a host's `resolveReference` reads.
2672
2795
  */
2673
2796
  assets?: Readonly<Record<string, string>>;
2674
- /**
2675
- * Optional cache for camera-independent derived geometry (hatch lines,
2676
- * dimension geometry, text blocks). Supply one per long-lived consumer
2677
- * (the canvas renderer keeps one across frames); omit for one-shot paints.
2678
- */
2679
- cache?: PaintGeometryCache;
2680
- /**
2681
- * Paint everything in `style` verbatim, ignoring per-child style overrides
2682
- * (block children carrying their own color/lineType). Selection/hover
2683
- * highlights set this so a block highlights as one uniform silhouette.
2684
- */
2685
- forceStyle?: boolean;
2686
2797
  /**
2687
2798
  * A reference's loaded file content (docs/references.md) — the host owns
2688
2799
  * loading and caching. Absent, or null for a file not loaded (yet), → the
2689
2800
  * reference paints as a dashed frame.
2690
2801
  */
2691
- resolveReference?: (ref: ReferenceObject) => ReferenceContent | null;
2692
- /** The output medium's color map (print palettes): content painted with
2693
- * its OWN styles (a reference's file) maps through it too. */
2694
- mapColor?: (color: string) => string;
2802
+ resolveReference?: (ref: Reference) => ReferenceContent | null;
2695
2803
  }
2696
2804
 
2697
2805
  /**
@@ -2699,21 +2807,8 @@ interface PaintEnv {
2699
2807
  * store, so it is passed in (the editor sources it from useModel; a headless
2700
2808
  * caller from the loaded document).
2701
2809
  */
2702
- interface LayoutModelContext {
2703
- objects: ModelObject[];
2704
- layers: Layer[];
2705
- dimStyles: readonly DimStyle[];
2706
- textStyles: readonly TextStyle[];
2707
- blockDefinitions: readonly string[];
2708
- /**
2709
- * Document-wide object lookup for block object-reference inputs; absent →
2710
- * referenced inputs evaluate as null (see BlockObjectResolver).
2711
- */
2712
- resolveObject?: (id: string) => ModelObject | undefined;
2713
- /** Embedded image assets (hash → data URL); absent = placeholder frames. */
2714
- assets?: Readonly<Record<string, string>>;
2715
- /** Loaded reference content (see PaintEnv.resolveReference). */
2716
- resolveReference?: PaintEnv["resolveReference"];
2810
+ interface LayoutModelContext extends DocumentPaintResources {
2811
+ objects: readonly ModelObject[];
2717
2812
  }
2718
2813
 
2719
2814
  /** A loaded reference: the file's model space as Linea objects (ids
@@ -2723,6 +2818,8 @@ interface ReferenceContent extends LayoutModelContext {
2723
2818
  bounds: AABB;
2724
2819
  /** PDF: how many pages the file has (the page field's range). */
2725
2820
  pageCount?: number;
2821
+ /** A bitmap drawn under `objects` (PNG/JPEG, raster PDF page). */
2822
+ raster?: ReferenceRaster;
2726
2823
  /**
2727
2824
  * Snap geometry precomputed in FILE coordinates (off the main thread —
2728
2825
  * see `referenceSnapOf`); absent → derived from `objects`. A raster PDF
@@ -2735,13 +2832,13 @@ interface ReferenceContent extends LayoutModelContext {
2735
2832
  * reference's hidden layers still filter them). */
2736
2833
  interface ReferenceSnap {
2737
2834
  points: {
2738
- p: Vec2;
2835
+ p: Vec2$1;
2739
2836
  type: SnapPointType;
2740
2837
  layer: string;
2741
2838
  }[];
2742
2839
  segments: {
2743
- a: Vec2;
2744
- b: Vec2;
2840
+ a: Vec2$1;
2841
+ b: Vec2$1;
2745
2842
  chord?: boolean;
2746
2843
  layer: string;
2747
2844
  }[];
@@ -2752,8 +2849,14 @@ interface ReferenceSnap {
2752
2849
  layer: string;
2753
2850
  })[];
2754
2851
  }
2755
-
2756
- type DwgVersion = "AC1015" | "AC1018" | "AC1021" | "AC1024" | "AC1027" | "AC1032";
2852
+ /** Raster content: one bitmap, bottom-left at the file origin, `width` ×
2853
+ * `height` mm — a PNG/JPEG reference or a raster PDF page. */
2854
+ interface ReferenceRaster {
2855
+ /** The bitmap as a data URL (what the sink's `image()` op draws). */
2856
+ data: string;
2857
+ width: number;
2858
+ height: number;
2859
+ }
2757
2860
 
2758
2861
  /**
2759
2862
  * Where a reorder places the moved objects: the top/bottom of the space's
@@ -2888,6 +2991,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2888
2991
  name: z.ZodString;
2889
2992
  angle: z.ZodNumber;
2890
2993
  scale: z.ZodNumber;
2994
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
2995
+ x: z.ZodNumber;
2996
+ y: z.ZodNumber;
2997
+ }, z.core.$strip>, unknown>>;
2891
2998
  }, z.core.$strip>, z.ZodObject<{
2892
2999
  kind: z.ZodLiteral<"lines">;
2893
3000
  angle: z.ZodNumber;
@@ -2917,6 +3024,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2917
3024
  y: z.ZodNumber;
2918
3025
  }, z.core.$strip>, unknown>;
2919
3026
  content: z.ZodString;
3027
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3028
+ start: z.ZodNumber;
3029
+ end: z.ZodNumber;
3030
+ font: z.ZodOptional<z.ZodString>;
3031
+ bold: z.ZodOptional<z.ZodBoolean>;
3032
+ italic: z.ZodOptional<z.ZodBoolean>;
3033
+ underline: z.ZodOptional<z.ZodBoolean>;
3034
+ color: z.ZodOptional<z.ZodString>;
3035
+ height: z.ZodOptional<z.ZodNumber>;
3036
+ script: z.ZodOptional<z.ZodEnum<{
3037
+ sub: "sub";
3038
+ super: "super";
3039
+ }>>;
3040
+ }, z.core.$strip>>>;
2920
3041
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2921
3042
  x: z.ZodNumber;
2922
3043
  y: z.ZodNumber;
@@ -2977,11 +3098,27 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2977
3098
  x: z.ZodNumber;
2978
3099
  y: z.ZodNumber;
2979
3100
  }, z.core.$strip>, unknown>>;
2980
- offset: z.ZodPreprocess<z.ZodObject<{
2981
- x: z.ZodNumber;
2982
- y: z.ZodNumber;
2983
- }, z.core.$strip>, unknown>;
2984
- textOverride: z.ZodOptional<z.ZodString>;
3101
+ rotation: z.ZodOptional<z.ZodNumber>;
3102
+ offset: z.ZodOptional<z.ZodNumber>;
3103
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
3104
+ along: z.ZodOptional<z.ZodNumber>;
3105
+ across: z.ZodOptional<z.ZodNumber>;
3106
+ content: z.ZodOptional<z.ZodString>;
3107
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3108
+ start: z.ZodNumber;
3109
+ end: z.ZodNumber;
3110
+ font: z.ZodOptional<z.ZodString>;
3111
+ bold: z.ZodOptional<z.ZodBoolean>;
3112
+ italic: z.ZodOptional<z.ZodBoolean>;
3113
+ underline: z.ZodOptional<z.ZodBoolean>;
3114
+ color: z.ZodOptional<z.ZodString>;
3115
+ height: z.ZodOptional<z.ZodNumber>;
3116
+ script: z.ZodOptional<z.ZodEnum<{
3117
+ sub: "sub";
3118
+ super: "super";
3119
+ }>>;
3120
+ }, z.core.$strip>>>;
3121
+ }, z.core.$strip>>>;
2985
3122
  styleId: z.ZodOptional<z.ZodString>;
2986
3123
  styleOverride: z.ZodOptional<z.ZodObject<{
2987
3124
  font: z.ZodOptional<z.ZodString>;
@@ -3024,23 +3161,6 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3024
3161
  x: z.ZodNumber;
3025
3162
  y: z.ZodNumber;
3026
3163
  }, z.core.$strip>, unknown>, z.ZodString]>>>;
3027
- }, z.core.$strip>, z.ZodObject<{
3028
- id: z.ZodString;
3029
- layerId: z.ZodString;
3030
- color: z.ZodOptional<z.ZodString>;
3031
- lineType: z.ZodOptional<z.ZodString>;
3032
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
3033
- lineWidth: z.ZodOptional<z.ZodNumber>;
3034
- opacity: z.ZodOptional<z.ZodNumber>;
3035
- type: z.ZodLiteral<"image">;
3036
- assetId: z.ZodString;
3037
- origin: z.ZodPreprocess<z.ZodObject<{
3038
- x: z.ZodNumber;
3039
- y: z.ZodNumber;
3040
- }, z.core.$strip>, unknown>;
3041
- width: z.ZodNumber;
3042
- height: z.ZodNumber;
3043
- rotation: z.ZodDefault<z.ZodNumber>;
3044
3164
  }, z.core.$strip>, z.ZodObject<{
3045
3165
  id: z.ZodString;
3046
3166
  layerId: z.ZodString;
@@ -3098,7 +3218,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3098
3218
  minHeight: z.ZodOptional<z.ZodNumber>;
3099
3219
  }, z.core.$strip>>, unknown>;
3100
3220
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3101
- text: z.ZodDefault<z.ZodString>;
3221
+ content: z.ZodDefault<z.ZodString>;
3222
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3223
+ start: z.ZodNumber;
3224
+ end: z.ZodNumber;
3225
+ font: z.ZodOptional<z.ZodString>;
3226
+ bold: z.ZodOptional<z.ZodBoolean>;
3227
+ italic: z.ZodOptional<z.ZodBoolean>;
3228
+ underline: z.ZodOptional<z.ZodBoolean>;
3229
+ color: z.ZodOptional<z.ZodString>;
3230
+ height: z.ZodOptional<z.ZodNumber>;
3231
+ script: z.ZodOptional<z.ZodEnum<{
3232
+ sub: "sub";
3233
+ super: "super";
3234
+ }>>;
3235
+ }, z.core.$strip>>>;
3102
3236
  span: z.ZodOptional<z.ZodObject<{
3103
3237
  cols: z.ZodNumber;
3104
3238
  rows: z.ZodNumber;
@@ -3180,6 +3314,9 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3180
3314
  }, z.core.$strip>, z.ZodObject<{
3181
3315
  kind: z.ZodLiteral<"url">;
3182
3316
  url: z.ZodString;
3317
+ }, z.core.$strip>, z.ZodObject<{
3318
+ kind: z.ZodLiteral<"asset">;
3319
+ assetId: z.ZodString;
3183
3320
  }, z.core.$strip>], "kind">;
3184
3321
  position: z.ZodPreprocess<z.ZodObject<{
3185
3322
  x: z.ZodNumber;
@@ -3333,6 +3470,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3333
3470
  name: z.ZodString;
3334
3471
  angle: z.ZodNumber;
3335
3472
  scale: z.ZodNumber;
3473
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
3474
+ x: z.ZodNumber;
3475
+ y: z.ZodNumber;
3476
+ }, z.core.$strip>, unknown>>;
3336
3477
  }, z.core.$strip>, z.ZodObject<{
3337
3478
  kind: z.ZodLiteral<"lines">;
3338
3479
  angle: z.ZodNumber;
@@ -3362,6 +3503,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3362
3503
  y: z.ZodNumber;
3363
3504
  }, z.core.$strip>, unknown>;
3364
3505
  content: z.ZodString;
3506
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3507
+ start: z.ZodNumber;
3508
+ end: z.ZodNumber;
3509
+ font: z.ZodOptional<z.ZodString>;
3510
+ bold: z.ZodOptional<z.ZodBoolean>;
3511
+ italic: z.ZodOptional<z.ZodBoolean>;
3512
+ underline: z.ZodOptional<z.ZodBoolean>;
3513
+ color: z.ZodOptional<z.ZodString>;
3514
+ height: z.ZodOptional<z.ZodNumber>;
3515
+ script: z.ZodOptional<z.ZodEnum<{
3516
+ sub: "sub";
3517
+ super: "super";
3518
+ }>>;
3519
+ }, z.core.$strip>>>;
3365
3520
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3366
3521
  x: z.ZodNumber;
3367
3522
  y: z.ZodNumber;
@@ -3422,11 +3577,27 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3422
3577
  x: z.ZodNumber;
3423
3578
  y: z.ZodNumber;
3424
3579
  }, z.core.$strip>, unknown>>;
3425
- offset: z.ZodPreprocess<z.ZodObject<{
3426
- x: z.ZodNumber;
3427
- y: z.ZodNumber;
3428
- }, z.core.$strip>, unknown>;
3429
- textOverride: z.ZodOptional<z.ZodString>;
3580
+ rotation: z.ZodOptional<z.ZodNumber>;
3581
+ offset: z.ZodOptional<z.ZodNumber>;
3582
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
3583
+ along: z.ZodOptional<z.ZodNumber>;
3584
+ across: z.ZodOptional<z.ZodNumber>;
3585
+ content: z.ZodOptional<z.ZodString>;
3586
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3587
+ start: z.ZodNumber;
3588
+ end: z.ZodNumber;
3589
+ font: z.ZodOptional<z.ZodString>;
3590
+ bold: z.ZodOptional<z.ZodBoolean>;
3591
+ italic: z.ZodOptional<z.ZodBoolean>;
3592
+ underline: z.ZodOptional<z.ZodBoolean>;
3593
+ color: z.ZodOptional<z.ZodString>;
3594
+ height: z.ZodOptional<z.ZodNumber>;
3595
+ script: z.ZodOptional<z.ZodEnum<{
3596
+ sub: "sub";
3597
+ super: "super";
3598
+ }>>;
3599
+ }, z.core.$strip>>>;
3600
+ }, z.core.$strip>>>;
3430
3601
  styleId: z.ZodOptional<z.ZodString>;
3431
3602
  styleOverride: z.ZodOptional<z.ZodObject<{
3432
3603
  font: z.ZodOptional<z.ZodString>;
@@ -3469,23 +3640,6 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3469
3640
  x: z.ZodNumber;
3470
3641
  y: z.ZodNumber;
3471
3642
  }, z.core.$strip>, unknown>, z.ZodString]>>>;
3472
- }, z.core.$strip>, z.ZodObject<{
3473
- id: z.ZodString;
3474
- layerId: z.ZodString;
3475
- color: z.ZodOptional<z.ZodString>;
3476
- lineType: z.ZodOptional<z.ZodString>;
3477
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
3478
- lineWidth: z.ZodOptional<z.ZodNumber>;
3479
- opacity: z.ZodOptional<z.ZodNumber>;
3480
- type: z.ZodLiteral<"image">;
3481
- assetId: z.ZodString;
3482
- origin: z.ZodPreprocess<z.ZodObject<{
3483
- x: z.ZodNumber;
3484
- y: z.ZodNumber;
3485
- }, z.core.$strip>, unknown>;
3486
- width: z.ZodNumber;
3487
- height: z.ZodNumber;
3488
- rotation: z.ZodDefault<z.ZodNumber>;
3489
3643
  }, z.core.$strip>, z.ZodObject<{
3490
3644
  id: z.ZodString;
3491
3645
  layerId: z.ZodString;
@@ -3543,7 +3697,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3543
3697
  minHeight: z.ZodOptional<z.ZodNumber>;
3544
3698
  }, z.core.$strip>>, unknown>;
3545
3699
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3546
- text: z.ZodDefault<z.ZodString>;
3700
+ content: z.ZodDefault<z.ZodString>;
3701
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
3702
+ start: z.ZodNumber;
3703
+ end: z.ZodNumber;
3704
+ font: z.ZodOptional<z.ZodString>;
3705
+ bold: z.ZodOptional<z.ZodBoolean>;
3706
+ italic: z.ZodOptional<z.ZodBoolean>;
3707
+ underline: z.ZodOptional<z.ZodBoolean>;
3708
+ color: z.ZodOptional<z.ZodString>;
3709
+ height: z.ZodOptional<z.ZodNumber>;
3710
+ script: z.ZodOptional<z.ZodEnum<{
3711
+ sub: "sub";
3712
+ super: "super";
3713
+ }>>;
3714
+ }, z.core.$strip>>>;
3547
3715
  span: z.ZodOptional<z.ZodObject<{
3548
3716
  cols: z.ZodNumber;
3549
3717
  rows: z.ZodNumber;
@@ -3625,6 +3793,9 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3625
3793
  }, z.core.$strip>, z.ZodObject<{
3626
3794
  kind: z.ZodLiteral<"url">;
3627
3795
  url: z.ZodString;
3796
+ }, z.core.$strip>, z.ZodObject<{
3797
+ kind: z.ZodLiteral<"asset">;
3798
+ assetId: z.ZodString;
3628
3799
  }, z.core.$strip>], "kind">;
3629
3800
  position: z.ZodPreprocess<z.ZodObject<{
3630
3801
  x: z.ZodNumber;
@@ -3720,6 +3891,14 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3720
3891
  }, z.core.$strip>, z.ZodObject<{
3721
3892
  type: z.ZodLiteral<"set-current-layer">;
3722
3893
  id: z.ZodString;
3894
+ }, z.core.$strip>, z.ZodObject<{
3895
+ type: z.ZodLiteral<"set-document-settings">;
3896
+ settings: z.ZodObject<{
3897
+ units: z.ZodDefault<z.ZodEnum<{
3898
+ in: "in";
3899
+ mm: "mm";
3900
+ }>>;
3901
+ }, z.core.$strip>;
3723
3902
  }, z.core.$strip>, z.ZodObject<{
3724
3903
  type: z.ZodLiteral<"add-layout">;
3725
3904
  layout: z.ZodObject<{
@@ -3852,6 +4031,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3852
4031
  name: z.ZodString;
3853
4032
  angle: z.ZodNumber;
3854
4033
  scale: z.ZodNumber;
4034
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
4035
+ x: z.ZodNumber;
4036
+ y: z.ZodNumber;
4037
+ }, z.core.$strip>, unknown>>;
3855
4038
  }, z.core.$strip>, z.ZodObject<{
3856
4039
  kind: z.ZodLiteral<"lines">;
3857
4040
  angle: z.ZodNumber;
@@ -3881,6 +4064,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3881
4064
  y: z.ZodNumber;
3882
4065
  }, z.core.$strip>, unknown>;
3883
4066
  content: z.ZodString;
4067
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4068
+ start: z.ZodNumber;
4069
+ end: z.ZodNumber;
4070
+ font: z.ZodOptional<z.ZodString>;
4071
+ bold: z.ZodOptional<z.ZodBoolean>;
4072
+ italic: z.ZodOptional<z.ZodBoolean>;
4073
+ underline: z.ZodOptional<z.ZodBoolean>;
4074
+ color: z.ZodOptional<z.ZodString>;
4075
+ height: z.ZodOptional<z.ZodNumber>;
4076
+ script: z.ZodOptional<z.ZodEnum<{
4077
+ sub: "sub";
4078
+ super: "super";
4079
+ }>>;
4080
+ }, z.core.$strip>>>;
3884
4081
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3885
4082
  x: z.ZodNumber;
3886
4083
  y: z.ZodNumber;
@@ -3941,11 +4138,27 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3941
4138
  x: z.ZodNumber;
3942
4139
  y: z.ZodNumber;
3943
4140
  }, z.core.$strip>, unknown>>;
3944
- offset: z.ZodPreprocess<z.ZodObject<{
3945
- x: z.ZodNumber;
3946
- y: z.ZodNumber;
3947
- }, z.core.$strip>, unknown>;
3948
- textOverride: z.ZodOptional<z.ZodString>;
4141
+ rotation: z.ZodOptional<z.ZodNumber>;
4142
+ offset: z.ZodOptional<z.ZodNumber>;
4143
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
4144
+ along: z.ZodOptional<z.ZodNumber>;
4145
+ across: z.ZodOptional<z.ZodNumber>;
4146
+ content: z.ZodOptional<z.ZodString>;
4147
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4148
+ start: z.ZodNumber;
4149
+ end: z.ZodNumber;
4150
+ font: z.ZodOptional<z.ZodString>;
4151
+ bold: z.ZodOptional<z.ZodBoolean>;
4152
+ italic: z.ZodOptional<z.ZodBoolean>;
4153
+ underline: z.ZodOptional<z.ZodBoolean>;
4154
+ color: z.ZodOptional<z.ZodString>;
4155
+ height: z.ZodOptional<z.ZodNumber>;
4156
+ script: z.ZodOptional<z.ZodEnum<{
4157
+ sub: "sub";
4158
+ super: "super";
4159
+ }>>;
4160
+ }, z.core.$strip>>>;
4161
+ }, z.core.$strip>>>;
3949
4162
  styleId: z.ZodOptional<z.ZodString>;
3950
4163
  styleOverride: z.ZodOptional<z.ZodObject<{
3951
4164
  font: z.ZodOptional<z.ZodString>;
@@ -3988,23 +4201,6 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3988
4201
  x: z.ZodNumber;
3989
4202
  y: z.ZodNumber;
3990
4203
  }, z.core.$strip>, unknown>, z.ZodString]>>>;
3991
- }, z.core.$strip>, z.ZodObject<{
3992
- id: z.ZodString;
3993
- layerId: z.ZodString;
3994
- color: z.ZodOptional<z.ZodString>;
3995
- lineType: z.ZodOptional<z.ZodString>;
3996
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
3997
- lineWidth: z.ZodOptional<z.ZodNumber>;
3998
- opacity: z.ZodOptional<z.ZodNumber>;
3999
- type: z.ZodLiteral<"image">;
4000
- assetId: z.ZodString;
4001
- origin: z.ZodPreprocess<z.ZodObject<{
4002
- x: z.ZodNumber;
4003
- y: z.ZodNumber;
4004
- }, z.core.$strip>, unknown>;
4005
- width: z.ZodNumber;
4006
- height: z.ZodNumber;
4007
- rotation: z.ZodDefault<z.ZodNumber>;
4008
4204
  }, z.core.$strip>, z.ZodObject<{
4009
4205
  id: z.ZodString;
4010
4206
  layerId: z.ZodString;
@@ -4062,7 +4258,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4062
4258
  minHeight: z.ZodOptional<z.ZodNumber>;
4063
4259
  }, z.core.$strip>>, unknown>;
4064
4260
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4065
- text: z.ZodDefault<z.ZodString>;
4261
+ content: z.ZodDefault<z.ZodString>;
4262
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4263
+ start: z.ZodNumber;
4264
+ end: z.ZodNumber;
4265
+ font: z.ZodOptional<z.ZodString>;
4266
+ bold: z.ZodOptional<z.ZodBoolean>;
4267
+ italic: z.ZodOptional<z.ZodBoolean>;
4268
+ underline: z.ZodOptional<z.ZodBoolean>;
4269
+ color: z.ZodOptional<z.ZodString>;
4270
+ height: z.ZodOptional<z.ZodNumber>;
4271
+ script: z.ZodOptional<z.ZodEnum<{
4272
+ sub: "sub";
4273
+ super: "super";
4274
+ }>>;
4275
+ }, z.core.$strip>>>;
4066
4276
  span: z.ZodOptional<z.ZodObject<{
4067
4277
  cols: z.ZodNumber;
4068
4278
  rows: z.ZodNumber;
@@ -4144,6 +4354,9 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4144
4354
  }, z.core.$strip>, z.ZodObject<{
4145
4355
  kind: z.ZodLiteral<"url">;
4146
4356
  url: z.ZodString;
4357
+ }, z.core.$strip>, z.ZodObject<{
4358
+ kind: z.ZodLiteral<"asset">;
4359
+ assetId: z.ZodString;
4147
4360
  }, z.core.$strip>], "kind">;
4148
4361
  position: z.ZodPreprocess<z.ZodObject<{
4149
4362
  x: z.ZodNumber;
@@ -4326,6 +4539,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4326
4539
  name: z.ZodString;
4327
4540
  angle: z.ZodNumber;
4328
4541
  scale: z.ZodNumber;
4542
+ origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
4543
+ x: z.ZodNumber;
4544
+ y: z.ZodNumber;
4545
+ }, z.core.$strip>, unknown>>;
4329
4546
  }, z.core.$strip>, z.ZodObject<{
4330
4547
  kind: z.ZodLiteral<"lines">;
4331
4548
  angle: z.ZodNumber;
@@ -4355,6 +4572,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4355
4572
  y: z.ZodNumber;
4356
4573
  }, z.core.$strip>, unknown>;
4357
4574
  content: z.ZodString;
4575
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4576
+ start: z.ZodNumber;
4577
+ end: z.ZodNumber;
4578
+ font: z.ZodOptional<z.ZodString>;
4579
+ bold: z.ZodOptional<z.ZodBoolean>;
4580
+ italic: z.ZodOptional<z.ZodBoolean>;
4581
+ underline: z.ZodOptional<z.ZodBoolean>;
4582
+ color: z.ZodOptional<z.ZodString>;
4583
+ height: z.ZodOptional<z.ZodNumber>;
4584
+ script: z.ZodOptional<z.ZodEnum<{
4585
+ sub: "sub";
4586
+ super: "super";
4587
+ }>>;
4588
+ }, z.core.$strip>>>;
4358
4589
  leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4359
4590
  x: z.ZodNumber;
4360
4591
  y: z.ZodNumber;
@@ -4415,11 +4646,27 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4415
4646
  x: z.ZodNumber;
4416
4647
  y: z.ZodNumber;
4417
4648
  }, z.core.$strip>, unknown>>;
4418
- offset: z.ZodPreprocess<z.ZodObject<{
4419
- x: z.ZodNumber;
4420
- y: z.ZodNumber;
4421
- }, z.core.$strip>, unknown>;
4422
- textOverride: z.ZodOptional<z.ZodString>;
4649
+ rotation: z.ZodOptional<z.ZodNumber>;
4650
+ offset: z.ZodOptional<z.ZodNumber>;
4651
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
4652
+ along: z.ZodOptional<z.ZodNumber>;
4653
+ across: z.ZodOptional<z.ZodNumber>;
4654
+ content: z.ZodOptional<z.ZodString>;
4655
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4656
+ start: z.ZodNumber;
4657
+ end: z.ZodNumber;
4658
+ font: z.ZodOptional<z.ZodString>;
4659
+ bold: z.ZodOptional<z.ZodBoolean>;
4660
+ italic: z.ZodOptional<z.ZodBoolean>;
4661
+ underline: z.ZodOptional<z.ZodBoolean>;
4662
+ color: z.ZodOptional<z.ZodString>;
4663
+ height: z.ZodOptional<z.ZodNumber>;
4664
+ script: z.ZodOptional<z.ZodEnum<{
4665
+ sub: "sub";
4666
+ super: "super";
4667
+ }>>;
4668
+ }, z.core.$strip>>>;
4669
+ }, z.core.$strip>>>;
4423
4670
  styleId: z.ZodOptional<z.ZodString>;
4424
4671
  styleOverride: z.ZodOptional<z.ZodObject<{
4425
4672
  font: z.ZodOptional<z.ZodString>;
@@ -4462,23 +4709,6 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4462
4709
  x: z.ZodNumber;
4463
4710
  y: z.ZodNumber;
4464
4711
  }, z.core.$strip>, unknown>, z.ZodString]>>>;
4465
- }, z.core.$strip>, z.ZodObject<{
4466
- id: z.ZodString;
4467
- layerId: z.ZodString;
4468
- color: z.ZodOptional<z.ZodString>;
4469
- lineType: z.ZodOptional<z.ZodString>;
4470
- lineTypeScale: z.ZodOptional<z.ZodNumber>;
4471
- lineWidth: z.ZodOptional<z.ZodNumber>;
4472
- opacity: z.ZodOptional<z.ZodNumber>;
4473
- type: z.ZodLiteral<"image">;
4474
- assetId: z.ZodString;
4475
- origin: z.ZodPreprocess<z.ZodObject<{
4476
- x: z.ZodNumber;
4477
- y: z.ZodNumber;
4478
- }, z.core.$strip>, unknown>;
4479
- width: z.ZodNumber;
4480
- height: z.ZodNumber;
4481
- rotation: z.ZodDefault<z.ZodNumber>;
4482
4712
  }, z.core.$strip>, z.ZodObject<{
4483
4713
  id: z.ZodString;
4484
4714
  layerId: z.ZodString;
@@ -4536,7 +4766,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4536
4766
  minHeight: z.ZodOptional<z.ZodNumber>;
4537
4767
  }, z.core.$strip>>, unknown>;
4538
4768
  cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4539
- text: z.ZodDefault<z.ZodString>;
4769
+ content: z.ZodDefault<z.ZodString>;
4770
+ spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
4771
+ start: z.ZodNumber;
4772
+ end: z.ZodNumber;
4773
+ font: z.ZodOptional<z.ZodString>;
4774
+ bold: z.ZodOptional<z.ZodBoolean>;
4775
+ italic: z.ZodOptional<z.ZodBoolean>;
4776
+ underline: z.ZodOptional<z.ZodBoolean>;
4777
+ color: z.ZodOptional<z.ZodString>;
4778
+ height: z.ZodOptional<z.ZodNumber>;
4779
+ script: z.ZodOptional<z.ZodEnum<{
4780
+ sub: "sub";
4781
+ super: "super";
4782
+ }>>;
4783
+ }, z.core.$strip>>>;
4540
4784
  span: z.ZodOptional<z.ZodObject<{
4541
4785
  cols: z.ZodNumber;
4542
4786
  rows: z.ZodNumber;
@@ -4618,6 +4862,9 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4618
4862
  }, z.core.$strip>, z.ZodObject<{
4619
4863
  kind: z.ZodLiteral<"url">;
4620
4864
  url: z.ZodString;
4865
+ }, z.core.$strip>, z.ZodObject<{
4866
+ kind: z.ZodLiteral<"asset">;
4867
+ assetId: z.ZodString;
4621
4868
  }, z.core.$strip>], "kind">;
4622
4869
  position: z.ZodPreprocess<z.ZodObject<{
4623
4870
  x: z.ZodNumber;
@@ -4712,6 +4959,60 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4712
4959
  }>>;
4713
4960
  arrowSize: z.ZodDefault<z.ZodNumber>;
4714
4961
  }, z.core.$strip>>;
4962
+ }, z.core.$strip>, z.ZodObject<{
4963
+ type: z.ZodLiteral<"add-line-type">;
4964
+ lineType: z.ZodObject<{
4965
+ name: z.ZodString;
4966
+ description: z.ZodOptional<z.ZodString>;
4967
+ dashesMm: z.ZodArray<z.ZodNumber>;
4968
+ }, z.core.$strip>;
4969
+ index: z.ZodOptional<z.ZodNumber>;
4970
+ }, z.core.$strip>, z.ZodObject<{
4971
+ type: z.ZodLiteral<"update-line-type">;
4972
+ lineType: z.ZodObject<{
4973
+ name: z.ZodString;
4974
+ description: z.ZodOptional<z.ZodString>;
4975
+ dashesMm: z.ZodArray<z.ZodNumber>;
4976
+ }, z.core.$strip>;
4977
+ }, z.core.$strip>, z.ZodObject<{
4978
+ type: z.ZodLiteral<"remove-line-type">;
4979
+ name: z.ZodString;
4980
+ }, z.core.$strip>, z.ZodObject<{
4981
+ type: z.ZodLiteral<"add-hatch-pattern">;
4982
+ hatchPattern: z.ZodObject<{
4983
+ name: z.ZodString;
4984
+ description: z.ZodOptional<z.ZodString>;
4985
+ lines: z.ZodArray<z.ZodObject<{
4986
+ angle: z.ZodNumber;
4987
+ origin: z.ZodPreprocess<z.ZodObject<{
4988
+ x: z.ZodNumber;
4989
+ y: z.ZodNumber;
4990
+ }, z.core.$strip>, unknown>;
4991
+ deltaX: z.ZodNumber;
4992
+ deltaY: z.ZodNumber;
4993
+ dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
4994
+ }, z.core.$strip>>;
4995
+ }, z.core.$strip>;
4996
+ index: z.ZodOptional<z.ZodNumber>;
4997
+ }, z.core.$strip>, z.ZodObject<{
4998
+ type: z.ZodLiteral<"update-hatch-pattern">;
4999
+ hatchPattern: z.ZodObject<{
5000
+ name: z.ZodString;
5001
+ description: z.ZodOptional<z.ZodString>;
5002
+ lines: z.ZodArray<z.ZodObject<{
5003
+ angle: z.ZodNumber;
5004
+ origin: z.ZodPreprocess<z.ZodObject<{
5005
+ x: z.ZodNumber;
5006
+ y: z.ZodNumber;
5007
+ }, z.core.$strip>, unknown>;
5008
+ deltaX: z.ZodNumber;
5009
+ deltaY: z.ZodNumber;
5010
+ dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
5011
+ }, z.core.$strip>>;
5012
+ }, z.core.$strip>;
5013
+ }, z.core.$strip>, z.ZodObject<{
5014
+ type: z.ZodLiteral<"remove-hatch-pattern">;
5015
+ name: z.ZodString;
4715
5016
  }, z.core.$strip>, z.ZodObject<{
4716
5017
  type: z.ZodLiteral<"add-dim-style">;
4717
5018
  style: z.ZodObject<{
@@ -4844,6 +5145,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4844
5145
  }, z.core.$strip>], "type">;
4845
5146
  type Operation = z.infer<typeof OperationSchema>;
4846
5147
 
5148
+ type DwgVersion = "AC1015" | "AC1018" | "AC1021" | "AC1024" | "AC1027" | "AC1032";
5149
+
4847
5150
  interface DxfImportOptions {
4848
5151
  /** mm per drawing unit; overrides the file's $INSUNITS header. */
4849
5152
  unitOverride?: number;
@@ -4854,6 +5157,21 @@ interface DxfImportReport {
4854
5157
  layouts: number;
4855
5158
  objectIds: string[];
4856
5159
  layoutIds: string[];
5160
+ /** `SOURCE→what` → entities imported as an approximation. */
5161
+ degraded: Record<string, number>;
5162
+ /** Entity type or reason → entities that produced nothing. */
5163
+ skipped: Record<string, number>;
5164
+ /** Text / dimension styles the file's STYLE / DIMSTYLE tables added
5165
+ * (styles matching an existing one by name and values are reused). */
5166
+ textStyles: number;
5167
+ dimStyles: number;
5168
+ /** Block definitions generated for the file's INSERTs (uniform-scale
5169
+ * inserts become instances of them). */
5170
+ blockDefinitions: number;
5171
+ /** Line type / hatch pattern definitions the file added (LTYPE table
5172
+ * entries the catalogue lacks; HATCH definition lines). */
5173
+ lineTypes: number;
5174
+ hatchPatterns: number;
4857
5175
  }
4858
5176
  interface PdfImportReport {
4859
5177
  objects: number;
@@ -4861,9 +5179,10 @@ interface PdfImportReport {
4861
5179
  objectIds: string[];
4862
5180
  }
4863
5181
  interface PdfImportOptions {
4864
- /** "vectors" (default): lines and text runs. "image": every page
4865
- * rasterized and placed as an image at true page scale — a host
4866
- * capability (`rasterizePdf`), refused where it is missing. */
5182
+ /** "vectors" (default): lines and text runs. "image": the PDF embedded
5183
+ * and every page placed as a raster reference at true page scale — a host
5184
+ * capability (`rasterizePdf`, for the page sizes), refused where it is
5185
+ * missing. */
4867
5186
  as?: "vectors" | "image";
4868
5187
  /** Bottom-left corner of the first page (image mode; default 0,0). Pages
4869
5188
  * line up to the right. */
@@ -4882,7 +5201,7 @@ interface AssetInfo {
4882
5201
  mimeType: string;
4883
5202
  /** Decoded size in bytes. */
4884
5203
  bytes: number;
4885
- /** Image objects (every space) that show it. */
5204
+ /** References (every space) that embed it. */
4886
5205
  users: number;
4887
5206
  }
4888
5207
  /**
@@ -4911,9 +5230,20 @@ interface DrawingHooks {
4911
5230
  /** Document-wide object lookup for block reference inputs. */
4912
5231
  resolveObject?: (id: string) => ModelObject | undefined;
4913
5232
  /** Loaded reference content (default: the drawing's referenceContent). */
4914
- resolveReference?: (ref: ReferenceObject) => ReferenceContent | null;
5233
+ resolveReference?: (ref: Reference) => ReferenceContent | null;
4915
5234
  /** Snap/hit-test geometry, e.g. from a cache (default: built per call). */
4916
5235
  snapEntry?: (obj: ModelObject) => SnapCacheEntry;
5236
+ /** Where the host keeps its marketplace list and how it reaches them
5237
+ * (default: an in-memory list holding the public collection, fetched
5238
+ * with the platform's fetch — folder marketplaces then need a reader). */
5239
+ marketplaces?: MarketplaceHost;
5240
+ }
5241
+ /** A host's marketplace configuration: the list (the editor's settings, a
5242
+ * process's config) and the client that fetches from it. */
5243
+ interface MarketplaceHost {
5244
+ list(): MarketplaceConfig[];
5245
+ set(list: MarketplaceConfig[]): void;
5246
+ client: MarketplaceClient;
4917
5247
  }
4918
5248
  declare class LocalDrawing implements Drawing$1 {
4919
5249
  private hooks;
@@ -4983,12 +5313,14 @@ declare class LocalDrawing implements Drawing$1 {
4983
5313
  reorderLayers(order: readonly string[]): void;
4984
5314
  /** The layer newly added objects default to. */
4985
5315
  setCurrentLayer(nameOrId: string): void;
5316
+ updateSettings(patch: Partial<LineaDocument["settings"]>): void;
4986
5317
  /**
4987
- * Embed image pixels (a data URL) and return the assetId that `image`
4988
- * objects reference. Content-keyed: the same data reuses one entry.
5318
+ * Embed a file (a data URL — PNG, JPEG, PDF…) and return the assetId an
5319
+ * embedded reference's `source: { kind: "asset", assetId }` names.
5320
+ * Content-keyed: the same data reuses one entry.
4989
5321
  */
4990
5322
  addAsset(dataUrl: string): string;
4991
- /** Remove an asset (the kernel refuses while an image references it). */
5323
+ /** Remove an asset (the kernel refuses while a reference embeds it). */
4992
5324
  removeAsset(id: string): void;
4993
5325
  listAssets(): AssetInfo[];
4994
5326
  /** Merge DXF text into the document (new layers, objects, layouts). */
@@ -4996,7 +5328,8 @@ declare class LocalDrawing implements Drawing$1 {
4996
5328
  /** Merge DWG bytes into the document (wasm transcode → the DXF path). */
4997
5329
  importDwgData(data: Uint8Array, opts?: DxfImportOptions): Promise<DxfImportReport>;
4998
5330
  /** Merge a PDF: its vector/text content onto the current layer, or
4999
- * (`as: "image"`) every page as an image at true page scale. */
5331
+ * (`as: "image"`) embedded, every page a raster reference at true page
5332
+ * scale. */
5000
5333
  importPdfData(data: ArrayBuffer | Uint8Array, opts?: PdfImportOptions): Promise<PdfImportReport>;
5001
5334
  /** Host capability: every PDF page rasterized. Absent → PDF-as-image
5002
5335
  * import is refused (headless Node, until it has a rasterizer). */
@@ -5005,35 +5338,48 @@ declare class LocalDrawing implements Drawing$1 {
5005
5338
  protected pdfWorkerSrc?: string;
5006
5339
  private resolveStyle;
5007
5340
  private assertStyleName;
5008
- listTextStyles(): TextStyle[];
5009
- listDimStyles(): DimStyle[];
5341
+ /** Layouts are addressed by name everywhere (`layout` on the object
5342
+ * tools, remove, reorder, render) — a duplicate would silently resolve to
5343
+ * the first match. */
5344
+ private assertLayoutName;
5345
+ /** Objects reference styles by id, but callers often pass the NAME:
5346
+ * resolve it (text/table → text styles, dimension → dim styles). An
5347
+ * unknown value is refused rather than stored dangling — a dangling
5348
+ * reference renders with the first style and nothing says why. */
5349
+ private styleRef;
5350
+ listTextStyles(): TextStyle$1[];
5351
+ listDimStyles(): DimStyle$1[];
5010
5352
  /** Create a text style (unique name; unset fields take the defaults);
5011
5353
  * returns its id. */
5012
5354
  addTextStyle(props: {
5013
5355
  name: string;
5014
- } & Partial<Omit<TextStyle, "id">>): string;
5015
- updateTextStyle(nameOrId: string, patch: Partial<Omit<TextStyle, "id">>): void;
5356
+ } & Partial<Omit<TextStyle$1, "id">>): string;
5357
+ updateTextStyle(nameOrId: string, patch: Partial<Omit<TextStyle$1, "id">>): void;
5358
+ listLineTypes(): LineType[];
5359
+ addLineTypes(lineTypes: readonly LineType[]): void;
5360
+ updateLineType(name: string, patch: Partial<LineType>): void;
5361
+ removeLineType(name: string): void;
5362
+ listHatchPatterns(): DocumentHatchPattern[];
5363
+ addHatchPatterns(patterns: readonly DocumentHatchPattern[]): void;
5364
+ updateHatchPattern(name: string, patch: Partial<DocumentHatchPattern>): void;
5365
+ removeHatchPattern(name: string): void;
5016
5366
  /** Remove a text style no object uses (the kernel refuses otherwise). */
5017
5367
  removeTextStyle(nameOrId: string): void;
5018
5368
  /** Create a dimension style (unique name; unset fields take the
5019
5369
  * defaults); returns its id. */
5020
5370
  addDimStyle(props: {
5021
5371
  name: string;
5022
- } & Partial<Omit<DimStyle, "id">>): string;
5023
- updateDimStyle(nameOrId: string, patch: Partial<Omit<DimStyle, "id">>): void;
5372
+ } & Partial<Omit<DimStyle$1, "id">>): string;
5373
+ updateDimStyle(nameOrId: string, patch: Partial<Omit<DimStyle$1, "id">>): void;
5024
5374
  /** Remove a dimension style no dimension uses (the kernel refuses
5025
5375
  * otherwise). */
5026
5376
  removeDimStyle(nameOrId: string): void;
5027
- /** @deprecated Use updateDimStyle (default here: the first style). */
5028
- setDimStyle(patch: Partial<DimStyle>, styleId?: string): void;
5029
5377
  /** Replace the document's dimension styles (min 1; objects reference by
5030
5378
  * id). Diffed into granular per-style ops. */
5031
- setDimStyles(styles: DimStyle[]): void;
5032
- /** @deprecated Use updateTextStyle (default here: the first style). */
5033
- setTextStyle(patch: Partial<TextStyle>, styleId?: string): void;
5379
+ setDimStyles(styles: DimStyle$1[]): void;
5034
5380
  /** Replace the document's text styles (min 1; objects reference by id).
5035
5381
  * Diffed into granular per-style ops. */
5036
- setTextStyles(styles: TextStyle[]): void;
5382
+ setTextStyles(styles: TextStyle$1[]): void;
5037
5383
  private assertModuleSources;
5038
5384
  /**
5039
5385
  * Replace the block library (raw module sources — each exports its own
@@ -5050,6 +5396,16 @@ declare class LocalDrawing implements Drawing$1 {
5050
5396
  listUserCommands(): CommandMeta[];
5051
5397
  addBlockDefinitions(sources: readonly string[]): Promise<MergeReport>;
5052
5398
  addUserCommands(sources: readonly string[]): Promise<MergeReport>;
5399
+ /** The host's marketplace list + client; a bare drawing gets an in-memory
5400
+ * list holding the public collection. */
5401
+ protected get marketplaceHost(): MarketplaceHost;
5402
+ /** Replace the host's marketplace configuration (SDK / server config). */
5403
+ setMarketplaceHost(host: MarketplaceHost): void;
5404
+ listMarketplaces(): MarketplaceInfo[];
5405
+ addMarketplaces(list: readonly MarketplaceConfig[]): Promise<MarketplaceInfo[]>;
5406
+ removeMarketplaces(names: readonly string[]): MarketplaceInfo[];
5407
+ searchMarketplaces(q?: MarketplaceQuery): Promise<MarketplaceHit[]>;
5408
+ installMarketplaceEntries(ids: readonly string[], marketplace?: string): Promise<MergeReport>;
5053
5409
  /** Remove a block module by its exported id (unknown id → error). */
5054
5410
  removeBlockDefinition(id: string): void;
5055
5411
  /** Remove a command module by its exported id (unknown id → error). */
@@ -5082,7 +5438,7 @@ declare class LocalDrawing implements Drawing$1 {
5082
5438
  * Add objects (points may be `[x, y]`; `layer` resolves by name) to model
5083
5439
  * space, or to a paper layout's sheet via `{ layout }`. Returns ids.
5084
5440
  */
5085
- add(objects: readonly ObjectInput[], opts?: AddOptions): string[];
5441
+ add(objects: readonly ModelObjectInput[], opts?: AddOptions): string[];
5086
5442
  private patched;
5087
5443
  /** Apply one patch to several ids. */
5088
5444
  update(ids: readonly string[], patch: Record<string, unknown>): void;
@@ -5135,9 +5491,16 @@ declare class LocalDrawing implements Drawing$1 {
5135
5491
  private distanceTo;
5136
5492
  /** Query model-space objects — or one paper layout's sheet objects
5137
5493
  * (viewports, annotations) via `filter.layout`. */
5138
- listObjects(filter?: QueryFilter): ModelObject[];
5494
+ listObjects(filter?: ObjectQuery): ModelObject[];
5139
5495
  summary(): DocumentSummary;
5140
5496
  protected paintContext(): {
5497
+ layers: readonly Layer[];
5498
+ dimStyles: readonly DimStyle$1[];
5499
+ textStyles: readonly TextStyle$1[];
5500
+ lineTypes: readonly LineType[];
5501
+ hatchPatterns: readonly DocumentHatchPattern[];
5502
+ blockDefinitions: readonly string[];
5503
+ assets?: Readonly<Record<string, string>>;
5141
5504
  objects: ({
5142
5505
  id: string;
5143
5506
  layerId: string;
@@ -5146,12 +5509,8 @@ declare class LocalDrawing implements Drawing$1 {
5146
5509
  lineTypeScale?: number | undefined;
5147
5510
  lineWidth?: number | undefined;
5148
5511
  opacity?: number | undefined;
5149
- type: "line";
5150
- a: {
5151
- x: number;
5152
- y: number;
5153
- };
5154
- b: {
5512
+ type: "point";
5513
+ p: {
5155
5514
  x: number;
5156
5515
  y: number;
5157
5516
  };
@@ -5163,8 +5522,12 @@ declare class LocalDrawing implements Drawing$1 {
5163
5522
  lineTypeScale?: number | undefined;
5164
5523
  lineWidth?: number | undefined;
5165
5524
  opacity?: number | undefined;
5166
- type: "point";
5167
- p: {
5525
+ type: "line";
5526
+ a: {
5527
+ x: number;
5528
+ y: number;
5529
+ };
5530
+ b: {
5168
5531
  x: number;
5169
5532
  y: number;
5170
5533
  };
@@ -5256,6 +5619,10 @@ declare class LocalDrawing implements Drawing$1 {
5256
5619
  name: string;
5257
5620
  angle: number;
5258
5621
  scale: number;
5622
+ origin?: {
5623
+ x: number;
5624
+ y: number;
5625
+ } | undefined;
5259
5626
  } | {
5260
5627
  kind: "lines";
5261
5628
  angle: number;
@@ -5282,6 +5649,17 @@ declare class LocalDrawing implements Drawing$1 {
5282
5649
  y: number;
5283
5650
  };
5284
5651
  content: string;
5652
+ spans?: {
5653
+ start: number;
5654
+ end: number;
5655
+ font?: string | undefined;
5656
+ bold?: boolean | undefined;
5657
+ italic?: boolean | undefined;
5658
+ underline?: boolean | undefined;
5659
+ color?: string | undefined;
5660
+ height?: number | undefined;
5661
+ script?: "sub" | "super" | undefined;
5662
+ }[] | undefined;
5285
5663
  leaderLines: {
5286
5664
  x: number;
5287
5665
  y: number;
@@ -5316,11 +5694,24 @@ declare class LocalDrawing implements Drawing$1 {
5316
5694
  x: number;
5317
5695
  y: number;
5318
5696
  }[];
5319
- offset: {
5320
- x: number;
5321
- y: number;
5322
- };
5323
- textOverride?: string | undefined;
5697
+ rotation?: number | undefined;
5698
+ offset?: number | undefined;
5699
+ labels: {
5700
+ along?: number | undefined;
5701
+ across?: number | undefined;
5702
+ content?: string | undefined;
5703
+ spans?: {
5704
+ start: number;
5705
+ end: number;
5706
+ font?: string | undefined;
5707
+ bold?: boolean | undefined;
5708
+ italic?: boolean | undefined;
5709
+ underline?: boolean | undefined;
5710
+ color?: string | undefined;
5711
+ height?: number | undefined;
5712
+ script?: "sub" | "super" | undefined;
5713
+ }[] | undefined;
5714
+ }[];
5324
5715
  styleId?: string | undefined;
5325
5716
  styleOverride?: {
5326
5717
  font?: string | undefined;
@@ -5354,23 +5745,6 @@ declare class LocalDrawing implements Drawing$1 {
5354
5745
  x: number;
5355
5746
  y: number;
5356
5747
  })[];
5357
- } | {
5358
- id: string;
5359
- layerId: string;
5360
- color?: string | undefined;
5361
- lineType?: string | undefined;
5362
- lineTypeScale?: number | undefined;
5363
- lineWidth?: number | undefined;
5364
- opacity?: number | undefined;
5365
- type: "image";
5366
- assetId: string;
5367
- origin: {
5368
- x: number;
5369
- y: number;
5370
- };
5371
- width: number;
5372
- height: number;
5373
- rotation: number;
5374
5748
  } | {
5375
5749
  id: string;
5376
5750
  layerId: string;
@@ -5428,7 +5802,18 @@ declare class LocalDrawing implements Drawing$1 {
5428
5802
  minHeight?: number | undefined;
5429
5803
  }[];
5430
5804
  cells: {
5431
- text: string;
5805
+ content: string;
5806
+ spans?: {
5807
+ start: number;
5808
+ end: number;
5809
+ font?: string | undefined;
5810
+ bold?: boolean | undefined;
5811
+ italic?: boolean | undefined;
5812
+ underline?: boolean | undefined;
5813
+ color?: string | undefined;
5814
+ height?: number | undefined;
5815
+ script?: "sub" | "super" | undefined;
5816
+ }[] | undefined;
5432
5817
  span?: {
5433
5818
  cols: number;
5434
5819
  rows: number;
@@ -5478,6 +5863,9 @@ declare class LocalDrawing implements Drawing$1 {
5478
5863
  } | {
5479
5864
  kind: "url";
5480
5865
  url: string;
5866
+ } | {
5867
+ kind: "asset";
5868
+ assetId: string;
5481
5869
  };
5482
5870
  position: {
5483
5871
  x: number;
@@ -5504,47 +5892,8 @@ declare class LocalDrawing implements Drawing$1 {
5504
5892
  maxY: number;
5505
5893
  } | undefined;
5506
5894
  })[];
5507
- layers: {
5508
- id: string;
5509
- name: string;
5510
- color: string;
5511
- lineType: string;
5512
- lineWidth: number;
5513
- opacity: number;
5514
- visible: boolean;
5515
- locked: boolean;
5516
- print: boolean;
5517
- }[];
5518
- dimStyles: {
5519
- id: string;
5520
- name: string;
5521
- font: string;
5522
- widthFactor: number;
5523
- bold?: boolean | undefined;
5524
- italic?: boolean | undefined;
5525
- textHeight: number;
5526
- textOffset: number;
5527
- arrowType: "dot" | "filled" | "none" | "open" | "tick";
5528
- arrowSize: number;
5529
- extensionType: "long" | "short";
5530
- extensionOffset: number;
5531
- extensionOvershoot: number;
5532
- precision: number;
5533
- }[];
5534
- textStyles: {
5535
- id: string;
5536
- name: string;
5537
- font: string;
5538
- widthFactor: number;
5539
- bold?: boolean | undefined;
5540
- italic?: boolean | undefined;
5541
- textHeight: number;
5542
- arrowType: "dot" | "filled" | "none" | "open" | "tick";
5543
- arrowSize: number;
5544
- }[];
5545
- blockDefinitions: string[];
5546
5895
  resolveObject: (id: string) => ModelObject | undefined;
5547
- resolveReference: (ref: ReferenceObject) => ReferenceContent | null;
5896
+ resolveReference: (ref: Reference) => ReferenceContent | null;
5548
5897
  };
5549
5898
  protected resolveLayout(nameOrId: string): PaperLayout;
5550
5899
  /** Render model space (or a paper layout via `layout`) to an SVG string. */
@@ -5553,23 +5902,374 @@ declare class LocalDrawing implements Drawing$1 {
5553
5902
  toDxf(): Promise<string>;
5554
5903
  /** Export the document to DWG bytes (the DXF content, wasm-transcoded).
5555
5904
  * Defaults to AC1027 (AutoCAD 2013) — readable by every current CAD tool.
5556
- * Dimensions transcode as real DIMENSION objects; leaders are exploded to
5557
- * plain geometry (acadrust's MULTILEADER DWG output is unproven in real
5558
- * CADs — exploded geometry always displays). */
5905
+ * Dimensions transcode as real DIMENSION objects; leaders and tables are
5906
+ * exploded to plain geometry (DWG_DXF_OPTIONS — the transcoder's DWG
5907
+ * output for them is not accepted by AutoCAD). */
5559
5908
  toDwg(opts?: {
5560
5909
  version?: DwgVersion;
5561
5910
  }): Promise<Uint8Array>;
5562
5911
  toLinea(): string;
5563
5912
  }
5564
5913
 
5914
+ /** A 2D point (mm, y-up). Point-valued fields also accept [x, y]. */
5915
+ type Vec2 = {
5916
+ x: number;
5917
+ y: number;
5918
+ };
5919
+ type Vec2Like = Vec2 | readonly [number, number];
5920
+ /** An axis-aligned box (mm). */
5921
+ type Box = {
5922
+ minX: number;
5923
+ minY: number;
5924
+ maxX: number;
5925
+ maxY: number;
5926
+ };
5927
+ /** Arrowhead styles (leaders, dimensions). */
5928
+ type ArrowType = "filled" | "open" | "tick" | "dot" | "none";
5929
+ /** Polyline vertex; bulge = tan(sweep/4), 0 = straight. Accepts [x, y, bulge?]. */
5930
+ type PolylineVertexInput = {
5931
+ x: number;
5932
+ y: number;
5933
+ bulge?: number;
5934
+ } | readonly [number, number, number?];
5935
+ /** The fields every object input may carry: its layer and the style
5936
+ * overrides (otherwise by layer — or, for a block child, by the instance). */
5937
+ type ObjectInputBase = {
5938
+ /** The layer, by NAME or id. Absent: `document.add` uses the current
5939
+ * layer, a block child the instance's (the portable default; an unknown
5940
+ * name falls back to it too). A child on another layer hides with that
5941
+ * layer, while its color / line type / width still follow the instance
5942
+ * unless it sets its own (ByBlock, as in CAD). */
5943
+ layer?: string;
5944
+ /** The layer by id only — prefer `layer`. */
5945
+ layerId?: string;
5946
+ /** #rrggbb; absent = by layer. */
5947
+ color?: string;
5948
+ /** Line type; absent = by layer. */
5949
+ lineType?: string;
5950
+ /** Dash-pattern length multiplier; absent = 1. */
5951
+ lineTypeScale?: number;
5952
+ /** Line weight in mm; absent = by layer. */
5953
+ lineWidth?: number;
5954
+ /** Paint opacity 0..1; absent = by layer (opaque unless the layer says). */
5955
+ opacity?: number;
5956
+ };
5957
+ /**
5958
+ * T plus the shared input fields, FLATTENED (the homomorphic map forces the
5959
+ * intersection to resolve): hovers then list every member inline instead of
5960
+ * the opaque `ObjectInputBase & { … }` — the block editor has no
5961
+ * expand-type affordance, so the alias display is all a script author gets.
5962
+ */
5963
+ type ObjectInputShape<T> = {
5964
+ [K in keyof (T & ObjectInputBase)]: (T & ObjectInputBase)[K];
5965
+ } & {};
5966
+ type LineInput = ObjectInputShape<{
5967
+ type: "line";
5968
+ a: Vec2Like;
5969
+ b: Vec2Like;
5970
+ }>;
5971
+ /** A point: paints as a round dot whose diameter is the lineWidth. */
5972
+ type PointInput$1 = ObjectInputShape<{
5973
+ type: "point";
5974
+ p: Vec2Like;
5975
+ }>;
5976
+ type PolylineInput = ObjectInputShape<{
5977
+ type: "polyline";
5978
+ /** At least 2 vertices. */
5979
+ points: readonly PolylineVertexInput[];
5980
+ closed?: boolean;
5981
+ }>;
5982
+ type CircleInput = ObjectInputShape<{
5983
+ type: "circle";
5984
+ center: Vec2Like;
5985
+ radius: number;
5986
+ }>;
5987
+ /** Runs CCW from startAngle to endAngle (radians; DXF ARC convention). */
5988
+ type ArcInput = ObjectInputShape<{
5989
+ type: "arc";
5990
+ center: Vec2Like;
5991
+ radius: number;
5992
+ startAngle: number;
5993
+ endAngle: number;
5994
+ }>;
5995
+ /** majorAxis = endpoint vector from center; ratio = minor/major in (0, 1]. */
5996
+ type EllipseInput = ObjectInputShape<{
5997
+ type: "ellipse";
5998
+ center: Vec2Like;
5999
+ majorAxis: Vec2Like;
6000
+ ratio: number;
6001
+ startAngle?: number;
6002
+ endAngle?: number;
6003
+ }>;
6004
+ type HatchInput = ObjectInputShape<{
6005
+ type: "hatch";
6006
+ /** loops[0] = outer boundary, the rest are holes (even-odd). */
6007
+ loops: readonly {
6008
+ points: readonly PolylineVertexInput[];
6009
+ }[];
6010
+ fill?: {
6011
+ kind: "solid";
6012
+ }
6013
+ /** A named pattern: the built-in catalogue (ANSI31, AR-CONC, …) or one of
6014
+ * the document's own hatch patterns, by name. `angle` radians, `scale`
6015
+ * multiplies the definition's mm; `origin` anchors the pattern frame
6016
+ * (block-local mm; absent = the block origin). */
6017
+ | {
6018
+ kind: "pattern";
6019
+ name: string;
6020
+ angle: number;
6021
+ scale: number;
6022
+ origin?: Vec2Like;
6023
+ } | {
6024
+ kind: "lines";
6025
+ angle: number;
6026
+ spacing: number;
6027
+ } | {
6028
+ kind: "gradient";
6029
+ shape?: "linear" | "radial";
6030
+ color1?: string;
6031
+ color2?: string;
6032
+ angle?: number;
6033
+ };
6034
+ /** Pattern spacing multiplier. */
6035
+ scale?: number;
6036
+ }>;
6037
+ /** Character formatting over [start, end) of a text's `content` (JS string
6038
+ * indices). Absent attributes inherit the text's style; `height` is a ratio
6039
+ * of its cap height. Setting `content` without `spans` drops old spans. */
6040
+ type TextSpan = {
6041
+ start: number;
6042
+ end: number;
6043
+ font?: string;
6044
+ bold?: boolean;
6045
+ italic?: boolean;
6046
+ underline?: boolean;
6047
+ /** "#rrggbb". */
6048
+ color?: string;
6049
+ height?: number;
6050
+ script?: "sub" | "super";
6051
+ };
6052
+ type TextInput = ObjectInputShape<{
6053
+ type: "text";
6054
+ position: Vec2Like;
6055
+ content: string;
6056
+ spans?: readonly TextSpan[];
6057
+ rotation?: number;
6058
+ /** Justification, as in AutoCAD / DXF: which edge sits on the point —
6059
+ * "left" = the text runs right of it, "right" = left of it; vAlign
6060
+ * "bottom" = the text sits above the point, "top" = below it. */
6061
+ hAlign?: "left" | "center" | "right";
6062
+ vAlign?: "bottom" | "center" | "top";
6063
+ /** Word-wrap / frame width in mm (before `scale`); absent = no wrapping. */
6064
+ width?: number;
6065
+ frame?: "none" | "rectangle" | "circle" | "slot" | "bottom" | "firstLine";
6066
+ /** MLEADER-style arrow polylines pointing at the text (arrowhead at [0]). */
6067
+ leaderLines?: readonly (readonly Vec2Like[])[];
6068
+ /** The document text style to follow (name or id); absent = the first. */
6069
+ styleId?: string;
6070
+ /** Style overrides; absent keys inherit the document text style. */
6071
+ styleOverride?: TextStyleOverride;
6072
+ /** Size multiplier for height + arrow size. */
6073
+ scale?: number;
6074
+ }>;
6075
+ type DimensionInput = ObjectInputShape<{
6076
+ type: "dimension";
6077
+ kind?: "linear" | "angular" | "radial" | "diameter";
6078
+ /** linear: 2+ chained points (measured point to point); angular: [vertex, a, b]; radial: [center, p]; diameter: [p1, p2]. */
6079
+ points: readonly Vec2Like[];
6080
+ /** linear only: the measuring direction, radians CCW from +X. Unset =
6081
+ * aligned to the points. */
6082
+ rotation?: number;
6083
+ /** linear: signed distance of the dimension line from points[0], positive
6084
+ * to the LEFT of the measuring direction; angular: signed arc radius
6085
+ * (negative = the complementary arc). Not for radial/diameter. */
6086
+ offset?: number;
6087
+ /** One per measured segment (linear chain: points.length − 1, others: 1).
6088
+ * `along` (mm along the line from the segment origin — radial/diameter:
6089
+ * from the center) and `across` (mm off the line) place the text, unset =
6090
+ * automatic; `content` is the text, `{value}` = the measurement. */
6091
+ labels?: readonly {
6092
+ along?: number;
6093
+ across?: number;
6094
+ content?: string;
6095
+ /** Formatting over `content` (spans covering `{value}` format it). */
6096
+ spans?: readonly TextSpan[];
6097
+ }[];
6098
+ /** The document dimension style to follow (name or id); absent = the first. */
6099
+ styleId?: string;
6100
+ /** Style overrides; absent keys inherit the document dimension style. */
6101
+ styleOverride?: DimStyleOverride;
6102
+ /** Annotation size multiplier (text/arrows/offsets). */
6103
+ scale?: number;
6104
+ }>;
6105
+ /** Nested block instance (inputs may hold points, never object references). */
6106
+ type BlockInput = ObjectInputShape<{
6107
+ type: "block";
6108
+ definitionId: string;
6109
+ /** Applied last, about the pivot (the first input point). */
6110
+ rotation?: number;
6111
+ scale?: number;
6112
+ params?: Record<string, number | string | boolean | readonly number[] | readonly string[]>;
6113
+ /** Input points in the PARENT's local coords; the first is the pivot. */
6114
+ inputs?: readonly Vec2Like[];
6115
+ }>;
6116
+ /** A table cell: plain text, or text with merge / alignment / style. */
6117
+ type TableCellInput = string | {
6118
+ content?: string;
6119
+ /** Character formatting over `content`. */
6120
+ spans?: readonly TextSpan[];
6121
+ /** Merge from this (top-left) cell; covered cells are ignored. */
6122
+ span?: {
6123
+ cols: number;
6124
+ rows: number;
6125
+ };
6126
+ hAlign?: "left" | "center" | "right";
6127
+ vAlign?: "top" | "center" | "bottom";
6128
+ styleId?: string;
6129
+ styleOverride?: TextStyleOverride;
6130
+ color?: string;
6131
+ };
6132
+ /** Grid of text cells hanging right/down from `position` (top-left);
6133
+ * rows grow to fit their wrapped text. */
6134
+ type TableInput = ObjectInputShape<{
6135
+ type: "table";
6136
+ position: Vec2Like;
6137
+ /** Column widths (mm, before `scale`). */
6138
+ columns: readonly number[];
6139
+ /** Row count, or per-row settings (`minHeight` mm floor). */
6140
+ rows: number | readonly {
6141
+ minHeight?: number;
6142
+ }[];
6143
+ /** Row-major `cells[row][column]`, exactly rows × columns. */
6144
+ cells: readonly (readonly TableCellInput[])[];
6145
+ rotation?: number;
6146
+ scale?: number;
6147
+ /** Rows above the heavier header rule. */
6148
+ headerRows?: number;
6149
+ /** Text inset from the cell edges (mm). */
6150
+ cellMargin?: number;
6151
+ borders?: "all" | "outer" | "rows" | "none";
6152
+ styleId?: string;
6153
+ styleOverride?: TextStyleOverride;
6154
+ }>;
6155
+ /** Where a reference's file lives: a path (relative to the drawing's
6156
+ * folder), a url, or EMBEDDED — an asset of the document holding it (add the
6157
+ * file's bytes first with `document.addAsset`). */
6158
+ type ReferenceSource = {
6159
+ kind: "path";
6160
+ path: string;
6161
+ cacheKey?: string;
6162
+ } | {
6163
+ kind: "url";
6164
+ url: string;
6165
+ } | {
6166
+ kind: "asset";
6167
+ assetId: string;
6168
+ };
6169
+ /** A file drawn in place — a .linea, DXF, DWG, PDF page or picture (PNG /
6170
+ * JPEG). The file's origin lands at `position`; a picture draws at its
6171
+ * natural size (96 dpi) times `scale`. */
6172
+ type ReferenceInput = ObjectInputShape<{
6173
+ type: "reference";
6174
+ format: "linea" | "dxf" | "dwg" | "pdf" | "png" | "jpg";
6175
+ name: string;
6176
+ source: ReferenceSource;
6177
+ position: Vec2Like;
6178
+ /** Radians CCW about `position`. */
6179
+ rotation?: number;
6180
+ scale?: number;
6181
+ /** Flipped left-right (x → −x) before the rotation. */
6182
+ mirrored?: boolean;
6183
+ /** PDF: the 1-based page, drawn as vectors or rasterized. */
6184
+ pdfPage?: number;
6185
+ pdfMode?: "vector" | "raster";
6186
+ /** The file's layers not drawn, by name. */
6187
+ hiddenLayers?: readonly string[];
6188
+ hidden?: boolean;
6189
+ locked?: boolean;
6190
+ /** Crop rectangle in file coordinates. */
6191
+ clip?: Box;
6192
+ /** Content bounds in file coordinates (the frame drawn before it loads). */
6193
+ extent?: Box;
6194
+ }>;
6195
+ /** Paper-space window into model space; only in a layout (`document.add`
6196
+ * with `layout`). */
6197
+ type ViewportInput = ObjectInputShape<{
6198
+ type: "viewport";
6199
+ /** The frame on the sheet (mm): bottom-left corner + size. */
6200
+ rect: {
6201
+ x: number;
6202
+ y: number;
6203
+ w: number;
6204
+ h: number;
6205
+ };
6206
+ /** The model point shown at the frame's centre. */
6207
+ modelCenter?: Vec2Like;
6208
+ /** Drawing-scale denominator (model mm per paper mm); 1:50 => 50. */
6209
+ scale?: number;
6210
+ /** Pinned: no pan/zoom-through, no move/resize grips. */
6211
+ locked?: boolean;
6212
+ /** Layer ids hidden in this viewport only. */
6213
+ hiddenLayerIds?: readonly string[];
6214
+ }>;
6215
+ /** Review note pinned to a point; the editor shows a screen-fixed marker. */
6216
+ type CommentInput = ObjectInputShape<{
6217
+ type: "comment";
6218
+ /** Tail tip of the bubble (world/sheet mm). */
6219
+ position: Vec2Like;
6220
+ text?: string;
6221
+ tags?: readonly string[];
6222
+ }>;
6223
+ /** What a script WRITES — the union of the authoring DTOs above (what
6224
+ * `document.add` takes). Reads return `ModelObject`. */
6225
+ type ModelObjectInput$1 = LineInput | PointInput$1 | PolylineInput | CircleInput | ArcInput | EllipseInput | HatchInput | TextInput | DimensionInput | BlockInput | TableInput | ViewportInput | CommentInput | ReferenceInput;
6226
+ /** Text style keys a text, table or table cell may override. */
6227
+ type TextStyleOverride = Partial<Omit<TextStyle, "id" | "name">>;
6228
+ /** Dimension style keys a dimension may override. */
6229
+ type DimStyleOverride = Partial<Omit<DimStyle, "id" | "name">>;
6230
+ /** A document text style (`styles.text(id)` in `draw`,
6231
+ * `document.listTextStyles()`). Heights and arrow sizes are mm before an
6232
+ * object's `scale`. */
6233
+ type TextStyle = {
6234
+ readonly id: string;
6235
+ readonly name: string;
6236
+ readonly font: string;
6237
+ readonly widthFactor: number;
6238
+ readonly bold?: boolean;
6239
+ readonly italic?: boolean;
6240
+ readonly textHeight: number;
6241
+ readonly arrowType: ArrowType;
6242
+ readonly arrowSize: number;
6243
+ };
6244
+ /** A document dimension style (`styles.dim(id)`,
6245
+ * `document.listDimStyles()`). */
6246
+ type DimStyle = {
6247
+ readonly id: string;
6248
+ readonly name: string;
6249
+ readonly font: string;
6250
+ readonly widthFactor: number;
6251
+ readonly bold?: boolean;
6252
+ readonly italic?: boolean;
6253
+ readonly textHeight: number;
6254
+ readonly textOffset: number;
6255
+ readonly arrowType: ArrowType;
6256
+ readonly arrowSize: number;
6257
+ /** "short" = a 2×overshoot tick across the dimension line. */
6258
+ readonly extensionType: "long" | "short";
6259
+ readonly extensionOffset: number;
6260
+ readonly extensionOvershoot: number;
6261
+ readonly precision: number;
6262
+ };
6263
+
5565
6264
  /** A world point in mm, as `[x, y]` or `{x, y}`. */
5566
- type PointInput = Vec2 | readonly [number, number];
5567
- /** Loose object input: model fields + `layer` (name) / `layerId` / `id`. */
5568
- type ObjectInput = {
5569
- type: ModelObjectType;
5570
- } & Record<string, unknown>;
6265
+ type PointInput = Vec2$1 | readonly [number, number];
6266
+ /** Object input: the typed authoring DTOs (per-type fields, so editors
6267
+ * autocomplete them; `layer` by name or id) + an optional own `id`. */
6268
+ type ModelObjectInput = ModelObjectInput$1 & {
6269
+ id?: string;
6270
+ };
5571
6271
  /** Semantic, filtered read over one space's objects (all filters AND). */
5572
- interface QueryFilter {
6272
+ interface ObjectQuery {
5573
6273
  ids?: readonly string[];
5574
6274
  type?: ModelObjectType;
5575
6275
  /** Layer name or id. */
@@ -5614,6 +6314,8 @@ interface DocumentSummary {
5614
6314
  name: string;
5615
6315
  objectCount: number;
5616
6316
  }[];
6317
+ /** Document-wide settings (`units`). */
6318
+ settings: LineaDocument["settings"];
5617
6319
  }
5618
6320
  interface RenderSvgOptions {
5619
6321
  /** Render this paper layout (name or id) instead of model space. */
@@ -5697,7 +6399,7 @@ interface Drawing$1 {
5697
6399
  readonly document: LineaDocument;
5698
6400
  summary(): DocumentSummary;
5699
6401
  /** Filtered objects — model space, or one layout via `filter.layout`. */
5700
- listObjects(filter?: QueryFilter): ModelObject[];
6402
+ listObjects(filter?: ObjectQuery): ModelObject[];
5701
6403
  /** Look up an object in ANY space. */
5702
6404
  getObject(id: string): ModelObject | undefined;
5703
6405
  /** bbox / curve length / enclosed area of one object (any space). */
@@ -5725,7 +6427,7 @@ interface Drawing$1 {
5725
6427
  toLinea(): string;
5726
6428
  /** Add objects (points may be `[x, y]`; `layer` resolves by name);
5727
6429
  * returns the created ids. */
5728
- add(objects: readonly ObjectInput[], opts?: AddOptions): string[];
6430
+ add(objects: readonly ModelObjectInput[], opts?: AddOptions): string[];
5729
6431
  /** Apply per-object patches (`{id, ...fields}`) in one undo step. */
5730
6432
  update(entries: readonly ({
5731
6433
  id: string;
@@ -5760,37 +6462,55 @@ interface Drawing$1 {
5760
6462
  reorderLayers(order: readonly string[]): void;
5761
6463
  /** The layer newly added objects default to (a mode, not an edit). */
5762
6464
  setCurrentLayer(nameOrId: string): void;
5763
- listTextStyles(): TextStyle[];
5764
- listDimStyles(): DimStyle[];
6465
+ /** Document-wide settings, merged over the current record (`units` is
6466
+ * declarative for now: everything is stored in mm). */
6467
+ updateSettings(patch: Partial<LineaDocument["settings"]>): void;
6468
+ listTextStyles(): TextStyle$1[];
6469
+ listDimStyles(): DimStyle$1[];
5765
6470
  /** Create a style (name unique, case-insensitive; unset fields take the
5766
6471
  * defaults); returns its id. Styles are addressed by name or id. */
5767
6472
  addTextStyle(props: {
5768
6473
  name: string;
5769
- } & Partial<Omit<TextStyle, "id">>): string;
5770
- updateTextStyle(nameOrId: string, patch: Partial<Omit<TextStyle, "id">>): void;
6474
+ } & Partial<Omit<TextStyle$1, "id">>): string;
6475
+ updateTextStyle(nameOrId: string, patch: Partial<Omit<TextStyle$1, "id">>): void;
5771
6476
  /** Remove a style no object resolves to (else refused, with a count). */
5772
6477
  removeTextStyle(nameOrId: string): void;
5773
6478
  addDimStyle(props: {
5774
6479
  name: string;
5775
- } & Partial<Omit<DimStyle, "id">>): string;
5776
- updateDimStyle(nameOrId: string, patch: Partial<Omit<DimStyle, "id">>): void;
6480
+ } & Partial<Omit<DimStyle$1, "id">>): string;
6481
+ updateDimStyle(nameOrId: string, patch: Partial<Omit<DimStyle$1, "id">>): void;
5777
6482
  removeDimStyle(nameOrId: string): void;
5778
- /** @deprecated Use updateDimStyle (default here: the first style). */
5779
- setDimStyle(patch: Partial<DimStyle>, styleId?: string): void;
5780
- /** @deprecated Use updateTextStyle (default here: the first style). */
5781
- setTextStyle(patch: Partial<TextStyle>, styleId?: string): void;
5782
- /** Embed image pixels (a data URL); returns the content-keyed assetId. */
6483
+ /** The document's own line type definitions (name-keyed; objects and
6484
+ * layers reference line types by NAME, these ahead of the built-in
6485
+ * catalogue). */
6486
+ listLineTypes(): LineType[];
6487
+ /** Add definitions (names unique, case-insensitive; a clash is refused).
6488
+ * `dashesMm`: signed dash cycle per 1 mm of line width — >0 dash, <0 gap,
6489
+ * 0 dot. */
6490
+ addLineTypes(lineTypes: readonly LineType[]): void;
6491
+ updateLineType(name: string, patch: Partial<LineType>): void;
6492
+ /** Remove a definition; objects still naming it fall back to the
6493
+ * catalogue or continuous. */
6494
+ removeLineType(name: string): void;
6495
+ /** The document's own hatch pattern definitions (same model: fills
6496
+ * reference patterns by NAME, these ahead of the catalogue). */
6497
+ listHatchPatterns(): DocumentHatchPattern[];
6498
+ addHatchPatterns(patterns: readonly DocumentHatchPattern[]): void;
6499
+ updateHatchPattern(name: string, patch: Partial<DocumentHatchPattern>): void;
6500
+ removeHatchPattern(name: string): void;
6501
+ /** Embed a file (a data URL); returns the content-keyed assetId an
6502
+ * embedded reference's `source: { kind: "asset", assetId }` names. */
5783
6503
  addAsset(dataUrl: string): string;
5784
- /** Remove an asset (refused while an image references it). */
6504
+ /** Remove an asset (refused while a reference embeds it). */
5785
6505
  removeAsset(id: string): void;
5786
- /** Embedded image assets: id, mime type, bytes, how many images use it. */
6506
+ /** Embedded files: id, mime type, bytes, how many references embed it. */
5787
6507
  listAssets(): AssetInfo[];
5788
6508
  /** DXF text → new layers, objects, layouts. */
5789
6509
  importDxfText(text: string, opts?: DxfImportOptions): DxfImportReport;
5790
6510
  /** DWG bytes (wasm transcode → the DXF path). */
5791
6511
  importDwgData(data: Uint8Array, opts?: DxfImportOptions): Promise<DxfImportReport>;
5792
6512
  /** PDF vectors/text onto the current layer, or (`as: "image"`, a host
5793
- * capability) every page as an image at true scale. */
6513
+ * capability) embedded, every page a raster reference at true scale. */
5794
6514
  importPdfData(data: ArrayBuffer | Uint8Array, opts?: PdfImportOptions): Promise<PdfImportReport>;
5795
6515
  /** Merge block module sources into the document library (verbatim →
5796
6516
  * skip, same id → replace in place, name clash → suffix). Async: awaits
@@ -5799,6 +6519,21 @@ interface Drawing$1 {
5799
6519
  removeBlockDefinition(id: string): void;
5800
6520
  addUserCommands(sources: readonly string[]): Promise<MergeReport>;
5801
6521
  removeUserCommand(id: string): void;
6522
+ /** The host's configured marketplaces, priority order, tokens hidden. */
6523
+ listMarketplaces(): MarketplaceInfo[];
6524
+ /** Add marketplaces at the top of the priority list (a repeated key
6525
+ * replaces in place, e.g. to update a token). Each catalog must be
6526
+ * fetchable, else the call throws with the reason. */
6527
+ addMarketplaces(list: readonly MarketplaceConfig[]): Promise<MarketplaceInfo[]>;
6528
+ /** Remove by key, spec, folder or label; the built-in collection stays. */
6529
+ removeMarketplaces(names: readonly string[]): MarketplaceInfo[];
6530
+ /** Entries across the configured marketplaces (first publisher of an id
6531
+ * wins), with each one's install status against this document. */
6532
+ searchMarketplaces(q?: MarketplaceQuery): Promise<MarketplaceHit[]>;
6533
+ /** Install (or update) entries by id — declared block dependencies
6534
+ * first, from the first marketplace publishing the id (or the named
6535
+ * one) — as one undo step. */
6536
+ installMarketplaceEntries(ids: readonly string[], marketplace?: string): Promise<MergeReport>;
5802
6537
  /** Escape hatch: apply an already-shaped op batch (validated, atomic,
5803
6538
  * one undo step). */
5804
6539
  applyOps(ops: readonly Operation[]): void;
@@ -5823,7 +6558,7 @@ interface EditorSurface {
5823
6558
  setSelection(ids: readonly string[]): void;
5824
6559
  zoom(to: ZoomTarget): void;
5825
6560
  /** Await one snapped world point; rejects when the user cancels. */
5826
- pickPoint(opts?: PickPointOptions): Promise<Vec2>;
6561
+ pickPoint(opts?: PickPointOptions): Promise<Vec2$1>;
5827
6562
  /** Await one object click; resolves the object's id. */
5828
6563
  pickObject(opts?: {
5829
6564
  label?: string;
@@ -5878,6 +6613,10 @@ declare class Drawing extends LocalDrawing {
5878
6613
  from: number;
5879
6614
  to: number;
5880
6615
  } | null);
6616
+ /** The marketplaces this drawing searches and installs from, in priority
6617
+ * order (the public collection is always present, last by default) —
6618
+ * process configuration, nothing is written to the file. */
6619
+ configureMarketplaces(list: readonly MarketplaceConfig[]): void;
5881
6620
  /** The file this drawing was opened from / last saved to, if any. */
5882
6621
  get filePath(): string | undefined;
5883
6622
  /** Block scripts compiled AND referenced files loaded (relative paths
@@ -5885,8 +6624,9 @@ declare class Drawing extends LocalDrawing {
5885
6624
  * that can't be read stays a frame. */
5886
6625
  ready(): Promise<void>;
5887
6626
  /** One reference's content (null when unreadable); a .linea's own
5888
- * references load relative to it — depth-limited, never re-entering a
5889
- * file above in the chain (the editor's rules). */
6627
+ * references load relative to it — and its embedded ones from ITS assets —
6628
+ * depth-limited, never re-entering a file above in the chain (the
6629
+ * editor's rules). */
5890
6630
  private loadReference;
5891
6631
  private readSource;
5892
6632
  /** Rasterize model space (or a paper layout via `layout`) to PNG bytes
@@ -5916,10 +6656,16 @@ declare class Drawing extends LocalDrawing {
5916
6656
  }
5917
6657
  /** A fresh empty document, optionally named (until saved to a file, whose
5918
6658
  * name then takes over). */
5919
- declare function newDrawing(name?: string): Drawing;
6659
+ interface DrawingOptions {
6660
+ /** Marketplaces to search and install from, in priority order (the
6661
+ * public collection is appended when missing). Default: the public
6662
+ * collection alone. */
6663
+ marketplaces?: readonly MarketplaceConfig[];
6664
+ }
6665
+ declare function newDrawing(name?: string, options?: DrawingOptions): Drawing;
5920
6666
  /** Parse a `.linea` JSON string. */
5921
6667
  declare function drawingFromJson(text: string): Drawing;
5922
6668
  /** Open a `.linea` file (parse + migrate) into an in-process kernel. */
5923
- declare function openDrawing(path: string): Promise<Drawing>;
6669
+ declare function openDrawing(path: string, options?: DrawingOptions): Promise<Drawing>;
5924
6670
 
5925
- 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 };
6671
+ export { type AABB, type AddOptions, type BlockMeta, type CommandMeta, type DimStyle$1 as 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 ModelObjectInput, type ModelObjectType, type ObjectQuery, type Operation, type PaperLayout, type PdfImportReport, type RenderPdfOptions as PdfOptions, type RenderPngOptions as PngOptions, type PointInput, type PrintPalette, type SheetName, type RenderSvgOptions as SvgOptions, type TextMeasurer, type TextStyle$1 as TextStyle, type Vec2$1 as Vec2, type ViewportOptions, drawingFromJson, ensureScriptTranspiler, getBlockMetaResult, getCommandMetaResult, newDrawing, openDrawing, parseScale, renderBlockThumbnailSvg, testBlockDefinition };