lineadraw 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -5
- package/bin/lineadraw.mjs +20 -5
- package/dist/{chunk-NCNZ7A6M.js → chunk-VWED6V6F.js} +2695 -632
- package/dist/chunk-VWED6V6F.js.map +1 -0
- package/dist/exportDxf-2VU5475O.js +8 -0
- package/dist/{node-2RH2EKXG.js → node-PLO3I6OZ.js} +39 -1
- package/dist/node-PLO3I6OZ.js.map +1 -0
- package/dist/pkg/linea_dwg_bg.wasm +0 -0
- package/dist/sdk.d.ts +874 -363
- package/dist/sdk.js +3371 -1490
- package/dist/sdk.js.map +1 -1
- package/lineadraw.d.ts +396 -26
- package/package.json +1 -1
- package/dist/chunk-NCNZ7A6M.js.map +0 -1
- package/dist/exportDxf-2HC6UIBS.js +0 -8
- package/dist/node-2RH2EKXG.js.map +0 -1
- /package/dist/{exportDxf-2HC6UIBS.js.map → exportDxf-2VU5475O.js.map} +0 -0
package/dist/sdk.d.ts
CHANGED
|
@@ -35,47 +35,6 @@ interface AABB {
|
|
|
35
35
|
maxY: number;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/** Owns copied boundary geometry (non-associative). loops[0] outer, rest holes (even-odd). */
|
|
39
|
-
declare const HatchSchema: z.ZodObject<{
|
|
40
|
-
id: z.ZodString;
|
|
41
|
-
layerId: z.ZodString;
|
|
42
|
-
color: z.ZodOptional<z.ZodString>;
|
|
43
|
-
lineType: z.ZodOptional<z.ZodString>;
|
|
44
|
-
lineTypeScale: z.ZodOptional<z.ZodNumber>;
|
|
45
|
-
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
46
|
-
opacity: z.ZodOptional<z.ZodNumber>;
|
|
47
|
-
type: z.ZodLiteral<"hatch">;
|
|
48
|
-
loops: z.ZodArray<z.ZodObject<{
|
|
49
|
-
points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
50
|
-
x: z.ZodNumber;
|
|
51
|
-
y: z.ZodNumber;
|
|
52
|
-
bulge: z.ZodDefault<z.ZodNumber>;
|
|
53
|
-
}, z.core.$strip>, unknown>>;
|
|
54
|
-
}, z.core.$strip>>;
|
|
55
|
-
fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
56
|
-
kind: z.ZodLiteral<"solid">;
|
|
57
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
-
kind: z.ZodLiteral<"pattern">;
|
|
59
|
-
name: z.ZodString;
|
|
60
|
-
angle: z.ZodNumber;
|
|
61
|
-
scale: z.ZodNumber;
|
|
62
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
-
kind: z.ZodLiteral<"lines">;
|
|
64
|
-
angle: z.ZodNumber;
|
|
65
|
-
spacing: z.ZodNumber;
|
|
66
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
67
|
-
kind: z.ZodLiteral<"gradient">;
|
|
68
|
-
shape: z.ZodDefault<z.ZodEnum<{
|
|
69
|
-
linear: "linear";
|
|
70
|
-
radial: "radial";
|
|
71
|
-
}>>;
|
|
72
|
-
color1: z.ZodDefault<z.ZodString>;
|
|
73
|
-
color2: z.ZodDefault<z.ZodString>;
|
|
74
|
-
angle: z.ZodDefault<z.ZodNumber>;
|
|
75
|
-
}, z.core.$strip>], "kind">>;
|
|
76
|
-
scale: z.ZodDefault<z.ZodNumber>;
|
|
77
|
-
}, z.core.$strip>;
|
|
78
|
-
type Hatch = z.infer<typeof HatchSchema>;
|
|
79
38
|
/**
|
|
80
39
|
* A named document text style: everything a TEXT object inherits unless its
|
|
81
40
|
* own `styleOverride` sets a key (same model as DimStyle for dimensions).
|
|
@@ -101,69 +60,6 @@ declare const TextStyleSchema: z.ZodObject<{
|
|
|
101
60
|
arrowSize: z.ZodDefault<z.ZodNumber>;
|
|
102
61
|
}, z.core.$strip>;
|
|
103
62
|
type TextStyle = z.infer<typeof TextStyleSchema>;
|
|
104
|
-
/**
|
|
105
|
-
* Text, optionally annotated with leader lines (MLEADER-style — the old
|
|
106
|
-
* standalone "leader" type merged in at document v6). Each leader line is a
|
|
107
|
-
* polyline with its arrowhead at [0]; by convention lines join at the first
|
|
108
|
-
* line's last point (the junction), near the text.
|
|
109
|
-
*/
|
|
110
|
-
declare const TextSchema: z.ZodObject<{
|
|
111
|
-
id: z.ZodString;
|
|
112
|
-
layerId: z.ZodString;
|
|
113
|
-
color: z.ZodOptional<z.ZodString>;
|
|
114
|
-
lineType: z.ZodOptional<z.ZodString>;
|
|
115
|
-
lineTypeScale: z.ZodOptional<z.ZodNumber>;
|
|
116
|
-
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
117
|
-
opacity: z.ZodOptional<z.ZodNumber>;
|
|
118
|
-
type: z.ZodLiteral<"text">;
|
|
119
|
-
position: z.ZodPreprocess<z.ZodObject<{
|
|
120
|
-
x: z.ZodNumber;
|
|
121
|
-
y: z.ZodNumber;
|
|
122
|
-
}, z.core.$strip>, unknown>;
|
|
123
|
-
content: z.ZodString;
|
|
124
|
-
leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
125
|
-
x: z.ZodNumber;
|
|
126
|
-
y: z.ZodNumber;
|
|
127
|
-
}, z.core.$strip>, unknown>>>>;
|
|
128
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
129
|
-
hAlign: z.ZodDefault<z.ZodEnum<{
|
|
130
|
-
center: "center";
|
|
131
|
-
left: "left";
|
|
132
|
-
right: "right";
|
|
133
|
-
}>>;
|
|
134
|
-
vAlign: z.ZodDefault<z.ZodEnum<{
|
|
135
|
-
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>;
|
|
167
63
|
/** A named document dimension style; documents carry an ARRAY of these and
|
|
168
64
|
* dimensions reference one by `styleId` (absent/dangling = the first). */
|
|
169
65
|
declare const DimStyleSchema: z.ZodObject<{
|
|
@@ -192,59 +88,6 @@ declare const DimStyleSchema: z.ZodObject<{
|
|
|
192
88
|
precision: z.ZodDefault<z.ZodNumber>;
|
|
193
89
|
}, z.core.$strip>;
|
|
194
90
|
type DimStyle = z.infer<typeof DimStyleSchema>;
|
|
195
|
-
/** Static (non-associative) definition points. Linear measures point to
|
|
196
|
-
* point (the pre-v9 "aligned" behavior; the axis-locked variant is gone). */
|
|
197
|
-
declare const DimensionSchema: z.ZodObject<{
|
|
198
|
-
id: z.ZodString;
|
|
199
|
-
layerId: z.ZodString;
|
|
200
|
-
color: z.ZodOptional<z.ZodString>;
|
|
201
|
-
lineType: z.ZodOptional<z.ZodString>;
|
|
202
|
-
lineTypeScale: z.ZodOptional<z.ZodNumber>;
|
|
203
|
-
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
204
|
-
opacity: z.ZodOptional<z.ZodNumber>;
|
|
205
|
-
type: z.ZodLiteral<"dimension">;
|
|
206
|
-
kind: z.ZodDefault<z.ZodEnum<{
|
|
207
|
-
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>;
|
|
248
91
|
/**
|
|
249
92
|
* A LINKED file drawn in place (an xref): the document holds this record,
|
|
250
93
|
* never the file. The file's model space lands with its origin at
|
|
@@ -423,6 +266,10 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
423
266
|
name: z.ZodString;
|
|
424
267
|
angle: z.ZodNumber;
|
|
425
268
|
scale: z.ZodNumber;
|
|
269
|
+
origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
270
|
+
x: z.ZodNumber;
|
|
271
|
+
y: z.ZodNumber;
|
|
272
|
+
}, z.core.$strip>, unknown>>;
|
|
426
273
|
}, z.core.$strip>, z.ZodObject<{
|
|
427
274
|
kind: z.ZodLiteral<"lines">;
|
|
428
275
|
angle: z.ZodNumber;
|
|
@@ -452,6 +299,20 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
452
299
|
y: z.ZodNumber;
|
|
453
300
|
}, z.core.$strip>, unknown>;
|
|
454
301
|
content: z.ZodString;
|
|
302
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
303
|
+
start: z.ZodNumber;
|
|
304
|
+
end: z.ZodNumber;
|
|
305
|
+
font: z.ZodOptional<z.ZodString>;
|
|
306
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
307
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
308
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
309
|
+
color: z.ZodOptional<z.ZodString>;
|
|
310
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
311
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
312
|
+
sub: "sub";
|
|
313
|
+
super: "super";
|
|
314
|
+
}>>;
|
|
315
|
+
}, z.core.$strip>>>;
|
|
455
316
|
leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
456
317
|
x: z.ZodNumber;
|
|
457
318
|
y: z.ZodNumber;
|
|
@@ -512,11 +373,27 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
512
373
|
x: z.ZodNumber;
|
|
513
374
|
y: z.ZodNumber;
|
|
514
375
|
}, z.core.$strip>, unknown>>;
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
376
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
377
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
378
|
+
labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
379
|
+
along: z.ZodOptional<z.ZodNumber>;
|
|
380
|
+
across: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
content: z.ZodOptional<z.ZodString>;
|
|
382
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
383
|
+
start: z.ZodNumber;
|
|
384
|
+
end: z.ZodNumber;
|
|
385
|
+
font: z.ZodOptional<z.ZodString>;
|
|
386
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
387
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
388
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
389
|
+
color: z.ZodOptional<z.ZodString>;
|
|
390
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
391
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
392
|
+
sub: "sub";
|
|
393
|
+
super: "super";
|
|
394
|
+
}>>;
|
|
395
|
+
}, z.core.$strip>>>;
|
|
396
|
+
}, z.core.$strip>>>;
|
|
520
397
|
styleId: z.ZodOptional<z.ZodString>;
|
|
521
398
|
styleOverride: z.ZodOptional<z.ZodObject<{
|
|
522
399
|
font: z.ZodOptional<z.ZodString>;
|
|
@@ -633,7 +510,21 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
633
510
|
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
634
511
|
}, z.core.$strip>>, unknown>;
|
|
635
512
|
cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
636
|
-
|
|
513
|
+
content: z.ZodDefault<z.ZodString>;
|
|
514
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
515
|
+
start: z.ZodNumber;
|
|
516
|
+
end: z.ZodNumber;
|
|
517
|
+
font: z.ZodOptional<z.ZodString>;
|
|
518
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
519
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
520
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
521
|
+
color: z.ZodOptional<z.ZodString>;
|
|
522
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
523
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
524
|
+
sub: "sub";
|
|
525
|
+
super: "super";
|
|
526
|
+
}>>;
|
|
527
|
+
}, z.core.$strip>>>;
|
|
637
528
|
span: z.ZodOptional<z.ZodObject<{
|
|
638
529
|
cols: z.ZodNumber;
|
|
639
530
|
rows: z.ZodNumber;
|
|
@@ -747,6 +638,29 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
747
638
|
type ModelObject = z.infer<typeof ModelObjectSchema>;
|
|
748
639
|
type ModelObjectType = ModelObject["type"];
|
|
749
640
|
|
|
641
|
+
declare const HatchPatternSchema: z.ZodObject<{
|
|
642
|
+
name: z.ZodString;
|
|
643
|
+
description: z.ZodOptional<z.ZodString>;
|
|
644
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
645
|
+
angle: z.ZodNumber;
|
|
646
|
+
origin: z.ZodPreprocess<z.ZodObject<{
|
|
647
|
+
x: z.ZodNumber;
|
|
648
|
+
y: z.ZodNumber;
|
|
649
|
+
}, z.core.$strip>, unknown>;
|
|
650
|
+
deltaX: z.ZodNumber;
|
|
651
|
+
deltaY: z.ZodNumber;
|
|
652
|
+
dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
653
|
+
}, z.core.$strip>>;
|
|
654
|
+
}, z.core.$strip>;
|
|
655
|
+
type DocumentHatchPattern = z.infer<typeof HatchPatternSchema>;
|
|
656
|
+
|
|
657
|
+
declare const LineTypeSchema: z.ZodObject<{
|
|
658
|
+
name: z.ZodString;
|
|
659
|
+
description: z.ZodOptional<z.ZodString>;
|
|
660
|
+
dashesMm: z.ZodArray<z.ZodNumber>;
|
|
661
|
+
}, z.core.$strip>;
|
|
662
|
+
type LineType = z.infer<typeof LineTypeSchema>;
|
|
663
|
+
|
|
750
664
|
declare const LayerSchema: z.ZodObject<{
|
|
751
665
|
id: z.ZodDefault<z.ZodString>;
|
|
752
666
|
name: z.ZodDefault<z.ZodString>;
|
|
@@ -762,7 +676,7 @@ type Layer = z.infer<typeof LayerSchema>;
|
|
|
762
676
|
declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
763
677
|
id: z.ZodDefault<z.ZodString>;
|
|
764
678
|
type: z.ZodDefault<z.ZodLiteral<"lineadraw">>;
|
|
765
|
-
version: z.ZodLiteral<
|
|
679
|
+
version: z.ZodLiteral<22>;
|
|
766
680
|
settings: z.ZodDefault<z.ZodObject<{
|
|
767
681
|
units: z.ZodDefault<z.ZodEnum<{
|
|
768
682
|
in: "in";
|
|
@@ -899,6 +813,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
899
813
|
name: z.ZodString;
|
|
900
814
|
angle: z.ZodNumber;
|
|
901
815
|
scale: z.ZodNumber;
|
|
816
|
+
origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
817
|
+
x: z.ZodNumber;
|
|
818
|
+
y: z.ZodNumber;
|
|
819
|
+
}, z.core.$strip>, unknown>>;
|
|
902
820
|
}, z.core.$strip>, z.ZodObject<{
|
|
903
821
|
kind: z.ZodLiteral<"lines">;
|
|
904
822
|
angle: z.ZodNumber;
|
|
@@ -928,6 +846,20 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
928
846
|
y: z.ZodNumber;
|
|
929
847
|
}, z.core.$strip>, unknown>;
|
|
930
848
|
content: z.ZodString;
|
|
849
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
850
|
+
start: z.ZodNumber;
|
|
851
|
+
end: z.ZodNumber;
|
|
852
|
+
font: z.ZodOptional<z.ZodString>;
|
|
853
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
854
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
855
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
856
|
+
color: z.ZodOptional<z.ZodString>;
|
|
857
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
858
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
859
|
+
sub: "sub";
|
|
860
|
+
super: "super";
|
|
861
|
+
}>>;
|
|
862
|
+
}, z.core.$strip>>>;
|
|
931
863
|
leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
932
864
|
x: z.ZodNumber;
|
|
933
865
|
y: z.ZodNumber;
|
|
@@ -988,11 +920,27 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
988
920
|
x: z.ZodNumber;
|
|
989
921
|
y: z.ZodNumber;
|
|
990
922
|
}, z.core.$strip>, unknown>>;
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
923
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
924
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
925
|
+
labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
926
|
+
along: z.ZodOptional<z.ZodNumber>;
|
|
927
|
+
across: z.ZodOptional<z.ZodNumber>;
|
|
928
|
+
content: z.ZodOptional<z.ZodString>;
|
|
929
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
930
|
+
start: z.ZodNumber;
|
|
931
|
+
end: z.ZodNumber;
|
|
932
|
+
font: z.ZodOptional<z.ZodString>;
|
|
933
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
934
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
935
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
936
|
+
color: z.ZodOptional<z.ZodString>;
|
|
937
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
938
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
939
|
+
sub: "sub";
|
|
940
|
+
super: "super";
|
|
941
|
+
}>>;
|
|
942
|
+
}, z.core.$strip>>>;
|
|
943
|
+
}, z.core.$strip>>>;
|
|
996
944
|
styleId: z.ZodOptional<z.ZodString>;
|
|
997
945
|
styleOverride: z.ZodOptional<z.ZodObject<{
|
|
998
946
|
font: z.ZodOptional<z.ZodString>;
|
|
@@ -1109,7 +1057,21 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
1109
1057
|
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1110
1058
|
}, z.core.$strip>>, unknown>;
|
|
1111
1059
|
cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
1112
|
-
|
|
1060
|
+
content: z.ZodDefault<z.ZodString>;
|
|
1061
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1062
|
+
start: z.ZodNumber;
|
|
1063
|
+
end: z.ZodNumber;
|
|
1064
|
+
font: z.ZodOptional<z.ZodString>;
|
|
1065
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
1066
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
1067
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
1068
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1069
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
1070
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
1071
|
+
sub: "sub";
|
|
1072
|
+
super: "super";
|
|
1073
|
+
}>>;
|
|
1074
|
+
}, z.core.$strip>>>;
|
|
1113
1075
|
span: z.ZodOptional<z.ZodObject<{
|
|
1114
1076
|
cols: z.ZodNumber;
|
|
1115
1077
|
rows: z.ZodNumber;
|
|
@@ -1350,6 +1312,10 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
1350
1312
|
name: z.ZodString;
|
|
1351
1313
|
angle: z.ZodNumber;
|
|
1352
1314
|
scale: z.ZodNumber;
|
|
1315
|
+
origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
1316
|
+
x: z.ZodNumber;
|
|
1317
|
+
y: z.ZodNumber;
|
|
1318
|
+
}, z.core.$strip>, unknown>>;
|
|
1353
1319
|
}, z.core.$strip>, z.ZodObject<{
|
|
1354
1320
|
kind: z.ZodLiteral<"lines">;
|
|
1355
1321
|
angle: z.ZodNumber;
|
|
@@ -1379,6 +1345,20 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
1379
1345
|
y: z.ZodNumber;
|
|
1380
1346
|
}, z.core.$strip>, unknown>;
|
|
1381
1347
|
content: z.ZodString;
|
|
1348
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1349
|
+
start: z.ZodNumber;
|
|
1350
|
+
end: z.ZodNumber;
|
|
1351
|
+
font: z.ZodOptional<z.ZodString>;
|
|
1352
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
1353
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
1354
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
1355
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1356
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
1357
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
1358
|
+
sub: "sub";
|
|
1359
|
+
super: "super";
|
|
1360
|
+
}>>;
|
|
1361
|
+
}, z.core.$strip>>>;
|
|
1382
1362
|
leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
1383
1363
|
x: z.ZodNumber;
|
|
1384
1364
|
y: z.ZodNumber;
|
|
@@ -1439,11 +1419,27 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
1439
1419
|
x: z.ZodNumber;
|
|
1440
1420
|
y: z.ZodNumber;
|
|
1441
1421
|
}, z.core.$strip>, unknown>>;
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1422
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
1423
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
1424
|
+
labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1425
|
+
along: z.ZodOptional<z.ZodNumber>;
|
|
1426
|
+
across: z.ZodOptional<z.ZodNumber>;
|
|
1427
|
+
content: z.ZodOptional<z.ZodString>;
|
|
1428
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1429
|
+
start: z.ZodNumber;
|
|
1430
|
+
end: z.ZodNumber;
|
|
1431
|
+
font: z.ZodOptional<z.ZodString>;
|
|
1432
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
1433
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
1434
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
1435
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1436
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
1437
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
1438
|
+
sub: "sub";
|
|
1439
|
+
super: "super";
|
|
1440
|
+
}>>;
|
|
1441
|
+
}, z.core.$strip>>>;
|
|
1442
|
+
}, z.core.$strip>>>;
|
|
1447
1443
|
styleId: z.ZodOptional<z.ZodString>;
|
|
1448
1444
|
styleOverride: z.ZodOptional<z.ZodObject<{
|
|
1449
1445
|
font: z.ZodOptional<z.ZodString>;
|
|
@@ -1560,7 +1556,21 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
1560
1556
|
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1561
1557
|
}, z.core.$strip>>, unknown>;
|
|
1562
1558
|
cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
1563
|
-
|
|
1559
|
+
content: z.ZodDefault<z.ZodString>;
|
|
1560
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1561
|
+
start: z.ZodNumber;
|
|
1562
|
+
end: z.ZodNumber;
|
|
1563
|
+
font: z.ZodOptional<z.ZodString>;
|
|
1564
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
1565
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
1566
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
1567
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1568
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
1569
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
1570
|
+
sub: "sub";
|
|
1571
|
+
super: "super";
|
|
1572
|
+
}>>;
|
|
1573
|
+
}, z.core.$strip>>>;
|
|
1564
1574
|
span: z.ZodOptional<z.ZodObject<{
|
|
1565
1575
|
cols: z.ZodNumber;
|
|
1566
1576
|
rows: z.ZodNumber;
|
|
@@ -1714,6 +1724,25 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
1714
1724
|
extensionOvershoot: z.ZodDefault<z.ZodNumber>;
|
|
1715
1725
|
precision: z.ZodDefault<z.ZodNumber>;
|
|
1716
1726
|
}, z.core.$strip>>>;
|
|
1727
|
+
lineTypes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1728
|
+
name: z.ZodString;
|
|
1729
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1730
|
+
dashesMm: z.ZodArray<z.ZodNumber>;
|
|
1731
|
+
}, z.core.$strip>>>;
|
|
1732
|
+
hatchPatterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1733
|
+
name: z.ZodString;
|
|
1734
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1735
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
1736
|
+
angle: z.ZodNumber;
|
|
1737
|
+
origin: z.ZodPreprocess<z.ZodObject<{
|
|
1738
|
+
x: z.ZodNumber;
|
|
1739
|
+
y: z.ZodNumber;
|
|
1740
|
+
}, z.core.$strip>, unknown>;
|
|
1741
|
+
deltaX: z.ZodNumber;
|
|
1742
|
+
deltaY: z.ZodNumber;
|
|
1743
|
+
dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
1744
|
+
}, z.core.$strip>>;
|
|
1745
|
+
}, z.core.$strip>>>;
|
|
1717
1746
|
assets: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1718
1747
|
blockDefinitions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1719
1748
|
commands: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -2087,6 +2116,10 @@ declare const PaperLayoutSchema: z.ZodObject<{
|
|
|
2087
2116
|
name: z.ZodString;
|
|
2088
2117
|
angle: z.ZodNumber;
|
|
2089
2118
|
scale: z.ZodNumber;
|
|
2119
|
+
origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
2120
|
+
x: z.ZodNumber;
|
|
2121
|
+
y: z.ZodNumber;
|
|
2122
|
+
}, z.core.$strip>, unknown>>;
|
|
2090
2123
|
}, z.core.$strip>, z.ZodObject<{
|
|
2091
2124
|
kind: z.ZodLiteral<"lines">;
|
|
2092
2125
|
angle: z.ZodNumber;
|
|
@@ -2116,6 +2149,20 @@ declare const PaperLayoutSchema: z.ZodObject<{
|
|
|
2116
2149
|
y: z.ZodNumber;
|
|
2117
2150
|
}, z.core.$strip>, unknown>;
|
|
2118
2151
|
content: z.ZodString;
|
|
2152
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2153
|
+
start: z.ZodNumber;
|
|
2154
|
+
end: z.ZodNumber;
|
|
2155
|
+
font: z.ZodOptional<z.ZodString>;
|
|
2156
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
2157
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
2158
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
2159
|
+
color: z.ZodOptional<z.ZodString>;
|
|
2160
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
2161
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
2162
|
+
sub: "sub";
|
|
2163
|
+
super: "super";
|
|
2164
|
+
}>>;
|
|
2165
|
+
}, z.core.$strip>>>;
|
|
2119
2166
|
leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
2120
2167
|
x: z.ZodNumber;
|
|
2121
2168
|
y: z.ZodNumber;
|
|
@@ -2176,11 +2223,27 @@ declare const PaperLayoutSchema: z.ZodObject<{
|
|
|
2176
2223
|
x: z.ZodNumber;
|
|
2177
2224
|
y: z.ZodNumber;
|
|
2178
2225
|
}, z.core.$strip>, unknown>>;
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2226
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
2227
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
2228
|
+
labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2229
|
+
along: z.ZodOptional<z.ZodNumber>;
|
|
2230
|
+
across: z.ZodOptional<z.ZodNumber>;
|
|
2231
|
+
content: z.ZodOptional<z.ZodString>;
|
|
2232
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2233
|
+
start: z.ZodNumber;
|
|
2234
|
+
end: z.ZodNumber;
|
|
2235
|
+
font: z.ZodOptional<z.ZodString>;
|
|
2236
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
2237
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
2238
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
2239
|
+
color: z.ZodOptional<z.ZodString>;
|
|
2240
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
2241
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
2242
|
+
sub: "sub";
|
|
2243
|
+
super: "super";
|
|
2244
|
+
}>>;
|
|
2245
|
+
}, z.core.$strip>>>;
|
|
2246
|
+
}, z.core.$strip>>>;
|
|
2184
2247
|
styleId: z.ZodOptional<z.ZodString>;
|
|
2185
2248
|
styleOverride: z.ZodOptional<z.ZodObject<{
|
|
2186
2249
|
font: z.ZodOptional<z.ZodString>;
|
|
@@ -2297,7 +2360,21 @@ declare const PaperLayoutSchema: z.ZodObject<{
|
|
|
2297
2360
|
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
2298
2361
|
}, z.core.$strip>>, unknown>;
|
|
2299
2362
|
cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
2300
|
-
|
|
2363
|
+
content: z.ZodDefault<z.ZodString>;
|
|
2364
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2365
|
+
start: z.ZodNumber;
|
|
2366
|
+
end: z.ZodNumber;
|
|
2367
|
+
font: z.ZodOptional<z.ZodString>;
|
|
2368
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
2369
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
2370
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
2371
|
+
color: z.ZodOptional<z.ZodString>;
|
|
2372
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
2373
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
2374
|
+
sub: "sub";
|
|
2375
|
+
super: "super";
|
|
2376
|
+
}>>;
|
|
2377
|
+
}, z.core.$strip>>>;
|
|
2301
2378
|
span: z.ZodOptional<z.ZodObject<{
|
|
2302
2379
|
cols: z.ZodNumber;
|
|
2303
2380
|
rows: z.ZodNumber;
|
|
@@ -2413,7 +2490,8 @@ type PaperLayout = z.infer<typeof PaperLayoutSchema>;
|
|
|
2413
2490
|
|
|
2414
2491
|
/**
|
|
2415
2492
|
* Drawing scale → the stored 1:N denominator (model mm per paper mm):
|
|
2416
|
-
* `"1:50"` → 50, `"2:1"` → 0.5; numbers pass through (50 means 1:50)
|
|
2493
|
+
* `"1:50"` → 50, `"2:1"` → 0.5; numbers pass through (50 means 1:50), as
|
|
2494
|
+
* does a plain numeric string (`"50"`).
|
|
2417
2495
|
*/
|
|
2418
2496
|
declare const parseScale: (scale: number | string) => number;
|
|
2419
2497
|
|
|
@@ -2468,6 +2546,10 @@ interface BlockThumbnailOptions {
|
|
|
2468
2546
|
/** Skip (return null) when the SVG exceeds this many characters — a
|
|
2469
2547
|
* manifest should stay a light index, not an asset bundle. */
|
|
2470
2548
|
maxChars?: number;
|
|
2549
|
+
/** The document's own line types / hatch patterns, when the block's
|
|
2550
|
+
* children reference them by name (the catalogue needs no help). */
|
|
2551
|
+
lineTypes?: readonly LineType[];
|
|
2552
|
+
hatchPatterns?: readonly DocumentHatchPattern[];
|
|
2471
2553
|
}
|
|
2472
2554
|
/**
|
|
2473
2555
|
* Render a block module to a small standalone SVG (viewBox-sized, strokes
|
|
@@ -2476,7 +2558,7 @@ interface BlockThumbnailOptions {
|
|
|
2476
2558
|
* module itself fails its dry run (same errors testBlockDefinition
|
|
2477
2559
|
* reports).
|
|
2478
2560
|
*/
|
|
2479
|
-
declare const renderBlockThumbnailSvg: (script: string, { definitions, maxChars }?: BlockThumbnailOptions) => Promise<string | null>;
|
|
2561
|
+
declare const renderBlockThumbnailSvg: (script: string, { definitions, maxChars, lineTypes, hatchPatterns, }?: BlockThumbnailOptions) => Promise<string | null>;
|
|
2480
2562
|
|
|
2481
2563
|
interface MergeModulesResult<M> {
|
|
2482
2564
|
/** The full library to install (replacements in place + new appended). */
|
|
@@ -2500,6 +2582,145 @@ interface MergeModulesResult<M> {
|
|
|
2500
2582
|
}[];
|
|
2501
2583
|
}
|
|
2502
2584
|
|
|
2585
|
+
/** One configured marketplace. `kind` discriminates so new source types
|
|
2586
|
+
* are one more variant; identity (for dedupe/remove/reorder) is
|
|
2587
|
+
* `marketplaceKey`. The built-in public collection is always present
|
|
2588
|
+
* exactly once (`normalizeMarketplaces`). Tokens never enter a document. */
|
|
2589
|
+
declare const MarketplaceConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2590
|
+
kind: z.ZodLiteral<"builtin">;
|
|
2591
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2592
|
+
kind: z.ZodLiteral<"github">;
|
|
2593
|
+
spec: z.ZodString;
|
|
2594
|
+
token: z.ZodOptional<z.ZodString>;
|
|
2595
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2596
|
+
kind: z.ZodLiteral<"folder">;
|
|
2597
|
+
folder: z.ZodString;
|
|
2598
|
+
}, z.core.$strip>], "kind">;
|
|
2599
|
+
type MarketplaceConfig = z.infer<typeof MarketplaceConfigSchema>;
|
|
2600
|
+
/** What agents and the SDK see of a configured marketplace — never the
|
|
2601
|
+
* token itself. */
|
|
2602
|
+
interface MarketplaceInfo {
|
|
2603
|
+
key: string;
|
|
2604
|
+
kind: MarketplaceConfig["kind"];
|
|
2605
|
+
label: string;
|
|
2606
|
+
spec?: string;
|
|
2607
|
+
folder?: string;
|
|
2608
|
+
hasToken: boolean;
|
|
2609
|
+
}
|
|
2610
|
+
/** One manifest row — the minimal-manifest scheme (docs/marketplace-devx.md)
|
|
2611
|
+
* with the legacy pinned-URL fields still accepted. Exported so tooling
|
|
2612
|
+
* tests can verify generated manifests parse. */
|
|
2613
|
+
declare const MarketplaceEntrySchema: z.ZodObject<{
|
|
2614
|
+
kind: z.ZodEnum<{
|
|
2615
|
+
block: "block";
|
|
2616
|
+
command: "command";
|
|
2617
|
+
}>;
|
|
2618
|
+
id: z.ZodString;
|
|
2619
|
+
name: z.ZodString;
|
|
2620
|
+
version: z.ZodString;
|
|
2621
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2622
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
2623
|
+
authors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
2624
|
+
dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
2625
|
+
source: z.ZodOptional<z.ZodString>;
|
|
2626
|
+
sourceUrl: z.ZodOptional<z.ZodString>;
|
|
2627
|
+
contentHash: z.ZodOptional<z.ZodString>;
|
|
2628
|
+
thumbnailSvg: z.ZodOptional<z.ZodString>;
|
|
2629
|
+
}, z.core.$strip>;
|
|
2630
|
+
type MarketplaceEntry = z.infer<typeof MarketplaceEntrySchema>;
|
|
2631
|
+
type MarketplaceCatalog = {
|
|
2632
|
+
state: "ready";
|
|
2633
|
+
name?: string;
|
|
2634
|
+
entries: MarketplaceEntry[];
|
|
2635
|
+
} | {
|
|
2636
|
+
state: "unavailable";
|
|
2637
|
+
reason: string;
|
|
2638
|
+
};
|
|
2639
|
+
/** How a catalog entry relates to what the document already has. */
|
|
2640
|
+
type InstallStatus = {
|
|
2641
|
+
kind: "absent";
|
|
2642
|
+
} | {
|
|
2643
|
+
kind: "installed";
|
|
2644
|
+
version?: string;
|
|
2645
|
+
} | {
|
|
2646
|
+
kind: "update";
|
|
2647
|
+
from?: string;
|
|
2648
|
+
};
|
|
2649
|
+
/** The document's module sources an install compares against. */
|
|
2650
|
+
interface VendoredModules {
|
|
2651
|
+
blockDefinitions: readonly string[];
|
|
2652
|
+
commands: readonly string[];
|
|
2653
|
+
}
|
|
2654
|
+
/** What a host lends the client: the platform's fetch (default
|
|
2655
|
+
* `globalThis.fetch`) and, for folder marketplaces, a reader of UTF-8
|
|
2656
|
+
* files by folder key + folder-relative POSIX path (reject when missing).
|
|
2657
|
+
* Without a reader, folder marketplaces report themselves unavailable. */
|
|
2658
|
+
interface MarketplaceIO {
|
|
2659
|
+
fetch?: typeof globalThis.fetch;
|
|
2660
|
+
readFile?: (folderKey: string, relPath: string) => Promise<string>;
|
|
2661
|
+
}
|
|
2662
|
+
/** A search hit: the entry, where it came from, and its install status. */
|
|
2663
|
+
interface MarketplaceHit extends MarketplaceEntry {
|
|
2664
|
+
marketplace: MarketplaceInfo;
|
|
2665
|
+
status: InstallStatus;
|
|
2666
|
+
}
|
|
2667
|
+
interface MarketplaceQuery {
|
|
2668
|
+
/** Case-insensitive substring over name, id, description and tags. */
|
|
2669
|
+
query?: string;
|
|
2670
|
+
kind?: MarketplaceEntry["kind"];
|
|
2671
|
+
/** Restrict to one marketplace — by key, spec, folder or label. */
|
|
2672
|
+
marketplace?: string;
|
|
2673
|
+
}
|
|
2674
|
+
/**
|
|
2675
|
+
* Catalog + source access over configured marketplaces, with per-instance
|
|
2676
|
+
* caches: one download of a module serves preview and install, and a
|
|
2677
|
+
* catalog is fetched once until `refresh`. One instance per host.
|
|
2678
|
+
*/
|
|
2679
|
+
declare class MarketplaceClient {
|
|
2680
|
+
private readonly catalogs;
|
|
2681
|
+
private readonly sources;
|
|
2682
|
+
private readonly io;
|
|
2683
|
+
constructor(io?: MarketplaceIO);
|
|
2684
|
+
private fetch;
|
|
2685
|
+
private cacheKey;
|
|
2686
|
+
private loadFolderCatalog;
|
|
2687
|
+
private loadCatalog;
|
|
2688
|
+
/** Fetch (and cache) a marketplace's catalog; `refresh` bypasses the
|
|
2689
|
+
* cache AND drops the marketplace's cached module sources — `source`
|
|
2690
|
+
* rows track a branch ref, so they are only immutable within one catalog
|
|
2691
|
+
* snapshot. */
|
|
2692
|
+
catalog(m: MarketplaceConfig, refresh?: boolean): Promise<MarketplaceCatalog>;
|
|
2693
|
+
/** An entry's module source. `source` rows resolve against the
|
|
2694
|
+
* marketplace repo at the manifest's ref; with a token the contents API
|
|
2695
|
+
* serves them instead of the raw host. */
|
|
2696
|
+
source(m: MarketplaceConfig, entry: MarketplaceEntry): Promise<string>;
|
|
2697
|
+
/**
|
|
2698
|
+
* Sources of an entry's declared dependency CLOSURE (the entry itself
|
|
2699
|
+
* excluded), resolved from the catalog recursively — what a preview
|
|
2700
|
+
* needs so nested instances (Grid → Axis) evaluate before anything is
|
|
2701
|
+
* installed. Missing catalog entries are skipped (the preview then shows
|
|
2702
|
+
* the eval error for that id, same as a dangling reference).
|
|
2703
|
+
*/
|
|
2704
|
+
closureSources(m: MarketplaceConfig, entry: MarketplaceEntry): Promise<string[]>;
|
|
2705
|
+
/**
|
|
2706
|
+
* The module sources an install of `entry` merges, in order: declared
|
|
2707
|
+
* block dependencies first (resolved from the catalog, recursively,
|
|
2708
|
+
* skipping ids the document already vendors — a dependency is never
|
|
2709
|
+
* force-updated), the entry itself last. Throws when a dependency is
|
|
2710
|
+
* missing from the catalog.
|
|
2711
|
+
*/
|
|
2712
|
+
installSources(m: MarketplaceConfig, entry: MarketplaceEntry, vendored: VendoredModules, visited?: Set<string>): Promise<string[]>;
|
|
2713
|
+
/** Entries across the configured marketplaces (priority order; the first
|
|
2714
|
+
* marketplace publishing an id wins), filtered by the query. */
|
|
2715
|
+
search(configs: readonly MarketplaceConfig[], q: MarketplaceQuery, vendored: VendoredModules): Promise<MarketplaceHit[]>;
|
|
2716
|
+
/** The first marketplace (in priority order, or the named one) that
|
|
2717
|
+
* publishes `id`, with its entry; null when none does. */
|
|
2718
|
+
find(configs: readonly MarketplaceConfig[], id: string, marketplace?: string): Promise<{
|
|
2719
|
+
config: MarketplaceConfig;
|
|
2720
|
+
entry: MarketplaceEntry;
|
|
2721
|
+
} | null>;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2503
2724
|
/** Identity + metadata derived from a command module's exports. */
|
|
2504
2725
|
interface CommandMeta {
|
|
2505
2726
|
id: string;
|
|
@@ -2535,14 +2756,6 @@ interface TextMeasurer {
|
|
|
2535
2756
|
* (horizontal glyph scale) when provided. */
|
|
2536
2757
|
measureTextWidth(text: string, heightMm: number, font?: string, widthFactor?: number): number;
|
|
2537
2758
|
}
|
|
2538
|
-
interface TextBlock {
|
|
2539
|
-
lines: string[];
|
|
2540
|
-
/** Widest line, mm. */
|
|
2541
|
-
width: number;
|
|
2542
|
-
/** Total block height, mm. */
|
|
2543
|
-
height: number;
|
|
2544
|
-
lineHeight: number;
|
|
2545
|
-
}
|
|
2546
2759
|
|
|
2547
2760
|
type SnapPointType = "endpoint" | "midpoint" | "center" | "quadrant";
|
|
2548
2761
|
interface SnapPoint {
|
|
@@ -2582,6 +2795,12 @@ interface SnapCacheEntry {
|
|
|
2582
2795
|
ellipses?: EllipseGeom[];
|
|
2583
2796
|
/** Closed tessellated rings (hatch interiors, for inside hit-testing). */
|
|
2584
2797
|
rings?: Vec2[][];
|
|
2798
|
+
/**
|
|
2799
|
+
* Filled regions of NESTED content — a block's hatch children — each its
|
|
2800
|
+
* own even-odd ring set (so two overlapping fills don't cancel). An
|
|
2801
|
+
* inside hit on one ranks like a hatch hit: below geometry drawn over it.
|
|
2802
|
+
*/
|
|
2803
|
+
regions?: Vec2[][][];
|
|
2585
2804
|
/**
|
|
2586
2805
|
* Huge entries (a referenced site plan: 10⁵+ segments) answer "what is in
|
|
2587
2806
|
* this box" from a spatial index, so snapping and picking near the cursor
|
|
@@ -2590,69 +2809,26 @@ interface SnapCacheEntry {
|
|
|
2590
2809
|
near?: (box: AABB) => SnapCacheEntry;
|
|
2591
2810
|
}
|
|
2592
2811
|
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
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;
|
|
2812
|
+
/**
|
|
2813
|
+
* The document half of a paint environment: everything a painter resolves
|
|
2814
|
+
* by id or name against the document. The array fields are REQUIRED so a
|
|
2815
|
+
* caller can't drop one by accident (an omitted `hatchPatterns` silently
|
|
2816
|
+
* painted the catalogue fallback); consumers without a document pass [].
|
|
2817
|
+
* `LayoutModelContext` and `ReferenceContent` extend it, so a paint env
|
|
2818
|
+
* spreads either one whole.
|
|
2819
|
+
*/
|
|
2820
|
+
interface DocumentPaintResources {
|
|
2821
|
+
/** Document layers — a block child that names its OWN layer hides with
|
|
2822
|
+
* it (its color still follows the instance unless it sets one). */
|
|
2823
|
+
layers: readonly Layer[];
|
|
2652
2824
|
/** Document dimension styles — dimensions pick theirs by styleId. */
|
|
2653
2825
|
dimStyles: readonly DimStyle[];
|
|
2654
2826
|
/** Document text styles — texts pick theirs by styleId. */
|
|
2655
2827
|
textStyles: readonly TextStyle[];
|
|
2828
|
+
/** Document-defined line types / hatch patterns, resolved by NAME ahead
|
|
2829
|
+
* of the built-in catalogue (block children and hatch fills). */
|
|
2830
|
+
lineTypes: readonly LineType[];
|
|
2831
|
+
hatchPatterns: readonly DocumentHatchPattern[];
|
|
2656
2832
|
/**
|
|
2657
2833
|
* The document's block definitions — the block painter evaluates instance
|
|
2658
2834
|
* children against these. The kernel holds no store, so they are threaded
|
|
@@ -2671,27 +2847,12 @@ interface PaintEnv {
|
|
|
2671
2847
|
* images (or documents without any) paint a crossed placeholder frame.
|
|
2672
2848
|
*/
|
|
2673
2849
|
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
2850
|
/**
|
|
2687
2851
|
* A reference's loaded file content (docs/references.md) — the host owns
|
|
2688
2852
|
* loading and caching. Absent, or null for a file not loaded (yet), → the
|
|
2689
2853
|
* reference paints as a dashed frame.
|
|
2690
2854
|
*/
|
|
2691
2855
|
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;
|
|
2695
2856
|
}
|
|
2696
2857
|
|
|
2697
2858
|
/**
|
|
@@ -2699,21 +2860,8 @@ interface PaintEnv {
|
|
|
2699
2860
|
* store, so it is passed in (the editor sources it from useModel; a headless
|
|
2700
2861
|
* caller from the loaded document).
|
|
2701
2862
|
*/
|
|
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"];
|
|
2863
|
+
interface LayoutModelContext extends DocumentPaintResources {
|
|
2864
|
+
objects: readonly ModelObject[];
|
|
2717
2865
|
}
|
|
2718
2866
|
|
|
2719
2867
|
/** A loaded reference: the file's model space as Linea objects (ids
|
|
@@ -2753,8 +2901,6 @@ interface ReferenceSnap {
|
|
|
2753
2901
|
})[];
|
|
2754
2902
|
}
|
|
2755
2903
|
|
|
2756
|
-
type DwgVersion = "AC1015" | "AC1018" | "AC1021" | "AC1024" | "AC1027" | "AC1032";
|
|
2757
|
-
|
|
2758
2904
|
/**
|
|
2759
2905
|
* Where a reorder places the moved objects: the top/bottom of the space's
|
|
2760
2906
|
* draw order, or immediately above/below a reference object (by id).
|
|
@@ -2888,6 +3034,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2888
3034
|
name: z.ZodString;
|
|
2889
3035
|
angle: z.ZodNumber;
|
|
2890
3036
|
scale: z.ZodNumber;
|
|
3037
|
+
origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
3038
|
+
x: z.ZodNumber;
|
|
3039
|
+
y: z.ZodNumber;
|
|
3040
|
+
}, z.core.$strip>, unknown>>;
|
|
2891
3041
|
}, z.core.$strip>, z.ZodObject<{
|
|
2892
3042
|
kind: z.ZodLiteral<"lines">;
|
|
2893
3043
|
angle: z.ZodNumber;
|
|
@@ -2917,6 +3067,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2917
3067
|
y: z.ZodNumber;
|
|
2918
3068
|
}, z.core.$strip>, unknown>;
|
|
2919
3069
|
content: z.ZodString;
|
|
3070
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3071
|
+
start: z.ZodNumber;
|
|
3072
|
+
end: z.ZodNumber;
|
|
3073
|
+
font: z.ZodOptional<z.ZodString>;
|
|
3074
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
3075
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
3076
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
3077
|
+
color: z.ZodOptional<z.ZodString>;
|
|
3078
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
3079
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
3080
|
+
sub: "sub";
|
|
3081
|
+
super: "super";
|
|
3082
|
+
}>>;
|
|
3083
|
+
}, z.core.$strip>>>;
|
|
2920
3084
|
leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
2921
3085
|
x: z.ZodNumber;
|
|
2922
3086
|
y: z.ZodNumber;
|
|
@@ -2977,11 +3141,27 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2977
3141
|
x: z.ZodNumber;
|
|
2978
3142
|
y: z.ZodNumber;
|
|
2979
3143
|
}, z.core.$strip>, unknown>>;
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
3144
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
3145
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
3146
|
+
labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
3147
|
+
along: z.ZodOptional<z.ZodNumber>;
|
|
3148
|
+
across: z.ZodOptional<z.ZodNumber>;
|
|
3149
|
+
content: z.ZodOptional<z.ZodString>;
|
|
3150
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3151
|
+
start: z.ZodNumber;
|
|
3152
|
+
end: z.ZodNumber;
|
|
3153
|
+
font: z.ZodOptional<z.ZodString>;
|
|
3154
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
3155
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
3156
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
3157
|
+
color: z.ZodOptional<z.ZodString>;
|
|
3158
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
3159
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
3160
|
+
sub: "sub";
|
|
3161
|
+
super: "super";
|
|
3162
|
+
}>>;
|
|
3163
|
+
}, z.core.$strip>>>;
|
|
3164
|
+
}, z.core.$strip>>>;
|
|
2985
3165
|
styleId: z.ZodOptional<z.ZodString>;
|
|
2986
3166
|
styleOverride: z.ZodOptional<z.ZodObject<{
|
|
2987
3167
|
font: z.ZodOptional<z.ZodString>;
|
|
@@ -3098,7 +3278,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3098
3278
|
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
3099
3279
|
}, z.core.$strip>>, unknown>;
|
|
3100
3280
|
cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
3101
|
-
|
|
3281
|
+
content: z.ZodDefault<z.ZodString>;
|
|
3282
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3283
|
+
start: z.ZodNumber;
|
|
3284
|
+
end: z.ZodNumber;
|
|
3285
|
+
font: z.ZodOptional<z.ZodString>;
|
|
3286
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
3287
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
3288
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
3289
|
+
color: z.ZodOptional<z.ZodString>;
|
|
3290
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
3291
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
3292
|
+
sub: "sub";
|
|
3293
|
+
super: "super";
|
|
3294
|
+
}>>;
|
|
3295
|
+
}, z.core.$strip>>>;
|
|
3102
3296
|
span: z.ZodOptional<z.ZodObject<{
|
|
3103
3297
|
cols: z.ZodNumber;
|
|
3104
3298
|
rows: z.ZodNumber;
|
|
@@ -3333,6 +3527,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3333
3527
|
name: z.ZodString;
|
|
3334
3528
|
angle: z.ZodNumber;
|
|
3335
3529
|
scale: z.ZodNumber;
|
|
3530
|
+
origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
3531
|
+
x: z.ZodNumber;
|
|
3532
|
+
y: z.ZodNumber;
|
|
3533
|
+
}, z.core.$strip>, unknown>>;
|
|
3336
3534
|
}, z.core.$strip>, z.ZodObject<{
|
|
3337
3535
|
kind: z.ZodLiteral<"lines">;
|
|
3338
3536
|
angle: z.ZodNumber;
|
|
@@ -3362,6 +3560,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3362
3560
|
y: z.ZodNumber;
|
|
3363
3561
|
}, z.core.$strip>, unknown>;
|
|
3364
3562
|
content: z.ZodString;
|
|
3563
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3564
|
+
start: z.ZodNumber;
|
|
3565
|
+
end: z.ZodNumber;
|
|
3566
|
+
font: z.ZodOptional<z.ZodString>;
|
|
3567
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
3568
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
3569
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
3570
|
+
color: z.ZodOptional<z.ZodString>;
|
|
3571
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
3572
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
3573
|
+
sub: "sub";
|
|
3574
|
+
super: "super";
|
|
3575
|
+
}>>;
|
|
3576
|
+
}, z.core.$strip>>>;
|
|
3365
3577
|
leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
3366
3578
|
x: z.ZodNumber;
|
|
3367
3579
|
y: z.ZodNumber;
|
|
@@ -3422,11 +3634,27 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3422
3634
|
x: z.ZodNumber;
|
|
3423
3635
|
y: z.ZodNumber;
|
|
3424
3636
|
}, z.core.$strip>, unknown>>;
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3637
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
3638
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
3639
|
+
labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
3640
|
+
along: z.ZodOptional<z.ZodNumber>;
|
|
3641
|
+
across: z.ZodOptional<z.ZodNumber>;
|
|
3642
|
+
content: z.ZodOptional<z.ZodString>;
|
|
3643
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3644
|
+
start: z.ZodNumber;
|
|
3645
|
+
end: z.ZodNumber;
|
|
3646
|
+
font: z.ZodOptional<z.ZodString>;
|
|
3647
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
3648
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
3649
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
3650
|
+
color: z.ZodOptional<z.ZodString>;
|
|
3651
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
3652
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
3653
|
+
sub: "sub";
|
|
3654
|
+
super: "super";
|
|
3655
|
+
}>>;
|
|
3656
|
+
}, z.core.$strip>>>;
|
|
3657
|
+
}, z.core.$strip>>>;
|
|
3430
3658
|
styleId: z.ZodOptional<z.ZodString>;
|
|
3431
3659
|
styleOverride: z.ZodOptional<z.ZodObject<{
|
|
3432
3660
|
font: z.ZodOptional<z.ZodString>;
|
|
@@ -3543,7 +3771,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3543
3771
|
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
3544
3772
|
}, z.core.$strip>>, unknown>;
|
|
3545
3773
|
cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
3546
|
-
|
|
3774
|
+
content: z.ZodDefault<z.ZodString>;
|
|
3775
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3776
|
+
start: z.ZodNumber;
|
|
3777
|
+
end: z.ZodNumber;
|
|
3778
|
+
font: z.ZodOptional<z.ZodString>;
|
|
3779
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
3780
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
3781
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
3782
|
+
color: z.ZodOptional<z.ZodString>;
|
|
3783
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
3784
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
3785
|
+
sub: "sub";
|
|
3786
|
+
super: "super";
|
|
3787
|
+
}>>;
|
|
3788
|
+
}, z.core.$strip>>>;
|
|
3547
3789
|
span: z.ZodOptional<z.ZodObject<{
|
|
3548
3790
|
cols: z.ZodNumber;
|
|
3549
3791
|
rows: z.ZodNumber;
|
|
@@ -3720,6 +3962,14 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3720
3962
|
}, z.core.$strip>, z.ZodObject<{
|
|
3721
3963
|
type: z.ZodLiteral<"set-current-layer">;
|
|
3722
3964
|
id: z.ZodString;
|
|
3965
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3966
|
+
type: z.ZodLiteral<"set-document-settings">;
|
|
3967
|
+
settings: z.ZodObject<{
|
|
3968
|
+
units: z.ZodDefault<z.ZodEnum<{
|
|
3969
|
+
in: "in";
|
|
3970
|
+
mm: "mm";
|
|
3971
|
+
}>>;
|
|
3972
|
+
}, z.core.$strip>;
|
|
3723
3973
|
}, z.core.$strip>, z.ZodObject<{
|
|
3724
3974
|
type: z.ZodLiteral<"add-layout">;
|
|
3725
3975
|
layout: z.ZodObject<{
|
|
@@ -3852,6 +4102,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3852
4102
|
name: z.ZodString;
|
|
3853
4103
|
angle: z.ZodNumber;
|
|
3854
4104
|
scale: z.ZodNumber;
|
|
4105
|
+
origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
4106
|
+
x: z.ZodNumber;
|
|
4107
|
+
y: z.ZodNumber;
|
|
4108
|
+
}, z.core.$strip>, unknown>>;
|
|
3855
4109
|
}, z.core.$strip>, z.ZodObject<{
|
|
3856
4110
|
kind: z.ZodLiteral<"lines">;
|
|
3857
4111
|
angle: z.ZodNumber;
|
|
@@ -3881,6 +4135,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3881
4135
|
y: z.ZodNumber;
|
|
3882
4136
|
}, z.core.$strip>, unknown>;
|
|
3883
4137
|
content: z.ZodString;
|
|
4138
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4139
|
+
start: z.ZodNumber;
|
|
4140
|
+
end: z.ZodNumber;
|
|
4141
|
+
font: z.ZodOptional<z.ZodString>;
|
|
4142
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
4143
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
4144
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
4145
|
+
color: z.ZodOptional<z.ZodString>;
|
|
4146
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
4147
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
4148
|
+
sub: "sub";
|
|
4149
|
+
super: "super";
|
|
4150
|
+
}>>;
|
|
4151
|
+
}, z.core.$strip>>>;
|
|
3884
4152
|
leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
3885
4153
|
x: z.ZodNumber;
|
|
3886
4154
|
y: z.ZodNumber;
|
|
@@ -3941,11 +4209,27 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3941
4209
|
x: z.ZodNumber;
|
|
3942
4210
|
y: z.ZodNumber;
|
|
3943
4211
|
}, z.core.$strip>, unknown>>;
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
4212
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
4213
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
4214
|
+
labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
4215
|
+
along: z.ZodOptional<z.ZodNumber>;
|
|
4216
|
+
across: z.ZodOptional<z.ZodNumber>;
|
|
4217
|
+
content: z.ZodOptional<z.ZodString>;
|
|
4218
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4219
|
+
start: z.ZodNumber;
|
|
4220
|
+
end: z.ZodNumber;
|
|
4221
|
+
font: z.ZodOptional<z.ZodString>;
|
|
4222
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
4223
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
4224
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
4225
|
+
color: z.ZodOptional<z.ZodString>;
|
|
4226
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
4227
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
4228
|
+
sub: "sub";
|
|
4229
|
+
super: "super";
|
|
4230
|
+
}>>;
|
|
4231
|
+
}, z.core.$strip>>>;
|
|
4232
|
+
}, z.core.$strip>>>;
|
|
3949
4233
|
styleId: z.ZodOptional<z.ZodString>;
|
|
3950
4234
|
styleOverride: z.ZodOptional<z.ZodObject<{
|
|
3951
4235
|
font: z.ZodOptional<z.ZodString>;
|
|
@@ -4062,7 +4346,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4062
4346
|
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
4063
4347
|
}, z.core.$strip>>, unknown>;
|
|
4064
4348
|
cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
4065
|
-
|
|
4349
|
+
content: z.ZodDefault<z.ZodString>;
|
|
4350
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4351
|
+
start: z.ZodNumber;
|
|
4352
|
+
end: z.ZodNumber;
|
|
4353
|
+
font: z.ZodOptional<z.ZodString>;
|
|
4354
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
4355
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
4356
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
4357
|
+
color: z.ZodOptional<z.ZodString>;
|
|
4358
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
4359
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
4360
|
+
sub: "sub";
|
|
4361
|
+
super: "super";
|
|
4362
|
+
}>>;
|
|
4363
|
+
}, z.core.$strip>>>;
|
|
4066
4364
|
span: z.ZodOptional<z.ZodObject<{
|
|
4067
4365
|
cols: z.ZodNumber;
|
|
4068
4366
|
rows: z.ZodNumber;
|
|
@@ -4326,6 +4624,10 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4326
4624
|
name: z.ZodString;
|
|
4327
4625
|
angle: z.ZodNumber;
|
|
4328
4626
|
scale: z.ZodNumber;
|
|
4627
|
+
origin: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
4628
|
+
x: z.ZodNumber;
|
|
4629
|
+
y: z.ZodNumber;
|
|
4630
|
+
}, z.core.$strip>, unknown>>;
|
|
4329
4631
|
}, z.core.$strip>, z.ZodObject<{
|
|
4330
4632
|
kind: z.ZodLiteral<"lines">;
|
|
4331
4633
|
angle: z.ZodNumber;
|
|
@@ -4355,6 +4657,20 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4355
4657
|
y: z.ZodNumber;
|
|
4356
4658
|
}, z.core.$strip>, unknown>;
|
|
4357
4659
|
content: z.ZodString;
|
|
4660
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4661
|
+
start: z.ZodNumber;
|
|
4662
|
+
end: z.ZodNumber;
|
|
4663
|
+
font: z.ZodOptional<z.ZodString>;
|
|
4664
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
4665
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
4666
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
4667
|
+
color: z.ZodOptional<z.ZodString>;
|
|
4668
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
4669
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
4670
|
+
sub: "sub";
|
|
4671
|
+
super: "super";
|
|
4672
|
+
}>>;
|
|
4673
|
+
}, z.core.$strip>>>;
|
|
4358
4674
|
leaderLines: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
4359
4675
|
x: z.ZodNumber;
|
|
4360
4676
|
y: z.ZodNumber;
|
|
@@ -4415,11 +4731,27 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4415
4731
|
x: z.ZodNumber;
|
|
4416
4732
|
y: z.ZodNumber;
|
|
4417
4733
|
}, z.core.$strip>, unknown>>;
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4734
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
4735
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
4736
|
+
labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
4737
|
+
along: z.ZodOptional<z.ZodNumber>;
|
|
4738
|
+
across: z.ZodOptional<z.ZodNumber>;
|
|
4739
|
+
content: z.ZodOptional<z.ZodString>;
|
|
4740
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4741
|
+
start: z.ZodNumber;
|
|
4742
|
+
end: z.ZodNumber;
|
|
4743
|
+
font: z.ZodOptional<z.ZodString>;
|
|
4744
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
4745
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
4746
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
4747
|
+
color: z.ZodOptional<z.ZodString>;
|
|
4748
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
4749
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
4750
|
+
sub: "sub";
|
|
4751
|
+
super: "super";
|
|
4752
|
+
}>>;
|
|
4753
|
+
}, z.core.$strip>>>;
|
|
4754
|
+
}, z.core.$strip>>>;
|
|
4423
4755
|
styleId: z.ZodOptional<z.ZodString>;
|
|
4424
4756
|
styleOverride: z.ZodOptional<z.ZodObject<{
|
|
4425
4757
|
font: z.ZodOptional<z.ZodString>;
|
|
@@ -4536,7 +4868,21 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4536
4868
|
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
4537
4869
|
}, z.core.$strip>>, unknown>;
|
|
4538
4870
|
cells: z.ZodArray<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
4539
|
-
|
|
4871
|
+
content: z.ZodDefault<z.ZodString>;
|
|
4872
|
+
spans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4873
|
+
start: z.ZodNumber;
|
|
4874
|
+
end: z.ZodNumber;
|
|
4875
|
+
font: z.ZodOptional<z.ZodString>;
|
|
4876
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
4877
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
4878
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
4879
|
+
color: z.ZodOptional<z.ZodString>;
|
|
4880
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
4881
|
+
script: z.ZodOptional<z.ZodEnum<{
|
|
4882
|
+
sub: "sub";
|
|
4883
|
+
super: "super";
|
|
4884
|
+
}>>;
|
|
4885
|
+
}, z.core.$strip>>>;
|
|
4540
4886
|
span: z.ZodOptional<z.ZodObject<{
|
|
4541
4887
|
cols: z.ZodNumber;
|
|
4542
4888
|
rows: z.ZodNumber;
|
|
@@ -4712,6 +5058,60 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4712
5058
|
}>>;
|
|
4713
5059
|
arrowSize: z.ZodDefault<z.ZodNumber>;
|
|
4714
5060
|
}, z.core.$strip>>;
|
|
5061
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5062
|
+
type: z.ZodLiteral<"add-line-type">;
|
|
5063
|
+
lineType: z.ZodObject<{
|
|
5064
|
+
name: z.ZodString;
|
|
5065
|
+
description: z.ZodOptional<z.ZodString>;
|
|
5066
|
+
dashesMm: z.ZodArray<z.ZodNumber>;
|
|
5067
|
+
}, z.core.$strip>;
|
|
5068
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
5069
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5070
|
+
type: z.ZodLiteral<"update-line-type">;
|
|
5071
|
+
lineType: z.ZodObject<{
|
|
5072
|
+
name: z.ZodString;
|
|
5073
|
+
description: z.ZodOptional<z.ZodString>;
|
|
5074
|
+
dashesMm: z.ZodArray<z.ZodNumber>;
|
|
5075
|
+
}, z.core.$strip>;
|
|
5076
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5077
|
+
type: z.ZodLiteral<"remove-line-type">;
|
|
5078
|
+
name: z.ZodString;
|
|
5079
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5080
|
+
type: z.ZodLiteral<"add-hatch-pattern">;
|
|
5081
|
+
hatchPattern: z.ZodObject<{
|
|
5082
|
+
name: z.ZodString;
|
|
5083
|
+
description: z.ZodOptional<z.ZodString>;
|
|
5084
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
5085
|
+
angle: z.ZodNumber;
|
|
5086
|
+
origin: z.ZodPreprocess<z.ZodObject<{
|
|
5087
|
+
x: z.ZodNumber;
|
|
5088
|
+
y: z.ZodNumber;
|
|
5089
|
+
}, z.core.$strip>, unknown>;
|
|
5090
|
+
deltaX: z.ZodNumber;
|
|
5091
|
+
deltaY: z.ZodNumber;
|
|
5092
|
+
dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
5093
|
+
}, z.core.$strip>>;
|
|
5094
|
+
}, z.core.$strip>;
|
|
5095
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
5096
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5097
|
+
type: z.ZodLiteral<"update-hatch-pattern">;
|
|
5098
|
+
hatchPattern: z.ZodObject<{
|
|
5099
|
+
name: z.ZodString;
|
|
5100
|
+
description: z.ZodOptional<z.ZodString>;
|
|
5101
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
5102
|
+
angle: z.ZodNumber;
|
|
5103
|
+
origin: z.ZodPreprocess<z.ZodObject<{
|
|
5104
|
+
x: z.ZodNumber;
|
|
5105
|
+
y: z.ZodNumber;
|
|
5106
|
+
}, z.core.$strip>, unknown>;
|
|
5107
|
+
deltaX: z.ZodNumber;
|
|
5108
|
+
deltaY: z.ZodNumber;
|
|
5109
|
+
dashesMm: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
5110
|
+
}, z.core.$strip>>;
|
|
5111
|
+
}, z.core.$strip>;
|
|
5112
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5113
|
+
type: z.ZodLiteral<"remove-hatch-pattern">;
|
|
5114
|
+
name: z.ZodString;
|
|
4715
5115
|
}, z.core.$strip>, z.ZodObject<{
|
|
4716
5116
|
type: z.ZodLiteral<"add-dim-style">;
|
|
4717
5117
|
style: z.ZodObject<{
|
|
@@ -4844,6 +5244,8 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4844
5244
|
}, z.core.$strip>], "type">;
|
|
4845
5245
|
type Operation = z.infer<typeof OperationSchema>;
|
|
4846
5246
|
|
|
5247
|
+
type DwgVersion = "AC1015" | "AC1018" | "AC1021" | "AC1024" | "AC1027" | "AC1032";
|
|
5248
|
+
|
|
4847
5249
|
interface DxfImportOptions {
|
|
4848
5250
|
/** mm per drawing unit; overrides the file's $INSUNITS header. */
|
|
4849
5251
|
unitOverride?: number;
|
|
@@ -4854,6 +5256,21 @@ interface DxfImportReport {
|
|
|
4854
5256
|
layouts: number;
|
|
4855
5257
|
objectIds: string[];
|
|
4856
5258
|
layoutIds: string[];
|
|
5259
|
+
/** `SOURCE→what` → entities imported as an approximation. */
|
|
5260
|
+
degraded: Record<string, number>;
|
|
5261
|
+
/** Entity type or reason → entities that produced nothing. */
|
|
5262
|
+
skipped: Record<string, number>;
|
|
5263
|
+
/** Text / dimension styles the file's STYLE / DIMSTYLE tables added
|
|
5264
|
+
* (styles matching an existing one by name and values are reused). */
|
|
5265
|
+
textStyles: number;
|
|
5266
|
+
dimStyles: number;
|
|
5267
|
+
/** Block definitions generated for the file's INSERTs (uniform-scale
|
|
5268
|
+
* inserts become instances of them). */
|
|
5269
|
+
blockDefinitions: number;
|
|
5270
|
+
/** Line type / hatch pattern definitions the file added (LTYPE table
|
|
5271
|
+
* entries the catalogue lacks; HATCH definition lines). */
|
|
5272
|
+
lineTypes: number;
|
|
5273
|
+
hatchPatterns: number;
|
|
4857
5274
|
}
|
|
4858
5275
|
interface PdfImportReport {
|
|
4859
5276
|
objects: number;
|
|
@@ -4914,6 +5331,17 @@ interface DrawingHooks {
|
|
|
4914
5331
|
resolveReference?: (ref: ReferenceObject) => ReferenceContent | null;
|
|
4915
5332
|
/** Snap/hit-test geometry, e.g. from a cache (default: built per call). */
|
|
4916
5333
|
snapEntry?: (obj: ModelObject) => SnapCacheEntry;
|
|
5334
|
+
/** Where the host keeps its marketplace list and how it reaches them
|
|
5335
|
+
* (default: an in-memory list holding the public collection, fetched
|
|
5336
|
+
* with the platform's fetch — folder marketplaces then need a reader). */
|
|
5337
|
+
marketplaces?: MarketplaceHost;
|
|
5338
|
+
}
|
|
5339
|
+
/** A host's marketplace configuration: the list (the editor's settings, a
|
|
5340
|
+
* process's config) and the client that fetches from it. */
|
|
5341
|
+
interface MarketplaceHost {
|
|
5342
|
+
list(): MarketplaceConfig[];
|
|
5343
|
+
set(list: MarketplaceConfig[]): void;
|
|
5344
|
+
client: MarketplaceClient;
|
|
4917
5345
|
}
|
|
4918
5346
|
declare class LocalDrawing implements Drawing$1 {
|
|
4919
5347
|
private hooks;
|
|
@@ -4983,6 +5411,7 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
4983
5411
|
reorderLayers(order: readonly string[]): void;
|
|
4984
5412
|
/** The layer newly added objects default to. */
|
|
4985
5413
|
setCurrentLayer(nameOrId: string): void;
|
|
5414
|
+
updateSettings(patch: Partial<LineaDocument["settings"]>): void;
|
|
4986
5415
|
/**
|
|
4987
5416
|
* Embed image pixels (a data URL) and return the assetId that `image`
|
|
4988
5417
|
* objects reference. Content-keyed: the same data reuses one entry.
|
|
@@ -5005,6 +5434,15 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5005
5434
|
protected pdfWorkerSrc?: string;
|
|
5006
5435
|
private resolveStyle;
|
|
5007
5436
|
private assertStyleName;
|
|
5437
|
+
/** Layouts are addressed by name everywhere (`layout` on the object
|
|
5438
|
+
* tools, remove, reorder, render) — a duplicate would silently resolve to
|
|
5439
|
+
* the first match. */
|
|
5440
|
+
private assertLayoutName;
|
|
5441
|
+
/** Objects reference styles by id, but callers often pass the NAME:
|
|
5442
|
+
* resolve it (text/table → text styles, dimension → dim styles). An
|
|
5443
|
+
* unknown value is refused rather than stored dangling — a dangling
|
|
5444
|
+
* reference renders with the first style and nothing says why. */
|
|
5445
|
+
private styleRef;
|
|
5008
5446
|
listTextStyles(): TextStyle[];
|
|
5009
5447
|
listDimStyles(): DimStyle[];
|
|
5010
5448
|
/** Create a text style (unique name; unset fields take the defaults);
|
|
@@ -5013,6 +5451,14 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5013
5451
|
name: string;
|
|
5014
5452
|
} & Partial<Omit<TextStyle, "id">>): string;
|
|
5015
5453
|
updateTextStyle(nameOrId: string, patch: Partial<Omit<TextStyle, "id">>): void;
|
|
5454
|
+
listLineTypes(): LineType[];
|
|
5455
|
+
addLineTypes(lineTypes: readonly LineType[]): void;
|
|
5456
|
+
updateLineType(name: string, patch: Partial<LineType>): void;
|
|
5457
|
+
removeLineType(name: string): void;
|
|
5458
|
+
listHatchPatterns(): DocumentHatchPattern[];
|
|
5459
|
+
addHatchPatterns(patterns: readonly DocumentHatchPattern[]): void;
|
|
5460
|
+
updateHatchPattern(name: string, patch: Partial<DocumentHatchPattern>): void;
|
|
5461
|
+
removeHatchPattern(name: string): void;
|
|
5016
5462
|
/** Remove a text style no object uses (the kernel refuses otherwise). */
|
|
5017
5463
|
removeTextStyle(nameOrId: string): void;
|
|
5018
5464
|
/** Create a dimension style (unique name; unset fields take the
|
|
@@ -5050,6 +5496,16 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5050
5496
|
listUserCommands(): CommandMeta[];
|
|
5051
5497
|
addBlockDefinitions(sources: readonly string[]): Promise<MergeReport>;
|
|
5052
5498
|
addUserCommands(sources: readonly string[]): Promise<MergeReport>;
|
|
5499
|
+
/** The host's marketplace list + client; a bare drawing gets an in-memory
|
|
5500
|
+
* list holding the public collection. */
|
|
5501
|
+
protected get marketplaceHost(): MarketplaceHost;
|
|
5502
|
+
/** Replace the host's marketplace configuration (SDK / server config). */
|
|
5503
|
+
setMarketplaceHost(host: MarketplaceHost): void;
|
|
5504
|
+
listMarketplaces(): MarketplaceInfo[];
|
|
5505
|
+
addMarketplaces(list: readonly MarketplaceConfig[]): Promise<MarketplaceInfo[]>;
|
|
5506
|
+
removeMarketplaces(names: readonly string[]): MarketplaceInfo[];
|
|
5507
|
+
searchMarketplaces(q?: MarketplaceQuery): Promise<MarketplaceHit[]>;
|
|
5508
|
+
installMarketplaceEntries(ids: readonly string[], marketplace?: string): Promise<MergeReport>;
|
|
5053
5509
|
/** Remove a block module by its exported id (unknown id → error). */
|
|
5054
5510
|
removeBlockDefinition(id: string): void;
|
|
5055
5511
|
/** Remove a command module by its exported id (unknown id → error). */
|
|
@@ -5138,6 +5594,13 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5138
5594
|
listObjects(filter?: QueryFilter): ModelObject[];
|
|
5139
5595
|
summary(): DocumentSummary;
|
|
5140
5596
|
protected paintContext(): {
|
|
5597
|
+
layers: readonly Layer[];
|
|
5598
|
+
dimStyles: readonly DimStyle[];
|
|
5599
|
+
textStyles: readonly TextStyle[];
|
|
5600
|
+
lineTypes: readonly LineType[];
|
|
5601
|
+
hatchPatterns: readonly DocumentHatchPattern[];
|
|
5602
|
+
blockDefinitions: readonly string[];
|
|
5603
|
+
assets?: Readonly<Record<string, string>>;
|
|
5141
5604
|
objects: ({
|
|
5142
5605
|
id: string;
|
|
5143
5606
|
layerId: string;
|
|
@@ -5146,12 +5609,8 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5146
5609
|
lineTypeScale?: number | undefined;
|
|
5147
5610
|
lineWidth?: number | undefined;
|
|
5148
5611
|
opacity?: number | undefined;
|
|
5149
|
-
type: "
|
|
5150
|
-
|
|
5151
|
-
x: number;
|
|
5152
|
-
y: number;
|
|
5153
|
-
};
|
|
5154
|
-
b: {
|
|
5612
|
+
type: "point";
|
|
5613
|
+
p: {
|
|
5155
5614
|
x: number;
|
|
5156
5615
|
y: number;
|
|
5157
5616
|
};
|
|
@@ -5163,8 +5622,12 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5163
5622
|
lineTypeScale?: number | undefined;
|
|
5164
5623
|
lineWidth?: number | undefined;
|
|
5165
5624
|
opacity?: number | undefined;
|
|
5166
|
-
type: "
|
|
5167
|
-
|
|
5625
|
+
type: "line";
|
|
5626
|
+
a: {
|
|
5627
|
+
x: number;
|
|
5628
|
+
y: number;
|
|
5629
|
+
};
|
|
5630
|
+
b: {
|
|
5168
5631
|
x: number;
|
|
5169
5632
|
y: number;
|
|
5170
5633
|
};
|
|
@@ -5256,6 +5719,10 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5256
5719
|
name: string;
|
|
5257
5720
|
angle: number;
|
|
5258
5721
|
scale: number;
|
|
5722
|
+
origin?: {
|
|
5723
|
+
x: number;
|
|
5724
|
+
y: number;
|
|
5725
|
+
} | undefined;
|
|
5259
5726
|
} | {
|
|
5260
5727
|
kind: "lines";
|
|
5261
5728
|
angle: number;
|
|
@@ -5282,6 +5749,17 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5282
5749
|
y: number;
|
|
5283
5750
|
};
|
|
5284
5751
|
content: string;
|
|
5752
|
+
spans?: {
|
|
5753
|
+
start: number;
|
|
5754
|
+
end: number;
|
|
5755
|
+
font?: string | undefined;
|
|
5756
|
+
bold?: boolean | undefined;
|
|
5757
|
+
italic?: boolean | undefined;
|
|
5758
|
+
underline?: boolean | undefined;
|
|
5759
|
+
color?: string | undefined;
|
|
5760
|
+
height?: number | undefined;
|
|
5761
|
+
script?: "sub" | "super" | undefined;
|
|
5762
|
+
}[] | undefined;
|
|
5285
5763
|
leaderLines: {
|
|
5286
5764
|
x: number;
|
|
5287
5765
|
y: number;
|
|
@@ -5316,11 +5794,24 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5316
5794
|
x: number;
|
|
5317
5795
|
y: number;
|
|
5318
5796
|
}[];
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5797
|
+
rotation?: number | undefined;
|
|
5798
|
+
offset?: number | undefined;
|
|
5799
|
+
labels: {
|
|
5800
|
+
along?: number | undefined;
|
|
5801
|
+
across?: number | undefined;
|
|
5802
|
+
content?: string | undefined;
|
|
5803
|
+
spans?: {
|
|
5804
|
+
start: number;
|
|
5805
|
+
end: number;
|
|
5806
|
+
font?: string | undefined;
|
|
5807
|
+
bold?: boolean | undefined;
|
|
5808
|
+
italic?: boolean | undefined;
|
|
5809
|
+
underline?: boolean | undefined;
|
|
5810
|
+
color?: string | undefined;
|
|
5811
|
+
height?: number | undefined;
|
|
5812
|
+
script?: "sub" | "super" | undefined;
|
|
5813
|
+
}[] | undefined;
|
|
5814
|
+
}[];
|
|
5324
5815
|
styleId?: string | undefined;
|
|
5325
5816
|
styleOverride?: {
|
|
5326
5817
|
font?: string | undefined;
|
|
@@ -5428,7 +5919,18 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5428
5919
|
minHeight?: number | undefined;
|
|
5429
5920
|
}[];
|
|
5430
5921
|
cells: {
|
|
5431
|
-
|
|
5922
|
+
content: string;
|
|
5923
|
+
spans?: {
|
|
5924
|
+
start: number;
|
|
5925
|
+
end: number;
|
|
5926
|
+
font?: string | undefined;
|
|
5927
|
+
bold?: boolean | undefined;
|
|
5928
|
+
italic?: boolean | undefined;
|
|
5929
|
+
underline?: boolean | undefined;
|
|
5930
|
+
color?: string | undefined;
|
|
5931
|
+
height?: number | undefined;
|
|
5932
|
+
script?: "sub" | "super" | undefined;
|
|
5933
|
+
}[] | undefined;
|
|
5432
5934
|
span?: {
|
|
5433
5935
|
cols: number;
|
|
5434
5936
|
rows: number;
|
|
@@ -5504,45 +6006,6 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5504
6006
|
maxY: number;
|
|
5505
6007
|
} | undefined;
|
|
5506
6008
|
})[];
|
|
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
6009
|
resolveObject: (id: string) => ModelObject | undefined;
|
|
5547
6010
|
resolveReference: (ref: ReferenceObject) => ReferenceContent | null;
|
|
5548
6011
|
};
|
|
@@ -5614,6 +6077,8 @@ interface DocumentSummary {
|
|
|
5614
6077
|
name: string;
|
|
5615
6078
|
objectCount: number;
|
|
5616
6079
|
}[];
|
|
6080
|
+
/** Document-wide settings (`units`). */
|
|
6081
|
+
settings: LineaDocument["settings"];
|
|
5617
6082
|
}
|
|
5618
6083
|
interface RenderSvgOptions {
|
|
5619
6084
|
/** Render this paper layout (name or id) instead of model space. */
|
|
@@ -5760,6 +6225,9 @@ interface Drawing$1 {
|
|
|
5760
6225
|
reorderLayers(order: readonly string[]): void;
|
|
5761
6226
|
/** The layer newly added objects default to (a mode, not an edit). */
|
|
5762
6227
|
setCurrentLayer(nameOrId: string): void;
|
|
6228
|
+
/** Document-wide settings, merged over the current record (`units` is
|
|
6229
|
+
* declarative for now: everything is stored in mm). */
|
|
6230
|
+
updateSettings(patch: Partial<LineaDocument["settings"]>): void;
|
|
5763
6231
|
listTextStyles(): TextStyle[];
|
|
5764
6232
|
listDimStyles(): DimStyle[];
|
|
5765
6233
|
/** Create a style (name unique, case-insensitive; unset fields take the
|
|
@@ -5779,6 +6247,24 @@ interface Drawing$1 {
|
|
|
5779
6247
|
setDimStyle(patch: Partial<DimStyle>, styleId?: string): void;
|
|
5780
6248
|
/** @deprecated Use updateTextStyle (default here: the first style). */
|
|
5781
6249
|
setTextStyle(patch: Partial<TextStyle>, styleId?: string): void;
|
|
6250
|
+
/** The document's own line type definitions (name-keyed; objects and
|
|
6251
|
+
* layers reference line types by NAME, these ahead of the built-in
|
|
6252
|
+
* catalogue). */
|
|
6253
|
+
listLineTypes(): LineType[];
|
|
6254
|
+
/** Add definitions (names unique, case-insensitive; a clash is refused).
|
|
6255
|
+
* `dashesMm`: signed dash cycle per 1 mm of line width — >0 dash, <0 gap,
|
|
6256
|
+
* 0 dot. */
|
|
6257
|
+
addLineTypes(lineTypes: readonly LineType[]): void;
|
|
6258
|
+
updateLineType(name: string, patch: Partial<LineType>): void;
|
|
6259
|
+
/** Remove a definition; objects still naming it fall back to the
|
|
6260
|
+
* catalogue or continuous. */
|
|
6261
|
+
removeLineType(name: string): void;
|
|
6262
|
+
/** The document's own hatch pattern definitions (same model: fills
|
|
6263
|
+
* reference patterns by NAME, these ahead of the catalogue). */
|
|
6264
|
+
listHatchPatterns(): DocumentHatchPattern[];
|
|
6265
|
+
addHatchPatterns(patterns: readonly DocumentHatchPattern[]): void;
|
|
6266
|
+
updateHatchPattern(name: string, patch: Partial<DocumentHatchPattern>): void;
|
|
6267
|
+
removeHatchPattern(name: string): void;
|
|
5782
6268
|
/** Embed image pixels (a data URL); returns the content-keyed assetId. */
|
|
5783
6269
|
addAsset(dataUrl: string): string;
|
|
5784
6270
|
/** Remove an asset (refused while an image references it). */
|
|
@@ -5799,6 +6285,21 @@ interface Drawing$1 {
|
|
|
5799
6285
|
removeBlockDefinition(id: string): void;
|
|
5800
6286
|
addUserCommands(sources: readonly string[]): Promise<MergeReport>;
|
|
5801
6287
|
removeUserCommand(id: string): void;
|
|
6288
|
+
/** The host's configured marketplaces, priority order, tokens hidden. */
|
|
6289
|
+
listMarketplaces(): MarketplaceInfo[];
|
|
6290
|
+
/** Add marketplaces at the top of the priority list (a repeated key
|
|
6291
|
+
* replaces in place, e.g. to update a token). Each catalog must be
|
|
6292
|
+
* fetchable, else the call throws with the reason. */
|
|
6293
|
+
addMarketplaces(list: readonly MarketplaceConfig[]): Promise<MarketplaceInfo[]>;
|
|
6294
|
+
/** Remove by key, spec, folder or label; the built-in collection stays. */
|
|
6295
|
+
removeMarketplaces(names: readonly string[]): MarketplaceInfo[];
|
|
6296
|
+
/** Entries across the configured marketplaces (first publisher of an id
|
|
6297
|
+
* wins), with each one's install status against this document. */
|
|
6298
|
+
searchMarketplaces(q?: MarketplaceQuery): Promise<MarketplaceHit[]>;
|
|
6299
|
+
/** Install (or update) entries by id — declared block dependencies
|
|
6300
|
+
* first, from the first marketplace publishing the id (or the named
|
|
6301
|
+
* one) — as one undo step. */
|
|
6302
|
+
installMarketplaceEntries(ids: readonly string[], marketplace?: string): Promise<MergeReport>;
|
|
5802
6303
|
/** Escape hatch: apply an already-shaped op batch (validated, atomic,
|
|
5803
6304
|
* one undo step). */
|
|
5804
6305
|
applyOps(ops: readonly Operation[]): void;
|
|
@@ -5878,6 +6379,10 @@ declare class Drawing extends LocalDrawing {
|
|
|
5878
6379
|
from: number;
|
|
5879
6380
|
to: number;
|
|
5880
6381
|
} | null);
|
|
6382
|
+
/** The marketplaces this drawing searches and installs from, in priority
|
|
6383
|
+
* order (the public collection is always present, last by default) —
|
|
6384
|
+
* process configuration, nothing is written to the file. */
|
|
6385
|
+
configureMarketplaces(list: readonly MarketplaceConfig[]): void;
|
|
5881
6386
|
/** The file this drawing was opened from / last saved to, if any. */
|
|
5882
6387
|
get filePath(): string | undefined;
|
|
5883
6388
|
/** Block scripts compiled AND referenced files loaded (relative paths
|
|
@@ -5916,10 +6421,16 @@ declare class Drawing extends LocalDrawing {
|
|
|
5916
6421
|
}
|
|
5917
6422
|
/** A fresh empty document, optionally named (until saved to a file, whose
|
|
5918
6423
|
* name then takes over). */
|
|
5919
|
-
|
|
6424
|
+
interface DrawingOptions {
|
|
6425
|
+
/** Marketplaces to search and install from, in priority order (the
|
|
6426
|
+
* public collection is appended when missing). Default: the public
|
|
6427
|
+
* collection alone. */
|
|
6428
|
+
marketplaces?: readonly MarketplaceConfig[];
|
|
6429
|
+
}
|
|
6430
|
+
declare function newDrawing(name?: string, options?: DrawingOptions): Drawing;
|
|
5920
6431
|
/** Parse a `.linea` JSON string. */
|
|
5921
6432
|
declare function drawingFromJson(text: string): Drawing;
|
|
5922
6433
|
/** Open a `.linea` file (parse + migrate) into an in-process kernel. */
|
|
5923
|
-
declare function openDrawing(path: string): Promise<Drawing>;
|
|
6434
|
+
declare function openDrawing(path: string, options?: DrawingOptions): Promise<Drawing>;
|
|
5924
6435
|
|
|
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 };
|
|
6436
|
+
export { type AABB, type AddOptions, type BlockMeta, type CommandMeta, type DimStyle, type DocumentSummary, Drawing, type Drawing$1 as DrawingApi, type DrawingOptions, type DxfImportOptions, type DxfImportReport, type EditorSurface, type Layer, type LayerInfo, type LayoutOptions, type LayoutPatch, type LineaDocument, type MarketplaceConfig, type MarketplaceHit, type MarketplaceInfo, type MarketplaceQuery, type Measurement, type MergeReport, type ModelObject, type ModelObjectType, type ObjectInput, type Operation, type PaperLayout, type PdfImportReport, type RenderPdfOptions as PdfOptions, type RenderPngOptions as PngOptions, type PointInput, type PrintPalette, type QueryFilter, type SheetName, type RenderSvgOptions as SvgOptions, type TextMeasurer, type TextStyle, type Vec2, type ViewportOptions, drawingFromJson, ensureScriptTranspiler, getBlockMetaResult, getCommandMetaResult, newDrawing, openDrawing, parseScale, renderBlockThumbnailSvg, testBlockDefinition };
|