forked from tracespace/tracespace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
77 lines (64 loc) · 1.89 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Type definitions for pcb-stackup 4.0
// Project: https://github.com/tracespace/tracespace
// Definitions by: Mike Cousins <https://mike.cousins.io>
/// <reference types="node" />
import {
GerberSource,
ConverterResult,
CreateElement,
Options as GerberOptions,
} from 'gerber-to-svg'
import {
Stackup as CoreStackup,
Layer as CoreLayer,
Options as CoreOptions,
} from 'pcb-stackup-core'
import {GerberSide, GerberType} from 'whats-that-gerber'
declare function pcbStackup<NodeType = string, Layer = pcbStackup.InputLayer>(
layers: Array<Layer>,
done: pcbStackup.Callback<NodeType, Layer>
): void
declare function pcbStackup<NodeType = string, Layer = pcbStackup.InputLayer>(
layers: Array<Layer>,
options: pcbStackup.Options | null,
done: pcbStackup.Callback<NodeType, Layer>
): void
declare function pcbStackup<NodeType = string, Layer = pcbStackup.InputLayer>(
layers: Array<Layer>,
options?: pcbStackup.Options | null
): Promise<pcbStackup.Stackup<NodeType, Layer>>
declare namespace pcbStackup {
interface InputLayer {
filename?: string
gerber?: GerberSource
options?: GerberOptions | string
side?: GerberSide
type?: GerberType
converter?: ConverterResult
externalId?: string | null
}
type OutputLayer<Layer = InputLayer> = Layer &
CoreLayer & {
options: {
id: string
plotAsOutline: boolean | number
createElement: CreateElement
}
}
interface Stackup<NodeType = string, Layer = InputLayer>
extends CoreStackup<NodeType> {
layers: Array<OutputLayer<Layer>>
outlineGapFill: number | null
}
type Options<NodeType = string> = Pick<
CoreOptions,
Exclude<keyof CoreOptions, 'id'>
> & {
id?: string
outlineGapFill?: number
}
interface Callback<NodeType = string, Input = InputLayer> {
(error: Error, stackup: Stackup<NodeType, Input>): unknown
}
}
export = pcbStackup