diff --git a/src/schematic/schematic_trace.ts b/src/schematic/schematic_trace.ts index 3cf5226..83b07b5 100644 --- a/src/schematic/schematic_trace.ts +++ b/src/schematic/schematic_trace.ts @@ -1,5 +1,27 @@ import { z } from "zod" import { distance } from "../units" +import { expectTypesMatch } from "src/utils/expect-types-match" + +export interface SchematicTraceEdge { + from: { + x: number + y: number + } + to: { + x: number + y: number + } + is_crossing?: boolean + from_schematic_port_id?: string + to_schematic_port_id?: string +} + +export interface SchematicTrace { + type: "schematic_trace" + schematic_trace_id: string + source_trace_id: string + edges: SchematicTraceEdge[] +} export const schematic_trace = z.object({ type: z.literal("schematic_trace"), @@ -15,6 +37,7 @@ export const schematic_trace = z.object({ x: z.number(), y: z.number(), }), + is_crossing: z.boolean().optional(), from_schematic_port_id: z.string().optional(), to_schematic_port_id: z.string().optional(), }), @@ -22,4 +45,6 @@ export const schematic_trace = z.object({ }) export type SchematicTraceInput = z.input -export type SchematicTrace = z.infer +type InferredSchematicTrace = z.infer + +expectTypesMatch(true)