@ikalogic/at1000 0.1.26 → 0.1.27

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.
Files changed (85) hide show
  1. package/build/{at1000-Du4TawpS.mjs → at1000-COqCU7HR.mjs} +2 -2
  2. package/build/{at1000-Du4TawpS.mjs.map → at1000-COqCU7HR.mjs.map} +1 -1
  3. package/build/{at1000-TeP9-fyr.d.mts → at1000-CbtCnc9k.d.mts} +7 -7
  4. package/build/{at1000-TeP9-fyr.d.mts.map → at1000-CbtCnc9k.d.mts.map} +1 -1
  5. package/build/{at1000-B0emb4U_.cjs → at1000-Drc2Gwwh.cjs} +2 -2
  6. package/build/{at1000-B0emb4U_.cjs.map → at1000-Drc2Gwwh.cjs.map} +1 -1
  7. package/build/{at1000-DIVuASWg.d.cts → at1000-iknorBtT.d.cts} +7 -7
  8. package/build/{at1000-DIVuASWg.d.cts.map → at1000-iknorBtT.d.cts.map} +1 -1
  9. package/build/browser.cjs +1 -1
  10. package/build/browser.d.cts +1 -1
  11. package/build/browser.d.mts +1 -2
  12. package/build/browser.d.mts.map +1 -1
  13. package/build/browser.mjs +1 -1
  14. package/build/com-BKy7zoOg.d.mts +1348 -0
  15. package/build/com-BKy7zoOg.d.mts.map +1 -0
  16. package/build/com-lqsVrnqO.d.cts +1348 -0
  17. package/build/com-lqsVrnqO.d.cts.map +1 -0
  18. package/build/com.cjs +1 -1
  19. package/build/com.cjs.map +1 -1
  20. package/build/com.d.cts +2 -1155
  21. package/build/com.d.mts +2 -1155
  22. package/build/com.mjs +1 -1
  23. package/build/com.mjs.map +1 -1
  24. package/build/{common-DJ7WSo1p.d.mts → common-Cc9ZDx5b.d.mts} +1 -1
  25. package/build/{common-DJ7WSo1p.d.mts.map → common-Cc9ZDx5b.d.mts.map} +1 -1
  26. package/build/{common-D4tBd_j2.mjs → common-DzTRbz1N.mjs} +1 -1
  27. package/build/{common-D4tBd_j2.mjs.map → common-DzTRbz1N.mjs.map} +1 -1
  28. package/build/{common-Bbc8Sixu.cjs → common-PXzrB8CC.cjs} +1 -1
  29. package/build/{common-Bbc8Sixu.cjs.map → common-PXzrB8CC.cjs.map} +1 -1
  30. package/build/gpio-B2EhZKM8.d.mts +358 -0
  31. package/build/gpio-B2EhZKM8.d.mts.map +1 -0
  32. package/build/gpio-C4wCa4wG.d.cts +358 -0
  33. package/build/gpio-C4wCa4wG.d.cts.map +1 -0
  34. package/build/gpio.cjs +1 -1
  35. package/build/gpio.d.cts +2 -357
  36. package/build/gpio.d.mts +3 -358
  37. package/build/gpio.mjs +1 -1
  38. package/build/hmi-BVhaUdzh.d.cts +135 -0
  39. package/build/hmi-BVhaUdzh.d.cts.map +1 -0
  40. package/build/hmi-CiHf34mI.d.mts +135 -0
  41. package/build/hmi-CiHf34mI.d.mts.map +1 -0
  42. package/build/hmi.d.cts +2 -135
  43. package/build/hmi.d.mts +2 -135
  44. package/build/management-ra61-qUr.d.mts +283 -0
  45. package/build/management-ra61-qUr.d.mts.map +1 -0
  46. package/build/management-wQgti8p7.d.cts +283 -0
  47. package/build/management-wQgti8p7.d.cts.map +1 -0
  48. package/build/management.cjs.map +1 -1
  49. package/build/management.d.cts +2 -283
  50. package/build/management.d.mts +2 -283
  51. package/build/management.mjs.map +1 -1
  52. package/build/node.cjs +1 -1
  53. package/build/node.cjs.map +1 -1
  54. package/build/node.d.cts +1 -1
  55. package/build/node.d.mts +1 -2
  56. package/build/node.d.mts.map +1 -1
  57. package/build/node.mjs +1 -1
  58. package/build/node.mjs.map +1 -1
  59. package/build/power-Bi9cbP8g.d.mts +343 -0
  60. package/build/power-Bi9cbP8g.d.mts.map +1 -0
  61. package/build/power-Dv21KxFx.d.cts +343 -0
  62. package/build/power-Dv21KxFx.d.cts.map +1 -0
  63. package/build/power.cjs +1 -1
  64. package/build/power.d.cts +2 -342
  65. package/build/power.d.mts +3 -343
  66. package/build/power.mjs +1 -1
  67. package/build/relays-C-vNqDM-.d.cts +80 -0
  68. package/build/relays-C-vNqDM-.d.cts.map +1 -0
  69. package/build/relays-CbyqFtJP.d.mts +80 -0
  70. package/build/relays-CbyqFtJP.d.mts.map +1 -0
  71. package/build/relays.d.cts +2 -80
  72. package/build/relays.d.mts +2 -80
  73. package/package.json +7 -7
  74. package/build/com.d.cts.map +0 -1
  75. package/build/com.d.mts.map +0 -1
  76. package/build/gpio.d.cts.map +0 -1
  77. package/build/gpio.d.mts.map +0 -1
  78. package/build/hmi.d.cts.map +0 -1
  79. package/build/hmi.d.mts.map +0 -1
  80. package/build/management.d.cts.map +0 -1
  81. package/build/management.d.mts.map +0 -1
  82. package/build/power.d.cts.map +0 -1
  83. package/build/power.d.mts.map +0 -1
  84. package/build/relays.d.cts.map +0 -1
  85. package/build/relays.d.mts.map +0 -1
