forked from tracespace/tracespace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
54 lines (45 loc) · 1.31 KB
/
index.d.ts
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
// Type definitions for whats-that-gerber 4.0
// Project: https://github.com/tracespace/tracespace
// Definitions by: Mike Cousins <https://mike.cousins.io>
declare function whatsThatGerber<T extends string>(
filenames: ReadonlyArray<T>
): Record<T, whatsThatGerber.GerberProps>
declare namespace whatsThatGerber {
// TODO(mc, 2018-11-21): dedupe this definition and source
const TYPE_COPPER = 'copper'
const TYPE_SOLDERMASK = 'soldermask'
const TYPE_SILKSCREEN = 'silkscreen'
const TYPE_SOLDERPASTE = 'solderpaste'
const TYPE_DRILL = 'drill'
const TYPE_OUTLINE = 'outline'
const TYPE_DRAWING = 'drawing'
// board sides
const SIDE_TOP = 'top'
const SIDE_BOTTOM = 'bottom'
const SIDE_INNER = 'inner'
const SIDE_ALL = 'all'
function validate(
target: Record<string, unknown>
): GerberProps & {valid: boolean}
function getAllLayers(): Array<GerberProps>
type GerberType =
| typeof TYPE_COPPER
| typeof TYPE_SOLDERMASK
| typeof TYPE_SILKSCREEN
| typeof TYPE_SOLDERPASTE
| typeof TYPE_DRILL
| typeof TYPE_OUTLINE
| typeof TYPE_DRAWING
| null
type GerberSide =
| typeof SIDE_TOP
| typeof SIDE_BOTTOM
| typeof SIDE_INNER
| typeof SIDE_ALL
| null
interface GerberProps {
type: GerberType
side: GerberSide
}
}
export = whatsThatGerber