schematic-symbols 0.0.3 → 0.0.5

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.
@@ -9,6 +9,8 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
11
  - uses: actions/checkout@v3
12
+ with:
13
+ token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
12
14
  - name: Setup bun
13
15
  uses: oven-sh/setup-bun@v1
14
16
  with:
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as symbols } from "./symbols"
1
+ import symbols from "./symbols"
2
2
  export type {
3
3
  SchSymbol,
4
4
  BoxPrimitive,
@@ -6,3 +6,17 @@ export type {
6
6
  PathPrimitive,
7
7
  TextPrimitive,
8
8
  } from "./drawing/types"
9
+
10
+ export type BaseSymbolName =
11
+ keyof typeof symbols extends `${infer T}_${infer U}` ? `${T}` : never
12
+
13
+ /**
14
+ * Utility for easier autocomplete:
15
+ *
16
+ * BASE_SYMBOLS.boxresistor
17
+ * // "boxresistor"
18
+ */
19
+ export const BASE_SYMBOLS: Record<BaseSymbolName, BaseSymbolName> =
20
+ Object.fromEntries(Object.keys(symbols).map((k) => [k, k])) as any
21
+
22
+ export { symbols }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "schematic-symbols",
3
3
  "main": "./dist/index.cjs",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "start": "bun run build && bun --hot run dev-server.ts",