@tscircuit/props 0.0.714 → 0.0.715
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +121 -2
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/lib/assembly/cable.ts +45 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -14973,25 +14973,89 @@ interface AssemblyCableProps {
|
|
|
14973
14973
|
standard?: AssemblyCableStandard;
|
|
14974
14974
|
/** Explicit cable model specification. Omit to infer the cable from its endpoints. */
|
|
14975
14975
|
model?: string;
|
|
14976
|
+
waypoints?: {
|
|
14977
|
+
x: number;
|
|
14978
|
+
y: number;
|
|
14979
|
+
z: number;
|
|
14980
|
+
}[];
|
|
14981
|
+
/** Reference endpoint for waypoint offsets. Required when waypoints is defined. */
|
|
14982
|
+
waypointAnchor?: "start" | "end";
|
|
14983
|
+
/** Board orientation for waypoint axes. Required when waypoints is defined. */
|
|
14984
|
+
waypointAxisOrientation?: "board_at_start" | "board_at_end";
|
|
14976
14985
|
}
|
|
14977
|
-
declare const assemblyCableProps: z.ZodObject<{
|
|
14986
|
+
declare const assemblyCableProps: z.ZodEffects<z.ZodObject<{
|
|
14978
14987
|
name: z.ZodString;
|
|
14979
14988
|
from: z.ZodString;
|
|
14980
14989
|
to: z.ZodString;
|
|
14981
14990
|
standard: z.ZodOptional<z.ZodLiteral<"usb_c">>;
|
|
14982
14991
|
model: z.ZodOptional<z.ZodString>;
|
|
14992
|
+
waypoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14993
|
+
x: z.ZodNumber;
|
|
14994
|
+
y: z.ZodNumber;
|
|
14995
|
+
z: z.ZodNumber;
|
|
14996
|
+
}, "strip", z.ZodTypeAny, {
|
|
14997
|
+
x: number;
|
|
14998
|
+
y: number;
|
|
14999
|
+
z: number;
|
|
15000
|
+
}, {
|
|
15001
|
+
x: number;
|
|
15002
|
+
y: number;
|
|
15003
|
+
z: number;
|
|
15004
|
+
}>, "many">>;
|
|
15005
|
+
waypointAnchor: z.ZodOptional<z.ZodEnum<["start", "end"]>>;
|
|
15006
|
+
waypointAxisOrientation: z.ZodOptional<z.ZodEnum<["board_at_start", "board_at_end"]>>;
|
|
14983
15007
|
}, "strip", z.ZodTypeAny, {
|
|
14984
15008
|
name: string;
|
|
14985
15009
|
from: string;
|
|
14986
15010
|
to: string;
|
|
14987
15011
|
model?: string | undefined;
|
|
14988
15012
|
standard?: "usb_c" | undefined;
|
|
15013
|
+
waypoints?: {
|
|
15014
|
+
x: number;
|
|
15015
|
+
y: number;
|
|
15016
|
+
z: number;
|
|
15017
|
+
}[] | undefined;
|
|
15018
|
+
waypointAnchor?: "start" | "end" | undefined;
|
|
15019
|
+
waypointAxisOrientation?: "board_at_start" | "board_at_end" | undefined;
|
|
15020
|
+
}, {
|
|
15021
|
+
name: string;
|
|
15022
|
+
from: string;
|
|
15023
|
+
to: string;
|
|
15024
|
+
model?: string | undefined;
|
|
15025
|
+
standard?: "usb_c" | undefined;
|
|
15026
|
+
waypoints?: {
|
|
15027
|
+
x: number;
|
|
15028
|
+
y: number;
|
|
15029
|
+
z: number;
|
|
15030
|
+
}[] | undefined;
|
|
15031
|
+
waypointAnchor?: "start" | "end" | undefined;
|
|
15032
|
+
waypointAxisOrientation?: "board_at_start" | "board_at_end" | undefined;
|
|
15033
|
+
}>, {
|
|
15034
|
+
name: string;
|
|
15035
|
+
from: string;
|
|
15036
|
+
to: string;
|
|
15037
|
+
model?: string | undefined;
|
|
15038
|
+
standard?: "usb_c" | undefined;
|
|
15039
|
+
waypoints?: {
|
|
15040
|
+
x: number;
|
|
15041
|
+
y: number;
|
|
15042
|
+
z: number;
|
|
15043
|
+
}[] | undefined;
|
|
15044
|
+
waypointAnchor?: "start" | "end" | undefined;
|
|
15045
|
+
waypointAxisOrientation?: "board_at_start" | "board_at_end" | undefined;
|
|
14989
15046
|
}, {
|
|
14990
15047
|
name: string;
|
|
14991
15048
|
from: string;
|
|
14992
15049
|
to: string;
|
|
14993
15050
|
model?: string | undefined;
|
|
14994
15051
|
standard?: "usb_c" | undefined;
|
|
15052
|
+
waypoints?: {
|
|
15053
|
+
x: number;
|
|
15054
|
+
y: number;
|
|
15055
|
+
z: number;
|
|
15056
|
+
}[] | undefined;
|
|
15057
|
+
waypointAnchor?: "start" | "end" | undefined;
|
|
15058
|
+
waypointAxisOrientation?: "board_at_start" | "board_at_end" | undefined;
|
|
14995
15059
|
}>;
|
|
14996
15060
|
type AssemblyCablePropsInput = z.input<typeof assemblyCableProps>;
|
|
14997
15061
|
|
|
@@ -33150,24 +33214,79 @@ declare const assemblyProps: {
|
|
|
33150
33214
|
mountFace?: string | undefined;
|
|
33151
33215
|
mountGap?: string | number | undefined;
|
|
33152
33216
|
}>;
|
|
33153
|
-
readonly cable: zod.ZodObject<{
|
|
33217
|
+
readonly cable: zod.ZodEffects<zod.ZodObject<{
|
|
33154
33218
|
name: zod.ZodString;
|
|
33155
33219
|
from: zod.ZodString;
|
|
33156
33220
|
to: zod.ZodString;
|
|
33157
33221
|
standard: zod.ZodOptional<zod.ZodLiteral<"usb_c">>;
|
|
33158
33222
|
model: zod.ZodOptional<zod.ZodString>;
|
|
33223
|
+
waypoints: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
33224
|
+
x: zod.ZodNumber;
|
|
33225
|
+
y: zod.ZodNumber;
|
|
33226
|
+
z: zod.ZodNumber;
|
|
33227
|
+
}, "strip", zod.ZodTypeAny, {
|
|
33228
|
+
x: number;
|
|
33229
|
+
y: number;
|
|
33230
|
+
z: number;
|
|
33231
|
+
}, {
|
|
33232
|
+
x: number;
|
|
33233
|
+
y: number;
|
|
33234
|
+
z: number;
|
|
33235
|
+
}>, "many">>;
|
|
33236
|
+
waypointAnchor: zod.ZodOptional<zod.ZodEnum<["start", "end"]>>;
|
|
33237
|
+
waypointAxisOrientation: zod.ZodOptional<zod.ZodEnum<["board_at_start", "board_at_end"]>>;
|
|
33159
33238
|
}, "strip", zod.ZodTypeAny, {
|
|
33160
33239
|
name: string;
|
|
33161
33240
|
from: string;
|
|
33162
33241
|
to: string;
|
|
33163
33242
|
model?: string | undefined;
|
|
33164
33243
|
standard?: "usb_c" | undefined;
|
|
33244
|
+
waypoints?: {
|
|
33245
|
+
x: number;
|
|
33246
|
+
y: number;
|
|
33247
|
+
z: number;
|
|
33248
|
+
}[] | undefined;
|
|
33249
|
+
waypointAnchor?: "start" | "end" | undefined;
|
|
33250
|
+
waypointAxisOrientation?: "board_at_start" | "board_at_end" | undefined;
|
|
33251
|
+
}, {
|
|
33252
|
+
name: string;
|
|
33253
|
+
from: string;
|
|
33254
|
+
to: string;
|
|
33255
|
+
model?: string | undefined;
|
|
33256
|
+
standard?: "usb_c" | undefined;
|
|
33257
|
+
waypoints?: {
|
|
33258
|
+
x: number;
|
|
33259
|
+
y: number;
|
|
33260
|
+
z: number;
|
|
33261
|
+
}[] | undefined;
|
|
33262
|
+
waypointAnchor?: "start" | "end" | undefined;
|
|
33263
|
+
waypointAxisOrientation?: "board_at_start" | "board_at_end" | undefined;
|
|
33264
|
+
}>, {
|
|
33265
|
+
name: string;
|
|
33266
|
+
from: string;
|
|
33267
|
+
to: string;
|
|
33268
|
+
model?: string | undefined;
|
|
33269
|
+
standard?: "usb_c" | undefined;
|
|
33270
|
+
waypoints?: {
|
|
33271
|
+
x: number;
|
|
33272
|
+
y: number;
|
|
33273
|
+
z: number;
|
|
33274
|
+
}[] | undefined;
|
|
33275
|
+
waypointAnchor?: "start" | "end" | undefined;
|
|
33276
|
+
waypointAxisOrientation?: "board_at_start" | "board_at_end" | undefined;
|
|
33165
33277
|
}, {
|
|
33166
33278
|
name: string;
|
|
33167
33279
|
from: string;
|
|
33168
33280
|
to: string;
|
|
33169
33281
|
model?: string | undefined;
|
|
33170
33282
|
standard?: "usb_c" | undefined;
|
|
33283
|
+
waypoints?: {
|
|
33284
|
+
x: number;
|
|
33285
|
+
y: number;
|
|
33286
|
+
z: number;
|
|
33287
|
+
}[] | undefined;
|
|
33288
|
+
waypointAnchor?: "start" | "end" | undefined;
|
|
33289
|
+
waypointAxisOrientation?: "board_at_start" | "board_at_end" | undefined;
|
|
33171
33290
|
}>;
|
|
33172
33291
|
readonly device: zod.ZodEffects<zod.ZodObject<{
|
|
33173
33292
|
name: zod.ZodOptional<zod.ZodString>;
|
package/dist/index.js
CHANGED
|
@@ -355,7 +355,32 @@ var assemblyCableProps = z13.object({
|
|
|
355
355
|
from: z13.string().trim().min(1),
|
|
356
356
|
to: z13.string().trim().min(1),
|
|
357
357
|
standard: z13.literal("usb_c").optional(),
|
|
358
|
-
model: z13.string().trim().min(1).optional()
|
|
358
|
+
model: z13.string().trim().min(1).optional(),
|
|
359
|
+
waypoints: z13.array(
|
|
360
|
+
z13.object({
|
|
361
|
+
x: z13.number().finite(),
|
|
362
|
+
y: z13.number().finite(),
|
|
363
|
+
z: z13.number().finite()
|
|
364
|
+
})
|
|
365
|
+
).optional(),
|
|
366
|
+
waypointAnchor: z13.enum(["start", "end"]).optional(),
|
|
367
|
+
waypointAxisOrientation: z13.enum(["board_at_start", "board_at_end"]).optional()
|
|
368
|
+
}).superRefine((cable, context) => {
|
|
369
|
+
if (cable.waypoints === void 0) return;
|
|
370
|
+
if (cable.waypointAnchor === void 0) {
|
|
371
|
+
context.addIssue({
|
|
372
|
+
code: z13.ZodIssueCode.custom,
|
|
373
|
+
path: ["waypointAnchor"],
|
|
374
|
+
message: "waypointAnchor is required when waypoints is defined"
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
if (cable.waypointAxisOrientation === void 0) {
|
|
378
|
+
context.addIssue({
|
|
379
|
+
code: z13.ZodIssueCode.custom,
|
|
380
|
+
path: ["waypointAxisOrientation"],
|
|
381
|
+
message: "waypointAxisOrientation is required when waypoints is defined"
|
|
382
|
+
});
|
|
383
|
+
}
|
|
359
384
|
});
|
|
360
385
|
expectTypesMatch(true);
|
|
361
386
|
|