package/build/gpio.d.mts CHANGED
@@ -1,358 +1,3 @@
1
- import { t as AnalogOutputLevel } from "./common-DJ7WSo1p.mjs";
2
- import { Information } from "./management.mjs";
3
- import { UpFetch } from "up-fetch";
4
- import * as v from "valibot";
5
-
6
- //#region src/api/gpio.d.ts
7
- declare const analogInputConfiguration: v.ObjectSchema<{
8
- readonly mode: v.LiteralSchema<"analog", undefined>;
9
- readonly direction: v.LiteralSchema<"input", undefined>;
10
- }, undefined>;
11
- declare const analogOutputConfiguration: v.ObjectSchema<{
12
- readonly mode: v.LiteralSchema<"analog", undefined>;
13
- readonly direction: v.LiteralSchema<"output", undefined>;
14
- readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
15
- }, undefined>;
16
- declare const digitalInputConfiguration: v.ObjectSchema<{
17
- readonly mode: v.LiteralSchema<"digital", undefined>;
18
- readonly direction: v.LiteralSchema<"input", undefined>;
19
- readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
20
- readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
21
- }, undefined>;
22
- declare const digitalOutputConfiguration: v.ObjectSchema<{
23
- readonly mode: v.LiteralSchema<"digital", undefined>;
24
- readonly direction: v.LiteralSchema<"output", undefined>;
25
- readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
26
- readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
27
- readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
28
- readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
29
- readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
30
- }, undefined>;
31
- declare const openDrainConfiguration: v.ObjectSchema<{
32
- readonly mode: v.LiteralSchema<"digital", undefined>;
33
- readonly direction: v.LiteralSchema<"open_drain", undefined>;
34
- readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
35
- readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
36
- readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
37
- }, undefined>;
38
- type AnalogInputConfiguration = v.InferOutput<typeof analogInputConfiguration>;
39
- type AnalogOutputConfiguration = v.InferOutput<typeof analogOutputConfiguration>;
40
- type DigitalInputConfiguration = v.InferOutput<typeof digitalInputConfiguration>;
41
- type DigitalOutputConfiguration = v.InferOutput<typeof digitalOutputConfiguration>;
42
- type OpenDrainConfiguration = v.InferOutput<typeof openDrainConfiguration>;
43
- declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
44
- readonly mode: v.LiteralSchema<"analog", undefined>;
45
- readonly direction: v.LiteralSchema<"output", undefined>;
46
- readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
47
- }, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
48
- readonly entries: Omit<{
49
- readonly mode: v.LiteralSchema<"analog", undefined>;
50
- readonly direction: v.LiteralSchema<"output", undefined>;
51
- readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
52
- }, "mode" | "direction">;
53
- readonly "~standard": v.StandardProps<{
54
- value?: number | undefined;
55
- }, {
56
- value?: number | undefined;
57
- }>;
58
- readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
59
- value?: number | undefined;
60
- }, v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>>;
61
- readonly "~types"?: {
62
- readonly input: {
63
- value?: number | undefined;
64
- };
65
- readonly output: {
66
- value?: number | undefined;
67
- };
68
- readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>;
69
- } | undefined;
70
- };
71
- type PartialAnalogOutputConfiguration = v.InferOutput<typeof partialAnalogOutputConfiguration>;
72
- declare const partialDigitalInputConfiguration: Omit<v.ObjectSchema<{
73
- readonly mode: v.LiteralSchema<"digital", undefined>;
74
- readonly direction: v.LiteralSchema<"input", undefined>;
75
- readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
76
- readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
77
- }, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
78
- readonly entries: Omit<{
79
- readonly mode: v.LiteralSchema<"digital", undefined>;
80
- readonly direction: v.LiteralSchema<"input", undefined>;
81
- readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
82
- readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
83
- }, "mode" | "direction">;
84
- readonly "~standard": v.StandardProps<{
85
- vil: number;
86
- vih: number;
87
- }, {
88
- vil: number;
89
- vih: number;
90
- }>;
91
- readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
92
- vil: number;
93
- vih: number;
94
- }, v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
95
- readonly "~types"?: {
96
- readonly input: {
97
- vil: number;
98
- vih: number;
99
- };
100
- readonly output: {
101
- vil: number;
102
- vih: number;
103
- };
104
- readonly issue: v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
105
- } | undefined;
106
- };
107
- type PartialDigitalInputConfiguration = v.InferOutput<typeof partialDigitalInputConfiguration>;
108
- declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
109
- readonly mode: v.LiteralSchema<"digital", undefined>;
110
- readonly direction: v.LiteralSchema<"output", undefined>;
111
- readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
112
- readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
113
- readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
114
- readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
115
- readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
116
- }, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
117
- readonly entries: Omit<{
118
- readonly mode: v.LiteralSchema<"digital", undefined>;
119
- readonly direction: v.LiteralSchema<"output", undefined>;
120
- readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
121
- readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
122
- readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
123
- readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
124
- readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
125
- }, "mode" | "direction">;
126
- readonly "~standard": v.StandardProps<{
127
- value: number | boolean;
128
- vil: number;
129
- vih: number;
130
- vol: number;
131
- voh: number;
132
- }, {
133
- value: boolean;
134
- vil: number;
135
- vih: number;
136
- vol: number;
137
- voh: number;
138
- }>;
139
- readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
140
- value: boolean;
141
- vil: number;
142
- vih: number;
143
- vol: number;
144
- voh: number;
145
- }, v.NumberIssue | v.MinValueIssue<number, 0> | v.BooleanIssue | v.ObjectIssue | v.MaxValueIssue<number, 24> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>>;
146
- readonly "~types"?: {
147
- readonly input: {
148
- value: number | boolean;
149
- vil: number;
150
- vih: number;
151
- vol: number;
152
- voh: number;
153
- };
154
- readonly output: {
155
- value: boolean;
156
- vil: number;
157
- vih: number;
158
- vol: number;
159
- voh: number;
160
- };
161
- readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.BooleanIssue | v.ObjectIssue | v.MaxValueIssue<number, 24> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>;
162
- } | undefined;
163
- }, "~standard" | "~run" | "~types" | "entries"> & {
164
- readonly entries: {
165
- readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
166
- readonly vil: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
167
- readonly vih: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
168
- readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
169
- readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
170
- };
171
- readonly "~standard": v.StandardProps<{
172
- value: number | boolean;
173
- vil?: number | undefined;
174
- vih?: number | undefined;
175
- vol: number;
176
- voh: number;
177
- }, {
178
- value: boolean;
179
- vil?: number | undefined;
180
- vih?: number | undefined;
181
- vol: number;
182
- voh: number;
183
- }>;
184
- readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
185
- value: boolean;
186
- vil?: number | undefined;
187
- vih?: number | undefined;
188
- vol: number;
189
- voh: number;
190
- }, v.NumberIssue | v.MinValueIssue<number, 0> | v.BooleanIssue | v.ObjectIssue | v.MaxValueIssue<number, 24> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>>;
191
- readonly "~types"?: {
192
- readonly input: {
193
- value: number | boolean;
194
- vil?: number | undefined;
195
- vih?: number | undefined;
196
- vol: number;
197
- voh: number;
198
- };
199
- readonly output: {
200
- value: boolean;
201
- vil?: number | undefined;
202
- vih?: number | undefined;
203
- vol: number;
204
- voh: number;
205
- };
206
- readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.BooleanIssue | v.ObjectIssue | v.MaxValueIssue<number, 24> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>;
207
- } | undefined;
208
- };
209
- type PartialDigitalOutputConfiguration = v.InferInput<typeof partialDigitalOutputConfiguration>;
210
- declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
211
- readonly mode: v.LiteralSchema<"digital", undefined>;
212
- readonly direction: v.LiteralSchema<"open_drain", undefined>;
213
- readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
214
- readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
215
- readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
216
- }, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
217
- readonly entries: Omit<{
218
- readonly mode: v.LiteralSchema<"digital", undefined>;
219
- readonly direction: v.LiteralSchema<"open_drain", undefined>;
220
- readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
221
- readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
222
- readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
223
- }, "mode" | "direction">;
224
- readonly "~standard": v.StandardProps<{
225
- value: number | boolean;
226
- vil: number;
227
- vih: number;
228
- }, {
229
- value: boolean;
230
- vil: number;
231
- vih: number;
232
- }>;
233
- readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
234
- value: boolean;
235
- vil: number;
236
- vih: number;
237
- }, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>>;
238
- readonly "~types"?: {
239
- readonly input: {
240
- value: number | boolean;
241
- vil: number;
242
- vih: number;
243
- };
244
- readonly output: {
245
- value: boolean;
246
- vil: number;
247
- vih: number;
248
- };
249
- readonly issue: v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>;
250
- } | undefined;
251
- };
252
- type PartialOpenDrainConfiguration = v.InferOutput<typeof partialOpenDrainConfiguration>;
253
- declare const syncConfiguration: v.ObjectSchema<{
254
- readonly action: v.PicklistSchema<["release", "hold"], "Invalid sync action">;
255
- }, undefined>;
256
- type SyncConfiguration = v.InferOutput<typeof syncConfiguration>;
257
- /** @hideconstructor */
258
- declare class GpioApi {
259
- private readonly fetch;
260
- private count;
261
- constructor(fetch: UpFetch, info: Information);
262
- /**
263
- * Resets all IO configurations to default.
264
- */
265
- reset(): Promise<void>;
266
- /**
267
- * Access a specific digital IO pin by id.
268
- * @param io The IO pin id.
269
- * @returns The digital IO instance.
270
- */
271
- digital(io: number): DigitalIO;
272
- /**
273
- * Access a specific analog IO pin by id.
274
- * @param io The IO pin id.
275
- * @returns The analog IO instance.
276
- */
277
- analog(io: number): AnalogIO;
278
- /**
279
- * Holds the current state of all GPIO pins.
280
- * @returns The applied sync state.
281
- */
282
- hold(): Promise<SyncConfiguration>;
283
- /**
284
- * Releases control of the IO pins, allowing external control.
285
- *
286
- * This also sets the device as a slave.
287
- *
288
- * @returns The applied sync state.
289
- */
290
- release(): Promise<SyncConfiguration>;
291
- }
292
- /** @hideconstructor */
293
- declare class DigitalIO {
294
- private readonly fetch;
295
- readonly id: number;
296
- constructor(fetch: UpFetch, id: number);
297
- /**
298
- * Configure the pin as a digital input.
299
- * @param config The digital input configuration.
300
- * @returns The applied configuration.
301
- */
302
- configure_input(config: PartialDigitalInputConfiguration): Promise<DigitalInputConfiguration>;
303
- /**
304
- * Configures the pin as a digital output.
305
- * @param config The digital output configuration.
306
- * @returns The applied configuration.
307
- */
308
- configure_output(config: PartialDigitalOutputConfiguration): Promise<DigitalOutputConfiguration>;
309
- /**
310
- * Reads the current state of the pin.
311
- * @returns The current state of the pin.
312
- */
313
- read(): Promise<boolean>;
314
- /**
315
- * Writes a value to the pin.
316
- * @param value The value to write.
317
- * @returns The written value.
318
- */
319
- write(value: boolean | number): Promise<boolean>;
320
- /**
321
- * Configure the pin as an open drain output.
322
- * @param config The open drain configuration.
323
- * @returns The applied configuration.
324
- */
325
- configure_open_drain(config: PartialOpenDrainConfiguration): Promise<OpenDrainConfiguration>;
326
- }
327
- /** @hideconstructor */
328
- declare class AnalogIO {
329
- private readonly fetch;
330
- readonly id: number;
331
- constructor(fetch: UpFetch, id: number);
332
- /**
333
- * Configures the pin as an analog input.
334
- * @returns The applied configuration.
335
- * @returns The applied configuration.
336
- */
337
- configure_input(): Promise<AnalogInputConfiguration>;
338
- /**
339
- * Configures the pin as an analog output.
340
- * @param config The analog output configuration.
341
- * @returns The applied configuration.
342
- */
343
- configure_output(value: AnalogOutputLevel): Promise<AnalogOutputConfiguration>;
344
- /**
345
- * Reads the current state of the pin.
346
- * @returns The current state of the pin.
347
- */
348
- read(): Promise<number>;
349
- /**
350
- * Writes a value to the pin.
351
- * @param value The value to write.
352
- * @returns The written value.
353
- */
354
- write(value: number): Promise<number>;
355
- }
356
- //#endregion
357
- export { AnalogIO, AnalogInputConfiguration, AnalogOutputConfiguration, type AnalogOutputLevel, DigitalIO, DigitalInputConfiguration, DigitalOutputConfiguration, GpioApi, OpenDrainConfiguration, PartialAnalogOutputConfiguration, PartialDigitalInputConfiguration, PartialDigitalOutputConfiguration, PartialOpenDrainConfiguration, SyncConfiguration };
358
- //# sourceMappingURL=gpio.d.mts.map
1
+ import { t as AnalogOutputLevel } from "./common-Cc9ZDx5b.mjs";
2
+ import { a as DigitalInputConfiguration, c as OpenDrainConfiguration, d as PartialDigitalOutputConfiguration, f as PartialOpenDrainConfiguration, i as DigitalIO, l as PartialAnalogOutputConfiguration, n as AnalogInputConfiguration, o as DigitalOutputConfiguration, p as SyncConfiguration, r as AnalogOutputConfiguration, s as GpioApi, t as AnalogIO, u as PartialDigitalInputConfiguration } from "./gpio-B2EhZKM8.mjs";
3
+ export { AnalogIO, AnalogInputConfiguration, AnalogOutputConfiguration, AnalogOutputLevel, DigitalIO, DigitalInputConfiguration, DigitalOutputConfiguration, GpioApi, OpenDrainConfiguration, PartialAnalogOutputConfiguration, PartialDigitalInputConfiguration, PartialDigitalOutputConfiguration, PartialOpenDrainConfiguration, SyncConfiguration };
package/build/gpio.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{n as e,r as t,t as n}from"./common-D4tBd_j2.mjs";import*as r from"valibot";const i=r.picklist([`release`,`hold`],`Invalid sync action`),a=r.object({mode:r.literal(`analog`),direction:r.literal(`input`)}),o=r.object({mode:r.literal(`analog`),direction:r.literal(`output`),value:r.optional(e)}),s=r.object({mode:r.literal(`digital`),direction:r.literal(`input`),vil:n,vih:n}),c=r.object({mode:r.literal(`digital`),direction:r.literal(`output`),value:t,vol:e,voh:e,vil:n,vih:n}),l=r.object({mode:r.literal(`digital`),direction:r.literal(`open_drain`),value:t,vil:n,vih:n});r.omit(o,[`direction`,`mode`]),r.omit(s,[`direction`,`mode`]);const u=r.partial(r.omit(c,[`direction`,`mode`]),[`vih`,`vil`]);r.omit(l,[`direction`,`mode`]);const d=r.object({value:t}),f=r.object({value:n}),p=r.object({action:i});var m=class{count;constructor(e,t){this.fetch=e,this.count=t.capabilities.io.count}reset(){return this.fetch(`/gpio/reset`,{method:`POST`,parseResponse:()=>{}})}digital(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new h(this.fetch,e)}analog(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new g(this.fetch,e)}hold(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`hold`},schema:p})}release(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`release`},schema:p})}},h=class{constructor(e,t){this.fetch=e,this.id=t}configure_input(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:r.parse(s,{...e,mode:`digital`,direction:`input`}),schema:s})}configure_output(e){e=r.parse(u,e);let t={mode:`digital`,direction:`output`,value:e.value,vol:e.vol,voh:e.voh,vil:e.vil??e.vol+(e.voh-e.vol)/4,vih:e.vih??e.voh-(e.voh-e.vol)/4};return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:r.parse(c,t),schema:c})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:d})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:d})).value}configure_open_drain(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:r.parse(l,{...e,mode:`digital`,direction:`open_drain`}),schema:l})}},g=class{constructor(e,t){this.fetch=e,this.id=t}configure_input(){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:{mode:`analog`,direction:`input`},schema:a})}configure_output(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:r.parse(o,{value:e,mode:`analog`,direction:`output`}),schema:o})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:f})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:f})).value}};export{g as AnalogIO,h as DigitalIO,m as GpioApi};
1
+ import{n as e,r as t,t as n}from"./common-DzTRbz1N.mjs";import*as r from"valibot";const i=r.picklist([`release`,`hold`],`Invalid sync action`),a=r.object({mode:r.literal(`analog`),direction:r.literal(`input`)}),o=r.object({mode:r.literal(`analog`),direction:r.literal(`output`),value:r.optional(e)}),s=r.object({mode:r.literal(`digital`),direction:r.literal(`input`),vil:n,vih:n}),c=r.object({mode:r.literal(`digital`),direction:r.literal(`output`),value:t,vol:e,voh:e,vil:n,vih:n}),l=r.object({mode:r.literal(`digital`),direction:r.literal(`open_drain`),value:t,vil:n,vih:n});r.omit(o,[`direction`,`mode`]),r.omit(s,[`direction`,`mode`]);const u=r.partial(r.omit(c,[`direction`,`mode`]),[`vih`,`vil`]);r.omit(l,[`direction`,`mode`]);const d=r.object({value:t}),f=r.object({value:n}),p=r.object({action:i});var m=class{count;constructor(e,t){this.fetch=e,this.count=t.capabilities.io.count}reset(){return this.fetch(`/gpio/reset`,{method:`POST`,parseResponse:()=>{}})}digital(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new h(this.fetch,e)}analog(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new g(this.fetch,e)}hold(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`hold`},schema:p})}release(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`release`},schema:p})}},h=class{constructor(e,t){this.fetch=e,this.id=t}configure_input(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:r.parse(s,{...e,mode:`digital`,direction:`input`}),schema:s})}configure_output(e){e=r.parse(u,e);let t={mode:`digital`,direction:`output`,value:e.value,vol:e.vol,voh:e.voh,vil:e.vil??e.vol+(e.voh-e.vol)/4,vih:e.vih??e.voh-(e.voh-e.vol)/4};return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:r.parse(c,t),schema:c})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:d})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:d})).value}configure_open_drain(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:r.parse(l,{...e,mode:`digital`,direction:`open_drain`}),schema:l})}},g=class{constructor(e,t){this.fetch=e,this.id=t}configure_input(){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:{mode:`analog`,direction:`input`},schema:a})}configure_output(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:r.parse(o,{value:e,mode:`analog`,direction:`output`}),schema:o})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:f})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:f})).value}};export{g as AnalogIO,h as DigitalIO,m as GpioApi};
2
2
  //# sourceMappingURL=gpio.mjs.map
