forked from tracespace/tracespace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
58 lines (48 loc) · 1.39 KB
/
index.d.ts
File metadata and controls
58 lines (48 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Type definitions for pcb-stackup-core 4.0
// Project: https://github.com/tracespace/tracespace
// Definitions by: Mike Cousins <https://mike.cousins.io>
/// <reference types="node" />
import {Converter, ConverterResult, CreateElement} from 'gerber-to-svg'
import {GerberSide, GerberType} from 'whats-that-gerber'
declare function pcbStackupCore<NodeType = string>(
layers: Array<pcbStackupCore.Layer>,
options: string | pcbStackupCore.Options<NodeType>
): pcbStackupCore.Stackup<NodeType>
declare namespace pcbStackupCore {
interface Layer {
side: GerberSide
type: GerberType
converter: Converter
externalId?: string | null
}
interface Options<NodeType = string> {
id: string
color?: ColorOptions
attributes?: Record<string, unknown>
useOutline?: boolean
createElement?: CreateElement<NodeType>
}
interface Stackup<NodeType = string> {
id: string
color: Color
attributes: Record<string, unknown>
useOutline: boolean
createElement: CreateElement<NodeType>
top: StackupSide<NodeType>
bottom: StackupSide<NodeType>
}
interface StackupSide<NodeType = string> extends ConverterResult<NodeType> {
svg: NodeType
}
interface Color {
fr4: string
cu: string
cf: string
sm: string
ss: string
sp: string
out: string
}
type ColorOptions = {[P in keyof Color]?: Color[P] | null}
}
export = pcbStackupCore