@tscircuit/props 0.0.528 → 0.0.529

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.
@@ -45,6 +45,19 @@ export interface AutorouterDefinition {
45
45
  ) => AutorouterInstance | Promise<AutorouterInstance>
46
46
  }
47
47
 
48
+ /** e.g. "kicad", this is the prefix used to reference libraries in footprinter strings e.g. kicad:Resistor_0402 **/
49
+ type FootprintLibraryPrefix = string
50
+
51
+ /** e.g. "kicad_mod", used to reference file extensions for loaders **/
52
+ type FileExtension = string
53
+
54
+ type FileContent = string | ArrayBufferLike
55
+
56
+ type EsModuleImportResult = {
57
+ __esModule: true
58
+ default: any
59
+ }
60
+
48
61
  export interface PlatformConfig {
49
62
  partsEngine?: PartsEngine
50
63
 
@@ -84,7 +97,7 @@ export interface PlatformConfig {
84
97
  spiceEngineMap?: Record<string, SpiceEngine>
85
98
 
86
99
  footprintLibraryMap?: Record<
87
- string,
100
+ FootprintLibraryPrefix,
88
101
  | ((
89
102
  path: string,
90
103
  options?: { resolvedPcbStyle?: PcbStyle },
@@ -99,7 +112,12 @@ export interface PlatformConfig {
99
112
  >
100
113
  >
101
114
 
102
- footprintFileParserMap?: Record<string, FootprintFileParserEntry>
115
+ footprintFileParserMap?: Record<FileExtension, FootprintFileParserEntry>
116
+
117
+ staticFileLoaderMap?: Record<
118
+ FileExtension,
119
+ (fileContent: FileContent) => Promise<EsModuleImportResult>
120
+ >
103
121
 
104
122
  resolveProjectStaticFileImportUrl?: (path: string) => Promise<string>
105
123
  nodeModulesResolver?: (modulePath: string) => Promise<string | null>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.528",
3
+ "version": "0.0.529",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",