@@ -0,0 +1,135 @@
1
+ import { UpFetch } from "up-fetch";
2
+ import * as v from "valibot";
3
+
4
+ //#region src/api/hmi.d.ts
5
+ declare const screenText: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 1024, undefined>]>;
6
+ type ScreenText = v.InferOutput<typeof screenText>;
7
+ declare const color: v.ObjectSchema<{
8
+ readonly text: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 7, undefined>, v.HexColorAction<string, undefined>]>, undefined>;
9
+ readonly progress: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 7, undefined>, v.HexColorAction<string, undefined>]>, undefined>;
10
+ readonly background: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 7, undefined>, v.HexColorAction<string, undefined>]>, undefined>;
11
+ }, undefined>;
12
+ type Color = v.InferOutput<typeof color>;
13
+ declare const progressValue: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100, undefined>]>;
14
+ type ProgressValue = v.InferOutput<typeof progressValue>;
15
+ declare const progress: v.ObjectSchema<{
16
+ readonly progress: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100, undefined>]>;
17
+ }, undefined>;
18
+ type Progress = v.InferOutput<typeof progress>;
19
+ declare const playbackConfiguration: v.ObjectSchema<{
20
+ readonly sound_id: v.PicklistSchema<["success", "warning", "failure", "notification_1", "notification_2", "imperial_march"], undefined>;
21
+ readonly volume: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100, undefined>]>;
22
+ }, undefined>;
23
+ type PlaybackConfiguration = v.InferOutput<typeof playbackConfiguration>;
24
+ declare const knobEvent: Omit<v.ObjectSchema<{
25
+ readonly button_pressed: v.BooleanSchema<undefined>;
26
+ readonly button_held: v.BooleanSchema<undefined>;
27
+ readonly rotation_delta: v.NumberSchema<undefined>;
28
+ }, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
29
+ readonly entries: Omit<{
30
+ readonly button_pressed: v.BooleanSchema<undefined>;
31
+ readonly button_held: v.BooleanSchema<undefined>;
32
+ readonly rotation_delta: v.NumberSchema<undefined>;
33
+ }, "button_held">;
34
+ readonly "~standard": v.StandardProps<{
35
+ button_pressed: boolean;
36
+ rotation_delta: number;
37
+ }, {
38
+ button_pressed: boolean;
39
+ rotation_delta: number;
40
+ }>;
41
+ readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
42
+ button_pressed: boolean;
43
+ rotation_delta: number;
44
+ }, v.NumberIssue | v.BooleanIssue | v.ObjectIssue>;
45
+ readonly "~types"?: {
46
+ readonly input: {
47
+ button_pressed: boolean;
48
+ rotation_delta: number;
49
+ };
50
+ readonly output: {
51
+ button_pressed: boolean;
52
+ rotation_delta: number;
53
+ };
54
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.ObjectIssue;
55
+ } | undefined;
56
+ };
57
+ type KnobEvent = v.InferOutput<typeof knobEvent>;
58
+ /** @hideconstructor */
59
+ declare class HmiApi {
60
+ private readonly fetch;
61
+ constructor(fetch: UpFetch);
62
+ /**
63
+ * Resets the HMI.
64
+ */
65
+ reset(): Promise<void>;
66
+ /**
67
+ * Access the screen API.
68
+ * @returns The screen instance.
69
+ */
70
+ screen(): Screen;
71
+ /**
72
+ * Access the audio API.
73
+ * @returns The audio instance.
74
+ */
75
+ audio(): Audio;
76
+ /**
77
+ * Access the knob API.
78
+ * @returns The knob instance.
79
+ */
80
+ knob(): Knob;
81
+ }
82
+ /** @hideconstructor */
83
+ declare class Screen {
84
+ private readonly fetch;
85
+ constructor(fetch: UpFetch);
86
+ /**
87
+ * Prints text to the screen.
88
+ * @param data The text to print.
89
+ * @returns The printed text.
90
+ */
91
+ print(data: ScreenText): Promise<string>;
92
+ /**
93
+ * Sets the screen colors.
94
+ * @param colors The colors to set.
95
+ * @returns The updated colors.
96
+ */
97
+ colors(colors: Color): Promise<Color>;
98
+ /**
99
+ * Sets the screen progress.
100
+ * @param data The progress value to set.
101
+ * @returns The updated progress.
102
+ */
103
+ progress(data: ProgressValue): Promise<Progress>;
104
+ /**
105
+ * Clears the screen.
106
+ */
107
+ clear(): Promise<void>;
108
+ }
109
+ /** @hideconstructor */
110
+ declare class Audio {
111
+ private readonly fetch;
112
+ constructor(fetch: UpFetch);
113
+ /**
114
+ * Plays a sound.
115
+ * @param config The configuration (sound_id, volume).
116
+ * @returns The play configuration.
117
+ */
118
+ play(config: PlaybackConfiguration): Promise<PlaybackConfiguration>;
119
+ }
120
+ /** @hideconstructor */
121
+ declare class Knob {
122
+ private readonly fetch;
123
+ constructor(fetch: UpFetch);
124
+ private get_knob_event;
125
+ is_button_pressed: () => Promise<boolean>;
126
+ /**
127
+ * Waits for a knob event and returns it.
128
+ * @param timeout_ms The timeout in milliseconds.
129
+ * @returns The knob event or null if the timeout was reached.
130
+ */
131
+ wait_event(timeout_ms: number): Promise<KnobEvent | null>;
132
+ }
133
+ //#endregion
134
+ export { KnobEvent as a, ProgressValue as c, Knob as i, Screen as l, Color as n, PlaybackConfiguration as o, HmiApi as r, Progress as s, Audio as t, ScreenText as u };
135
+ //# sourceMappingURL=hmi-BVhaUdzh.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hmi-BVhaUdzh.d.cts","names":[],"sources":["../src/api/hmi.ts"],"mappings":";;;;cAGM,UAAA,EAAU,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,YAAA,aAAA,CAAA,CAAA,eAAA;AAAA,KACJ,UAAA,GAAa,CAAA,CAAE,WAAA,QAAmB,UAAA;AAAA,cAMxC,KAAA,EAAK,CAAA,CAAA,YAAA;EAAA;;;;KAKC,KAAA,GAAQ,CAAA,CAAE,WAAA,QAAmB,KAAA;AAAA,cAEnC,aAAA,EAAa,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,YAAA,aAAA,CAAA,CAAA,cAAA,wBAAA,CAAA,CAAA,cAAA;AAAA,KACP,aAAA,GAAgB,CAAA,CAAE,WAAA,QAAmB,aAAA;AAAA,cAC3C,QAAA,EAAQ,CAAA,CAAA,YAAA;EAAA;;KACF,QAAA,GAAW,CAAA,CAAE,WAAA,QAAmB,QAAA;AAAA,cAEtC,qBAAA,EAAqB,CAAA,CAAA,YAAA;EAAA;;;KAOf,qBAAA,GAAwB,CAAA,CAAE,WAAA,QAAmB,qBAAA;AAAA,cAOnD,SAAA,EAAS,IAAA,CAAA,CAAA,CAAA,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACH,SAAA,GAAY,CAAA,CAAE,WAAA,QAAmB,SAAA;;cAGhC,MAAA;EAAA,iBACkB,KAAA;cAAA,KAAA,EAAO,OAAA;;;;EAKpC,KAAA,CAAA,GAAS,OAAA;;;;;EAQT,MAAA,CAAA,GAAU,MAAA;;;;;EAQV,KAAA,CAAA,GAAS,KAAA;;;;;EAQT,IAAA,CAAA,GAAQ,IAAA;AAAA;;cAMG,MAAA;EAAA,iBACkB,KAAA;cAAA,KAAA,EAAO,OAAA;;;;;AA9DtC;EAqEQ,KAAA,CAAM,IAAA,EAAM,UAAA,GAAa,OAAA;;;;;;EAc/B,MAAA,CAAO,MAAA,EAAQ,KAAA,GAAQ,OAAA,CAAQ,KAAA;EAnFa;AAAE;;;;EAgGxC,QAAA,CAAS,IAAA,EAAM,aAAA,GAAgB,OAAA,CAAQ,QAAA;EA9F5B;;;EAgHjB,KAAA,CAAA,GAAS,OAAA;AAAA;;cAME,KAAA;EAAA,iBACkB,KAAA;cAAA,KAAA,EAAO,OAAA;EAvHnB;;;;;EA8HX,IAAA,CAAK,MAAA,EAAQ,qBAAA,GAAwB,OAAA,CAAQ,qBAAA;AAAA;;cAUxC,IAAA;EAAA,iBACkB,KAAA;cAAA,KAAA,EAAO,OAAA;EAAA,QAE5B,cAAA;EAGR,iBAAA,QAAiB,OAAA;EA7I2C;AAAE;;;;EAoJxD,UAAA,CAAW,UAAA,WAAqB,OAAA,CAAQ,SAAA;AAAA"}
@@ -0,0 +1,135 @@
1
+ import { UpFetch } from "up-fetch";
2
+ import * as v from "valibot";
3
+
4
+ //#region src/api/hmi.d.ts
5
+ declare const screenText: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 1024, undefined>]>;
6
+ type ScreenText = v.InferOutput<typeof screenText>;
7
+ declare const color: v.ObjectSchema<{
8
+ readonly text: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 7, undefined>, v.HexColorAction<string, undefined>]>, undefined>;
9
+ readonly progress: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 7, undefined>, v.HexColorAction<string, undefined>]>, undefined>;
10
+ readonly background: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 7, undefined>, v.HexColorAction<string, undefined>]>, undefined>;
11
+ }, undefined>;
12
+ type Color = v.InferOutput<typeof color>;
13
+ declare const progressValue: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100, undefined>]>;
14
+ type ProgressValue = v.InferOutput<typeof progressValue>;
15
+ declare const progress: v.ObjectSchema<{
16
+ readonly progress: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100, undefined>]>;
17
+ }, undefined>;
18
+ type Progress = v.InferOutput<typeof progress>;
19
+ declare const playbackConfiguration: v.ObjectSchema<{
20
+ readonly sound_id: v.PicklistSchema<["success", "warning", "failure", "notification_1", "notification_2", "imperial_march"], undefined>;
21
+ readonly volume: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100, undefined>]>;
22
+ }, undefined>;
23
+ type PlaybackConfiguration = v.InferOutput<typeof playbackConfiguration>;
24
+ declare const knobEvent: Omit<v.ObjectSchema<{
25
+ readonly button_pressed: v.BooleanSchema<undefined>;
26
+ readonly button_held: v.BooleanSchema<undefined>;
27
+ readonly rotation_delta: v.NumberSchema<undefined>;
28
+ }, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
29
+ readonly entries: Omit<{
30
+ readonly button_pressed: v.BooleanSchema<undefined>;
31
+ readonly button_held: v.BooleanSchema<undefined>;
32
+ readonly rotation_delta: v.NumberSchema<undefined>;
33
+ }, "button_held">;
34
+ readonly "~standard": v.StandardProps<{
35
+ button_pressed: boolean;
36
+ rotation_delta: number;
37
+ }, {
38
+ button_pressed: boolean;
39
+ rotation_delta: number;
40
+ }>;
41
+ readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
42
+ button_pressed: boolean;
43
+ rotation_delta: number;
44
+ }, v.NumberIssue | v.BooleanIssue | v.ObjectIssue>;
45
+ readonly "~types"?: {
46
+ readonly input: {
47
+ button_pressed: boolean;
48
+ rotation_delta: number;
49
+ };
50
+ readonly output: {
51
+ button_pressed: boolean;
52
+ rotation_delta: number;
53
+ };
54
+ readonly issue: v.NumberIssue | v.BooleanIssue | v.ObjectIssue;
55
+ } | undefined;
56
+ };
57
+ type KnobEvent = v.InferOutput<typeof knobEvent>;
58
+ /** @hideconstructor */
59
+ declare class HmiApi {
60
+ private readonly fetch;
61
+ constructor(fetch: UpFetch);
62
+ /**
63
+ * Resets the HMI.
64
+ */
65
+ reset(): Promise<void>;
66
+ /**
67
+ * Access the screen API.
68
+ * @returns The screen instance.
69
+ */
70
+ screen(): Screen;
71
+ /**
72
+ * Access the audio API.
73
+ * @returns The audio instance.
74
+ */
75
+ audio(): Audio;
76
+ /**
77
+ * Access the knob API.
78
+ * @returns The knob instance.
79
+ */
80
+ knob(): Knob;
81
+ }
82
+ /** @hideconstructor */
83
+ declare class Screen {
84
+ private readonly fetch;
85
+ constructor(fetch: UpFetch);
86
+ /**
87
+ * Prints text to the screen.
88
+ * @param data The text to print.
89
+ * @returns The printed text.
90
+ */
91
+ print(data: ScreenText): Promise<string>;
92
+ /**
93
+ * Sets the screen colors.
94
+ * @param colors The colors to set.
95
+ * @returns The updated colors.
96
+ */
97
+ colors(colors: Color): Promise<Color>;
98
+ /**
99
+ * Sets the screen progress.
100
+ * @param data The progress value to set.
101
+ * @returns The updated progress.
102
+ */
103
+ progress(data: ProgressValue): Promise<Progress>;
104
+ /**
105
+ * Clears the screen.
106
+ */
107
+ clear(): Promise<void>;
108
+ }
109
+ /** @hideconstructor */
110
+ declare class Audio {
111
+ private readonly fetch;
112
+ constructor(fetch: UpFetch);
113
+ /**
114
+ * Plays a sound.
115
+ * @param config The configuration (sound_id, volume).
116
+ * @returns The play configuration.
117
+ */
118
+ play(config: PlaybackConfiguration): Promise<PlaybackConfiguration>;
119
+ }
120
+ /** @hideconstructor */
121
+ declare class Knob {
122
+ private readonly fetch;
123
+ constructor(fetch: UpFetch);
124
+ private get_knob_event;
125
+ is_button_pressed: () => Promise<boolean>;
126
+ /**
127
+ * Waits for a knob event and returns it.
128
+ * @param timeout_ms The timeout in milliseconds.
129
+ * @returns The knob event or null if the timeout was reached.
130
+ */
131
+ wait_event(timeout_ms: number): Promise<KnobEvent | null>;
132
+ }
133
+ //#endregion
134
+ export { KnobEvent as a, ProgressValue as c, Knob as i, Screen as l, Color as n, PlaybackConfiguration as o, HmiApi as r, Progress as s, Audio as t, ScreenText as u };
135
+ //# sourceMappingURL=hmi-CiHf34mI.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hmi-CiHf34mI.d.mts","names":[],"sources":["../src/api/hmi.ts"],"mappings":";;;;cAGM,UAAA,EAAU,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,YAAA,aAAA,CAAA,CAAA,eAAA;AAAA,KACJ,UAAA,GAAa,CAAA,CAAE,WAAA,QAAmB,UAAA;AAAA,cAMxC,KAAA,EAAK,CAAA,CAAA,YAAA;EAAA;;;;KAKC,KAAA,GAAQ,CAAA,CAAE,WAAA,QAAmB,KAAA;AAAA,cAEnC,aAAA,EAAa,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,YAAA,aAAA,CAAA,CAAA,cAAA,wBAAA,CAAA,CAAA,cAAA;AAAA,KACP,aAAA,GAAgB,CAAA,CAAE,WAAA,QAAmB,aAAA;AAAA,cAC3C,QAAA,EAAQ,CAAA,CAAA,YAAA;EAAA;;KACF,QAAA,GAAW,CAAA,CAAE,WAAA,QAAmB,QAAA;AAAA,cAEtC,qBAAA,EAAqB,CAAA,CAAA,YAAA;EAAA;;;KAOf,qBAAA,GAAwB,CAAA,CAAE,WAAA,QAAmB,qBAAA;AAAA,cAOnD,SAAA,EAAS,IAAA,CAAA,CAAA,CAAA,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACH,SAAA,GAAY,CAAA,CAAE,WAAA,QAAmB,SAAA;;cAGhC,MAAA;EAAA,iBACkB,KAAA;cAAA,KAAA,EAAO,OAAA;;;;EAKpC,KAAA,CAAA,GAAS,OAAA;;;;;EAQT,MAAA,CAAA,GAAU,MAAA;;;;;EAQV,KAAA,CAAA,GAAS,KAAA;;;;;EAQT,IAAA,CAAA,GAAQ,IAAA;AAAA;;cAMG,MAAA;EAAA,iBACkB,KAAA;cAAA,KAAA,EAAO,OAAA;;;;;AA9DtC;EAqEQ,KAAA,CAAM,IAAA,EAAM,UAAA,GAAa,OAAA;;;;;;EAc/B,MAAA,CAAO,MAAA,EAAQ,KAAA,GAAQ,OAAA,CAAQ,KAAA;EAnFa;AAAE;;;;EAgGxC,QAAA,CAAS,IAAA,EAAM,aAAA,GAAgB,OAAA,CAAQ,QAAA;EA9F5B;;;EAgHjB,KAAA,CAAA,GAAS,OAAA;AAAA;;cAME,KAAA;EAAA,iBACkB,KAAA;cAAA,KAAA,EAAO,OAAA;EAvHnB;;;;;EA8HX,IAAA,CAAK,MAAA,EAAQ,qBAAA,GAAwB,OAAA,CAAQ,qBAAA;AAAA;;cAUxC,IAAA;EAAA,iBACkB,KAAA;cAAA,KAAA,EAAO,OAAA;EAAA,QAE5B,cAAA;EAGR,iBAAA,QAAiB,OAAA;EA7I2C;AAAE;;;;EAoJxD,UAAA,CAAW,UAAA,WAAqB,OAAA,CAAQ,SAAA;AAAA"}