lineadraw 0.9.0 → 0.10.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 +137 -14
- package/dist/{chunk-BQCSFVAF.js → chunk-YYJAXJOY.js} +4037 -1180
- package/dist/chunk-YYJAXJOY.js.map +1 -0
- package/dist/{exportDxf-T2RTSTH5.js → exportDxf-C4CLQCC3.js} +2 -2
- package/dist/sdk.d.ts +259 -42
- package/dist/sdk.js +127 -66
- package/dist/sdk.js.map +1 -1
- package/lineadraw.d.ts +505 -37
- package/package.json +2 -2
- package/templates/README.md +6 -4
- package/dist/chunk-BQCSFVAF.js.map +0 -1
- /package/dist/{exportDxf-T2RTSTH5.js.map → exportDxf-C4CLQCC3.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DWG_DXF_OPTIONS,
|
|
3
3
|
buildDxf
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YYJAXJOY.js";
|
|
5
5
|
import "./chunk-PZ5AY32C.js";
|
|
6
6
|
export {
|
|
7
7
|
DWG_DXF_OPTIONS,
|
|
8
8
|
buildDxf
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=exportDxf-
|
|
10
|
+
//# sourceMappingURL=exportDxf-C4CLQCC3.js.map
|
package/dist/sdk.d.ts
CHANGED
|
@@ -89,6 +89,31 @@ declare const DimStyleSchema: z.ZodObject<{
|
|
|
89
89
|
precision: z.ZodDefault<z.ZodNumber>;
|
|
90
90
|
}, z.core.$strip>;
|
|
91
91
|
type DimStyle$1 = z.infer<typeof DimStyleSchema>;
|
|
92
|
+
declare const BlockSchema: z.ZodObject<{
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
layerId: z.ZodString;
|
|
95
|
+
color: z.ZodOptional<z.ZodString>;
|
|
96
|
+
lineType: z.ZodOptional<z.ZodString>;
|
|
97
|
+
lineTypeScale: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
type: z.ZodLiteral<"block">;
|
|
101
|
+
definitionId: z.ZodString;
|
|
102
|
+
rotation: z.ZodDefault<z.ZodNumber>;
|
|
103
|
+
scale: z.ZodDefault<z.ZodNumber>;
|
|
104
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodJSONSchema]>>>;
|
|
105
|
+
inputs: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
106
|
+
x: z.ZodNumber;
|
|
107
|
+
y: z.ZodNumber;
|
|
108
|
+
}, z.core.$strip>, unknown>, z.ZodString]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
109
|
+
x: z.ZodNumber;
|
|
110
|
+
y: z.ZodNumber;
|
|
111
|
+
}, z.core.$strip>, unknown>, z.ZodString, z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
112
|
+
x: z.ZodNumber;
|
|
113
|
+
y: z.ZodNumber;
|
|
114
|
+
}, z.core.$strip>, unknown>>, z.ZodArray<z.ZodString>]>>]>>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
type Block = z.infer<typeof BlockSchema>;
|
|
92
117
|
/**
|
|
93
118
|
* A LINKED file drawn in place (an xref): the document holds this record,
|
|
94
119
|
* never the file. The file's model space lands with its origin at
|
|
@@ -435,11 +460,17 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
435
460
|
definitionId: z.ZodString;
|
|
436
461
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
437
462
|
scale: z.ZodDefault<z.ZodNumber>;
|
|
438
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString
|
|
439
|
-
inputs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
463
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodJSONSchema]>>>;
|
|
464
|
+
inputs: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
465
|
+
x: z.ZodNumber;
|
|
466
|
+
y: z.ZodNumber;
|
|
467
|
+
}, z.core.$strip>, unknown>, z.ZodString]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
468
|
+
x: z.ZodNumber;
|
|
469
|
+
y: z.ZodNumber;
|
|
470
|
+
}, z.core.$strip>, unknown>, z.ZodString, z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
440
471
|
x: z.ZodNumber;
|
|
441
472
|
y: z.ZodNumber;
|
|
442
|
-
}, z.core.$strip>, unknown
|
|
473
|
+
}, z.core.$strip>, unknown>>, z.ZodArray<z.ZodString>]>>]>>;
|
|
443
474
|
}, z.core.$strip>, z.ZodObject<{
|
|
444
475
|
id: z.ZodString;
|
|
445
476
|
layerId: z.ZodString;
|
|
@@ -666,7 +697,7 @@ type Layer = z.infer<typeof LayerSchema>;
|
|
|
666
697
|
declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
667
698
|
id: z.ZodDefault<z.ZodString>;
|
|
668
699
|
type: z.ZodDefault<z.ZodLiteral<"lineadraw">>;
|
|
669
|
-
version: z.ZodLiteral<
|
|
700
|
+
version: z.ZodLiteral<24>;
|
|
670
701
|
settings: z.ZodDefault<z.ZodObject<{
|
|
671
702
|
units: z.ZodDefault<z.ZodEnum<{
|
|
672
703
|
in: "in";
|
|
@@ -968,11 +999,17 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
968
999
|
definitionId: z.ZodString;
|
|
969
1000
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
970
1001
|
scale: z.ZodDefault<z.ZodNumber>;
|
|
971
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString
|
|
972
|
-
inputs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
1002
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodJSONSchema]>>>;
|
|
1003
|
+
inputs: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
973
1004
|
x: z.ZodNumber;
|
|
974
1005
|
y: z.ZodNumber;
|
|
975
|
-
}, z.core.$strip>, unknown>, z.ZodString]
|
|
1006
|
+
}, z.core.$strip>, unknown>, z.ZodString]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
1007
|
+
x: z.ZodNumber;
|
|
1008
|
+
y: z.ZodNumber;
|
|
1009
|
+
}, z.core.$strip>, unknown>, z.ZodString, z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
1010
|
+
x: z.ZodNumber;
|
|
1011
|
+
y: z.ZodNumber;
|
|
1012
|
+
}, z.core.$strip>, unknown>>, z.ZodArray<z.ZodString>]>>]>>;
|
|
976
1013
|
}, z.core.$strip>, z.ZodObject<{
|
|
977
1014
|
id: z.ZodString;
|
|
978
1015
|
layerId: z.ZodString;
|
|
@@ -1453,11 +1490,17 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
1453
1490
|
definitionId: z.ZodString;
|
|
1454
1491
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
1455
1492
|
scale: z.ZodDefault<z.ZodNumber>;
|
|
1456
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString
|
|
1457
|
-
inputs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
1493
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodJSONSchema]>>>;
|
|
1494
|
+
inputs: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
1495
|
+
x: z.ZodNumber;
|
|
1496
|
+
y: z.ZodNumber;
|
|
1497
|
+
}, z.core.$strip>, unknown>, z.ZodString]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
1458
1498
|
x: z.ZodNumber;
|
|
1459
1499
|
y: z.ZodNumber;
|
|
1460
|
-
}, z.core.$strip>, unknown>, z.ZodString
|
|
1500
|
+
}, z.core.$strip>, unknown>, z.ZodString, z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
1501
|
+
x: z.ZodNumber;
|
|
1502
|
+
y: z.ZodNumber;
|
|
1503
|
+
}, z.core.$strip>, unknown>>, z.ZodArray<z.ZodString>]>>]>>;
|
|
1461
1504
|
}, z.core.$strip>, z.ZodObject<{
|
|
1462
1505
|
id: z.ZodString;
|
|
1463
1506
|
layerId: z.ZodString;
|
|
@@ -1813,6 +1856,12 @@ declare const ParamDefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1813
1856
|
hint: z.ZodOptional<z.ZodString>;
|
|
1814
1857
|
type: z.ZodLiteral<"hatchPattern">;
|
|
1815
1858
|
default: z.ZodDefault<z.ZodString>;
|
|
1859
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1860
|
+
name: z.ZodString;
|
|
1861
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1862
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
1863
|
+
type: z.ZodLiteral<"data">;
|
|
1864
|
+
default: z.ZodJSONSchema;
|
|
1816
1865
|
}, z.core.$strip>, z.ZodObject<{
|
|
1817
1866
|
name: z.ZodString;
|
|
1818
1867
|
label: z.ZodOptional<z.ZodString>;
|
|
@@ -1910,6 +1959,73 @@ declare const ParamDefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1910
1959
|
}, z.core.$strip>], "type">>;
|
|
1911
1960
|
}, z.core.$strip>], "type">;
|
|
1912
1961
|
type ParamDef = z.infer<typeof ParamDefSchema>;
|
|
1962
|
+
declare const InputDefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1963
|
+
name: z.ZodString;
|
|
1964
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1965
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1966
|
+
type: z.ZodLiteral<"point">;
|
|
1967
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
1968
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1969
|
+
name: z.ZodString;
|
|
1970
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1971
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1972
|
+
type: z.ZodLiteral<"points">;
|
|
1973
|
+
min: z.ZodDefault<z.ZodNumber>;
|
|
1974
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
1975
|
+
closed: z.ZodDefault<z.ZodBoolean>;
|
|
1976
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1977
|
+
name: z.ZodString;
|
|
1978
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1979
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1980
|
+
type: z.ZodLiteral<"object">;
|
|
1981
|
+
types: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
1982
|
+
arc: "arc";
|
|
1983
|
+
block: "block";
|
|
1984
|
+
circle: "circle";
|
|
1985
|
+
comment: "comment";
|
|
1986
|
+
dimension: "dimension";
|
|
1987
|
+
ellipse: "ellipse";
|
|
1988
|
+
hatch: "hatch";
|
|
1989
|
+
line: "line";
|
|
1990
|
+
point: "point";
|
|
1991
|
+
polyline: "polyline";
|
|
1992
|
+
reference: "reference";
|
|
1993
|
+
table: "table";
|
|
1994
|
+
text: "text";
|
|
1995
|
+
viewport: "viewport";
|
|
1996
|
+
}>>>;
|
|
1997
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
1998
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1999
|
+
name: z.ZodString;
|
|
2000
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2001
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2002
|
+
type: z.ZodLiteral<"objects">;
|
|
2003
|
+
types: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
2004
|
+
arc: "arc";
|
|
2005
|
+
block: "block";
|
|
2006
|
+
circle: "circle";
|
|
2007
|
+
comment: "comment";
|
|
2008
|
+
dimension: "dimension";
|
|
2009
|
+
ellipse: "ellipse";
|
|
2010
|
+
hatch: "hatch";
|
|
2011
|
+
line: "line";
|
|
2012
|
+
point: "point";
|
|
2013
|
+
polyline: "polyline";
|
|
2014
|
+
reference: "reference";
|
|
2015
|
+
table: "table";
|
|
2016
|
+
text: "text";
|
|
2017
|
+
viewport: "viewport";
|
|
2018
|
+
}>>>;
|
|
2019
|
+
min: z.ZodDefault<z.ZodNumber>;
|
|
2020
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
2021
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2022
|
+
name: z.ZodString;
|
|
2023
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2024
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2025
|
+
type: z.ZodLiteral<"host">;
|
|
2026
|
+
types: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
2027
|
+
}, z.core.$strip>], "type">;
|
|
2028
|
+
type InputDef = z.infer<typeof InputDefSchema>;
|
|
1913
2029
|
|
|
1914
2030
|
/** ISO A-series portrait sizes in mm [width, height]. */
|
|
1915
2031
|
declare const SHEET_PRESETS: {
|
|
@@ -2243,11 +2359,17 @@ declare const PaperLayoutSchema: z.ZodObject<{
|
|
|
2243
2359
|
definitionId: z.ZodString;
|
|
2244
2360
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
2245
2361
|
scale: z.ZodDefault<z.ZodNumber>;
|
|
2246
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString
|
|
2247
|
-
inputs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
2362
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodJSONSchema]>>>;
|
|
2363
|
+
inputs: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
2248
2364
|
x: z.ZodNumber;
|
|
2249
2365
|
y: z.ZodNumber;
|
|
2250
|
-
}, z.core.$strip>, unknown>, z.ZodString]
|
|
2366
|
+
}, z.core.$strip>, unknown>, z.ZodString]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
2367
|
+
x: z.ZodNumber;
|
|
2368
|
+
y: z.ZodNumber;
|
|
2369
|
+
}, z.core.$strip>, unknown>, z.ZodString, z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
2370
|
+
x: z.ZodNumber;
|
|
2371
|
+
y: z.ZodNumber;
|
|
2372
|
+
}, z.core.$strip>, unknown>>, z.ZodArray<z.ZodString>]>>]>>;
|
|
2251
2373
|
}, z.core.$strip>, z.ZodObject<{
|
|
2252
2374
|
id: z.ZodString;
|
|
2253
2375
|
layerId: z.ZodString;
|
|
@@ -2448,6 +2570,15 @@ type ModuleExecutor = (script: string) => Record<string, unknown>;
|
|
|
2448
2570
|
* Shared by block AND command modules. */
|
|
2449
2571
|
declare const ensureScriptTranspiler: () => Promise<ModuleExecutor>;
|
|
2450
2572
|
|
|
2573
|
+
/**
|
|
2574
|
+
* Looks up a referenced object by id — supplied by whoever owns the
|
|
2575
|
+
* document (ids are document-unique, so a document-wide lookup is correct).
|
|
2576
|
+
*/
|
|
2577
|
+
type BlockObjectResolver = ((id: string) => ModelObject | undefined) & {
|
|
2578
|
+
/** Every block instance in the document (all spaces) — how a host finds
|
|
2579
|
+
* what lives on it (hostedOf). Absent → hosts see no `hosted`. */
|
|
2580
|
+
blocks?: () => readonly Block[];
|
|
2581
|
+
};
|
|
2451
2582
|
/** Identity + metadata derived from a block module's exports. The optional
|
|
2452
2583
|
* fields are marketplace/listing metadata (docs/block-marketplace.md) —
|
|
2453
2584
|
* absent ones change nothing about evaluation. */
|
|
@@ -2463,6 +2594,10 @@ interface BlockMeta {
|
|
|
2463
2594
|
* Declared (a param-dependent path may emit only sometimes), but the
|
|
2464
2595
|
* save-time dry run REJECTS emitted instances that are not declared. */
|
|
2465
2596
|
dependencies?: string[];
|
|
2597
|
+
/** The declared input table (`inputs` member) — instances of a module
|
|
2598
|
+
* with one store their inputs as a record by name. Absent for the
|
|
2599
|
+
* positional forms (`place` labels / function, or no `place`). */
|
|
2600
|
+
inputs?: InputDef[];
|
|
2466
2601
|
}
|
|
2467
2602
|
/** Non-throwing meta lookup for list UIs. */
|
|
2468
2603
|
type BlockMetaResult = {
|
|
@@ -2677,14 +2812,23 @@ interface CommandMeta {
|
|
|
2677
2812
|
version?: string;
|
|
2678
2813
|
authors?: string[];
|
|
2679
2814
|
tags?: string[];
|
|
2680
|
-
/** Declared
|
|
2681
|
-
*
|
|
2682
|
-
|
|
2815
|
+
/** Declared inputs, as declared: point LABELS (positional — `ctx.inputs`
|
|
2816
|
+
* is an array) or an input TABLE (named — `ctx.inputs` is a record;
|
|
2817
|
+
* object inputs take the selection first). Acquired before `run`: picked
|
|
2818
|
+
* in the editor, or supplied up front by a headless/remote caller. */
|
|
2819
|
+
inputs?: string[] | CommandInputDef[];
|
|
2820
|
+
/** Asks during the run (editor.pickPoint / prompt / ask), so it can't
|
|
2821
|
+
* run headless: headless runners refuse it up front. */
|
|
2822
|
+
requiresEditor?: boolean;
|
|
2683
2823
|
/** Declared parameters (the blocks' ParamDef table): prompted in the
|
|
2684
2824
|
* editor before `run`, or passed by a headless caller; arrive as
|
|
2685
2825
|
* `ctx.params`. Absent when the command declares none. */
|
|
2686
2826
|
params?: ParamDef[];
|
|
2687
2827
|
}
|
|
2828
|
+
/** A command input: any input kind but `host` (block-only). */
|
|
2829
|
+
type CommandInputDef = Exclude<InputDef, {
|
|
2830
|
+
type: "host";
|
|
2831
|
+
}>;
|
|
2688
2832
|
/** Non-throwing meta lookup for list UIs. */
|
|
2689
2833
|
type CommandMetaResult = {
|
|
2690
2834
|
ok: true;
|
|
@@ -3156,11 +3300,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3156
3300
|
definitionId: z.ZodString;
|
|
3157
3301
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
3158
3302
|
scale: z.ZodDefault<z.ZodNumber>;
|
|
3159
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString
|
|
3160
|
-
inputs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
3303
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodJSONSchema]>>>;
|
|
3304
|
+
inputs: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
3305
|
+
x: z.ZodNumber;
|
|
3306
|
+
y: z.ZodNumber;
|
|
3307
|
+
}, z.core.$strip>, unknown>, z.ZodString]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
3308
|
+
x: z.ZodNumber;
|
|
3309
|
+
y: z.ZodNumber;
|
|
3310
|
+
}, z.core.$strip>, unknown>, z.ZodString, z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
3161
3311
|
x: z.ZodNumber;
|
|
3162
3312
|
y: z.ZodNumber;
|
|
3163
|
-
}, z.core.$strip>, unknown
|
|
3313
|
+
}, z.core.$strip>, unknown>>, z.ZodArray<z.ZodString>]>>]>>;
|
|
3164
3314
|
}, z.core.$strip>, z.ZodObject<{
|
|
3165
3315
|
id: z.ZodString;
|
|
3166
3316
|
layerId: z.ZodString;
|
|
@@ -3635,11 +3785,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3635
3785
|
definitionId: z.ZodString;
|
|
3636
3786
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
3637
3787
|
scale: z.ZodDefault<z.ZodNumber>;
|
|
3638
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString
|
|
3639
|
-
inputs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
3788
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodJSONSchema]>>>;
|
|
3789
|
+
inputs: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
3640
3790
|
x: z.ZodNumber;
|
|
3641
3791
|
y: z.ZodNumber;
|
|
3642
|
-
}, z.core.$strip>, unknown>, z.ZodString]
|
|
3792
|
+
}, z.core.$strip>, unknown>, z.ZodString]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
3793
|
+
x: z.ZodNumber;
|
|
3794
|
+
y: z.ZodNumber;
|
|
3795
|
+
}, z.core.$strip>, unknown>, z.ZodString, z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
3796
|
+
x: z.ZodNumber;
|
|
3797
|
+
y: z.ZodNumber;
|
|
3798
|
+
}, z.core.$strip>, unknown>>, z.ZodArray<z.ZodString>]>>]>>;
|
|
3643
3799
|
}, z.core.$strip>, z.ZodObject<{
|
|
3644
3800
|
id: z.ZodString;
|
|
3645
3801
|
layerId: z.ZodString;
|
|
@@ -4196,11 +4352,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4196
4352
|
definitionId: z.ZodString;
|
|
4197
4353
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
4198
4354
|
scale: z.ZodDefault<z.ZodNumber>;
|
|
4199
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString
|
|
4200
|
-
inputs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
4355
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodJSONSchema]>>>;
|
|
4356
|
+
inputs: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
4357
|
+
x: z.ZodNumber;
|
|
4358
|
+
y: z.ZodNumber;
|
|
4359
|
+
}, z.core.$strip>, unknown>, z.ZodString]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
4201
4360
|
x: z.ZodNumber;
|
|
4202
4361
|
y: z.ZodNumber;
|
|
4203
|
-
}, z.core.$strip>, unknown>, z.ZodString
|
|
4362
|
+
}, z.core.$strip>, unknown>, z.ZodString, z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
4363
|
+
x: z.ZodNumber;
|
|
4364
|
+
y: z.ZodNumber;
|
|
4365
|
+
}, z.core.$strip>, unknown>>, z.ZodArray<z.ZodString>]>>]>>;
|
|
4204
4366
|
}, z.core.$strip>, z.ZodObject<{
|
|
4205
4367
|
id: z.ZodString;
|
|
4206
4368
|
layerId: z.ZodString;
|
|
@@ -4704,11 +4866,17 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4704
4866
|
definitionId: z.ZodString;
|
|
4705
4867
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
4706
4868
|
scale: z.ZodDefault<z.ZodNumber>;
|
|
4707
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString
|
|
4708
|
-
inputs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
4869
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>, z.ZodJSONSchema]>>>;
|
|
4870
|
+
inputs: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
4871
|
+
x: z.ZodNumber;
|
|
4872
|
+
y: z.ZodNumber;
|
|
4873
|
+
}, z.core.$strip>, unknown>, z.ZodString]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodPreprocess<z.ZodObject<{
|
|
4874
|
+
x: z.ZodNumber;
|
|
4875
|
+
y: z.ZodNumber;
|
|
4876
|
+
}, z.core.$strip>, unknown>, z.ZodString, z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
4709
4877
|
x: z.ZodNumber;
|
|
4710
4878
|
y: z.ZodNumber;
|
|
4711
|
-
}, z.core.$strip>, unknown
|
|
4879
|
+
}, z.core.$strip>, unknown>>, z.ZodArray<z.ZodString>]>>]>>;
|
|
4712
4880
|
}, z.core.$strip>, z.ZodObject<{
|
|
4713
4881
|
id: z.ZodString;
|
|
4714
4882
|
layerId: z.ZodString;
|
|
@@ -5227,8 +5395,9 @@ interface DrawingHooks {
|
|
|
5227
5395
|
revision(): number;
|
|
5228
5396
|
/** Text metrics for bounds and DXF (default: approximate font metrics). */
|
|
5229
5397
|
measure?: TextMeasurer;
|
|
5230
|
-
/** Document-wide object lookup for block reference inputs
|
|
5231
|
-
|
|
5398
|
+
/** Document-wide object lookup for block reference inputs (and the
|
|
5399
|
+
* document's block list, for hosted blocks). */
|
|
5400
|
+
resolveObject?: BlockObjectResolver;
|
|
5232
5401
|
/** Loaded reference content (default: the drawing's referenceContent). */
|
|
5233
5402
|
resolveReference?: (ref: Reference) => ReferenceContent | null;
|
|
5234
5403
|
/** Snap/hit-test geometry, e.g. from a cache (default: built per call). */
|
|
@@ -5740,11 +5909,17 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5740
5909
|
definitionId: string;
|
|
5741
5910
|
rotation: number;
|
|
5742
5911
|
scale: number;
|
|
5743
|
-
params: Record<string, string | number
|
|
5912
|
+
params: Record<string, string[] | number[] | z.JSONType>;
|
|
5744
5913
|
inputs: (string | {
|
|
5745
5914
|
x: number;
|
|
5746
5915
|
y: number;
|
|
5747
|
-
})[]
|
|
5916
|
+
})[] | Record<string, string | string[] | {
|
|
5917
|
+
x: number;
|
|
5918
|
+
y: number;
|
|
5919
|
+
}[] | {
|
|
5920
|
+
x: number;
|
|
5921
|
+
y: number;
|
|
5922
|
+
}>;
|
|
5748
5923
|
} | {
|
|
5749
5924
|
id: string;
|
|
5750
5925
|
layerId: string;
|
|
@@ -5892,7 +6067,7 @@ declare class LocalDrawing implements Drawing$1 {
|
|
|
5892
6067
|
maxY: number;
|
|
5893
6068
|
} | undefined;
|
|
5894
6069
|
})[];
|
|
5895
|
-
resolveObject:
|
|
6070
|
+
resolveObject: BlockObjectResolver;
|
|
5896
6071
|
resolveReference: (ref: Reference) => ReferenceContent | null;
|
|
5897
6072
|
};
|
|
5898
6073
|
protected resolveLayout(nameOrId: string): PaperLayout;
|
|
@@ -6109,9 +6284,12 @@ type BlockInput = ObjectInputShape<{
|
|
|
6109
6284
|
/** Applied last, about the pivot (the first input point). */
|
|
6110
6285
|
rotation?: number;
|
|
6111
6286
|
scale?: number;
|
|
6112
|
-
params?: Record<string, number | string | boolean | readonly number[] | readonly string[]>;
|
|
6113
|
-
/** Input points in the PARENT's local coords
|
|
6114
|
-
|
|
6287
|
+
params?: Record<string, number | string | boolean | readonly number[] | readonly string[] | JsonValue>;
|
|
6288
|
+
/** Input points in the PARENT's local coords (the first is the pivot):
|
|
6289
|
+
* in pick order, or by input name for a block declaring an `inputs`
|
|
6290
|
+
* table. Object ids (a `host`, picked objects) only on instances a
|
|
6291
|
+
* script ADDS to the document — a block's own children can't reference. */
|
|
6292
|
+
inputs?: readonly Vec2Like[] | Readonly<Record<string, Vec2Like | readonly Vec2Like[] | string | readonly string[]>>;
|
|
6115
6293
|
}>;
|
|
6116
6294
|
/** A table cell: plain text, or text with merge / alignment / style. */
|
|
6117
6295
|
type TableCellInput = string | {
|
|
@@ -6207,7 +6385,7 @@ type ViewportInput = ObjectInputShape<{
|
|
|
6207
6385
|
modelCenter?: Vec2Like;
|
|
6208
6386
|
/** Drawing-scale denominator (model mm per paper mm); 1:50 => 50. */
|
|
6209
6387
|
scale?: number;
|
|
6210
|
-
/** Pinned: no pan/zoom-through, no move/resize
|
|
6388
|
+
/** Pinned: no pan/zoom-through, no move/resize handles. */
|
|
6211
6389
|
locked?: boolean;
|
|
6212
6390
|
/** Layer ids hidden in this viewport only. */
|
|
6213
6391
|
hiddenLayerIds?: readonly string[];
|
|
@@ -6260,6 +6438,10 @@ type DimStyle = {
|
|
|
6260
6438
|
readonly extensionOvershoot: number;
|
|
6261
6439
|
readonly precision: number;
|
|
6262
6440
|
};
|
|
6441
|
+
/** Any JSON value — what a `data` param holds. */
|
|
6442
|
+
type JsonValue = string | number | boolean | null | readonly JsonValue[] | {
|
|
6443
|
+
readonly [key: string]: JsonValue;
|
|
6444
|
+
};
|
|
6263
6445
|
|
|
6264
6446
|
/** A world point in mm, as `[x, y]` or `{x, y}`. */
|
|
6265
6447
|
type PointInput = Vec2$1 | readonly [number, number];
|
|
@@ -6559,10 +6741,30 @@ interface EditorSurface {
|
|
|
6559
6741
|
zoom(to: ZoomTarget): void;
|
|
6560
6742
|
/** Await one snapped world point; rejects when the user cancels. */
|
|
6561
6743
|
pickPoint(opts?: PickPointOptions): Promise<Vec2$1>;
|
|
6562
|
-
/** Await one object click; resolves the object's id.
|
|
6744
|
+
/** Await one object click; resolves the object's id. `types` limits what
|
|
6745
|
+
* can be picked (ModelObject types; empty/absent = any). */
|
|
6563
6746
|
pickObject(opts?: {
|
|
6564
6747
|
label?: string;
|
|
6748
|
+
types?: readonly string[];
|
|
6565
6749
|
}): Promise<string>;
|
|
6750
|
+
/** Await a chain of snapped points (rubber band from the previous);
|
|
6751
|
+
* Enter/Esc finishes once `min` (default 1) is met, `max` ends it.
|
|
6752
|
+
* Rejects when the user cancels below `min`. */
|
|
6753
|
+
pickPoints(opts?: PickPointsOptions): Promise<Vec2$1[]>;
|
|
6754
|
+
/** Await several object picks (each once); Enter/Esc finishes once
|
|
6755
|
+
* `min` (default 1) is met. Rejects when the user cancels below `min`. */
|
|
6756
|
+
pickObjects(opts?: {
|
|
6757
|
+
label?: string;
|
|
6758
|
+
types?: readonly string[];
|
|
6759
|
+
min?: number;
|
|
6760
|
+
max?: number;
|
|
6761
|
+
}): Promise<string[]>;
|
|
6762
|
+
/** Ask several values in one dialog — the command params form, from a
|
|
6763
|
+
* ParamDef table; resolves the values by name, rejects on cancel. */
|
|
6764
|
+
ask(params: readonly ParamDef[], opts?: {
|
|
6765
|
+
title?: string;
|
|
6766
|
+
description?: string;
|
|
6767
|
+
}): Promise<Record<string, unknown>>;
|
|
6566
6768
|
/** Await a typed value from a small input dialog; rejects on cancel. */
|
|
6567
6769
|
prompt(message: string, opts?: {
|
|
6568
6770
|
initial?: string;
|
|
@@ -6574,7 +6776,21 @@ interface EditorSurface {
|
|
|
6574
6776
|
/** Trigger a command by id (interactive tools start and wait for the
|
|
6575
6777
|
* user; macros with declared inputs / params accept them up front —
|
|
6576
6778
|
* params passed skip the params dialog). */
|
|
6577
|
-
runCommand(id: string, inputs?:
|
|
6779
|
+
runCommand(id: string, inputs?: CommandInputsArg, params?: Readonly<Record<string, unknown>>): Promise<void>;
|
|
6780
|
+
}
|
|
6781
|
+
/** Inputs a caller supplies to a command: positional points (a command
|
|
6782
|
+
* declaring labels) or a record by input name (a command declaring a
|
|
6783
|
+
* table — points as [x, y], objects as ids). */
|
|
6784
|
+
type CommandInputsArg = readonly PointInput[] | Readonly<Record<string, PointInput | readonly PointInput[] | string | readonly string[]>>;
|
|
6785
|
+
interface PickPointsOptions {
|
|
6786
|
+
label?: string;
|
|
6787
|
+
/** Default 1. */
|
|
6788
|
+
min?: number;
|
|
6789
|
+
max?: number;
|
|
6790
|
+
/** Preview the closing segment (a polygon). */
|
|
6791
|
+
closed?: boolean;
|
|
6792
|
+
/** Rubber band from here to the first pick. */
|
|
6793
|
+
referencePoint?: PointInput;
|
|
6578
6794
|
}
|
|
6579
6795
|
/** Where `EditorSurface.zoom` moves the camera: everything in the active
|
|
6580
6796
|
* space, the selection, some objects' extents, or a window (world mm; sheet
|
|
@@ -6647,12 +6863,13 @@ declare class Drawing extends LocalDrawing {
|
|
|
6647
6863
|
importDwg(path: string, opts?: DxfImportOptions): Promise<DxfImportReport>;
|
|
6648
6864
|
importPdf(path: string, opts?: PdfImportOptions): Promise<PdfImportReport>;
|
|
6649
6865
|
/** Run a command module source (`defineCommand`) against this drawing as
|
|
6650
|
-
* ONE undo step, headlessly: declared `inputs` must be supplied
|
|
6866
|
+
* ONE undo step, headlessly: declared `inputs` must be supplied (points
|
|
6867
|
+
* in label order, or a record by name for an inputs table); declared
|
|
6651
6868
|
* `params` take their defaults unless given by name (unknown names and
|
|
6652
6869
|
* wrong types throw). Resolves with the script's return value. */
|
|
6653
|
-
runScript(source: string, inputs?:
|
|
6870
|
+
runScript(source: string, inputs?: CommandInputsArg, params?: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
6654
6871
|
/** Run one of the document's own commands (by exported id). */
|
|
6655
|
-
runUserCommand(id: string, inputs?:
|
|
6872
|
+
runUserCommand(id: string, inputs?: CommandInputsArg, params?: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
6656
6873
|
}
|
|
6657
6874
|
/** A fresh empty document, optionally named (until saved to a file, whose
|
|
6658
6875
|
* name then takes over). */
|