@resconet/jsbridge 18.0.0-beta.2 → 18.0.0-beta.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resconet/jsbridge",
3
- "version": "18.0.0-beta.2",
3
+ "version": "18.0.0-beta.3",
4
4
  "main": "./src/JSBridge.js",
5
5
  "types": "./src/JSBridge.d.ts",
6
6
  "description": "Install npm JSBridge module",
package/src/JSBridge.d.ts CHANGED
@@ -1461,7 +1461,9 @@ declare module MobileCRM.Services {
1461
1461
  }
1462
1462
  class ZebraScanner {
1463
1463
  static connect: (success: (result: string) => void, failed?: (err: string) => void, scope?: any) => void;
1464
- static onScan: (handler: (questionnaireForm: QuestionnaireForm) => void, bind: boolean, scope?: any) => void;
1464
+ static setPower: (power: number, success: (result: string) => void, failed?: (err: string) => void, scope?: any) => void;
1465
+ static setVolume: (volume: number, success: (result: string) => void, failed?: (err: string) => void, scope?: any) => void;
1466
+ static onScan: (handler: (tags: string[]) => void, bind: boolean, scope?: any) => void;
1465
1467
  }
1466
1468
  class DocumentService {
1467
1469
  /**Gets or sets the maximum captured image size. If captured image size is greater, the image is resized to specified maximum size. [640x480,1024x768,1600x1200,2048x1536,2592x1936].*/
package/src/JSBridge.js CHANGED
@@ -1210,12 +1210,30 @@
1210
1210
  MobileCRM.bridge.command("initZebra", null, successCallback, errorCallback, scope);
1211
1211
  };
1212
1212
 
1213
+ MobileCRM.Services.ZebraScanner.setPower = function (power, successCallback, errorCallback, scope) {
1214
+ /// <summary>Set power of antenna the Zebra scanner.</summary>
1215
+ /// <param name="power" type="Number">The power of the scanner.</param>
1216
+ /// <param name="successCallback" type="function">The callback function that is called when the connection is established.</param>
1217
+ /// <param name="errorCallback" type="function(errorMsg)">The errorCallback which is called in case of error.</param>
1218
+ /// <param name="scope" type="Object">The scope in which the callback function is called.</param>
1219
+ MobileCRM.bridge.command("setPower", JSON.stringify({ power: power }), successCallback, errorCallback, scope);
1220
+ };
1221
+
1222
+ MobileCRM.Services.ZebraScanner.setVolume = function (volume, successCallback, errorCallback, scope) {
1223
+ /// <summary>Set volume of the Zebra scanner.</summary>
1224
+ /// <param name="volume" type="Number">The volume of the scanner.</param>
1225
+ /// <param name="successCallback" type="function">The callback function that is called when the connection is established.</param>
1226
+ /// <param name="errorCallback" type="function(errorMsg)">The errorCallback which is called in case of error.</param>
1227
+ /// <param name="scope" type="Object">The scope in which the callback function is called.</param>
1228
+ MobileCRM.bridge.command("setVolume", JSON.stringify({ volume: volume }), successCallback, errorCallback, scope);
1229
+ };
1230
+
1213
1231
  MobileCRM.Services.ZebraScanner._callHandlers = function (event, data) {
1214
1232
  /// <summary>Invokes the registered handlers for the specified event.</summary>
1215
1233
  const handlers = MobileCRM.Services.ZebraScanner._handlers[event];
1216
1234
 
1217
1235
  if (handlers && handlers.length > 0) {
1218
- return _callHandlers(handlers, data);
1236
+ return _callHandlers(handlers, JSON.parse(data));
1219
1237
  }
1220
1238
 
1221
1239
  return null;