@tscircuit/props 0.0.627 → 0.0.628

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.
@@ -0,0 +1,71 @@
1
+ export interface ImplicitBreakoutPoint {
2
+ readonly x: number
3
+ readonly y: number
4
+ }
5
+
6
+ export interface ImplicitBreakoutBounds {
7
+ readonly minX: number
8
+ readonly maxX: number
9
+ readonly minY: number
10
+ readonly maxY: number
11
+ }
12
+
13
+ export type ImplicitBreakoutEdge = "left" | "right" | "bottom" | "top"
14
+
15
+ export interface ImplicitBreakoutRegion {
16
+ readonly regionId: string
17
+ readonly bounds: ImplicitBreakoutBounds
18
+ readonly edge: ImplicitBreakoutEdge
19
+ }
20
+
21
+ export interface ImplicitBreakoutConnectionEndpoint {
22
+ readonly regionId: string
23
+ readonly position: ImplicitBreakoutPoint
24
+ }
25
+
26
+ export interface ImplicitBreakoutConnection {
27
+ readonly connectionId: string
28
+ readonly endpoints: readonly ImplicitBreakoutConnectionEndpoint[]
29
+ }
30
+
31
+ export interface ImplicitBreakoutDifferentialPair {
32
+ readonly type: "differential"
33
+ readonly connections: readonly [
34
+ ImplicitBreakoutConnection,
35
+ ImplicitBreakoutConnection,
36
+ ]
37
+ }
38
+
39
+ export type ImplicitBreakoutConnectionOrDifferentialPair =
40
+ | ImplicitBreakoutConnection
41
+ | ImplicitBreakoutDifferentialPair
42
+
43
+ export interface ImplicitBreakoutBus {
44
+ readonly busId: string
45
+ readonly connectionIds: readonly string[]
46
+ /** Ordered candidate layers that the solver may distribute this bus over. */
47
+ readonly targetLayers?: readonly string[]
48
+ }
49
+
50
+ export interface ImplicitBreakoutPointSolverInput {
51
+ readonly regions: readonly ImplicitBreakoutRegion[]
52
+ readonly connections: readonly ImplicitBreakoutConnectionOrDifferentialPair[]
53
+ readonly buses: readonly ImplicitBreakoutBus[]
54
+ readonly boundaryPointSpacing: number
55
+ }
56
+
57
+ export interface ImplicitBreakoutSolverPoint extends ImplicitBreakoutPoint {
58
+ readonly regionId: string
59
+ readonly connectionId: string
60
+ readonly layer: string
61
+ }
62
+
63
+ export interface ImplicitBreakoutPointSolverOutput {
64
+ readonly breakoutPoints: readonly ImplicitBreakoutSolverPoint[]
65
+ }
66
+
67
+ export type ImplicitBreakoutPointSolverFn = (
68
+ input: ImplicitBreakoutPointSolverInput,
69
+ ) =>
70
+ | ImplicitBreakoutPointSolverOutput
71
+ | Promise<ImplicitBreakoutPointSolverOutput>
@@ -33,6 +33,7 @@ import {
33
33
  } from "lib/common/schematicPinStyle"
34
34
  import { url } from "lib/common/url"
35
35
  import type { Connections } from "lib/utility-types/connections-and-selectors"
36
+ import type { ImplicitBreakoutPointSolverFn } from "lib/common/implicitBreakoutPointSolver"
36
37
 
37
38
  export const layoutConfig = z.object({
38
39
  layoutMode: z
@@ -342,6 +343,8 @@ export interface AutorouterConfig {
342
343
  | /** @deprecated Use "sequential_trace" */ "sequential-trace"
343
344
  local?: boolean
344
345
  algorithmFn?: (simpleRouteJson: any) => Promise<any>
346
+ /** Override the solver used to place implicit breakout points. */
347
+ implicitBreakoutPointSolverFn?: ImplicitBreakoutPointSolverFn
345
348
  preset?:
346
349
  | "sequential_trace"
347
350
  | "subcircuit"
@@ -423,6 +426,11 @@ export const autorouterConfig = z.object({
423
426
  (v) => typeof v === "function" || v === undefined,
424
427
  )
425
428
  .optional(),
429
+ implicitBreakoutPointSolverFn: z
430
+ .custom<ImplicitBreakoutPointSolverFn>(
431
+ (value) => typeof value === "function" || value === undefined,
432
+ )
433
+ .optional(),
426
434
  preset: z
427
435
  .enum([
428
436
  "sequential_trace",
package/lib/index.ts CHANGED
@@ -141,3 +141,4 @@ export * from "./utility-types/connections-and-selectors"
141
141
  export * from "./common/ninePointAnchor"
142
142
  export * from "./common/fanoutBoundaryPadding"
143
143
  export * from "./common/fanoutProps"
144
+ export * from "./common/implicitBreakoutPointSolver"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.627",
3
+ "version": "0.0.628",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",