@medwand/mwsdk-javascript 0.0.0-stage → 3.2.2
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.
- package/README.md +79 -2
- package/dist/index.d.ts +1248 -0
- package/dist/index.js +49 -0
- package/dist/medwand-browser-sdk.js +1 -0
- package/package.json +38 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1248 @@
|
|
|
1
|
+
declare type CameraEvents = {
|
|
2
|
+
/**
|
|
3
|
+
* Occurs when a new frame is ready to be processed.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This event provides the raw frame data as a `Uint8ClampedArray` of RGBA pixels.
|
|
7
|
+
* Subscribers can use this data for further processing, such as rendering or saving the frame.
|
|
8
|
+
*/
|
|
9
|
+
FrameReady: Uint8ClampedArray;
|
|
10
|
+
/**
|
|
11
|
+
* Occurs when a recorded frame is ready for processing or display.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* This event is triggered after a frame has been recorded by the camera module.
|
|
15
|
+
* The event provides the recorded frame data as a `Uint8ClampedArray` of RGBA pixels.
|
|
16
|
+
*/
|
|
17
|
+
RecordedFrameReady: Uint8ClampedArray;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Specifies the available camera modes for the MedWand SDK.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* This enumeration defines the operational modes for cameras supported by the MedWand SDK,
|
|
25
|
+
* including modes for turning the camera off, using it as a dermatoscope, or as an otoscope.
|
|
26
|
+
*/
|
|
27
|
+
export declare enum CameraModes {
|
|
28
|
+
/** The camera is turned off. */
|
|
29
|
+
Off = 0,
|
|
30
|
+
/** The camera is operating in dermatoscope mode, suitable for skin examinations. */
|
|
31
|
+
Dermatoscope = 1,
|
|
32
|
+
/** The camera is operating in otoscope mode, suitable for ear examinations. */
|
|
33
|
+
Otoscope = 2
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Represents a module for managing camera events within a browser application.
|
|
38
|
+
*/
|
|
39
|
+
export declare class CameraModule extends TypedEventTarget<CameraEvents> {
|
|
40
|
+
/** Stops preview, releases camera media resources, and removes event subscriptions. */
|
|
41
|
+
Dispose(): void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Represents the various states of a device within the device state machine.
|
|
46
|
+
*/
|
|
47
|
+
export declare enum DeviceState {
|
|
48
|
+
/**
|
|
49
|
+
* Indicates that the device is not currently connected.
|
|
50
|
+
*/
|
|
51
|
+
NotConnected = 0,
|
|
52
|
+
/**
|
|
53
|
+
* Indicates that the device is in the process of establishing a connection.
|
|
54
|
+
*/
|
|
55
|
+
Connecting = 1,
|
|
56
|
+
/**
|
|
57
|
+
* Indicates that the device is successfully connected and ready for further operations.
|
|
58
|
+
*/
|
|
59
|
+
Connected = 2,
|
|
60
|
+
/**
|
|
61
|
+
* Indicates that the device is in the process of initializing.
|
|
62
|
+
* This state occurs after the device has connected but before it is fully initialized.
|
|
63
|
+
*/
|
|
64
|
+
Initializing = 3,
|
|
65
|
+
/**
|
|
66
|
+
* Indicates that the device has completed the initialization process
|
|
67
|
+
* and is ready for operation.
|
|
68
|
+
*/
|
|
69
|
+
Initialized = 4,
|
|
70
|
+
/**
|
|
71
|
+
* Represents the state where the device is in the process of disconnecting from its current connection.
|
|
72
|
+
*/
|
|
73
|
+
DisConnecting = 5,
|
|
74
|
+
/**
|
|
75
|
+
* Represents a state in the device state machine, indicating that the device has a required firmware update pending.
|
|
76
|
+
*/
|
|
77
|
+
FirmwareUpdateRequired = 6,
|
|
78
|
+
/**
|
|
79
|
+
* Represents a state in the device state machine, indicating that the device is updating the firmware.
|
|
80
|
+
*/
|
|
81
|
+
FirmwareUpdating = 7,
|
|
82
|
+
/**
|
|
83
|
+
* Represents an error state in the device state machine, indicating that the device has encountered an issue.
|
|
84
|
+
*/
|
|
85
|
+
Error = 8
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare type EcgEvents = {
|
|
89
|
+
/**
|
|
90
|
+
* Occurs when a recorded ECG strip is ready for processing or display.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* This event is triggered after the ECG recording is stopped and the recorded data is converted into a bitmap.
|
|
94
|
+
* The event provides the recorded ECG strip as a `Uint8Array` in BMP format.
|
|
95
|
+
*/
|
|
96
|
+
RecordedStripReady: Uint8Array;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Represents the ECG (Electrocardiogram) module for browser applications, providing functionality for monitoring, recording,
|
|
101
|
+
* and processing ECG data.
|
|
102
|
+
*/
|
|
103
|
+
export declare class EcgModule extends TypedEventTarget<EcgEvents> {
|
|
104
|
+
private constructor();
|
|
105
|
+
/** Stops ECG processing and removes event subscriptions. */
|
|
106
|
+
Dispose(): void;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Enumeration for MedWand device/communication errors.
|
|
111
|
+
*/
|
|
112
|
+
export declare enum ErrorCode {
|
|
113
|
+
/**
|
|
114
|
+
* An un specified error has occured.
|
|
115
|
+
*/
|
|
116
|
+
Generic = 0,
|
|
117
|
+
/**
|
|
118
|
+
* The MedWand device was not found.
|
|
119
|
+
*/
|
|
120
|
+
DeviceNotFound = 1,
|
|
121
|
+
/**
|
|
122
|
+
* The serial port has failed to connect.
|
|
123
|
+
*/
|
|
124
|
+
SerialPortConnectionError = 2,
|
|
125
|
+
/**
|
|
126
|
+
* The serial port has failed to open.
|
|
127
|
+
*/
|
|
128
|
+
SerialPortOpenError = 3,
|
|
129
|
+
/**
|
|
130
|
+
* The serial port has failed.
|
|
131
|
+
*/
|
|
132
|
+
SerialPortError = 4,
|
|
133
|
+
/**
|
|
134
|
+
* The serial port has failed.
|
|
135
|
+
*/
|
|
136
|
+
SerialPortClosedError = 5,
|
|
137
|
+
/**
|
|
138
|
+
* The serial port transmission has failed.
|
|
139
|
+
*/
|
|
140
|
+
SerialPortTransmitError = 6,
|
|
141
|
+
/**
|
|
142
|
+
* The serial port notification.
|
|
143
|
+
*/
|
|
144
|
+
SerialPortNotification = 7
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
declare type EventHandler<T> = (payload: T) => void;
|
|
148
|
+
|
|
149
|
+
declare type EventMap = Record<string, unknown>;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The `FirmwareController` class facilitates the firmware update process by managing device connections, handling update workflows, and reporting progress and errors through events. Use `DisposeAsync` to ensure proper resource cleanup after use.
|
|
153
|
+
*
|
|
154
|
+
* See the {@link https://github.com/orgs/MedWand/repositories | MedWand DECL Sample Applications} for full examples.
|
|
155
|
+
*
|
|
156
|
+
* @remarks
|
|
157
|
+
* This copy of the MedWand Software Libraries (MSL) is licensed to You as the end user or to Your employer or another third party authorized to permit under the TERMS AND CONDITIONS OF THE MSL LICENSE AGREEMENT. Firmware updates may be required to correct performance problems and will be provided under the MSL Agreement where deemed applicable by MedWand. No license is granted to you for redistribution of MedWand Device Firmware. You expressly agree to make Device Firmware Upgrade calls, using the provided DECL(s) libraries whenever you are notified of a new firmware upgrade, and in any event, not less than every 90 days, and receive firmware updates for the MedWand hardware device within your software workflow and/or UI. Failure to update firmware when notified of a firmware update may affect the availability of features and the reliability of the MedWand and its related software. See MSL agreement for additional details.
|
|
158
|
+
*/
|
|
159
|
+
export declare class FirmwareController extends TypedEventSubscriptions<FirmwareControllerEvents> {
|
|
160
|
+
/**
|
|
161
|
+
* Initializes a new instance of the `FirmwareController` class.
|
|
162
|
+
*
|
|
163
|
+
* @param signal - An optional `AbortSignal` that can be used to cancel operations initiated by this controller.
|
|
164
|
+
*/
|
|
165
|
+
constructor(signal?: AbortSignal | undefined);
|
|
166
|
+
/**
|
|
167
|
+
* Initiates the firmware update process for the connected MedWand device.
|
|
168
|
+
*
|
|
169
|
+
* See the {@link https://github.com/orgs/MedWand/repositories | MedWand DECL Sample Applications} for full examples.
|
|
170
|
+
*
|
|
171
|
+
* @returns A promise that resolves to `true` if the firmware update process completes successfully.
|
|
172
|
+
* It resolves to `false` on failure or cancellation.
|
|
173
|
+
*
|
|
174
|
+
* @remarks
|
|
175
|
+
* This method establishes a connection to the MedWand device and then proceeds with the firmware update.
|
|
176
|
+
* Ensure that you have internet connectivity and the device remains connected during the update process to avoid interruptions.
|
|
177
|
+
* Dispose the `MedWandController` first and invoke this method from a user gesture so the browser can request serial permission.
|
|
178
|
+
* Subscribe to `FirmwareError` or `DeviceErrorReceived` to handle specific errors.
|
|
179
|
+
*/
|
|
180
|
+
StartAsync(): Promise<boolean>;
|
|
181
|
+
/** Cancels active work, releases the serial port, and removes event subscriptions. */
|
|
182
|
+
DisposeAsync(): Promise<void>;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
declare type FirmwareControllerEvents = {
|
|
186
|
+
/** Notifies the caller when the updater moves between high-level workflow states. */
|
|
187
|
+
FirmwareStateChanged: UpdaterState;
|
|
188
|
+
/** Reports stage-local progress as an integer percentage. */
|
|
189
|
+
FirmwareProgressChanged: number;
|
|
190
|
+
/** Reports errors encountered during the firmware update. */
|
|
191
|
+
FirmwareError: Error;
|
|
192
|
+
/** Reports low-level errors raised by the browser serial connection. */
|
|
193
|
+
DeviceErrorReceived: Error;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Represents information about the focus capabilities of a camera.
|
|
198
|
+
*
|
|
199
|
+
* @remarks
|
|
200
|
+
* This record encapsulates details about the focus functionality of a camera,
|
|
201
|
+
* including whether it supports auto-focus or manual focus, as well as the
|
|
202
|
+
* minimum and maximum focus values.
|
|
203
|
+
*/
|
|
204
|
+
export declare interface FocusInfo {
|
|
205
|
+
/** Indicates whether the camera supports automatic focus. */
|
|
206
|
+
HasAutoFocus: boolean;
|
|
207
|
+
/** Indicates whether the camera supports manual focus. */
|
|
208
|
+
HasManualFocus: boolean;
|
|
209
|
+
/** The lowest manual focus value supported by the camera. */
|
|
210
|
+
FocusMinimum: number;
|
|
211
|
+
/** The highest manual focus value supported by the camera. */
|
|
212
|
+
FocusMaximum: number;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Specifies the available focus modes for cameras supported by the MedWand SDK.
|
|
217
|
+
*
|
|
218
|
+
* @remarks
|
|
219
|
+
* This enumeration defines the focus modes that can be used with cameras,
|
|
220
|
+
* including no focus adjustment, automatic focus adjustment, and manual focus adjustment.
|
|
221
|
+
*/
|
|
222
|
+
export declare enum FocusModes {
|
|
223
|
+
/** No focus adjustment is applied. */
|
|
224
|
+
None = 0,
|
|
225
|
+
/** The camera automatically adjusts the focus. */
|
|
226
|
+
Auto = 1,
|
|
227
|
+
/** The focus is manually adjusted by the user. */
|
|
228
|
+
Manual = 2
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Represents an error associated with a license, including its state and any related exception details.
|
|
233
|
+
*/
|
|
234
|
+
export declare class LicenseError {
|
|
235
|
+
/**
|
|
236
|
+
* Represents the current state of the license.
|
|
237
|
+
*/
|
|
238
|
+
readonly State: LicenseState;
|
|
239
|
+
/**
|
|
240
|
+
* Exception details.
|
|
241
|
+
*/
|
|
242
|
+
readonly Exception: Error;
|
|
243
|
+
/**
|
|
244
|
+
* Initializes a new instance of the `LicenseError` class.
|
|
245
|
+
*
|
|
246
|
+
* @param state - The license state associated with the error.
|
|
247
|
+
* @param exception - The underlying error.
|
|
248
|
+
*/
|
|
249
|
+
constructor(state: LicenseState, exception: Error);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Defines the various states of a license within the system.
|
|
254
|
+
*/
|
|
255
|
+
export declare enum LicenseState {
|
|
256
|
+
/**
|
|
257
|
+
* Represents an invalid state of the license, indicating that the license is either missing, corrupted, or otherwise unusable.
|
|
258
|
+
*/
|
|
259
|
+
Invalid = 0,
|
|
260
|
+
/**
|
|
261
|
+
* Indicates that the license is does not support the feature requested.
|
|
262
|
+
*/
|
|
263
|
+
InvalidFeature = 1,
|
|
264
|
+
/**
|
|
265
|
+
* Indicates that the license is nearing its expiration date but is still valid.
|
|
266
|
+
*/
|
|
267
|
+
Expiring = 2,
|
|
268
|
+
/**
|
|
269
|
+
* Indicates that the license has expired and is no longer valid.
|
|
270
|
+
*/
|
|
271
|
+
Expired = 3
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Represents a controller for managing and interacting with various MedWand devices in a browser application.
|
|
276
|
+
*
|
|
277
|
+
* See the {@link https://github.com/orgs/MedWand/repositories | MedWand DECL Sample Applications} for full examples.
|
|
278
|
+
*
|
|
279
|
+
* @remarks
|
|
280
|
+
* This copy of the MedWand Software Libraries (MSL) is licensed to You as the end user or to Your employer or another third party authorized to permit under the TERMS AND CONDITIONS OF THE MSL LICENSE AGREEMENT. Firmware updates may be required to correct performance problems and will be provided under the MSL Agreement where deemed applicable by MedWand. No license is granted to you for redistribution of MedWand Device Firmware. You expressly agree to make Device Firmware Upgrade calls, using the provided DECL(s) libraries whenever you are notified of a new firmware upgrade, and in any event, not less than every 90 days, and receive firmware updates for the MedWand hardware device within your software workflow and/or UI. Failure to update firmware when notified of a firmware update may affect the availability of features and the reliability of the MedWand and its related software. See MSL agreement for additional details.
|
|
281
|
+
*/
|
|
282
|
+
export declare class MedWandController extends TypedEventTarget<MedWandControllerEvents> {
|
|
283
|
+
/**
|
|
284
|
+
* Represents the name of the MedWand device.
|
|
285
|
+
*
|
|
286
|
+
* @remarks
|
|
287
|
+
* This field is initialized with the default value "MedWand".
|
|
288
|
+
*/
|
|
289
|
+
static readonly DeviceName = "MedWand";
|
|
290
|
+
/**
|
|
291
|
+
* Initializes a new instance of the `MedWandController` class.
|
|
292
|
+
*
|
|
293
|
+
* See the {@link https://github.com/orgs/MedWand/repositories | MedWand DECL Sample Applications} for full examples.
|
|
294
|
+
*
|
|
295
|
+
* @remarks
|
|
296
|
+
* This copy of the MedWand Software Libraries (MSL) is licensed to You as the end user or to Your employer or another third party authorized to permit under the TERMS AND CONDITIONS OF THE MSL LICENSE AGREEMENT. Firmware updates may be required to correct performance problems and will be provided under the MSL Agreement where deemed applicable by MedWand. No license is granted to you for redistribution of MedWand Device Firmware. You expressly agree to make Device Firmware Upgrade calls, using the provided DECL(s) libraries whenever you are notified of a new firmware upgrade, and in any event, not less than every 90 days, and receive firmware updates for the MedWand hardware device within your software workflow and/or UI. Failure to update firmware when notified of a firmware update may affect the availability of features and the reliability of the MedWand and its related software. See MSL agreement for additional details.
|
|
297
|
+
*/
|
|
298
|
+
constructor();
|
|
299
|
+
/**
|
|
300
|
+
* Initializes the MedWand controller with the provided license information and public key.
|
|
301
|
+
*
|
|
302
|
+
* @param licenseString - The license string required to initialize the MedWand controller. This value must not be null or empty.
|
|
303
|
+
* @param publicKey - The public key associated with the license string. This value must not be null or empty.
|
|
304
|
+
*
|
|
305
|
+
* @remarks
|
|
306
|
+
* If the license is invalid, expired, or nearing expiration, the `OnLicenseError` event will be triggered.
|
|
307
|
+
*/
|
|
308
|
+
Construct(licenseString: string, publicKey: string): void;
|
|
309
|
+
/**
|
|
310
|
+
* Configures the `MedWandController` by initializing its modules based on available features
|
|
311
|
+
* and optionally setting up the ECG module with the provided canvas.
|
|
312
|
+
*
|
|
313
|
+
* @param ecgCanvas - An `HTMLCanvasElement` used to initialize the ECG module if the ECG feature is available.
|
|
314
|
+
* Pass `null` if the ECG module should not be initialized with a canvas.
|
|
315
|
+
*/
|
|
316
|
+
Configure(ecgCanvas?: HTMLCanvasElement | null): void;
|
|
317
|
+
/**
|
|
318
|
+
* Gets a value indicating whether the license associated with the MedWand device is valid.
|
|
319
|
+
*
|
|
320
|
+
* @remarks
|
|
321
|
+
* `true` if the license is valid; otherwise, `false`.
|
|
322
|
+
*
|
|
323
|
+
* This property is determined by the internal license controller and reflects the current state of the license.
|
|
324
|
+
*/
|
|
325
|
+
get IsLicenseValid(): boolean;
|
|
326
|
+
/**
|
|
327
|
+
* Gets the current state of the MedWand device.
|
|
328
|
+
*
|
|
329
|
+
* @remarks
|
|
330
|
+
* The `DeviceState` property reflects the current operational state of the device,
|
|
331
|
+
* such as whether it is connected, disconnected, initializing, or in an error state.
|
|
332
|
+
* Changes to this property trigger the `OnDeviceStateChanged` event.
|
|
333
|
+
*
|
|
334
|
+
* A `DeviceState` enumeration value representing the current state of the device.
|
|
335
|
+
*/
|
|
336
|
+
get DeviceState(): DeviceState;
|
|
337
|
+
/**
|
|
338
|
+
* Gets the current state of the reading process for the MedWand device.
|
|
339
|
+
*
|
|
340
|
+
* @remarks
|
|
341
|
+
* The `ReadingState` property reflects the operational state of the device's reading mechanism.
|
|
342
|
+
* Possible states include `Stopped`, `Starting`,
|
|
343
|
+
* `Started`, `Reading`, `Recording`,
|
|
344
|
+
* `Stopping`, and `Error`.
|
|
345
|
+
*
|
|
346
|
+
* A `ReadingState` enumeration value representing the current state of the reading process.
|
|
347
|
+
*/
|
|
348
|
+
get ReadingState(): ReadingState;
|
|
349
|
+
/**
|
|
350
|
+
* Gets a value indicating whether the MedWand device is currently connected.
|
|
351
|
+
*
|
|
352
|
+
* @remarks
|
|
353
|
+
* A device is considered connected if its state is one of the following:
|
|
354
|
+
* `Connected`, `Initializing`, or `Initialized`.
|
|
355
|
+
*
|
|
356
|
+
* `true` if the device is connected; otherwise, `false`.
|
|
357
|
+
*/
|
|
358
|
+
get IsConnected(): boolean;
|
|
359
|
+
/**
|
|
360
|
+
* Gets a value indicating whether the MedWand device has been successfully initialized.
|
|
361
|
+
*
|
|
362
|
+
* @remarks
|
|
363
|
+
* `true` if the device is initialized; otherwise, `false`.
|
|
364
|
+
*
|
|
365
|
+
* The `IsInitialized` property reflects the initialization state of the MedWand device.
|
|
366
|
+
* It becomes `true` after the device has completed the initialization process successfully.
|
|
367
|
+
*/
|
|
368
|
+
get IsInitialized(): boolean;
|
|
369
|
+
/**
|
|
370
|
+
* Gets the license information associated with the current instance of the MedWand controller.
|
|
371
|
+
*
|
|
372
|
+
* @remarks
|
|
373
|
+
* This property retrieves a string representation of the license details managed by the underlying license controller.
|
|
374
|
+
*
|
|
375
|
+
* A `string` containing the license information.
|
|
376
|
+
*/
|
|
377
|
+
get LicenseInfo(): string;
|
|
378
|
+
/**
|
|
379
|
+
* Gets a value indicating whether the stethoscope feature can be used with the current license.
|
|
380
|
+
*
|
|
381
|
+
* @remarks
|
|
382
|
+
* `true` if the stethoscope feature is available; otherwise, `false`.
|
|
383
|
+
*
|
|
384
|
+
* This property checks the license to determine if the "Stethoscope" feature is enabled.
|
|
385
|
+
*/
|
|
386
|
+
get CanUseStethoscope(): boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Gets a value indicating whether the camera feature can be used based on the current license.
|
|
389
|
+
*
|
|
390
|
+
* @remarks
|
|
391
|
+
* `true` if the camera feature is available; otherwise, `false`.
|
|
392
|
+
*
|
|
393
|
+
* This property checks the license to determine if the "Camera" feature is enabled.
|
|
394
|
+
*/
|
|
395
|
+
get CanUseCamera(): boolean;
|
|
396
|
+
/**
|
|
397
|
+
* Gets a value indicating whether the ECG (Electrocardiogram) feature can be used.
|
|
398
|
+
*
|
|
399
|
+
* @remarks
|
|
400
|
+
* `true` if the ECG feature is available and licensed; otherwise, `false`.
|
|
401
|
+
*
|
|
402
|
+
* This property checks the license to determine if the ECG feature is enabled.
|
|
403
|
+
*/
|
|
404
|
+
get CanUseEcg(): boolean;
|
|
405
|
+
/**
|
|
406
|
+
* Gets the Vendor ID of the connected MedWand device.
|
|
407
|
+
*/
|
|
408
|
+
get VendorId(): string | null;
|
|
409
|
+
/**
|
|
410
|
+
* Gets the product identifier of the connected MedWand device.
|
|
411
|
+
*/
|
|
412
|
+
get ProductId(): string | null;
|
|
413
|
+
/**
|
|
414
|
+
* Gets the name of the port associated with the MedWand device.
|
|
415
|
+
*/
|
|
416
|
+
get ComPort(): string | null;
|
|
417
|
+
/**
|
|
418
|
+
* Establishes a connection to the MedWand device.
|
|
419
|
+
*
|
|
420
|
+
* @throws MedWandFirmwareUpdateRequiredException when a device in bootloader mode requires a firmware update.
|
|
421
|
+
* @throws Error when a device is in bootloader mode and the firmware service does not report a required version.
|
|
422
|
+
*/
|
|
423
|
+
Connect(): Promise<void>;
|
|
424
|
+
/**
|
|
425
|
+
* Initializes the MedWand device, setting it to the `Initialized` state if successful.
|
|
426
|
+
*/
|
|
427
|
+
Initialize(): Promise<void>;
|
|
428
|
+
/**
|
|
429
|
+
* Gets the firmware version read during connection, or null before it is known.
|
|
430
|
+
* A failed device version query is represented by "0.0.0.0".
|
|
431
|
+
*/
|
|
432
|
+
get FirmwareVersion(): string | null;
|
|
433
|
+
/**
|
|
434
|
+
* Checks the MedWand firmware service for the version required by this device.
|
|
435
|
+
*
|
|
436
|
+
* @remarks
|
|
437
|
+
* This mirrors the Windows base controller workflow. The method only checks the
|
|
438
|
+
* installed version; it does not start an update or take ownership of the serial
|
|
439
|
+
* port for `FirmwareController`.
|
|
440
|
+
*
|
|
441
|
+
* @throws MedWandFirmwareUpdateRequiredException when the service reports a
|
|
442
|
+
* different required version. The device state is changed to
|
|
443
|
+
* `FirmwareUpdateRequired` before the exception is thrown.
|
|
444
|
+
* As in the Windows SDK, an unavailable or invalid check response is treated
|
|
445
|
+
* as no reported update and does not prevent use of the connected device.
|
|
446
|
+
*/
|
|
447
|
+
CheckFirmwareVersion(): Promise<void>;
|
|
448
|
+
/**
|
|
449
|
+
* Determines whether the device is currently in bootloader mode.
|
|
450
|
+
*/
|
|
451
|
+
IsBootloaderMode(forceCheck?: boolean): Promise<boolean>;
|
|
452
|
+
/**
|
|
453
|
+
* Gets the unique identifier of the connected MedWand device.
|
|
454
|
+
*
|
|
455
|
+
* @remarks
|
|
456
|
+
* The `DeviceId` property retrieves the device's unique identifier.
|
|
457
|
+
* If the identifier is not already cached, it attempts to fetch it by transmitting
|
|
458
|
+
* the appropriate command to the device and waiting for a response.
|
|
459
|
+
*
|
|
460
|
+
* A `string` representing the unique identifier of the MedWand device.
|
|
461
|
+
* Returns an empty string if the identifier cannot be retrieved.
|
|
462
|
+
*/
|
|
463
|
+
get DeviceId(): string;
|
|
464
|
+
/**
|
|
465
|
+
* Gets the generation of the MedWand device.
|
|
466
|
+
*
|
|
467
|
+
* @remarks
|
|
468
|
+
* The generation is determined based on the device's unique identifier or by querying the device.
|
|
469
|
+
* Possible values include `Generation1`, `Generation2`,
|
|
470
|
+
* `Unknown`, and `NotReady`.
|
|
471
|
+
*
|
|
472
|
+
* A `MedWandGeneration` value representing the generation of the MedWand device.
|
|
473
|
+
*/
|
|
474
|
+
get Generation(): MedWandGeneration;
|
|
475
|
+
/**
|
|
476
|
+
* Gets the Unique Device Identifier (UDI) of the connected MedWand device.
|
|
477
|
+
*
|
|
478
|
+
* @remarks
|
|
479
|
+
* The UDI is a globally unique identifier that provides detailed information about the device.
|
|
480
|
+
* If the UDI is not already cached, this property attempts to retrieve it from the device.
|
|
481
|
+
*
|
|
482
|
+
* A `string` representing the UDI of the device, or an empty string if the UDI could not be retrieved.
|
|
483
|
+
*/
|
|
484
|
+
get Udi(): string;
|
|
485
|
+
/**
|
|
486
|
+
* Gets the most recent reading data from the MedWand sensor.
|
|
487
|
+
*
|
|
488
|
+
* @remarks
|
|
489
|
+
* An instance of `MedWandReading` containing the latest sensor data,
|
|
490
|
+
* such as timestamp, status, and various measurement values.
|
|
491
|
+
*/
|
|
492
|
+
get LastReading(): MedWandReading;
|
|
493
|
+
/**
|
|
494
|
+
* Gets the currently active sensor on the MedWand device.
|
|
495
|
+
*
|
|
496
|
+
* @remarks
|
|
497
|
+
* A `MedWandSensor` value representing the sensor currently in use.
|
|
498
|
+
* Defaults to `None` if no sensor is active.
|
|
499
|
+
*
|
|
500
|
+
* The active sensor is managed by the internal reading state machine and is updated
|
|
501
|
+
* when a sensor is started or stopped. Ensure that no other sensor is active before
|
|
502
|
+
* starting a new one to avoid conflicts.
|
|
503
|
+
*/
|
|
504
|
+
get ActiveSensor(): MedWandSensor;
|
|
505
|
+
/**
|
|
506
|
+
* Gets the current intensity level of the LED.
|
|
507
|
+
*
|
|
508
|
+
* @remarks
|
|
509
|
+
* An integer representing the LED intensity level.
|
|
510
|
+
*
|
|
511
|
+
* The LED intensity level is managed internally and can be adjusted using the appropriate methods.
|
|
512
|
+
* Changes to the intensity level trigger the `OnLedIntensityChanged` event.
|
|
513
|
+
*/
|
|
514
|
+
get LedIntensity(): number;
|
|
515
|
+
/**
|
|
516
|
+
* Gets a value indicating whether a valid stethoscope module is available.
|
|
517
|
+
*
|
|
518
|
+
* @remarks
|
|
519
|
+
* `true` if a valid stethoscope module is present; otherwise, `false`.
|
|
520
|
+
*/
|
|
521
|
+
get HasValidStethoscope(): boolean;
|
|
522
|
+
/**
|
|
523
|
+
* Gets a value indicating whether the stethoscope is currently monitoring.
|
|
524
|
+
*
|
|
525
|
+
* @remarks
|
|
526
|
+
* `true` if the stethoscope is actively monitoring; otherwise, `false`.
|
|
527
|
+
*/
|
|
528
|
+
get StethoscopeIsMonitoring(): boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Gets the instance of the `StethoscopeModule` associated with the controller.
|
|
531
|
+
*
|
|
532
|
+
* @remarks
|
|
533
|
+
* The `Stethoscope` property provides access to the stethoscope module, allowing interaction with
|
|
534
|
+
* stethoscope-related functionalities, such as monitoring and recording.
|
|
535
|
+
*
|
|
536
|
+
* An instance of `StethoscopeModule` if a valid stethoscope module is available; otherwise, `null`.
|
|
537
|
+
*/
|
|
538
|
+
get Stethoscope(): StethoscopeModule | null;
|
|
539
|
+
/**
|
|
540
|
+
* Gets the model name of the connected stethoscope.
|
|
541
|
+
*
|
|
542
|
+
* @remarks
|
|
543
|
+
* A `string` representing the name of the stethoscope model if available; otherwise, "Unknown".
|
|
544
|
+
*/
|
|
545
|
+
get StethoscopeModel(): string;
|
|
546
|
+
/**
|
|
547
|
+
* Gets the current microphone mode of the stethoscope.
|
|
548
|
+
*
|
|
549
|
+
* @remarks
|
|
550
|
+
* A `MicrophoneModes` value representing the mode of the stethoscope.
|
|
551
|
+
* Defaults to `Off` if the stethoscope is not available.
|
|
552
|
+
*/
|
|
553
|
+
get StethoscopeMode(): MicrophoneModes;
|
|
554
|
+
/**
|
|
555
|
+
* Converts the provided stethoscope capture data into a WAV audio file format.
|
|
556
|
+
*
|
|
557
|
+
* @param bytes - The byte array representing the stethoscope capture data.
|
|
558
|
+
*
|
|
559
|
+
* @returns A Base64-encoded string representing the WAV audio file, or `null` if the conversion fails
|
|
560
|
+
* or the stethoscope module is not valid.
|
|
561
|
+
*
|
|
562
|
+
* @remarks
|
|
563
|
+
* This method utilizes the stethoscope module to process the raw capture data and generate
|
|
564
|
+
* a WAV audio file. Ensure that the stethoscope module is properly initialized before calling this method.
|
|
565
|
+
*/
|
|
566
|
+
StethoscopeWavFromCapture(bytes: Uint8Array): string | null;
|
|
567
|
+
/**
|
|
568
|
+
* Gets a value indicating whether a valid otoscope is available.
|
|
569
|
+
*
|
|
570
|
+
* @remarks
|
|
571
|
+
* `true` if a valid otoscope is available; otherwise, `false`.
|
|
572
|
+
*/
|
|
573
|
+
get HasValidOtoscope(): boolean;
|
|
574
|
+
/**
|
|
575
|
+
* Gets the camera module associated with the `MedWandController`.
|
|
576
|
+
*
|
|
577
|
+
* @remarks
|
|
578
|
+
* The `CameraModule` instance if a valid camera module is available; otherwise, `null`.
|
|
579
|
+
*
|
|
580
|
+
* The camera module provides functionality for managing camera operations, such as monitoring, zooming, and adjusting LED intensity.
|
|
581
|
+
*/
|
|
582
|
+
get Camera(): CameraModule | null;
|
|
583
|
+
/**
|
|
584
|
+
* Gets a value indicating whether the camera is currently monitoring.
|
|
585
|
+
*
|
|
586
|
+
* @remarks
|
|
587
|
+
* `true` if the camera is actively monitoring; otherwise, `false`.
|
|
588
|
+
*
|
|
589
|
+
* This property checks the `Camera` instance to determine if it is in a monitoring state.
|
|
590
|
+
*/
|
|
591
|
+
get CameraIsMonitoring(): boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Gets the model name of the connected camera.
|
|
594
|
+
*
|
|
595
|
+
* @remarks
|
|
596
|
+
* A `string` representing the name of the camera model if a valid camera is connected; otherwise, "Unknown".
|
|
597
|
+
*/
|
|
598
|
+
get CameraModel(): string;
|
|
599
|
+
/**
|
|
600
|
+
* Gets the current camera mode of the connected camera module.
|
|
601
|
+
*
|
|
602
|
+
* @remarks
|
|
603
|
+
* The `CameraModes` representing the selected camera mode.
|
|
604
|
+
* Returns `Off` if no camera module is available.
|
|
605
|
+
*/
|
|
606
|
+
get CameraMode(): CameraModes;
|
|
607
|
+
/**
|
|
608
|
+
* Converts a captured byte array from the camera into a Base64-encoded bitmap string.
|
|
609
|
+
*
|
|
610
|
+
* @param bytes - The byte array representing the captured camera frame.
|
|
611
|
+
* @returns A Base64-encoded bitmap string, or `null` if the camera module is not available.
|
|
612
|
+
*
|
|
613
|
+
* @remarks
|
|
614
|
+
* This method utilizes the camera module to process the provided byte array and generate a Base64-encoded bitmap string.
|
|
615
|
+
* Ensure that the camera module is valid before invoking this method.
|
|
616
|
+
*/
|
|
617
|
+
CameraBmpFromCapture(bytes: Uint8Array | Uint8ClampedArray): string | null;
|
|
618
|
+
/**
|
|
619
|
+
* Gets a value indicating whether the camera associated with the controller has an "On Timer" feature.
|
|
620
|
+
*
|
|
621
|
+
* @remarks
|
|
622
|
+
* `true` if the camera has an "On Timer" feature; otherwise, `false`.
|
|
623
|
+
*
|
|
624
|
+
* This property checks if the camera's model supports the "On Timer" functionality.
|
|
625
|
+
*/
|
|
626
|
+
get CameraHasOnTimer(): boolean;
|
|
627
|
+
/**
|
|
628
|
+
* Gets the maximum duration, in seconds, that the camera can remain active before requiring a cooldown period.
|
|
629
|
+
*
|
|
630
|
+
* @remarks
|
|
631
|
+
* The maximum active time for the camera, or -100 if the camera is not available.
|
|
632
|
+
*
|
|
633
|
+
* This property retrieves the value from the camera model's `OnTimeMax` property.
|
|
634
|
+
*/
|
|
635
|
+
get CameraOnTimeMax(): number;
|
|
636
|
+
/**
|
|
637
|
+
* Gets the minimum cooldown time, in seconds, required for the camera to be operational again
|
|
638
|
+
* after it has been turned off.
|
|
639
|
+
*
|
|
640
|
+
* @remarks
|
|
641
|
+
* The minimum cooldown time in seconds. Returns `-100` if the camera is not available.
|
|
642
|
+
*/
|
|
643
|
+
get CameraCoolTimeMin(): number;
|
|
644
|
+
/**
|
|
645
|
+
* Moves the camera by the specified increments in the horizontal and vertical directions.
|
|
646
|
+
*
|
|
647
|
+
* @param incrementLeft - The amount to move the camera horizontally. A positive value moves the camera to the right,
|
|
648
|
+
* a negative value moves it to the left, and `null` indicates no horizontal movement.
|
|
649
|
+
*
|
|
650
|
+
* @param incrementTop - The amount to move the camera vertically. A positive value moves the camera downward,
|
|
651
|
+
* a negative value moves it upward, and `null` indicates no vertical movement.
|
|
652
|
+
*/
|
|
653
|
+
CameraMove(incrementLeft: number | null, incrementTop: number | null): void;
|
|
654
|
+
/**
|
|
655
|
+
* Adjusts the zoom level of the camera by the specified increment.
|
|
656
|
+
*
|
|
657
|
+
* @param increment - The amount by which to adjust the zoom level. Positive values zoom in,
|
|
658
|
+
* while negative values zoom out.
|
|
659
|
+
*
|
|
660
|
+
* @remarks
|
|
661
|
+
* This method delegates the zoom functionality to the associated `CameraModule`.
|
|
662
|
+
* Ensure that a valid camera module is available before invoking this method.
|
|
663
|
+
*/
|
|
664
|
+
CameraZoom(increment: number): void;
|
|
665
|
+
/**
|
|
666
|
+
* Adjusts the camera's radius by the specified increment.
|
|
667
|
+
*
|
|
668
|
+
* @param increment - The value by which to adjust the camera's radius. Positive values increase the radius,
|
|
669
|
+
* while negative values decrease it.
|
|
670
|
+
*/
|
|
671
|
+
CameraRadius(increment: number): void;
|
|
672
|
+
/**
|
|
673
|
+
* Sets the white LED intensity on an initialized device.
|
|
674
|
+
*
|
|
675
|
+
* @param value - Intensity supported by the camera; zero turns the LED off.
|
|
676
|
+
*/
|
|
677
|
+
SetLedIntensity(value: number): Promise<void>;
|
|
678
|
+
/**
|
|
679
|
+
* Sets the LED intensity for the camera.
|
|
680
|
+
*
|
|
681
|
+
* @param value - The intensity value to set for the camera's LED. The value should be within the allowable range defined by the camera.
|
|
682
|
+
*
|
|
683
|
+
* @remarks
|
|
684
|
+
* This method adjusts the brightness of the camera's LED. Ensure that the provided value is within the range specified by
|
|
685
|
+
* `CameraLedIntensityMax`.
|
|
686
|
+
*/
|
|
687
|
+
CameraSetLedIntensity(value: number): Promise<void>;
|
|
688
|
+
/** Sets the camera focus mode when the active browser camera supports it. */
|
|
689
|
+
CameraSetFocusMode(focusMode: FocusModes, resetLastValue: boolean): Promise<void>;
|
|
690
|
+
/** Sets the manual focus distance when the active browser camera supports it. */
|
|
691
|
+
CameraSetFocusValue(focusValue: number): Promise<void>;
|
|
692
|
+
/**
|
|
693
|
+
* Resets the camera to its default state by invoking the reset functionality of the associated camera module.
|
|
694
|
+
*
|
|
695
|
+
* @remarks
|
|
696
|
+
* This method is a wrapper around the `Reset` method,
|
|
697
|
+
* which resets the camera's zoom and position to their initial values.
|
|
698
|
+
* It has no effect if the camera module is not valid or initialized.
|
|
699
|
+
*/
|
|
700
|
+
CameraReset(): void;
|
|
701
|
+
/** Gets focus controls and distance bounds reported by the active browser camera. */
|
|
702
|
+
get CameraFocusInfo(): FocusInfo | null;
|
|
703
|
+
/**
|
|
704
|
+
* Gets the currently selected focus mode of the camera.
|
|
705
|
+
*
|
|
706
|
+
* @remarks
|
|
707
|
+
* A `FocusModes` value representing the current focus mode of the camera.
|
|
708
|
+
*
|
|
709
|
+
* The focus mode can be `None`, `Auto`, or `Manual`.
|
|
710
|
+
*/
|
|
711
|
+
get CameraFocusMode(): FocusModes;
|
|
712
|
+
/**
|
|
713
|
+
* Gets a value indicating whether the camera's LED intensity is adjustable.
|
|
714
|
+
*
|
|
715
|
+
* @remarks
|
|
716
|
+
* `true` if the camera's LED intensity can be adjusted; otherwise, `false`.
|
|
717
|
+
*/
|
|
718
|
+
get CameraLedIntensityAdjustable(): boolean;
|
|
719
|
+
/**
|
|
720
|
+
* Gets the maximum LED intensity value for the camera.
|
|
721
|
+
*
|
|
722
|
+
* @remarks
|
|
723
|
+
* An `int` representing the maximum LED intensity. Returns 0 if the camera is not available.
|
|
724
|
+
*/
|
|
725
|
+
get CameraLedIntensityMax(): number;
|
|
726
|
+
/**
|
|
727
|
+
* Gets a value indicating whether a valid ECG (Electrocardiogram) module is available.
|
|
728
|
+
*
|
|
729
|
+
* @remarks
|
|
730
|
+
* `true` if a valid ECG module is present; otherwise, `false`.
|
|
731
|
+
*/
|
|
732
|
+
get HasValidEcg(): boolean;
|
|
733
|
+
/**
|
|
734
|
+
* Gets the ECG module associated with the MedWand device.
|
|
735
|
+
*
|
|
736
|
+
* @remarks
|
|
737
|
+
* An instance of `EcgModule` if the ECG module is valid; otherwise, `null`.
|
|
738
|
+
*
|
|
739
|
+
* The ECG module provides functionality for monitoring, recording, and processing ECG data.
|
|
740
|
+
*/
|
|
741
|
+
get Ecg(): EcgModule | null;
|
|
742
|
+
/**
|
|
743
|
+
* Gets the recorded ECG (Electrocardiogram) data as an array of numbers.
|
|
744
|
+
*
|
|
745
|
+
* @remarks
|
|
746
|
+
* This property retrieves the ECG data that was recorded during a session.
|
|
747
|
+
* The data is represented as a list of numerical values, where each value corresponds
|
|
748
|
+
* to a specific point in the ECG signal. If no data is available, the property returns `null`.
|
|
749
|
+
*
|
|
750
|
+
* A `number[]` representing the recorded ECG data, or `null` if no data is available.
|
|
751
|
+
*/
|
|
752
|
+
get EcgRecordedData(): number[] | null;
|
|
753
|
+
/**
|
|
754
|
+
* Converts a captured byte array from the ECG into a Base64-encoded bitmap string.
|
|
755
|
+
*
|
|
756
|
+
* @param bytes - The byte array representing the captured ECG data.
|
|
757
|
+
*
|
|
758
|
+
* @returns A Base64-encoded string representation of the bitmap if the conversion is successful;
|
|
759
|
+
* otherwise, `null` if the ECG module is not available.
|
|
760
|
+
*
|
|
761
|
+
* @remarks
|
|
762
|
+
* This method utilizes the ECG module to process the provided byte array and generate
|
|
763
|
+
* a Base64-encoded bitmap string. Ensure that the ecg module is valid before invoking this method.
|
|
764
|
+
*/
|
|
765
|
+
EcgBmpFromCapture(bytes: Uint8Array): string | null;
|
|
766
|
+
/**
|
|
767
|
+
* Starts the thermometer sensor for temperature measurement.
|
|
768
|
+
*
|
|
769
|
+
* @returns `true` if the thermometer starts successfully; otherwise, `false`.
|
|
770
|
+
*
|
|
771
|
+
* @remarks
|
|
772
|
+
* This method overrides the base implementation to initiate the thermometer sensor.
|
|
773
|
+
* Ensure that the necessary hardware and licenses are valid before calling this method.
|
|
774
|
+
*/
|
|
775
|
+
StartThermometer(): Promise<boolean>;
|
|
776
|
+
/**
|
|
777
|
+
* Starts the pulse oximeter sensor.
|
|
778
|
+
*
|
|
779
|
+
* @returns `true` if the pulse oximeter sensor starts successfully; otherwise, `false`.
|
|
780
|
+
*
|
|
781
|
+
* @remarks
|
|
782
|
+
* This method overrides the base implementation to provide functionality specific to the
|
|
783
|
+
* `MedWandController` class.
|
|
784
|
+
*/
|
|
785
|
+
StartPulseOximeter(): Promise<boolean>;
|
|
786
|
+
/**
|
|
787
|
+
* Starts the ECG (Electrocardiogram) monitoring process.
|
|
788
|
+
*/
|
|
789
|
+
StartEcg(): Promise<boolean>;
|
|
790
|
+
/**
|
|
791
|
+
* Configures the stethoscope filter without opening the MedWand microphone or
|
|
792
|
+
* starting an SDK-managed audio preview.
|
|
793
|
+
*
|
|
794
|
+
* @param microphoneMode - The desired microphone mode for the stethoscope. Supported modes include Off, Heart,
|
|
795
|
+
* Lungs, and Bowel.
|
|
796
|
+
* @returns `true` if the stethoscope mode was successfully set; otherwise, `false`.
|
|
797
|
+
*
|
|
798
|
+
* @throws Error if the stethoscope module is not initialized or an unsupported microphone mode is provided.
|
|
799
|
+
*
|
|
800
|
+
* @remarks
|
|
801
|
+
* Use this overload when the application connects directly to the MedWand
|
|
802
|
+
* microphone with its own audio stack. Call this method with `Off` when the
|
|
803
|
+
* application is finished with the stethoscope.
|
|
804
|
+
*/
|
|
805
|
+
SetStethoscopeMode(microphoneMode: MicrophoneModes): Promise<boolean>;
|
|
806
|
+
/**
|
|
807
|
+
* Configures the stethoscope filter and starts or stops the SDK-managed audio preview.
|
|
808
|
+
*
|
|
809
|
+
* @param microphoneMode - The desired microphone mode for the stethoscope. Supported modes include Off, Heart,
|
|
810
|
+
* Lungs, and Bowel.
|
|
811
|
+
* @param speakerName - The speaker to use for audio output. Pass `null` to use the system default speaker.
|
|
812
|
+
* @returns `true` if the stethoscope mode was successfully set; otherwise, `false`.
|
|
813
|
+
*
|
|
814
|
+
* @remarks
|
|
815
|
+
* To connect to the MedWand microphone with an application-managed audio
|
|
816
|
+
* stack, use the overload without `speakerName`.
|
|
817
|
+
*/
|
|
818
|
+
SetStethoscopeMode(microphoneMode: MicrophoneModes, speakerName: string | null): Promise<boolean>;
|
|
819
|
+
/**
|
|
820
|
+
* Configures the camera mode and optionally starts the camera preview.
|
|
821
|
+
*/
|
|
822
|
+
SetCameraMode(previewTarget: HTMLVideoElement | HTMLCanvasElement | null, cameraMode: CameraModes): Promise<boolean>;
|
|
823
|
+
/**
|
|
824
|
+
* Starts recording data for the currently active sensor.
|
|
825
|
+
*/
|
|
826
|
+
StartRecording(): void;
|
|
827
|
+
/**
|
|
828
|
+
* Stops the recording process for the currently active sensor, if applicable.
|
|
829
|
+
*/
|
|
830
|
+
StopRecording(): void;
|
|
831
|
+
/**
|
|
832
|
+
* Stops the currently active sensor, if any, and performs necessary cleanup operations.
|
|
833
|
+
*/
|
|
834
|
+
StopSensor(): Promise<boolean>;
|
|
835
|
+
/**
|
|
836
|
+
* Releases all resources used by the `MedWandController` instance.
|
|
837
|
+
*/
|
|
838
|
+
Dispose(): Promise<void>;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
declare type MedWandControllerEvents = {
|
|
842
|
+
/**
|
|
843
|
+
* Occurs when there is an issue with the license state of the MedWand device.
|
|
844
|
+
*
|
|
845
|
+
* @remarks
|
|
846
|
+
* This event is triggered in scenarios such as:
|
|
847
|
+
* The license is invalid.
|
|
848
|
+
* The license has expired.
|
|
849
|
+
* The license is nearing expiration.
|
|
850
|
+
*/
|
|
851
|
+
OnLicenseError: LicenseState;
|
|
852
|
+
/**
|
|
853
|
+
* Occurs when the state of the MedWand device changes.
|
|
854
|
+
*
|
|
855
|
+
* @remarks
|
|
856
|
+
* This event is triggered whenever the `DeviceState` property transitions to a new state.
|
|
857
|
+
* It can be used to monitor the connection status, initialization progress, or other state changes
|
|
858
|
+
* of the MedWand device.
|
|
859
|
+
*/
|
|
860
|
+
OnDeviceStateChanged: DeviceState;
|
|
861
|
+
/**
|
|
862
|
+
* Occurs when an error related to the MedWand device is encountered.
|
|
863
|
+
*
|
|
864
|
+
* @remarks
|
|
865
|
+
* This event is triggered to notify about various device-related errors, such as connection issues,
|
|
866
|
+
* serial port errors, or other device-specific problems. The event provides detailed error information
|
|
867
|
+
* through the `MedWandDeviceError` parameter.
|
|
868
|
+
*/
|
|
869
|
+
OnDeviceError: MedWandDeviceError;
|
|
870
|
+
/**
|
|
871
|
+
* Occurs when the reading state of the MedWand device changes.
|
|
872
|
+
*
|
|
873
|
+
* @remarks
|
|
874
|
+
* This event is triggered whenever the `ReadingState` property of the MedWand device changes.
|
|
875
|
+
* It provides the updated `ReadingState` as an argument to the event handler.
|
|
876
|
+
*/
|
|
877
|
+
OnReadingStateChanged: ReadingState;
|
|
878
|
+
/**
|
|
879
|
+
* Occurs when a new reading is received from the MedWand device.
|
|
880
|
+
*
|
|
881
|
+
* @remarks
|
|
882
|
+
* This event is triggered whenever the MedWand device processes and provides a new reading.
|
|
883
|
+
* The event handler receives a `MedWandReading` object containing the details of the reading.
|
|
884
|
+
*/
|
|
885
|
+
OnReadingReceived: MedWandReading;
|
|
886
|
+
/**
|
|
887
|
+
* Occurs when the LED intensity of the MedWand device changes.
|
|
888
|
+
*
|
|
889
|
+
* @remarks
|
|
890
|
+
* This event is triggered whenever the LED intensity is updated via the `SetLedIntensity` method.
|
|
891
|
+
* Subscribers can use this event to respond to changes in the LED intensity, such as updating UI elements or logging.
|
|
892
|
+
*/
|
|
893
|
+
OnLedIntensityChanged: number;
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* Represents an error encountered by a MedWand device or during communication with it.
|
|
898
|
+
*
|
|
899
|
+
* @remarks
|
|
900
|
+
* This class encapsulates an error code and an associated exception, providing detailed
|
|
901
|
+
* information about the nature of the error. It is used throughout the MedWand SDK to
|
|
902
|
+
* standardize error reporting and handling.
|
|
903
|
+
*/
|
|
904
|
+
export declare class MedWandDeviceError {
|
|
905
|
+
/**
|
|
906
|
+
* Error code.
|
|
907
|
+
*/
|
|
908
|
+
readonly Code: ErrorCode;
|
|
909
|
+
/**
|
|
910
|
+
* Exception details.
|
|
911
|
+
*/
|
|
912
|
+
readonly Exception: Error;
|
|
913
|
+
/**
|
|
914
|
+
* Initializes a new instance of the `MedWandDeviceError` class.
|
|
915
|
+
*
|
|
916
|
+
* @param code - The code that identifies the device error.
|
|
917
|
+
* @param exception - The underlying error.
|
|
918
|
+
*/
|
|
919
|
+
constructor(code: ErrorCode, exception: Error);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Represents an exception that is thrown when a MedWand device requires a firmware update to function properly.
|
|
924
|
+
*
|
|
925
|
+
* @remarks
|
|
926
|
+
* This exception provides details about the current firmware version of the device and the required firmware version.
|
|
927
|
+
* It is typically used to notify the application that a firmware update is necessary for compatibility or functionality.
|
|
928
|
+
*/
|
|
929
|
+
export declare class MedWandFirmwareUpdateRequiredException extends Error {
|
|
930
|
+
/** The firmware version currently installed on the device. */
|
|
931
|
+
readonly CurrentVersion: string;
|
|
932
|
+
/** The firmware version reported by the MedWand firmware service. */
|
|
933
|
+
readonly RequiredVersion: string;
|
|
934
|
+
/**
|
|
935
|
+
* Initializes an error indicating that the MedWand firmware must be updated.
|
|
936
|
+
*
|
|
937
|
+
* @param currentVersion - The firmware version currently installed on the device.
|
|
938
|
+
* @param requiredVersion - The firmware version required by the firmware service.
|
|
939
|
+
* @param message - The message describing the required update.
|
|
940
|
+
*/
|
|
941
|
+
constructor(currentVersion: string, requiredVersion: string, message: string);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/************************************
|
|
945
|
+
* MedWandGeneration
|
|
946
|
+
************************************/
|
|
947
|
+
/**
|
|
948
|
+
* Enumeration for MedWand Device.
|
|
949
|
+
*/
|
|
950
|
+
export declare enum MedWandGeneration {
|
|
951
|
+
/**
|
|
952
|
+
* Generation 1.0 MedWand Device.
|
|
953
|
+
*/
|
|
954
|
+
Generation1 = 1,
|
|
955
|
+
/**
|
|
956
|
+
* Generation 2.0 MedWand Device.
|
|
957
|
+
*/
|
|
958
|
+
Generation2 = 2,
|
|
959
|
+
/**
|
|
960
|
+
* Unknown Generation MedWand Device.
|
|
961
|
+
*/
|
|
962
|
+
Unknown = 0,
|
|
963
|
+
/**
|
|
964
|
+
* Initial state of generation.
|
|
965
|
+
*/
|
|
966
|
+
NotReady = -1
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Class used to return reading data from MedWand sensor.
|
|
971
|
+
*/
|
|
972
|
+
export declare class MedWandReading {
|
|
973
|
+
/**
|
|
974
|
+
* DateTime of the reading.
|
|
975
|
+
*/
|
|
976
|
+
TimeStamp: Date;
|
|
977
|
+
/**
|
|
978
|
+
* Current status of the MedWand device.
|
|
979
|
+
*/
|
|
980
|
+
Status: string | null;
|
|
981
|
+
/**
|
|
982
|
+
* ECG reading offest.
|
|
983
|
+
*/
|
|
984
|
+
Index: number;
|
|
985
|
+
/**
|
|
986
|
+
* ECG reading values count.
|
|
987
|
+
*/
|
|
988
|
+
Count: number;
|
|
989
|
+
/**
|
|
990
|
+
* Reading sensor type.
|
|
991
|
+
*/
|
|
992
|
+
SensorType: string | null;
|
|
993
|
+
/**
|
|
994
|
+
* Temperature ambient value.
|
|
995
|
+
* Will return 'Low' if less than 60.0F
|
|
996
|
+
* Will return 'High' if greater than 104.0F
|
|
997
|
+
*/
|
|
998
|
+
TempAmbient: string | null;
|
|
999
|
+
/**
|
|
1000
|
+
* Temperature fahrenheit value.
|
|
1001
|
+
* Will return 'Low' if less than 92.9F
|
|
1002
|
+
* Will return 'High' if greater than 107.6F
|
|
1003
|
+
*/
|
|
1004
|
+
TempObject: string | null;
|
|
1005
|
+
/**
|
|
1006
|
+
* SPO2 pulse rate value.
|
|
1007
|
+
* Will return 'Low' if less than 25
|
|
1008
|
+
* Will return 'High' if greater than 200
|
|
1009
|
+
*/
|
|
1010
|
+
PulseRate: string | null;
|
|
1011
|
+
/**
|
|
1012
|
+
* SPO2 value.
|
|
1013
|
+
* Will return 'Low' if less than 70
|
|
1014
|
+
* Will return 'High' if greater than 100
|
|
1015
|
+
*/
|
|
1016
|
+
Spo2: string | null;
|
|
1017
|
+
/**
|
|
1018
|
+
* ECG sensor data.
|
|
1019
|
+
*/
|
|
1020
|
+
EcgData: string | null;
|
|
1021
|
+
/**
|
|
1022
|
+
* Creates a deep copy of the specified MedWandReading object.
|
|
1023
|
+
*
|
|
1024
|
+
* This method serializes the input object to JSON and then
|
|
1025
|
+
* deserializes it to create a deep copy.
|
|
1026
|
+
*
|
|
1027
|
+
* @param obj The MedWandReading object to clone.
|
|
1028
|
+
* @returns A new instance of MedWandReading that is a deep copy of the input object.
|
|
1029
|
+
* @throws Error Thrown if the obj parameter is null or undefined.
|
|
1030
|
+
*/
|
|
1031
|
+
static DeepClone<T>(obj: MedWandReading): MedWandReading;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Enumeration for MedWand device sensor selection.
|
|
1036
|
+
*/
|
|
1037
|
+
export declare enum MedWandSensor {
|
|
1038
|
+
/**
|
|
1039
|
+
* No sensor selected.
|
|
1040
|
+
*/
|
|
1041
|
+
None = 0,
|
|
1042
|
+
/**
|
|
1043
|
+
* Thermometer sensor.
|
|
1044
|
+
*/
|
|
1045
|
+
Thermometer = 1,
|
|
1046
|
+
/**
|
|
1047
|
+
* PulseOximeter sensor.
|
|
1048
|
+
*/
|
|
1049
|
+
PulseOximeter = 2,
|
|
1050
|
+
/**
|
|
1051
|
+
* Ecg sensor.
|
|
1052
|
+
*/
|
|
1053
|
+
Ecg = 3,
|
|
1054
|
+
/**
|
|
1055
|
+
* Stethoscope sensor.
|
|
1056
|
+
*/
|
|
1057
|
+
Stethoscope = 4,
|
|
1058
|
+
/**
|
|
1059
|
+
* Otoscope sensor.
|
|
1060
|
+
*/
|
|
1061
|
+
Otoscope = 5
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* Specifies the available microphone modes for the stethoscope functionality
|
|
1066
|
+
* within the MedWand SDK.
|
|
1067
|
+
*
|
|
1068
|
+
* @remarks
|
|
1069
|
+
* These modes determine the type of sound the stethoscope captures, such as
|
|
1070
|
+
* heart sounds, lung sounds, or bowel sounds. The `Off` mode disables
|
|
1071
|
+
* the microphone.
|
|
1072
|
+
*/
|
|
1073
|
+
export declare enum MicrophoneModes {
|
|
1074
|
+
/** Disables the microphone. */
|
|
1075
|
+
Off = 0,
|
|
1076
|
+
/** Configures the microphone to capture heart sounds. */
|
|
1077
|
+
Heart = 1,
|
|
1078
|
+
/** Configures the microphone to capture lung sounds. */
|
|
1079
|
+
Lungs = 2,
|
|
1080
|
+
/** Configures the microphone to capture bowel sounds. */
|
|
1081
|
+
Bowel = 3
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* Represents the various states of the reading process in the MedWand SDK.
|
|
1086
|
+
*/
|
|
1087
|
+
export declare enum ReadingState {
|
|
1088
|
+
/**
|
|
1089
|
+
* Indicates that the reading process is stopped and no active operations are being performed.
|
|
1090
|
+
*/
|
|
1091
|
+
Stopped = 0,
|
|
1092
|
+
/**
|
|
1093
|
+
* Indicates that the reading process is in the initial phase of starting.
|
|
1094
|
+
*/
|
|
1095
|
+
Starting = 1,
|
|
1096
|
+
/**
|
|
1097
|
+
* Indicates that the reading process has successfully started and is actively running.
|
|
1098
|
+
*/
|
|
1099
|
+
Started = 2,
|
|
1100
|
+
/**
|
|
1101
|
+
* Indicates the state where the MedWand device is actively relaying readings.
|
|
1102
|
+
*/
|
|
1103
|
+
Reading = 3,
|
|
1104
|
+
/**
|
|
1105
|
+
* Indicates that the MedWand SDK is actively recording data during the reading process.
|
|
1106
|
+
*/
|
|
1107
|
+
Recording = 4,
|
|
1108
|
+
/**
|
|
1109
|
+
* Indicates that the reading process is in the phase of stopping.
|
|
1110
|
+
*/
|
|
1111
|
+
Stopping = 5,
|
|
1112
|
+
/**
|
|
1113
|
+
* Indicates that an error has occurred during the reading process in the MedWand SDK.
|
|
1114
|
+
*/
|
|
1115
|
+
Error = 6
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
declare type StethoscopeEvents = {
|
|
1119
|
+
/**
|
|
1120
|
+
* Occurs when a new frame is ready to be processed.
|
|
1121
|
+
*
|
|
1122
|
+
* @remarks
|
|
1123
|
+
* This event provides the raw frame data as a byte array. Subscribers can use this data
|
|
1124
|
+
* for further processing, such as rendering or saving the frame.
|
|
1125
|
+
*/
|
|
1126
|
+
FrameReady: Uint8Array;
|
|
1127
|
+
/**
|
|
1128
|
+
* Occurs when the recorded frames are ready for processing.
|
|
1129
|
+
*
|
|
1130
|
+
* @remarks
|
|
1131
|
+
* This event is triggered after all frames have been recorded by the stethoscope module.
|
|
1132
|
+
* The event provides the recorded frame data as a byte array.
|
|
1133
|
+
*/
|
|
1134
|
+
RecordedFramesReady: Uint8Array;
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Enumeration for MedWand stethoscope filter selection.
|
|
1139
|
+
*/
|
|
1140
|
+
export declare enum StethoscopeFilter {
|
|
1141
|
+
/**
|
|
1142
|
+
* Default audio filter used when initialized.
|
|
1143
|
+
*/
|
|
1144
|
+
Off = 0,
|
|
1145
|
+
/**
|
|
1146
|
+
* Heart audio filter.
|
|
1147
|
+
*/
|
|
1148
|
+
Heart = 1,
|
|
1149
|
+
/**
|
|
1150
|
+
* Lungs audio filter.
|
|
1151
|
+
*/
|
|
1152
|
+
Lungs = 2,
|
|
1153
|
+
/**
|
|
1154
|
+
* Bowel audio filter.
|
|
1155
|
+
*/
|
|
1156
|
+
Bowel = 3
|
|
1157
|
+
/**
|
|
1158
|
+
* Fetal audio filter.
|
|
1159
|
+
*/
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Represents a module for managing stethoscope-related events within a browser application.
|
|
1164
|
+
*/
|
|
1165
|
+
export declare class StethoscopeModule extends TypedEventSubscriptions<StethoscopeEvents> {
|
|
1166
|
+
/** Stops preview, releases audio resources, and removes event subscriptions. */
|
|
1167
|
+
Dispose(): void;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
declare class TypedEventSubscriptions<TEvents extends EventMap> {
|
|
1171
|
+
/**
|
|
1172
|
+
* Subscribes a handler to the named event. The handler receives the event payload.
|
|
1173
|
+
*
|
|
1174
|
+
* @returns A function that removes the subscription.
|
|
1175
|
+
*/
|
|
1176
|
+
on<TKey extends keyof TEvents>(eventName: TKey, handler: EventHandler<TEvents[TKey]>): () => void;
|
|
1177
|
+
/** Removes the specified handler from the named event. */
|
|
1178
|
+
off<TKey extends keyof TEvents>(eventName: TKey, handler: EventHandler<TEvents[TKey]>): void;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
declare class TypedEventTarget<TEvents extends EventMap> extends TypedEventSubscriptions<TEvents> {
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* Enumeration for MedWand updater status.
|
|
1186
|
+
*/
|
|
1187
|
+
export declare enum UpdaterState {
|
|
1188
|
+
/**
|
|
1189
|
+
* Reconnecting to the MedWand device
|
|
1190
|
+
*/
|
|
1191
|
+
Reconnecting = 0,
|
|
1192
|
+
/**
|
|
1193
|
+
* Initializing the MedWand device bootloader
|
|
1194
|
+
*/
|
|
1195
|
+
Initializing = 1,
|
|
1196
|
+
/**
|
|
1197
|
+
* Erasing the MedWand device firmware
|
|
1198
|
+
*/
|
|
1199
|
+
Erasing = 2,
|
|
1200
|
+
/**
|
|
1201
|
+
* Programming the MedWand device firmware
|
|
1202
|
+
*/
|
|
1203
|
+
Programming = 3,
|
|
1204
|
+
/**
|
|
1205
|
+
* Reading the MedWand device firmware
|
|
1206
|
+
*/
|
|
1207
|
+
Reading = 4,
|
|
1208
|
+
/**
|
|
1209
|
+
* Verifying the MedWand device firmware
|
|
1210
|
+
*/
|
|
1211
|
+
Verifying = 5,
|
|
1212
|
+
/**
|
|
1213
|
+
* Commiting the MedWand device firmware
|
|
1214
|
+
*/
|
|
1215
|
+
Commiting = 6,
|
|
1216
|
+
/**
|
|
1217
|
+
* Completed the MedWand device firmware
|
|
1218
|
+
*/
|
|
1219
|
+
Complete = 7
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
export { }
|
|
1223
|
+
|
|
1224
|
+
/** Browser globals supplied by the standalone SDK bundle. */
|
|
1225
|
+
declare global {
|
|
1226
|
+
var MedWandSdk: {
|
|
1227
|
+
readonly CameraModes: typeof CameraModes;
|
|
1228
|
+
readonly CameraModule: typeof CameraModule;
|
|
1229
|
+
readonly DeviceState: typeof DeviceState;
|
|
1230
|
+
readonly EcgModule: typeof EcgModule;
|
|
1231
|
+
readonly ErrorCode: typeof ErrorCode;
|
|
1232
|
+
readonly FirmwareController: typeof FirmwareController;
|
|
1233
|
+
readonly FocusModes: typeof FocusModes;
|
|
1234
|
+
readonly LicenseError: typeof LicenseError;
|
|
1235
|
+
readonly LicenseState: typeof LicenseState;
|
|
1236
|
+
readonly MedWandController: typeof MedWandController;
|
|
1237
|
+
readonly MedWandDeviceError: typeof MedWandDeviceError;
|
|
1238
|
+
readonly MedWandFirmwareUpdateRequiredException: typeof MedWandFirmwareUpdateRequiredException;
|
|
1239
|
+
readonly MedWandGeneration: typeof MedWandGeneration;
|
|
1240
|
+
readonly MedWandReading: typeof MedWandReading;
|
|
1241
|
+
readonly MedWandSensor: typeof MedWandSensor;
|
|
1242
|
+
readonly MicrophoneModes: typeof MicrophoneModes;
|
|
1243
|
+
readonly ReadingState: typeof ReadingState;
|
|
1244
|
+
readonly StethoscopeFilter: typeof StethoscopeFilter;
|
|
1245
|
+
readonly StethoscopeModule: typeof StethoscopeModule;
|
|
1246
|
+
readonly UpdaterState: typeof UpdaterState;
|
|
1247
|
+
};
|
|
1248
|
+
}
|