Skip to content

findSnap

findSnap(draggedComponent, candidateOrigin, others, radius?, wires?): SnapResult

Defined in: packages/core/src/preview/snap.ts:11

Component

Point

readonly Readonly<{ controller?: Readonly<{ latches: readonly Readonly<{ id: string; initial: 0 | 1; source: string; toggledBy: string; }>[]; pins?: readonly ControllerPin[]; }>; devices?: readonly Readonly<{ id: string; kind?: ComponentKind; terminals: readonly string[]; }>[]; flipped: boolean; id: string; kind: ComponentKind; name: string; origin: Point; program?: Readonly<{ positions: readonly Readonly<{ id: string; label?: string; lines?: Readonly<…>; ops: readonly Readonly<…>[]; parameters?: Readonly<…>; }>[]; router?: Readonly<{ control: string; positions: number; read?: ProgramRouterRead; routes: readonly Readonly<…>[]; scannedBy?: string; }>; }>; properties: Readonly<Record<string, PropertyValue>>; rotation: Rotation; sourceTypeName: string | null; terminals: readonly Readonly<{ name: string; position: Point; role?: string; }>[]; windings?: readonly Readonly<{ id?: string; impedances?: readonly Readonly<{ across: …; impedance: …; }>[]; role: WindingRole; terminals: readonly string[]; voltage?: Readonly<{ raw: string; unit: string; value: number; }>; }>[]; }>[]

number = DEFAULT_SNAP_RADIUS

readonly Readonly<{ endpoints: readonly [Readonly<{ x: number; y: number; }>, Readonly<{ x: number; y: number; }>]; id: string; }>[] = []

SnapResult