-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathtypes.ts
91 lines (76 loc) · 1.92 KB
/
types.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import type {
PipetteModel,
PipetteModelSpecs,
PipetteName,
} from '@opentrons/shared-data'
// common types
export type Mount = 'left' | 'right'
export interface AttachedPipette {
id: string
name: string
model: string
tip_length: number
mount_axis: string
plunger_axis: string
modelSpecs: PipetteModelSpecs
}
export type AttachedPipettesByMount = {
[mount in Mount]: null | AttachedPipette
}
export type Pipettes = FetchPipettesResponseBody
export interface GetPipettesParams {
refresh?: boolean
}
// API response types
export type FetchPipettesResponsePipette =
| {
id: string
name: PipetteName
model: PipetteModel
tip_length: number
mount_axis: string
plunger_axis: string
}
| {
id: null
name: null
model: null
mount_axis: string
plunger_axis: string
}
export interface FetchPipettesResponseBody {
left: FetchPipettesResponsePipette
right: FetchPipettesResponsePipette
}
export interface PipetteSettingsField {
value: number | null | boolean | undefined
default: number
min?: number
max?: number
units?: string
type?: string
}
interface PipetteQuirksField {
[quirkId: string]: boolean
}
interface QuirksField {
quirks?: PipetteQuirksField
}
export type PipetteSettingsFieldsMap = QuirksField & {
[fieldId: string]: PipetteSettingsField
}
export interface IndividualPipetteSettings {
info: { name: string | null | undefined; model: string | null | undefined }
fields: PipetteSettingsFieldsMap
}
type PipetteSettingsById = Partial<{ [id: string]: IndividualPipetteSettings }>
export type PipetteSettings = PipetteSettingsById
export interface PipetteSettingsUpdateFieldsMap {
[fieldId: string]: PipetteSettingsUpdateField
}
export type PipetteSettingsUpdateField = {
value: PipetteSettingsField['value']
} | null
export interface UpdatePipetteSettingsData {
fields: { [fieldId: string]: PipetteSettingsUpdateField }
}