@ikalogic/at1000 0.1.26 → 0.1.28

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 (93) hide show
  1. package/build/{at1000-B0emb4U_.cjs → at1000-Buk_qSPK.cjs} +3 -3
  2. package/build/at1000-Buk_qSPK.cjs.map +1 -0
  3. package/build/{at1000-TeP9-fyr.d.mts → at1000-C4BduTvM.d.mts} +7 -7
  4. package/build/at1000-C4BduTvM.d.mts.map +1 -0
  5. package/build/{at1000-Du4TawpS.mjs → at1000-D2141F9Y.mjs} +3 -3
  6. package/build/at1000-D2141F9Y.mjs.map +1 -0
  7. package/build/{at1000-DIVuASWg.d.cts → at1000-LlkehOWj.d.cts} +7 -7
  8. package/build/at1000-LlkehOWj.d.cts.map +1 -0
  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-BdkiKYEE.d.mts +140 -0
  39. package/build/hmi-BdkiKYEE.d.mts.map +1 -0
  40. package/build/hmi-DkO4bd8B.d.cts +140 -0
  41. package/build/hmi-DkO4bd8B.d.cts.map +1 -0
  42. package/build/hmi.cjs +1 -1
  43. package/build/hmi.cjs.map +1 -1
  44. package/build/hmi.d.cts +2 -135
  45. package/build/hmi.d.mts +2 -135
  46. package/build/hmi.mjs +1 -1
  47. package/build/hmi.mjs.map +1 -1
  48. package/build/management-ra61-qUr.d.mts +283 -0
  49. package/build/management-ra61-qUr.d.mts.map +1 -0
  50. package/build/management-wQgti8p7.d.cts +283 -0
  51. package/build/management-wQgti8p7.d.cts.map +1 -0
  52. package/build/management.cjs.map +1 -1
  53. package/build/management.d.cts +2 -283
  54. package/build/management.d.mts +2 -283
  55. package/build/management.mjs.map +1 -1
  56. package/build/node.cjs +1 -1
  57. package/build/node.cjs.map +1 -1
  58. package/build/node.d.cts +1 -1
  59. package/build/node.d.mts +1 -2
  60. package/build/node.d.mts.map +1 -1
  61. package/build/node.mjs +1 -1
  62. package/build/node.mjs.map +1 -1
  63. package/build/power-Bi9cbP8g.d.mts +343 -0
  64. package/build/power-Bi9cbP8g.d.mts.map +1 -0
  65. package/build/power-Dv21KxFx.d.cts +343 -0
  66. package/build/power-Dv21KxFx.d.cts.map +1 -0
  67. package/build/power.cjs +1 -1
  68. package/build/power.d.cts +2 -342
  69. package/build/power.d.mts +3 -343
  70. package/build/power.mjs +1 -1
  71. package/build/relays-C-vNqDM-.d.cts +80 -0
  72. package/build/relays-C-vNqDM-.d.cts.map +1 -0
  73. package/build/relays-CbyqFtJP.d.mts +80 -0
  74. package/build/relays-CbyqFtJP.d.mts.map +1 -0
  75. package/build/relays.d.cts +2 -80
  76. package/build/relays.d.mts +2 -80
  77. package/package.json +7 -7
  78. package/build/at1000-B0emb4U_.cjs.map +0 -1
  79. package/build/at1000-DIVuASWg.d.cts.map +0 -1
  80. package/build/at1000-Du4TawpS.mjs.map +0 -1
  81. package/build/at1000-TeP9-fyr.d.mts.map +0 -1
  82. package/build/com.d.cts.map +0 -1
  83. package/build/com.d.mts.map +0 -1
  84. package/build/gpio.d.cts.map +0 -1
  85. package/build/gpio.d.mts.map +0 -1
  86. package/build/hmi.d.cts.map +0 -1
  87. package/build/hmi.d.mts.map +0 -1
  88. package/build/management.d.cts.map +0 -1
  89. package/build/management.d.mts.map +0 -1
  90. package/build/power.d.cts.map +0 -1
  91. package/build/power.d.mts.map +0 -1
  92. package/build/relays.d.cts.map +0 -1
  93. package/build/relays.d.mts.map +0 -1
