@zaber/motion 7.2.3 → 7.4.0

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 (70) hide show
  1. package/LICENSE +963 -1209
  2. package/dist/binding/wasm/zaber-motion-core.wasm +0 -0
  3. package/dist/lib/ascii/all_axes.d.ts +16 -0
  4. package/dist/lib/ascii/all_axes.d.ts.map +1 -1
  5. package/dist/lib/ascii/all_axes.js +34 -0
  6. package/dist/lib/ascii/all_axes.js.map +1 -1
  7. package/dist/lib/ascii/axis.d.ts +20 -3
  8. package/dist/lib/ascii/axis.d.ts.map +1 -1
  9. package/dist/lib/ascii/axis.js +30 -5
  10. package/dist/lib/ascii/axis.js.map +1 -1
  11. package/dist/lib/ascii/device.d.ts +13 -1
  12. package/dist/lib/ascii/device.d.ts.map +1 -1
  13. package/dist/lib/ascii/device.js +25 -1
  14. package/dist/lib/ascii/device.js.map +1 -1
  15. package/dist/lib/ascii/index.d.ts +2 -0
  16. package/dist/lib/ascii/index.d.ts.map +1 -1
  17. package/dist/lib/ascii/index.js +2 -0
  18. package/dist/lib/ascii/index.js.map +1 -1
  19. package/dist/lib/ascii/set_state_axis_response.d.ts +20 -0
  20. package/dist/lib/ascii/set_state_axis_response.d.ts.map +1 -0
  21. package/dist/lib/ascii/set_state_axis_response.js +28 -0
  22. package/dist/lib/ascii/set_state_axis_response.js.map +1 -0
  23. package/dist/lib/ascii/set_state_device_response.d.ts +21 -0
  24. package/dist/lib/ascii/set_state_device_response.d.ts.map +1 -0
  25. package/dist/lib/ascii/set_state_device_response.js +29 -0
  26. package/dist/lib/ascii/set_state_device_response.js.map +1 -0
  27. package/dist/lib/finalizer.js.map +1 -1
  28. package/dist/lib/gateway/bindings.exec.js +2 -1
  29. package/dist/lib/gateway/bindings.exec.js.map +1 -1
  30. package/dist/lib/gateway/bindings.js.map +1 -1
  31. package/dist/lib/gateway/bindings.node.js +1 -1
  32. package/dist/lib/gateway/bindings.node.js.map +1 -1
  33. package/dist/lib/gateway/bindings.wasm.d.ts +1 -1
  34. package/dist/lib/gateway/bindings.wasm.d.ts.map +1 -1
  35. package/dist/lib/gateway/bindings.wasm.js +4 -4
  36. package/dist/lib/gateway/bindings.wasm.js.map +1 -1
  37. package/dist/lib/gateway/call.d.ts +1 -1
  38. package/dist/lib/gateway/call.d.ts.map +1 -1
  39. package/dist/lib/gateway/call.js.map +1 -1
  40. package/dist/lib/gateway/events.d.ts.map +1 -1
  41. package/dist/lib/gateway/events.js.map +1 -1
  42. package/dist/lib/gateway/sanitizer.js +3 -3
  43. package/dist/lib/gateway/sanitizer.js.map +1 -1
  44. package/dist/lib/gateway/serialization.d.ts +1 -1
  45. package/dist/lib/gateway/serialization.d.ts.map +1 -1
  46. package/dist/lib/gateway/serialization.js.map +1 -1
  47. package/dist/lib/library.js +1 -1
  48. package/dist/lib/library.js.map +1 -1
  49. package/dist/lib/microscopy/illuminator_channel.d.ts +3 -1
  50. package/dist/lib/microscopy/illuminator_channel.d.ts.map +1 -1
  51. package/dist/lib/microscopy/illuminator_channel.js +4 -1
  52. package/dist/lib/microscopy/illuminator_channel.js.map +1 -1
  53. package/dist/lib/product/process.d.ts +3 -1
  54. package/dist/lib/product/process.d.ts.map +1 -1
  55. package/dist/lib/product/process.js +4 -1
  56. package/dist/lib/product/process.js.map +1 -1
  57. package/dist/lib/requests/device_restore_request.d.ts +13 -0
  58. package/dist/lib/requests/device_restore_request.d.ts.map +1 -0
  59. package/dist/lib/requests/device_restore_request.js +31 -0
  60. package/dist/lib/requests/device_restore_request.js.map +1 -0
  61. package/dist/lib/requests/driver_enable_request.d.ts +13 -0
  62. package/dist/lib/requests/driver_enable_request.d.ts.map +1 -0
  63. package/dist/lib/requests/driver_enable_request.js +31 -0
  64. package/dist/lib/requests/driver_enable_request.js.map +1 -0
  65. package/dist/lib/requests/empty_request.js.map +1 -1
  66. package/dist/lib/requests/index.d.ts +2 -0
  67. package/dist/lib/requests/index.d.ts.map +1 -1
  68. package/dist/lib/requests/index.js +2 -0
  69. package/dist/lib/requests/index.js.map +1 -1
  70. package/package.json +5 -8
@@ -15,6 +15,7 @@ import { FirmwareVersion } from '../firmware_version';
15
15
  import { DeviceStorage } from './storage';
16
16
  import { Triggers } from './triggers';
17
17
  import { Streams } from './streams';
18
+ import { SetStateDeviceResponse } from './set_state_device_response';
18
19
  /**
19
20
  * Represents the controller part of one device - may be either a standalone controller or an integrated controller.
20
21
  */
