@tscircuit/core 0.0.178 → 0.0.180

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 CHANGED
@@ -7113,19 +7113,19 @@ declare const useRenderedCircuit: (reactElements: React.ReactElement) => {
7113
7113
  circuitJson?: AnyCircuitElement[];
7114
7114
  };
7115
7115
 
7116
- type PinLabelSpec<PinLabel extends string> = readonly PinLabel[] | readonly (readonly PinLabel[])[] | {
7117
- [key: string]: readonly PinLabel[];
7118
- };
7116
+ type PinLabelSpec<PinLabel extends string, PinNumberKey extends string = never> = readonly PinLabel[] | readonly (readonly PinLabel[])[] | Record<PinNumberKey, readonly PinLabel[]>;
7119
7117
  type ComponentWithPins<Props, PinLabel extends string | never = never, PropsFromHook extends Omit<Props, "name"> | undefined = undefined> = React.ComponentType<(PropsFromHook extends undefined ? Omit<Props, "name"> : Omit<Partial<Props>, "name">) & {
7120
7118
  [key in PinLabel]?: string;
7121
7119
  }> & {
7122
7120
  [key in PinLabel]: string;
7123
7121
  };
7124
- 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>);
7122
+ type CreateUseComponentConstPinLabels = <Props, PinLabel extends string | never = never>(Component: React.ComponentType<Props>, pins: readonly PinLabel[]) => <PropsFromHook extends Omit<Props, "name"> | undefined = undefined>(name: string, props?: PropsFromHook) => ComponentWithPins<Props, PinLabel, PropsFromHook>;
7123
+ type CreateUseComponentPinLabelMap = <Props, PinLabel extends string | never = never, PinNumberKey extends string = never>(Component: React.ComponentType<Props>, pins: Record<PinNumberKey, readonly PinLabel[] | PinLabel[]>) => <PropsFromHook extends Omit<Props, "name"> | undefined = undefined>(name: string, props?: PropsFromHook) => ComponentWithPins<Props, PinLabel | PinNumberKey, PropsFromHook>;
7124
+ declare const createUseComponent: CreateUseComponentConstPinLabels & CreateUseComponentPinLabelMap;
7125
7125
 
7126
7126
  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>;
7127
7127
 
7128
- 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>;
7128
+ declare const useChip: <PinLabel extends string>(pinLabels: Record<string, PinLabel[]>) => <PropsFromHook extends Omit<ChipProps, "name"> | undefined = undefined>(name: string, props?: PropsFromHook | undefined) => ComponentWithPins<ChipProps, string | PinLabel, PropsFromHook>;
7129
7129
 
7130
7130
  declare const useDiode: <PropsFromHook extends Omit<{
7131
7131
  name: string;
package/dist/index.js CHANGED
@@ -5330,7 +5330,9 @@ var createUseComponent = (Component2, pins) => {
5330
5330
  if (Array.isArray(pins)) {
5331
5331
  pinLabelsFlatArray.push(...pins.flat());
5332
5332
  } else if (typeof pins === "object") {
5333
- pinLabelsFlatArray.push(...Object.values(pins).flat());
5333
+ pinLabelsFlatArray.push(
5334
+ ...Object.values(pins).flat()
5335
+ );
5334
5336
  pinLabelsFlatArray.push(...Object.keys(pins));
5335
5337
  }
5336
5338
  const R = (props2) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.178",
4
+ "version": "0.0.180",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -51,7 +51,7 @@
51
51
  "performance-now": "^2.1.0",
52
52
  "react": "^18.3.1",
53
53
  "react-reconciler": "^0.29.2",
54
- "schematic-symbols": "^0.0.97",
54
+ "schematic-symbols": "^0.0.98",
55
55
  "transformation-matrix": "^2.16.1",
56
56
  "zod": "^3.23.8"
57
57
  }