@@ -0,0 +1,358 @@
1
+ import { t as AnalogOutputLevel } from "./common-DWQyDOs5.cjs";
2
+ import { n as Information } from "./management-wQgti8p7.cjs";
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 { DigitalInputConfiguration as a, OpenDrainConfiguration as c, PartialDigitalOutputConfiguration as d, PartialOpenDrainConfiguration as f, DigitalIO as i, PartialAnalogOutputConfiguration as l, AnalogInputConfiguration as n, DigitalOutputConfiguration as o, SyncConfiguration as p, AnalogOutputConfiguration as r, GpioApi as s, AnalogIO as t, PartialDigitalInputConfiguration as u };
358
+ //# sourceMappingURL=gpio-C4wCa4w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AAA,CAAiB,KAAA,EAAO,iBAAA,GAAoB,OAAA,CAAQ,yBAAA;;;;;EAe9C,IAAA,CAAA,GAAQ,OAAA;;;;;;EASR,KAAA,CAAM,KAAA,WAAgB,OAAA;AAAA"}
package/build/gpio.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./common-Bbc8Sixu.cjs`);let n=require(`valibot`);n=e.t(n);const r=n.picklist([`release`,`hold`],`Invalid sync action`),i=n.object({mode:n.literal(`analog`),direction:n.literal(`input`)}),a=n.object({mode:n.literal(`analog`),direction:n.literal(`output`),value:n.optional(t.n)}),o=n.object({mode:n.literal(`digital`),direction:n.literal(`input`),vil:t.t,vih:t.t}),s=n.object({mode:n.literal(`digital`),direction:n.literal(`output`),value:t.r,vol:t.n,voh:t.n,vil:t.t,vih:t.t}),c=n.object({mode:n.literal(`digital`),direction:n.literal(`open_drain`),value:t.r,vil:t.t,vih:t.t});n.omit(a,[`direction`,`mode`]),n.omit(o,[`direction`,`mode`]);const l=n.partial(n.omit(s,[`direction`,`mode`]),[`vih`,`vil`]);n.omit(c,[`direction`,`mode`]);const u=n.object({value:t.r}),d=n.object({value:t.t}),f=n.object({action:r});var p=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 m(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 h(this.fetch,e)}hold(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`hold`},schema:f})}release(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`release`},schema:f})}},m=class{constructor(e,t){this.fetch=e,this.id=t}configure_input(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(o,{...e,mode:`digital`,direction:`input`}),schema:o})}configure_output(e){e=n.parse(l,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:n.parse(s,t),schema:s})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:u})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:u})).value}configure_open_drain(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(c,{...e,mode:`digital`,direction:`open_drain`}),schema:c})}},h=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:i})}configure_output(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(a,{value:e,mode:`analog`,direction:`output`}),schema:a})}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}};exports.AnalogIO=h,exports.DigitalIO=m,exports.GpioApi=p;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./common-PXzrB8CC.cjs`);let n=require(`valibot`);n=e.t(n);const r=n.picklist([`release`,`hold`],`Invalid sync action`),i=n.object({mode:n.literal(`analog`),direction:n.literal(`input`)}),a=n.object({mode:n.literal(`analog`),direction:n.literal(`output`),value:n.optional(t.n)}),o=n.object({mode:n.literal(`digital`),direction:n.literal(`input`),vil:t.t,vih:t.t}),s=n.object({mode:n.literal(`digital`),direction:n.literal(`output`),value:t.r,vol:t.n,voh:t.n,vil:t.t,vih:t.t}),c=n.object({mode:n.literal(`digital`),direction:n.literal(`open_drain`),value:t.r,vil:t.t,vih:t.t});n.omit(a,[`direction`,`mode`]),n.omit(o,[`direction`,`mode`]);const l=n.partial(n.omit(s,[`direction`,`mode`]),[`vih`,`vil`]);n.omit(c,[`direction`,`mode`]);const u=n.object({value:t.r}),d=n.object({value:t.t}),f=n.object({action:r});var p=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 m(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 h(this.fetch,e)}hold(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`hold`},schema:f})}release(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`release`},schema:f})}},m=class{constructor(e,t){this.fetch=e,this.id=t}configure_input(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(o,{...e,mode:`digital`,direction:`input`}),schema:o})}configure_output(e){e=n.parse(l,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:n.parse(s,t),schema:s})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:u})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:u})).value}configure_open_drain(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(c,{...e,mode:`digital`,direction:`open_drain`}),schema:c})}},h=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:i})}configure_output(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(a,{value:e,mode:`analog`,direction:`output`}),schema:a})}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}};exports.AnalogIO=h,exports.DigitalIO=m,exports.GpioApi=p;
2
2
  //# sourceMappingURL=gpio.cjs.map