@@ -209,8 +210,9 @@ export declare class Device {
209
210
  * Applies a saved state to this device.
210
211
  * @param state The state object to apply to this device.
211
212
  * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.
213
+ * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.
212
214
  */
213
- setState(state: string, options?: Device.SetStateOptions): Promise<void>;
215
+ setState(state: string, options?: Device.SetStateOptions): Promise<SetStateDeviceResponse>;
214
216
  /**
215
217
  * Checks if a state can be applied to this device.
216
218
  * This only covers exceptions that can be determined statically such as mismatches of ID or version,
@@ -234,6 +236,16 @@ export declare class Device {
234
236
  * @returns New device instance with the new address.
235
237
  */
236
238
  renumber(address: number): Promise<Device>;
239
+ /**
240
+ * Restores most of the settings to their default values.
241
+ * Deletes all triggers, stream and PVT buffers, servo tunings.
242
+ * Deletes all zaber storage keys.
243
+ * Disables locksteps, unparks axes.
244
+ * Preserves storage, communication settings, peripherals (unless hard is specified).
245
+ * The device needs to be identified again after the restore.
246
+ * @param [hard=false] If true, completely erases device's memory. The device also resets.
247
+ */
248
+ restore(hard?: boolean): Promise<void>;
237
249
  /**
238
250
  * Returns identity.
239
251
  * @returns Device identity.
@@ -1 +1 @@
1
- {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9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ar(require("../requests"));
42
42
  const storage_1 = require("./storage");
43
43
  const triggers_1 = require("./triggers");
44
44
  const streams_1 = require("./streams");
45
+ const set_state_device_response_1 = require("./set_state_device_response");
45
46
  /**
46
47
  * Represents the controller part of one device - may be either a standalone controller or an integrated controller.
47
48
  */
@@ -402,6 +403,7 @@ class Device {
402
403
  * Applies a saved state to this device.
403
404
  * @param state The state object to apply to this device.
404
405
  * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.
406
+ * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.
405
407
  */
406
408
  async setState(state, options = {}) {
407
409
  const { deviceOnly = false, } = options;
@@ -415,7 +417,8 @@ class Device {
415
417
  return requests.SetStateRequest.toBinary(this);
416
418
  },
417
419
  };
418
- await gateway.callAsync('device/set_state', request);
420
+ const response = await gateway.callAsync('device/set_device_state', request, set_state_device_response_1.SetStateDeviceResponse.fromBinary);
421
+ return response;
419
422
  }
420
423
  /**
421
424
  * Checks if a state can be applied to this device.
@@ -478,6 +481,27 @@ class Device {
478
481
  const response = await gateway.callAsync('device/renumber', request, requests.IntResponse.fromBinary);
479
482
  return new Device(this.connection, response.value);
480
483
  }
484
+ /**
485
+ * Restores most of the settings to their default values.
486
+ * Deletes all triggers, stream and PVT buffers, servo tunings.
487
+ * Deletes all zaber storage keys.
488
+ * Disables locksteps, unparks axes.
489
+ * Preserves storage, communication settings, peripherals (unless hard is specified).
490
+ * The device needs to be identified again after the restore.
491
+ * @param [hard=false] If true, completely erases device's memory. The device also resets.
492
+ */
493
+ async restore(hard = false) {
494
+ const request = {
495
+ ...requests.DeviceRestoreRequest.DEFAULT,
496
+ interfaceId: this.connection.interfaceId,
497
+ device: this.deviceAddress,
498
+ hard: hard,
499
+ toBinary() {
500
+ return requests.DeviceRestoreRequest.toBinary(this);
501
+ },
502
+ };
503
+ await gateway.callAsync('device/restore', request);
504
+ }
481
505
  /**
482
506
  * Returns identity.
483
507
  * @returns Device identity.
@@ -1 +1 @@
1
- {"version":3,"file":"device.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,KAAK,CAAC;IACxB,CAAC;CACF;AA5lBD,wBA4lBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Oscilloscope } from './oscilloscope';\nimport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nimport { Pvt } from './pvt';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { DeviceStorage } from './storage';\nimport { Triggers } from './triggers';\nimport { Streams } from './streams';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * Key-value storage of this device.\n */\n public get storage(): DeviceStorage {\n return this._storage;\n }\n private _storage: DeviceStorage;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Oscilloscope recording helper for this device.\n * Requires at least Firmware 7.00.\n */\n public get oscilloscope(): Oscilloscope {\n return this._oscilloscope;\n }\n private _oscilloscope: Oscilloscope;\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n /**\n * User-assigned label of the device.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n /**\n * Triggers for this device.\n * Requires at least Firmware 7.06.\n */\n public get triggers(): Triggers {\n return this._triggers;\n }\n private _triggers: Triggers;\n\n /**\n * Gets an object that provides access to Streams on this device.\n * Requires at least Firmware 7.05.\n */\n public get streams(): Streams {\n return this._streams;\n }\n private _streams: Streams;\n\n /**\n * Gets an object that provides access to PVT functions of this device.\n * Note that as of ZML v5.0.0, this returns a Pvt object and NOT a PvtSequence object.\n * The PvtSequence can now be obtained from the Pvt object.\n * Requires at least Firmware 7.33.\n */\n public get pvt(): Pvt {\n return this._pvt;\n }\n private _pvt: Pvt;\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._storage = new DeviceStorage(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n this._oscilloscope = new Oscilloscope(this);\n this._triggers = new Triggers(this);\n this._streams = new Streams(this);\n this._pvt = new Pvt(this);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @param options.assumeVersion The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n * @returns Device identification data.\n */\n public async identify(\n options: Device.IdentifyOptions = {}\n ): Promise<DeviceIdentity> {\n const {\n assumeVersion,\n } = options;\n const request: requests.DeviceIdentifyRequest & gateway.Message = {\n ...requests.DeviceIdentifyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n assumeVersion: assumeVersion,\n toBinary() {\n return requests.DeviceIdentifyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<DeviceIdentity>(\n 'device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Device.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Device.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Device.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n axis = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @returns Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * Requires at least Firmware 6.15 or 7.11.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @returns Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * Unit conversion is not supported for commands where axes can be remapped, such as stream and PVT commands.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request: requests.PrepareCommandRequest & gateway.Message = {\n ...requests.PrepareCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n commandTemplate: commandTemplate,\n parameters: parameters,\n toBinary() {\n return requests.PrepareCommandRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/prepare_command',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the user-assigned device label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request: requests.DeviceSetStorageRequest & gateway.Message = {\n ...requests.DeviceSetStorageRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n value: label,\n toBinary() {\n return requests.DeviceSetStorageRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the device name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/get_label',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @returns A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this device.\n * @param state The state object to apply to this device.\n * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.\n */\n public async setState(\n state: string,\n options: Device.SetStateOptions = {}\n ): Promise<void> {\n const {\n deviceOnly = false,\n } = options;\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n deviceOnly: deviceOnly,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to this device.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string\n ): Promise<CanSetStateDeviceResponse> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n CanSetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Waits for the device to start responding to messages.\n * Useful to call after resetting the device.\n * Throws RequestTimeoutException upon timeout.\n * @param timeout For how long to wait in milliseconds for the device to start responding.\n */\n public async waitToRespond(\n timeout: number\n ): Promise<void> {\n const request: requests.WaitToRespondRequest & gateway.Message = {\n ...requests.WaitToRespondRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n timeout: timeout,\n toBinary() {\n return requests.WaitToRespondRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/wait_to_respond', request);\n }\n\n /**\n * Changes the address of this device.\n * After the address is successfully changed, the existing device class instance no longer represents the device.\n * Instead, use the new device instance returned by this method.\n * @param address The new address to assign to the device.\n * @returns New device instance with the new address.\n */\n public async renumber(\n address: number\n ): Promise<Device> {\n if (address < 1 || address > 99) {\n throw new TypeError('Invalid value; device addresses are numbered from 1 to 99.');\n }\n const request: requests.RenumberRequest & gateway.Message = {\n ...requests.RenumberRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n address: address,\n toBinary() {\n return requests.RenumberRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/renumber',\n request,\n requests.IntResponse.fromBinary);\n return new Device(this.connection, response.value);\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<DeviceIdentity>(\n 'device/get_identity',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @returns True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.BoolResponse>(\n 'device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface IdentifyOptions {\n /**\n * The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n */\n assumeVersion?: FirmwareVersion;\n }\n export interface GenericCommandOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n /**\n * Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n axis?: number;\n }\n export interface SetStateOptions {\n /**\n * If true, only device scope settings and features will be set.\n */\n deviceOnly?: boolean;\n }\n}\n"]}
1
+ {"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDA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C;IAED;;;OAGG;IACK,qBAAqB;QAC3B,MAAM,OAAO,GAAkD;YAC7D,GAAG,QAAQ,CAAC,kBAAkB,CAAC,OAAO;YACtC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW;YACxC,MAAM,EAAE,IAAI,CAAC,aAAa;YAC1B,QAAQ;gBACN,OAAO,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,0BAA0B,EAC1B,OAAO,EACP,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA1nBD,wBA0nBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Oscilloscope } from './oscilloscope';\nimport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nimport { Pvt } from './pvt';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { DeviceStorage } from './storage';\nimport { Triggers } from './triggers';\nimport { Streams } from './streams';\nimport { SetStateDeviceResponse } from './set_state_device_response';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * Key-value storage of this device.\n */\n public get storage(): DeviceStorage {\n return this._storage;\n }\n private _storage: DeviceStorage;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Oscilloscope recording helper for this device.\n * Requires at least Firmware 7.00.\n */\n public get oscilloscope(): Oscilloscope {\n return this._oscilloscope;\n }\n private _oscilloscope: Oscilloscope;\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n /**\n * User-assigned label of the device.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n /**\n * Triggers for this device.\n * Requires at least Firmware 7.06.\n */\n public get triggers(): Triggers {\n return this._triggers;\n }\n private _triggers: Triggers;\n\n /**\n * Gets an object that provides access to Streams on this device.\n * Requires at least Firmware 7.05.\n */\n public get streams(): Streams {\n return this._streams;\n }\n private _streams: Streams;\n\n /**\n * Gets an object that provides access to PVT functions of this device.\n * Note that as of ZML v5.0.0, this returns a Pvt object and NOT a PvtSequence object.\n * The PvtSequence can now be obtained from the Pvt object.\n * Requires at least Firmware 7.33.\n */\n public get pvt(): Pvt {\n return this._pvt;\n }\n private _pvt: Pvt;\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._storage = new DeviceStorage(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n this._oscilloscope = new Oscilloscope(this);\n this._triggers = new Triggers(this);\n this._streams = new Streams(this);\n this._pvt = new Pvt(this);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @param options.assumeVersion The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n * @returns Device identification data.\n */\n public async identify(\n options: Device.IdentifyOptions = {}\n ): Promise<DeviceIdentity> {\n const {\n assumeVersion,\n } = options;\n const request: requests.DeviceIdentifyRequest & gateway.Message = {\n ...requests.DeviceIdentifyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n assumeVersion: assumeVersion,\n toBinary() {\n return requests.DeviceIdentifyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<DeviceIdentity>(\n 'device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Device.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Response>(\n 'interface/generic_command',\n request,\n Response.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic ASCII command to this device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Device.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n checkErrors: checkErrors,\n timeout: timeout,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n requests.GenericCommandResponseCollection.fromBinary);\n return response.responses;\n }\n\n /**\n * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Device.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n axis = 0,\n } = options;\n const request: requests.GenericCommandRequest & gateway.Message = {\n ...requests.GenericCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n axis: axis,\n toBinary() {\n return requests.GenericCommandRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @returns Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * Requires at least Firmware 6.15 or 7.11.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @returns Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * Unit conversion is not supported for commands where axes can be remapped, such as stream and PVT commands.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request: requests.PrepareCommandRequest & gateway.Message = {\n ...requests.PrepareCommandRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n commandTemplate: commandTemplate,\n parameters: parameters,\n toBinary() {\n return requests.PrepareCommandRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/prepare_command',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the user-assigned device label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request: requests.DeviceSetStorageRequest & gateway.Message = {\n ...requests.DeviceSetStorageRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n value: label,\n toBinary() {\n return requests.DeviceSetStorageRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the device name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/get_label',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @returns A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.StringResponse>(\n 'device/get_state',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Applies a saved state to this device.\n * @param state The state object to apply to this device.\n * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.\n * @returns Reports of any issues that were handled, but caused the state to not be exactly restored.\n */\n public async setState(\n state: string,\n options: Device.SetStateOptions = {}\n ): Promise<SetStateDeviceResponse> {\n const {\n deviceOnly = false,\n } = options;\n const request: requests.SetStateRequest & gateway.Message = {\n ...requests.SetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n deviceOnly: deviceOnly,\n toBinary() {\n return requests.SetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SetStateDeviceResponse>(\n 'device/set_device_state',\n request,\n SetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Checks if a state can be applied to this device.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string\n ): Promise<CanSetStateDeviceResponse> {\n const request: requests.CanSetStateRequest & gateway.Message = {\n ...requests.CanSetStateRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n state: state,\n toBinary() {\n return requests.CanSetStateRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n CanSetStateDeviceResponse.fromBinary);\n return response;\n }\n\n /**\n * Waits for the device to start responding to messages.\n * Useful to call after resetting the device.\n * Throws RequestTimeoutException upon timeout.\n * @param timeout For how long to wait in milliseconds for the device to start responding.\n */\n public async waitToRespond(\n timeout: number\n ): Promise<void> {\n const request: requests.WaitToRespondRequest & gateway.Message = {\n ...requests.WaitToRespondRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n timeout: timeout,\n toBinary() {\n return requests.WaitToRespondRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/wait_to_respond', request);\n }\n\n /**\n * Changes the address of this device.\n * After the address is successfully changed, the existing device class instance no longer represents the device.\n * Instead, use the new device instance returned by this method.\n * @param address The new address to assign to the device.\n * @returns New device instance with the new address.\n */\n public async renumber(\n address: number\n ): Promise<Device> {\n if (address < 1 || address > 99) {\n throw new TypeError('Invalid value; device addresses are numbered from 1 to 99.');\n }\n const request: requests.RenumberRequest & gateway.Message = {\n ...requests.RenumberRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n address: address,\n toBinary() {\n return requests.RenumberRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/renumber',\n request,\n requests.IntResponse.fromBinary);\n return new Device(this.connection, response.value);\n }\n\n /**\n * Restores most of the settings to their default values.\n * Deletes all triggers, stream and PVT buffers, servo tunings.\n * Deletes all zaber storage keys.\n * Disables locksteps, unparks axes.\n * Preserves storage, communication settings, peripherals (unless hard is specified).\n * The device needs to be identified again after the restore.\n * @param [hard=false] If true, completely erases device's memory. The device also resets.\n */\n public async restore(\n hard: boolean = false\n ): Promise<void> {\n const request: requests.DeviceRestoreRequest & gateway.Message = {\n ...requests.DeviceRestoreRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n hard: hard,\n toBinary() {\n return requests.DeviceRestoreRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/restore', request);\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<DeviceIdentity>(\n 'device/get_identity',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @returns True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.BoolResponse>(\n 'device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface IdentifyOptions {\n /**\n * The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n */\n assumeVersion?: FirmwareVersion;\n }\n export interface GenericCommandOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when the device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n /**\n * Optional axis number to send the command to.\n */\n axis?: number;\n /**\n * Controls whether to throw an exception when a device rejects the command.\n */\n checkErrors?: boolean;\n /**\n * The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n */\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n /**\n * Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n axis?: number;\n }\n export interface SetStateOptions {\n /**\n * If true, only device scope settings and features will be set.\n */\n deviceOnly?: boolean;\n }\n}\n"]}
@@ -41,6 +41,8 @@ export * from './response';
41
41
  export * from './servo_tuner';
42
42
  export * from './servo_tuning_param';
43
43
  export * from './servo_tuning_paramset';
44
+ export * from './set_state_axis_response';
45
+ export * from './set_state_device_response';
44
46
  export * from './setting_constants';
45
47
  export * from './simple_tuning';
46
48
  export * from './simple_tuning_param_definition';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ascii/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAC9B,cAAc,Y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D,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kCAAkC,CAAC;AACjD,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
@@ -58,6 +58,8 @@ __exportStar(require("./response"), exports);
58
58
  __exportStar(require("./servo_tuner"), exports);
59
59
  __exportStar(require("./servo_tuning_param"), exports);
60
60
  __exportStar(require("./servo_tuning_paramset"), exports);
61
+ __exportStar(require("./set_state_axis_response"), exports);
62
+ __exportStar(require("./set_state_device_response"), exports);
61
63
  __exportStar(require("./setting_constants"), exports);
62
64
  __exportStar(require("./simple_tuning"), exports);
63
65
  __exportStar(require("./simple_tuning_param_definition"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ascii/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,gDAA8B;AAC9B,6CAA2B;AAC3B,yCAAuB;AACvB,+CAA6B;AAC7B,kDAAgC;AAChC,kDAAgC;AAChC,8CAA4B;AAC5B,gEAA8C;AAC9C,kEAAgD;AAChD,+CAA6B;AAC7B,sDAAoC;AACpC,2CAAyB;AACzB,oDAAkC;AAClC,8CAA4B;AAC5B,mDAAiC;AACjC,oDAAkC;AAClC,0DAAwC;AACxC,qDAAmC;AACnC,4DAA0C;AAC1C,gDAA8B;AAC9B,uDAAqC;AACrC,kDAAgC;AAChC,iDAA+B;AAC/B,6CAA2B;AAC3B,kDAAgC;AAChC,iDAA+B;AAC/B,iDAA+B;AAC/B,oEAAkD;AAClD,sDAAoC;AACpC,6DAA2C;AAC3C,kDAAgC;AAChC,+CAA6B;AAC7B,wCAAsB;AACtB,wDAAsC;AACtC,kDAAgC;AAChC,+CAA6B;AAC7B,2CAAyB;AACzB,6CAA2B;AAC3B,iDAA+B;AAC/B,6CAA2B;AAC3B,gDAA8B;AAC9B,uDAAqC;AACrC,0DAAwC;AACxC,sDAAoC;AACpC,kDAAgC;AAChC,mEAAiD;AACjD,4CAA0B;AAC1B,2CAAyB;AACzB,2DAAyC;AACzC,qDAAmC;AACnC,kDAAgC;AAChC,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,8CAA4B;AAC5B,4CAA0B;AAC1B,mDAAiC;AACjC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,kDAAgC;AAChC,6CAA2B;AAC3B,2DAAyC;AACzC,kDAAgC;AAChC,6CAA2B","sourcesContent":["/* This file is generated. Do not modify by hand. */\nexport * from './alert_event';\nexport * from './all_axes';\nexport * from './axis';\nexport * from './axis_group';\nexport * from './axis_identity';\nexport * from './axis_settings';\nexport * from './axis_type';\nexport * from './can_set_state_axis_response';\nexport * from './can_set_state_device_response';\nexport * from './connection';\nexport * from './conversion_factor';\nexport * from './device';\nexport * from './device_identity';\nexport * from './device_io';\nexport * from './device_io_info';\nexport * from './device_settings';\nexport * from './digital_output_action';\nexport * from './get_axis_setting';\nexport * from './get_axis_setting_result';\nexport * from './get_setting';\nexport * from './get_setting_result';\nexport * from './io_port_label';\nexport * from './io_port_type';\nexport * from './lockstep';\nexport * from './lockstep_axes';\nexport * from './message_type';\nexport * from './oscilloscope';\nexport * from './oscilloscope_capture_properties';\nexport * from './oscilloscope_data';\nexport * from './oscilloscope_data_source';\nexport * from './paramset_info';\nexport * from './pid_tuning';\nexport * from './pvt';\nexport * from './pvt_axis_definition';\nexport * from './pvt_axis_type';\nexport * from './pvt_buffer';\nexport * from './pvt_io';\nexport * from './pvt_mode';\nexport * from './pvt_sequence';\nexport * from './response';\nexport * from './servo_tuner';\nexport * from './servo_tuning_param';\nexport * from './servo_tuning_paramset';\nexport * from './setting_constants';\nexport * from './simple_tuning';\nexport * from './simple_tuning_param_definition';\nexport * from './storage';\nexport * from './stream';\nexport * from './stream_axis_definition';\nexport * from './stream_axis_type';\nexport * from './stream_buffer';\nexport * from './stream_io';\nexport * from './stream_mode';\nexport * from './streams';\nexport * from './transport';\nexport * from './trigger';\nexport * from './trigger_action';\nexport * from './trigger_condition';\nexport * from './trigger_enabled_state';\nexport * from './trigger_operation';\nexport * from './trigger_state';\nexport * from './triggers';\nexport * from './unknown_response_event';\nexport * from './warning_flags';\nexport * from './warnings';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ascii/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,gDAA8B;AAC9B,6CAA2B;AAC3B,yCAAuB;AACvB,+CAA6B;AAC7B,kDAAgC;AAChC,kDAAgC;AAChC,8CAA4B;AAC5B,gEAA8C;AAC9C,kEAAgD;AAChD,+CAA6B;AAC7B,sDAAoC;AACpC,2CAAyB;AACzB,oDAAkC;AAClC,8CAA4B;AAC5B,mDAAiC;AACjC,oDAAkC;AAClC,0DAAwC;AACxC,qDAAmC;AACnC,4DAA0C;AAC1C,gDAA8B;AAC9B,uDAAqC;AACrC,kDAAgC;AAChC,iDAA+B;AAC/B,6CAA2B;AAC3B,kDAAgC;AAChC,iDAA+B;AAC/B,iDAA+B;AAC/B,oEAAkD;AAClD,sDAAoC;AACpC,6DAA2C;AAC3C,kDAAgC;AAChC,+CAA6B;AAC7B,wCAAsB;AACtB,wDAAsC;AACtC,kDAAgC;AAChC,+CAA6B;AAC7B,2CAAyB;AACzB,6CAA2B;AAC3B,iDAA+B;AAC/B,6CAA2B;AAC3B,gDAA8B;AAC9B,uDAAqC;AACrC,0DAAwC;AACxC,4DAA0C;AAC1C,8DAA4C;AAC5C,sDAAoC;AACpC,kDAAgC;AAChC,mEAAiD;AACjD,4CAA0B;AAC1B,2CAAyB;AACzB,2DAAyC;AACzC,qDAAmC;AACnC,kDAAgC;AAChC,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,8CAA4B;AAC5B,4CAA0B;AAC1B,mDAAiC;AACjC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,kDAAgC;AAChC,6CAA2B;AAC3B,2DAAyC;AACzC,kDAAgC;AAChC,6CAA2B","sourcesContent":["/* This file is generated. Do not modify by hand. */\nexport * from './alert_event';\nexport * from './all_axes';\nexport * from './axis';\nexport * from './axis_group';\nexport * from './axis_identity';\nexport * from './axis_settings';\nexport * from './axis_type';\nexport * from './can_set_state_axis_response';\nexport * from './can_set_state_device_response';\nexport * from './connection';\nexport * from './conversion_factor';\nexport * from './device';\nexport * from './device_identity';\nexport * from './device_io';\nexport * from './device_io_info';\nexport * from './device_settings';\nexport * from './digital_output_action';\nexport * from './get_axis_setting';\nexport * from './get_axis_setting_result';\nexport * from './get_setting';\nexport * from './get_setting_result';\nexport * from './io_port_label';\nexport * from './io_port_type';\nexport * from './lockstep';\nexport * from './lockstep_axes';\nexport * from './message_type';\nexport * from './oscilloscope';\nexport * from './oscilloscope_capture_properties';\nexport * from './oscilloscope_data';\nexport * from './oscilloscope_data_source';\nexport * from './paramset_info';\nexport * from './pid_tuning';\nexport * from './pvt';\nexport * from './pvt_axis_definition';\nexport * from './pvt_axis_type';\nexport * from './pvt_buffer';\nexport * from './pvt_io';\nexport * from './pvt_mode';\nexport * from './pvt_sequence';\nexport * from './response';\nexport * from './servo_tuner';\nexport * from './servo_tuning_param';\nexport * from './servo_tuning_paramset';\nexport * from './set_state_axis_response';\nexport * from './set_state_device_response';\nexport * from './setting_constants';\nexport * from './simple_tuning';\nexport * from './simple_tuning_param_definition';\nexport * from './storage';\nexport * from './stream';\nexport * from './stream_axis_definition';\nexport * from './stream_axis_type';\nexport * from './stream_buffer';\nexport * from './stream_io';\nexport * from './stream_mode';\nexport * from './streams';\nexport * from './transport';\nexport * from './trigger';\nexport * from './trigger_action';\nexport * from './trigger_condition';\nexport * from './trigger_enabled_state';\nexport * from './trigger_operation';\nexport * from './trigger_state';\nexport * from './triggers';\nexport * from './unknown_response_event';\nexport * from './warning_flags';\nexport * from './warnings';\n"]}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * An object containing any non-blocking issues encountered when loading a saved state to an axis.
3
+ */
4
+ export interface SetStateAxisResponse {
5
+ /**
6
+ * The warnings encountered when applying this state to the given axis.
7
+ */
8
+ warnings: string[];
9
+ /**
10
+ * The number of the axis that was set.
11
+ */
12
+ axisNumber: number;
13
+ }
14
+ export declare const SetStateAxisResponse: {
15
+ fromBinary: (buffer: Uint8Array) => SetStateAxisResponse;
16
+ toBinary: (value: SetStateAxisResponse) => Uint8Array;
17
+ DEFAULT: Readonly<SetStateAxisResponse>;
18
+ sanitize: (value: SetStateAxisResponse) => SetStateAxisResponse;
19
+ };
20
+ //# sourceMappingURL=set_state_axis_response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set_state_axis_response.d.ts","sourceRoot":"","sources":["../../../src/ascii/set_state_axis_response.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CAEpB;AAED,eAAO,MAAM,oBAAoB;yBACV,UAAU,KAAG,oBAAoB;sBACpC,oBAAoB,KAAG,UAAU;;sBAKjC,oBAAoB,KAAG,oBAAoB;CAQ9D,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetStateAxisResponse = void 0;
4
+ /* This file is generated. Do not modify by hand. */
5
+ const bson_1 = require("bson");
6
+ const sanitizer_1 = require("../gateway/sanitizer");
7
+ exports.SetStateAxisResponse = {
8
+ fromBinary: (buffer) => bson_1.BSON.deserialize(buffer),
9
+ toBinary: (value) => bson_1.BSON.serialize(exports.SetStateAxisResponse.sanitize(value)),
10
+ DEFAULT: Object.freeze({
11
+ warnings: [],
12
+ axisNumber: 0,
13
+ }),
14
+ sanitize: (value) => {
15
+ var _a;
16
+ if (value == null) {
17
+ throw new TypeError('Expected SetStateAxisResponse object but got null or undefined.');
18
+ }
19
+ if (typeof value !== 'object') {
20
+ throw new TypeError(`Expected SetStateAxisResponse object but got ${typeof value}.`);
21
+ }
22
+ return {
23
+ warnings: Array.from((_a = value.warnings) !== null && _a !== void 0 ? _a : [], item => sanitizer_1.sanitizer.sanitizeString(item, 'items of warnings')),
24
+ axisNumber: sanitizer_1.sanitizer.sanitizeInt(value.axisNumber, 'axisNumber'),
25
+ };
26
+ },
27
+ };
28
+ //# sourceMappingURL=set_state_axis_response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set_state_axis_response.js","sourceRoot":"","sources":["../../../src/ascii/set_state_axis_response.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AAkBpC,QAAA,oBAAoB,GAAG;IAClC,UAAU,EAAE,CAAC,MAAkB,EAAwB,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,CAAyB;IAC1G,QAAQ,EAAE,CAAC,KAA2B,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,4BAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3G,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,CAAC;KACd,CAAmC;IACpC,QAAQ,EAAE,CAAC,KAA2B,EAAwB,EAAE;;QAC9D,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAA;QAAC,CAAC;QAC7G,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,gDAAgD,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QACvH,OAAO;YACL,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,MAAA,KAAK,CAAC,QAAQ,mCAAI,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,qBAAS,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;YACvG,UAAU,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC;SAClE,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\n\n/**\n * An object containing any non-blocking issues encountered when loading a saved state to an axis.\n */\nexport interface SetStateAxisResponse {\n /**\n * The warnings encountered when applying this state to the given axis.\n */\n warnings: string[];\n\n /**\n * The number of the axis that was set.\n */\n axisNumber: number;\n\n}\n\nexport const SetStateAxisResponse = {\n fromBinary: (buffer: Uint8Array): SetStateAxisResponse => BSON.deserialize(buffer) as SetStateAxisResponse,\n toBinary: (value: SetStateAxisResponse): Uint8Array => BSON.serialize(SetStateAxisResponse.sanitize(value)),\n DEFAULT: Object.freeze({\n warnings: [],\n axisNumber: 0,\n }) as Readonly<SetStateAxisResponse>,\n sanitize: (value: SetStateAxisResponse): SetStateAxisResponse => {\n if (value == null) { throw new TypeError('Expected SetStateAxisResponse object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected SetStateAxisResponse object but got ${typeof value}.`) }\n return {\n warnings: Array.from(value.warnings ?? [], item => sanitizer.sanitizeString(item, 'items of warnings')),\n axisNumber: sanitizer.sanitizeInt(value.axisNumber, 'axisNumber'),\n };\n },\n};\n"]}
@@ -0,0 +1,21 @@
1
+ import { SetStateAxisResponse } from '../ascii/set_state_axis_response';
2
+ /**
3
+ * An object containing any non-blocking issues encountered when loading a saved state to a device.
4
+ */
5
+ export interface SetStateDeviceResponse {
6
+ /**
7
+ * The warnings encountered when applying this state to the given device.
8
+ */
9
+ warnings: string[];
10
+ /**
11
+ * A list of warnings encountered when applying this state to the device's axes.
12
+ */
13
+ axisResponses: SetStateAxisResponse[];
14
+ }
15
+ export declare const SetStateDeviceResponse: {
16
+ fromBinary: (buffer: Uint8Array) => SetStateDeviceResponse;
17
+ toBinary: (value: SetStateDeviceResponse) => Uint8Array;
18
+ DEFAULT: Readonly<SetStateDeviceResponse>;
19
+ sanitize: (value: SetStateDeviceResponse) => SetStateDeviceResponse;
20
+ };
21
+ //# sourceMappingURL=set_state_device_response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set_state_device_response.d.ts","sourceRoot":"","sources":["../../../src/ascii/set_state_device_response.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,oBAAoB,EAAE,CAAC;CAEvC;AAED,eAAO,MAAM,sBAAsB;yBACZ,UAAU,KAAG,sBAAsB;sBACtC,sBAAsB,KAAG,UAAU;;sBAKnC,sBAAsB,KAAG,sBAAsB;CAQlE,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetStateDeviceResponse = void 0;
4
+ /* This file is generated. Do not modify by hand. */
5
+ const bson_1 = require("bson");
6
+ const sanitizer_1 = require("../gateway/sanitizer");
7
+ const set_state_axis_response_1 = require("../ascii/set_state_axis_response");
8
+ exports.SetStateDeviceResponse = {
9
+ fromBinary: (buffer) => bson_1.BSON.deserialize(buffer),
10
+ toBinary: (value) => bson_1.BSON.serialize(exports.SetStateDeviceResponse.sanitize(value)),
11
+ DEFAULT: Object.freeze({
12
+ warnings: [],
13
+ axisResponses: [],
14
+ }),
15
+ sanitize: (value) => {
16
+ var _a, _b;
17
+ if (value == null) {
18
+ throw new TypeError('Expected SetStateDeviceResponse object but got null or undefined.');
19
+ }
20
+ if (typeof value !== 'object') {
21
+ throw new TypeError(`Expected SetStateDeviceResponse object but got ${typeof value}.`);
22
+ }
23
+ return {
24
+ warnings: Array.from((_a = value.warnings) !== null && _a !== void 0 ? _a : [], item => sanitizer_1.sanitizer.sanitizeString(item, 'items of warnings')),
25
+ axisResponses: Array.from((_b = value.axisResponses) !== null && _b !== void 0 ? _b : [], item => set_state_axis_response_1.SetStateAxisResponse.sanitize(item)),
26
+ };
27
+ },
28
+ };
29
+ //# sourceMappingURL=set_state_device_response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set_state_device_response.js","sourceRoot":"","sources":["../../../src/ascii/set_state_device_response.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AACjD,8EAAwE;AAkB3D,QAAA,sBAAsB,GAAG;IACpC,UAAU,EAAE,CAAC,MAAkB,EAA0B,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,CAA2B;IAC9G,QAAQ,EAAE,CAAC,KAA6B,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,8BAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/G,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,QAAQ,EAAE,EAAE;QACZ,aAAa,EAAE,EAAE;KAClB,CAAqC;IACtC,QAAQ,EAAE,CAAC,KAA6B,EAA0B,EAAE;;QAClE,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,mEAAmE,CAAC,CAAA;QAAC,CAAC;QAC/G,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,kDAAkD,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QACzH,OAAO;YACL,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,MAAA,KAAK,CAAC,QAAQ,mCAAI,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,qBAAS,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;YACvG,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,MAAA,KAAK,CAAC,aAAa,mCAAI,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,8CAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SAClG,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\nimport { SetStateAxisResponse } from '../ascii/set_state_axis_response';\n\n/**\n * An object containing any non-blocking issues encountered when loading a saved state to a device.\n */\nexport interface SetStateDeviceResponse {\n /**\n * The warnings encountered when applying this state to the given device.\n */\n warnings: string[];\n\n /**\n * A list of warnings encountered when applying this state to the device's axes.\n */\n axisResponses: SetStateAxisResponse[];\n\n}\n\nexport const SetStateDeviceResponse = {\n fromBinary: (buffer: Uint8Array): SetStateDeviceResponse => BSON.deserialize(buffer) as SetStateDeviceResponse,\n toBinary: (value: SetStateDeviceResponse): Uint8Array => BSON.serialize(SetStateDeviceResponse.sanitize(value)),\n DEFAULT: Object.freeze({\n warnings: [],\n axisResponses: [],\n }) as Readonly<SetStateDeviceResponse>,\n sanitize: (value: SetStateDeviceResponse): SetStateDeviceResponse => {\n if (value == null) { throw new TypeError('Expected SetStateDeviceResponse object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected SetStateDeviceResponse object but got ${typeof value}.`) }\n return {\n warnings: Array.from(value.warnings ?? [], item => sanitizer.sanitizeString(item, 'items of warnings')),\n axisResponses: Array.from(value.axisResponses ?? [], item => SetStateAxisResponse.sanitize(item)),\n };\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"finalizer.js","sourceRoot":"","sources":["../../src/finalizer.ts"],"names":[],"mappings":";;;AAAA,IAAI,oBAAkE,CAAC;AAEvE,IAAI,OAAO,oBAAoB,KAAK,WAAW,EAAE,CAAC;IAChD,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;AACxE,CAAC;AAED;;;GAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAE,OAAmB,EAAE,EAAE;IAC/E,IAAI,oBAAoB,IAAI,IAAI,EAAE,CAAC;QACjC,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,2EAA2E,QAAQ,CAAC,WAAW,CAAC,IAAI,0BAA0B,CAAC,CAAC;QAC7I,OAAO;IACT,CAAC;IACD,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;AAPW,QAAA,uBAAuB,2BAOlC","sourcesContent":["let finalizationRegistry: FinalizationRegistry<() => void> | undefined;\n\nif (typeof FinalizationRegistry !== 'undefined') {\n finalizationRegistry = new FinalizationRegistry(cleanup => cleanup());\n}\n\n/**\n * @param instance what to finalize\n * @param cleanup callback performing the finalization (MUST NOT hold reference to instance)\n */\nexport const registerForFinalization = (instance: object, cleanup: () => void) => { // eslint-disable-line @typescript-eslint/ban-types\n if (finalizationRegistry == null) {\n // eslint-disable-next-line no-console\n console.warn(`FinalizationRegistry is not supported by your environment, instances of ${instance.constructor.name} must be freed manually.`);\n return;\n }\n finalizationRegistry.register(instance, cleanup);\n};\n"]}
1
+ {"version":3,"file":"finalizer.js","sourceRoot":"","sources":["../../src/finalizer.ts"],"names":[],"mappings":";;;AAAA,IAAI,oBAAkE,CAAC;AAEvE,IAAI,OAAO,oBAAoB,KAAK,WAAW,EAAE,CAAC;IAChD,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;AACxE,CAAC;AAED;;;GAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAE,OAAmB,EAAE,EAAE;IAC/E,IAAI,oBAAoB,IAAI,IAAI,EAAE,CAAC;QACjC,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,2EAA2E,QAAQ,CAAC,WAAW,CAAC,IAAI,0BAA0B,CAAC,CAAC;QAC7I,OAAO;IACT,CAAC;IACD,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;AAPW,QAAA,uBAAuB,2BAOlC","sourcesContent":["let finalizationRegistry: FinalizationRegistry<() => void> | undefined;\n\nif (typeof FinalizationRegistry !== 'undefined') {\n finalizationRegistry = new FinalizationRegistry(cleanup => cleanup());\n}\n\n/**\n * @param instance what to finalize\n * @param cleanup callback performing the finalization (MUST NOT hold reference to instance)\n */\nexport const registerForFinalization = (instance: object, cleanup: () => void) => {\n if (finalizationRegistry == null) {\n // eslint-disable-next-line no-console\n console.warn(`FinalizationRegistry is not supported by your environment, instances of ${instance.constructor.name} must be freed manually.`);\n return;\n }\n finalizationRegistry.register(instance, cleanup);\n};\n"]}
@@ -11,6 +11,7 @@ try {
11
11
  module.exports.loadDll(execLibPath);
12
12
  }
13
13
  catch (error) {
14
- throw new Error(`Failed to load bindings at "${execLibPath}" (${error})`);
14
+ const errorStr = error instanceof Error ? String(error) : JSON.stringify(error);
15
+ throw new Error(`Failed to load bindings at "${execLibPath}" (${errorStr})`);
15
16
  }
16
17
  //# sourceMappingURL=bindings.exec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.exec.js","sourceRoot":"","sources":["../../../src/gateway/bindings.exec.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,yCAA4C;AAE5C,MAAM,WAAW,GAAG,yBAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,cAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,yBAAc,GAAG,cAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,yBAAc,CAAC;AACzG,IAAI,CAAC;IACH,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACpE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,MAAM,IAAI,KAAK,CAAC,+BAA+B,WAAW,MAAM,KAAK,GAAG,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["import path from 'path';\nimport { bindingLibPath } from './bindings';\n\nconst execLibPath = bindingLibPath.at(-1) !== path.sep ? `${bindingLibPath}${path.sep}` : bindingLibPath;\ntry {\n process.dlopen(module, path.join(execLibPath, 'zaber-motion.node'));\n module.exports.loadDll(execLibPath);\n} catch (error) {\n throw new Error(`Failed to load bindings at \"${execLibPath}\" (${error})`);\n}\n"]}
1
+ {"version":3,"file":"bindings.exec.js","sourceRoot":"","sources":["../../../src/gateway/bindings.exec.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,yCAA4C;AAE5C,MAAM,WAAW,GAAG,yBAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,cAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,yBAAc,GAAG,cAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,yBAAc,CAAC;AACzG,IAAI,CAAC;IACH,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACpE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,MAAM,QAAQ,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAChF,MAAM,IAAI,KAAK,CAAC,+BAA+B,WAAW,MAAM,QAAQ,GAAG,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import path from 'path';\nimport { bindingLibPath } from './bindings';\n\nconst execLibPath = bindingLibPath.at(-1) !== path.sep ? `${bindingLibPath}${path.sep}` : bindingLibPath;\ntry {\n process.dlopen(module, path.join(execLibPath, 'zaber-motion.node'));\n module.exports.loadDll(execLibPath);\n} catch (error) {\n const errorStr = error instanceof Error ? String(error) : JSON.stringify(error);\n throw new Error(`Failed to load bindings at \"${execLibPath}\" (${errorStr})`);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.js","sourceRoot":"","sources":["../../../src/gateway/bindings.ts"],"names":[],"mappings":";;;AAGA,IAAI,OAAO,GAAQ,MAAM,CAAC;AACf,QAAA,cAAc,GAAG,EAAE,CAAC;AAC/B,IAAI,MAAM,GAAG,KAAK,CAAC;AACnB,IAAI,QAAa,CAAC;AAClB,IAAI,aAAa,GAA0B,EAAE,CAAC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nlet execEnv: Env = 'node';\nexport let bindingLibPath = '';\nlet locked = false;\nlet bindings: any;\nlet initCallbacks: (() => void)[] | null = [];\n\nexport function setEnv(env: Exclude<Env, 'exec'>): void;\nexport function setEnv(env: 'exec', libPath: string): void;\nexport function setEnv(env: Env, libPath?: string): void {\n if (locked) {\n throw new Error('Library was already loaded.');\n }\n execEnv = env;\n if (libPath != null) {\n bindingLibPath = libPath;\n }\n}\n\nexport const getBinding = (): any => {\n if (bindings != null) {\n return bindings;\n }\n locked = true;\n if (execEnv === 'exec') {\n bindings = require('./bindings.exec');\n } else if (execEnv === 'node') {\n bindings = require('./bindings.node').binding;\n } else {\n bindings = require('./bindings.wasm').binding;\n }\n\n initCallbacks!.forEach(callback => callback());\n initCallbacks = null;\n\n return bindings;\n};\n\nexport const addInitCallback = (cb: () => void) => {\n if (initCallbacks == null) {\n throw new Error('Library was already loaded.');\n }\n initCallbacks.push(cb);\n};\n"]}
1
+ {"version":3,"file":"bindings.js","sourceRoot":"","sources":["../../../src/gateway/bindings.ts"],"names":[],"mappings":";;;AAGA,IAAI,OAAO,GAAQ,MAAM,CAAC;AACf,QAAA,cAAc,GAAG,EAAE,CAAC;AAC/B,IAAI,MAAM,GAAG,KAAK,CAAC;AACnB,IAAI,QAAa,CAAC;AAClB,IAAI,aAAa,GAA0B,EAAE,CAAC;AAI9C,SAAgB,MAAM,CAAC,GAAQ,EAAE,OAAgB;IAC/C,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,GAAG,GAAG,CAAC;IACd,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,sBAAc,GAAG,OAAO,CAAC;IAC3B,CAAC;AACH,CAAC;AARD,wBAQC;AAEM,MAAM,UAAU,GAAG,GAAQ,EAAE;IAClC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,GAAG,IAAI,CAAC;IACd,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACxC,CAAC;SAAM,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC9B,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;IAChD,CAAC;IAED,aAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/C,aAAa,GAAG,IAAI,CAAC;IAErB,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAjBW,QAAA,UAAU,cAiBrB;AAEK,MAAM,eAAe,GAAG,CAAC,EAAc,EAAE,EAAE;IAChD,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC,CAAC;AALW,QAAA,eAAe,mBAK1B","sourcesContent":["/* eslint-disable @typescript-eslint/no-require-imports */\ntype Env = 'node' | 'wasm' | 'exec';\n\nlet execEnv: Env = 'node';\nexport let bindingLibPath = '';\nlet locked = false;\nlet bindings: any;\nlet initCallbacks: (() => void)[] | null = [];\n\nexport function setEnv(env: Exclude<Env, 'exec'>): void;\nexport function setEnv(env: 'exec', libPath: string): void;\nexport function setEnv(env: Env, libPath?: string): void {\n if (locked) {\n throw new Error('Library was already loaded.');\n }\n execEnv = env;\n if (libPath != null) {\n bindingLibPath = libPath;\n }\n}\n\nexport const getBinding = (): any => {\n if (bindings != null) {\n return bindings;\n }\n locked = true;\n if (execEnv === 'exec') {\n bindings = require('./bindings.exec');\n } else if (execEnv === 'node') {\n bindings = require('./bindings.node').binding;\n } else {\n bindings = require('./bindings.wasm').binding;\n }\n\n initCallbacks!.forEach(callback => callback());\n initCallbacks = null;\n\n return bindings;\n};\n\nexport const addInitCallback = (cb: () => void) => {\n if (initCallbacks == null) {\n throw new Error('Library was already loaded.');\n }\n initCallbacks.push(cb);\n};\n"]}
@@ -9,7 +9,7 @@ const pkg_up_1 = __importDefault(require("pkg-up"));
9
9
  const node_pre_gyp_1 = __importDefault(require("@mapbox/node-pre-gyp"));
10
10
  const packageJsonPath = pkg_up_1.default.sync({ cwd: __dirname });
11
11
  const bindingPath = node_pre_gyp_1.default.find(packageJsonPath);
12
- // eslint-disable-next-line @typescript-eslint/no-var-requires
12
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
13
13
  exports.binding = require(bindingPath);
14
14
  let dllPath = path_1.default.dirname(bindingPath) + path_1.default.sep;
15
15
  const isElectron = !!process.versions.electron;
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.node.js","sourceRoot":"","sources":["../../../src/gateway/bindings.node.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,oDAA2B;AAC3B,wEAA0C;AAE1C,MAAM,eAAe,GAAG,gBAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;AACvD,MAAM,WAAW,GAAG,sBAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AACjD,8DAA8D;AACjD,QAAA,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE5C,IAAI,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,cAAI,CAAC,GAAG,CAAC;AAEnD,MAAM,UAAU,GAAG,CAAC,CAAE,OAAO,CAAC,QAA8C,CAAC,QAAQ,CAAC;AACtF,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;IACzD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;AAC7D,CAAC;AAED,eAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport pkgUp from 'pkg-up';\nimport binary from '@mapbox/node-pre-gyp';\n\nconst packageJsonPath = pkgUp.sync({ cwd: __dirname });\nconst bindingPath = binary.find(packageJsonPath);\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const binding = require(bindingPath);\n\nlet dllPath = path.dirname(bindingPath) + path.sep;\n\nconst isElectron = !!(process.versions as unknown as Record<string, string>).electron;\nif (isElectron && !dllPath.includes('app.asar.unpacked')) {\n dllPath = dllPath.replace('app.asar', 'app.asar.unpacked');\n}\n\nbinding.loadDll(dllPath);\n"]}
1
+ {"version":3,"file":"bindings.node.js","sourceRoot":"","sources":["../../../src/gateway/bindings.node.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,oDAA2B;AAC3B,wEAA0C;AAE1C,MAAM,eAAe,GAAG,gBAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;AACvD,MAAM,WAAW,GAAG,sBAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AACjD,iEAAiE;AACpD,QAAA,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE5C,IAAI,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,cAAI,CAAC,GAAG,CAAC;AAEnD,MAAM,UAAU,GAAG,CAAC,CAAE,OAAO,CAAC,QAA8C,CAAC,QAAQ,CAAC;AACtF,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;IACzD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;AAC7D,CAAC;AAED,eAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport pkgUp from 'pkg-up';\nimport binary from '@mapbox/node-pre-gyp';\n\nconst packageJsonPath = pkgUp.sync({ cwd: __dirname });\nconst bindingPath = binary.find(packageJsonPath);\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nexport const binding = require(bindingPath);\n\nlet dllPath = path.dirname(bindingPath) + path.sep;\n\nconst isElectron = !!(process.versions as unknown as Record<string, string>).electron;\nif (isElectron && !dllPath.includes('app.asar.unpacked')) {\n dllPath = dllPath.replace('app.asar', 'app.asar.unpacked');\n}\n\nbinding.loadDll(dllPath);\n"]}
@@ -1,6 +1,6 @@
1
1
  export declare const binding: {
2
2
  setEventHandler: (eventHandler: (eventUint8Array: Uint8Array) => void) => void;
3
- setEventsEnabled: (enabled: boolean) => void;
3
+ setEventsEnabled: () => void;
4
4
  callAsync: (data: Uint8Array, resolve: (buffer: Uint8Array) => void) => void;
5
5
  callSync: (data: Uint8Array) => Uint8Array;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.wasm.d.ts","sourceRoot":"","sources":["../../../src/gateway/bindings.wasm.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;sDACgC,UAAU,KAAK,IAAI,KAAG,IAAI;gCAMhD,OAAO,KAAG,IAAI;sBACxB,UAAU,oBAAoB,UAAU,KAAK,IAAI,KAAG,IAAI;qBAMzD,UAAU,KAAG,UAAU;CAKzC,CAAC"}
1
+ {"version":3,"file":"bindings.wasm.d.ts","sourceRoot":"","sources":["../../../src/gateway/bindings.wasm.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;sDACgC,UAAU,KAAK,IAAI,KAAG,IAAI;4BAMtD,IAAI;sBACR,UAAU,oBAAoB,UAAU,KAAK,IAAI,KAAG,IAAI;qBAMzD,UAAU,KAAG,UAAU;CAKzC,CAAC"}
@@ -5,8 +5,8 @@ exports.binding = {
5
5
  setEventHandler: (eventHandler) => {
6
6
  window.__zmlSetEventHandler((eventString) => eventHandler(decodeBase64(eventString)));
7
7
  },
8
- // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function
9
- setEventsEnabled: (enabled) => { },
8
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
9
+ setEventsEnabled: () => { },
10
10
  callAsync: (data, resolve) => {
11
11
  const requestBytesString = encodeBase64(data);
12
12
  window.__zmlRequest(requestBytesString, (responseString) => resolve(decodeBase64(responseString)));
@@ -19,8 +19,8 @@ exports.binding = {
19
19
  };
20
20
  function encodeBase64(buffer) {
21
21
  const output = [];
22
- for (let i = 0; i < buffer.length; i++) {
23
- output.push(String.fromCharCode(buffer[i]));
22
+ for (const segment of buffer) {
23
+ output.push(String.fromCharCode(segment));
24
24
  }
25
25
  return window.btoa(output.join(''));
26
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bindings.wasm.js","sourceRoot":"","sources":["../../../src/gateway/bindings.wasm.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG;IACrB,eAAe,EAAE,CAAC,YAAmD,EAAQ,EAAE;QAC7E,MAAM,CAAC,oBAAoB,CAAC,CAAC,WAAmB,EAAE,EAAE,CAClD,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CACxC,CAAC;IACJ,CAAC;IACD,kGAAkG;IAClG,gBAAgB,EAAE,CAAC,OAAgB,EAAQ,EAAE,GAAE,CAAC;IAChD,SAAS,EAAE,CAAC,IAAgB,EAAE,OAAqC,EAAQ,EAAE;QAC3E,MAAM,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,CAAC,cAAsB,EAAE,EAAE,CACjE,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CACtC,CAAC;IACJ,CAAC;IACD,QAAQ,EAAE,CAAC,IAAgB,EAAc,EAAE;QACzC,MAAM,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,cAAc,GAAG,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QAC/D,OAAO,YAAY,CAAC,cAAc,CAAC,CAAC;IACtC,CAAC;CACF,CAAC;AAEF,SAAS,YAAY,CAAC,MAAkB;IACtC,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["export const binding = {\n setEventHandler: (eventHandler: (eventUint8Array: Uint8Array) => void): void => {\n window.__zmlSetEventHandler((eventString: string) =>\n eventHandler(decodeBase64(eventString))\n );\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function\n setEventsEnabled: (enabled: boolean): void => {},\n callAsync: (data: Uint8Array, resolve: (buffer: Uint8Array) => void): void => {\n const requestBytesString = encodeBase64(data);\n window.__zmlRequest(requestBytesString, (responseString: string) =>\n resolve(decodeBase64(responseString))\n );\n },\n callSync: (data: Uint8Array): Uint8Array => {\n const requestBytesString = encodeBase64(data);\n const responseString = window.__zmlRequest(requestBytesString);\n return decodeBase64(responseString);\n }\n};\n\nfunction encodeBase64(buffer: Uint8Array) {\n const output = [];\n for (let i = 0; i < buffer.length; i++) {\n output.push(String.fromCharCode(buffer[i]));\n }\n return window.btoa(output.join(''));\n}\n\nfunction decodeBase64(chars: string) {\n return Uint8Array.from(window.atob(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AC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["export const binding = {\n setEventHandler: (eventHandler: (eventUint8Array: Uint8Array) => void): void => {\n window.__zmlSetEventHandler((eventString: string) =>\n eventHandler(decodeBase64(eventString))\n );\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setEventsEnabled: (): void => {},\n callAsync: (data: Uint8Array, resolve: (buffer: Uint8Array) => void): void => {\n const requestBytesString = encodeBase64(data);\n window.__zmlRequest(requestBytesString, (responseString: string) =>\n resolve(decodeBase64(responseString))\n );\n },\n callSync: (data: Uint8Array): Uint8Array => {\n const requestBytesString = encodeBase64(data);\n const responseString = window.__zmlRequest(requestBytesString);\n return decodeBase64(responseString);\n }\n};\n\nfunction encodeBase64(buffer: Uint8Array) {\n const output = [];\n for (const segment of buffer) {\n output.push(String.fromCharCode(segment));\n }\n return window.btoa(output.join(''));\n}\n\nfunction decodeBase64(chars: string) {\n return Uint8Array.from(window.atob(chars), c => c.charCodeAt(0));\n}\n"]}
@@ -2,6 +2,6 @@ import { Serializable } from './serialization';
2
2
  import { FromBinary } from './message';
3
3
  export declare function callAsync(request: string, requestData?: Serializable): Promise<null>;
4
4
  export declare function callAsync<TReturn>(request: string, requestData: Serializable | undefined, responseProto: FromBinary<TReturn>): Promise<TReturn>;
5
- export declare function callSync(request: string, requestData?: Serializable | undefined): null;
5
+ export declare function callSync(request: string, requestData?: Serializable): null;
6
6
  export declare function callSync<TReturn>(request: string, requestData: Serializable | undefined, responseProto: FromBinary<TReturn>): TReturn;
7
7
  //# sourceMappingURL=call.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../src/gateway/call.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAEvE,OAAO,EAAE,UAAU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