@tscircuit/core 0.0.138 → 0.0.140
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 +148 -2
- package/dist/index.js +36 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { PcbTraceError, PcbPlacementError, LayerRef, AnyCircuitElement, AnySourc
|
|
|
6
6
|
import { SoupUtilObjects } from '@tscircuit/soup-util';
|
|
7
7
|
import { Matrix } from 'transformation-matrix';
|
|
8
8
|
import * as _tscircuit_props from '@tscircuit/props';
|
|
9
|
-
import { traceProps, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, holeProps, pcbKeepoutProps, netAliasProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, traceHintProps, viaProps, batteryProps, inductorProps } from '@tscircuit/props';
|
|
9
|
+
import { traceProps, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, holeProps, pcbKeepoutProps, netAliasProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, traceHintProps, viaProps, batteryProps, inductorProps, CapacitorProps, ChipProps, ResistorProps } from '@tscircuit/props';
|
|
10
10
|
|
|
11
11
|
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortDiscovery", "PortMatching", "SourceTraceRender", "SchematicComponentRender", "SchematicPortRender", "SchematicLayout", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbTraceRender", "PcbTraceHintRender", "PcbRouteNetIslands", "PcbComponentSizeCalculation", "CadModelRender"];
|
|
12
12
|
type RenderPhase = (typeof orderedRenderPhases)[number];
|
|
@@ -6230,6 +6230,152 @@ type ComponentWithPins<Props, PinLabel extends string | never = never, PropsFrom
|
|
|
6230
6230
|
};
|
|
6231
6231
|
declare const createUseComponent: <Props, PinLabel extends string | never = never>(Component: React.ComponentType<Props>, pins: PinLabelSpec<PinLabel>) => (<PropsFromHook extends Omit<Props, "name"> | undefined = undefined>(name: string, props?: PropsFromHook) => ComponentWithPins<Props, PinLabel, PropsFromHook>);
|
|
6232
6232
|
|
|
6233
|
+
declare const useCapacitor: <PropsFromHook extends Omit<CapacitorProps, "name"> | undefined = undefined>(name: string, props?: PropsFromHook | undefined) => ComponentWithPins<CapacitorProps, "left" | "right" | "pin1" | "pin2" | "anode" | "cathode" | "pos" | "neg", PropsFromHook>;
|
|
6234
|
+
|
|
6235
|
+
declare const useChip: <PinLabel extends string>(pinLabels: Record<string, PinLabel[]>) => <PropsFromHook extends Omit<ChipProps, "name"> | undefined = undefined>(name: string, props?: PropsFromHook | undefined) => ComponentWithPins<ChipProps, PinLabel, PropsFromHook>;
|
|
6236
|
+
|
|
6237
|
+
declare const useDiode: <PropsFromHook extends Omit<{
|
|
6238
|
+
name: string;
|
|
6239
|
+
pcbX?: string | number | undefined;
|
|
6240
|
+
pcbY?: string | number | undefined;
|
|
6241
|
+
pcbRotation?: string | number | undefined;
|
|
6242
|
+
schX?: string | number | undefined;
|
|
6243
|
+
schY?: string | number | undefined;
|
|
6244
|
+
schRotation?: string | number | undefined;
|
|
6245
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
6246
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
6247
|
+
} | undefined;
|
|
6248
|
+
footprint?: _tscircuit_props.Footprint | undefined;
|
|
6249
|
+
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
6250
|
+
key?: any;
|
|
6251
|
+
cadModel?: string | {
|
|
6252
|
+
stlUrl: string;
|
|
6253
|
+
rotationOffset?: number | {
|
|
6254
|
+
x: string | number;
|
|
6255
|
+
y: string | number;
|
|
6256
|
+
z: string | number;
|
|
6257
|
+
} | undefined;
|
|
6258
|
+
positionOffset?: {
|
|
6259
|
+
x: string | number;
|
|
6260
|
+
y: string | number;
|
|
6261
|
+
z: string | number;
|
|
6262
|
+
} | undefined;
|
|
6263
|
+
size?: {
|
|
6264
|
+
x: string | number;
|
|
6265
|
+
y: string | number;
|
|
6266
|
+
z: string | number;
|
|
6267
|
+
} | undefined;
|
|
6268
|
+
} | {
|
|
6269
|
+
objUrl: string;
|
|
6270
|
+
rotationOffset?: number | {
|
|
6271
|
+
x: string | number;
|
|
6272
|
+
y: string | number;
|
|
6273
|
+
z: string | number;
|
|
6274
|
+
} | undefined;
|
|
6275
|
+
positionOffset?: {
|
|
6276
|
+
x: string | number;
|
|
6277
|
+
y: string | number;
|
|
6278
|
+
z: string | number;
|
|
6279
|
+
} | undefined;
|
|
6280
|
+
size?: {
|
|
6281
|
+
x: string | number;
|
|
6282
|
+
y: string | number;
|
|
6283
|
+
z: string | number;
|
|
6284
|
+
} | undefined;
|
|
6285
|
+
mtlUrl?: string | undefined;
|
|
6286
|
+
} | {
|
|
6287
|
+
jscad: Record<string, any>;
|
|
6288
|
+
rotationOffset?: number | {
|
|
6289
|
+
x: string | number;
|
|
6290
|
+
y: string | number;
|
|
6291
|
+
z: string | number;
|
|
6292
|
+
} | undefined;
|
|
6293
|
+
positionOffset?: {
|
|
6294
|
+
x: string | number;
|
|
6295
|
+
y: string | number;
|
|
6296
|
+
z: string | number;
|
|
6297
|
+
} | undefined;
|
|
6298
|
+
size?: {
|
|
6299
|
+
x: string | number;
|
|
6300
|
+
y: string | number;
|
|
6301
|
+
z: string | number;
|
|
6302
|
+
} | undefined;
|
|
6303
|
+
} | undefined;
|
|
6304
|
+
children?: any;
|
|
6305
|
+
symbolName?: string | undefined;
|
|
6306
|
+
}, "name"> | undefined = undefined>(name: string, props?: PropsFromHook | undefined) => ComponentWithPins<{
|
|
6307
|
+
name: string;
|
|
6308
|
+
pcbX?: string | number | undefined;
|
|
6309
|
+
pcbY?: string | number | undefined;
|
|
6310
|
+
pcbRotation?: string | number | undefined;
|
|
6311
|
+
schX?: string | number | undefined;
|
|
6312
|
+
schY?: string | number | undefined;
|
|
6313
|
+
schRotation?: string | number | undefined;
|
|
6314
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
6315
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
6316
|
+
} | undefined;
|
|
6317
|
+
footprint?: _tscircuit_props.Footprint | undefined;
|
|
6318
|
+
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
6319
|
+
key?: any;
|
|
6320
|
+
cadModel?: string | {
|
|
6321
|
+
stlUrl: string;
|
|
6322
|
+
rotationOffset?: number | {
|
|
6323
|
+
x: string | number;
|
|
6324
|
+
y: string | number;
|
|
6325
|
+
z: string | number;
|
|
6326
|
+
} | undefined;
|
|
6327
|
+
positionOffset?: {
|
|
6328
|
+
x: string | number;
|
|
6329
|
+
y: string | number;
|
|
6330
|
+
z: string | number;
|
|
6331
|
+
} | undefined;
|
|
6332
|
+
size?: {
|
|
6333
|
+
x: string | number;
|
|
6334
|
+
y: string | number;
|
|
6335
|
+
z: string | number;
|
|
6336
|
+
} | undefined;
|
|
6337
|
+
} | {
|
|
6338
|
+
objUrl: string;
|
|
6339
|
+
rotationOffset?: number | {
|
|
6340
|
+
x: string | number;
|
|
6341
|
+
y: string | number;
|
|
6342
|
+
z: string | number;
|
|
6343
|
+
} | undefined;
|
|
6344
|
+
positionOffset?: {
|
|
6345
|
+
x: string | number;
|
|
6346
|
+
y: string | number;
|
|
6347
|
+
z: string | number;
|
|
6348
|
+
} | undefined;
|
|
6349
|
+
size?: {
|
|
6350
|
+
x: string | number;
|
|
6351
|
+
y: string | number;
|
|
6352
|
+
z: string | number;
|
|
6353
|
+
} | undefined;
|
|
6354
|
+
mtlUrl?: string | undefined;
|
|
6355
|
+
} | {
|
|
6356
|
+
jscad: Record<string, any>;
|
|
6357
|
+
rotationOffset?: number | {
|
|
6358
|
+
x: string | number;
|
|
6359
|
+
y: string | number;
|
|
6360
|
+
z: string | number;
|
|
6361
|
+
} | undefined;
|
|
6362
|
+
positionOffset?: {
|
|
6363
|
+
x: string | number;
|
|
6364
|
+
y: string | number;
|
|
6365
|
+
z: string | number;
|
|
6366
|
+
} | undefined;
|
|
6367
|
+
size?: {
|
|
6368
|
+
x: string | number;
|
|
6369
|
+
y: string | number;
|
|
6370
|
+
z: string | number;
|
|
6371
|
+
} | undefined;
|
|
6372
|
+
} | undefined;
|
|
6373
|
+
children?: any;
|
|
6374
|
+
symbolName?: string | undefined;
|
|
6375
|
+
}, "left" | "right" | "pin1" | "pin2" | "anode" | "cathode" | "pos" | "neg", PropsFromHook>;
|
|
6376
|
+
|
|
6377
|
+
declare const useResistor: <PropsFromHook extends Omit<ResistorProps, "name"> | undefined = undefined>(name: string, props?: PropsFromHook | undefined) => ComponentWithPins<ResistorProps, "left" | "right" | "pin1" | "pin2", PropsFromHook>;
|
|
6378
|
+
|
|
6233
6379
|
declare global {
|
|
6234
6380
|
namespace JSX {
|
|
6235
6381
|
interface IntrinsicElements {
|
|
@@ -6277,4 +6423,4 @@ declare global {
|
|
|
6277
6423
|
}
|
|
6278
6424
|
}
|
|
6279
6425
|
|
|
6280
|
-
export { Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Diode, FabricationNotePath, FabricationNoteText, Footprint, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Net, NetAlias, NormalComponent, type PinLabelSpec, PlatedHole, Port, PowerSource, PrimitiveComponent, Project, Renderable, Resistor, SilkscreenCircle, SilkscreenPath, SilkscreenRect, SilkscreenText, SmtPad, Trace, TraceHint, Via, createUseComponent, useRenderedCircuit };
|
|
6426
|
+
export { Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Diode, FabricationNotePath, FabricationNoteText, Footprint, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Net, NetAlias, NormalComponent, type PinLabelSpec, PlatedHole, Port, PowerSource, PrimitiveComponent, Project, Renderable, Resistor, SilkscreenCircle, SilkscreenPath, SilkscreenRect, SilkscreenText, SmtPad, Trace, TraceHint, Via, createUseComponent, useCapacitor, useChip, useDiode, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -4694,6 +4694,37 @@ var createUseComponent = (Component2, pins) => {
|
|
|
4694
4694
|
};
|
|
4695
4695
|
};
|
|
4696
4696
|
|
|
4697
|
+
// lib/hooks/use-capacitor.tsx
|
|
4698
|
+
import { capacitorPins } from "@tscircuit/props";
|
|
4699
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
4700
|
+
var useCapacitor = createUseComponent(
|
|
4701
|
+
(props) => /* @__PURE__ */ jsx2("capacitor", { ...props }),
|
|
4702
|
+
capacitorPins
|
|
4703
|
+
);
|
|
4704
|
+
|
|
4705
|
+
// lib/hooks/use-chip.tsx
|
|
4706
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
4707
|
+
var useChip = (pinLabels) => createUseComponent(
|
|
4708
|
+
(props) => /* @__PURE__ */ jsx3("chip", { pinLabels, ...props }),
|
|
4709
|
+
pinLabels
|
|
4710
|
+
);
|
|
4711
|
+
|
|
4712
|
+
// lib/hooks/use-diode.tsx
|
|
4713
|
+
import { diodePins } from "@tscircuit/props";
|
|
4714
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
4715
|
+
var useDiode = createUseComponent(
|
|
4716
|
+
(props) => /* @__PURE__ */ jsx4("diode", { ...props }),
|
|
4717
|
+
diodePins
|
|
4718
|
+
);
|
|
4719
|
+
|
|
4720
|
+
// lib/hooks/use-resistor.tsx
|
|
4721
|
+
import { resistorPins as resistorPins2 } from "@tscircuit/props";
|
|
4722
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
4723
|
+
var useResistor = createUseComponent(
|
|
4724
|
+
(props) => /* @__PURE__ */ jsx5("resistor", { ...props }),
|
|
4725
|
+
resistorPins2
|
|
4726
|
+
);
|
|
4727
|
+
|
|
4697
4728
|
// lib/register-catalogue.ts
|
|
4698
4729
|
extendCatalogue(components_exports);
|
|
4699
4730
|
extendCatalogue({
|
|
@@ -4735,5 +4766,9 @@ export {
|
|
|
4735
4766
|
TraceHint,
|
|
4736
4767
|
Via,
|
|
4737
4768
|
createUseComponent,
|
|
4738
|
-
|
|
4769
|
+
useCapacitor,
|
|
4770
|
+
useChip,
|
|
4771
|
+
useDiode,
|
|
4772
|
+
useRenderedCircuit,
|
|
4773
|
+
useResistor
|
|
4739
4774
|
};
|