@cpzxrobot/sdk 1.1.42 → 1.1.43

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/dist/index.js CHANGED
@@ -148,8 +148,8 @@ class Cpzxrobot {
148
148
  this.scanQrcode = function () {
149
149
  return platform.callHandler("app.scanQrcode");
150
150
  };
151
- this.getGeo = function () {
152
- var result = platform.callHandler("app.getGeo");
151
+ this.getGeo = async function () {
152
+ var result = await platform.callHandler("app.getGeo");
153
153
  if (result.error) {
154
154
  throw result.error;
155
155
  }
package/index.ts CHANGED
@@ -46,10 +46,10 @@ export class Cpzxrobot {
46
46
  saveBlob!: (blob: Blob, filename: string) => void;
47
47
  scanQrcode!: () => Promise<string>;
48
48
  vibrate!: (time?: number) => void;
49
- getGeo!: () => {
49
+ getGeo!: () => Promise<{
50
50
  lat: number;
51
51
  lng: number;
52
- };
52
+ }>;
53
53
  assistant: AssistantGateway;
54
54
  energy: EnergyGateway;
55
55
  camera: CameraGateway;
@@ -185,8 +185,8 @@ export class Cpzxrobot {
185
185
  this.scanQrcode = function () {
186
186
  return platform.callHandler("app.scanQrcode");
187
187
  }
188
- this.getGeo = function () {
189
- var result = platform.callHandler("app.getGeo");
188
+ this.getGeo = async function () {
189
+ var result = await platform.callHandler("app.getGeo");
190
190
  if (result.error) {
191
191
  throw result.error;
192
192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.42",
3
+ "version": "1.1.43",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/types.d.ts CHANGED
@@ -329,6 +329,7 @@ class Cpzxrobot {
329
329
  saveBlob: (blob: Blob, filename: string) => void;
330
330
  scanQrcode: () => Promise<string>;
331
331
  vibrate: (time?: number) => void;
332
+ getGeo: () => Promise<{ lat: number; lng: number }>;
332
333
  }
333
334
 
334
335
  declare global {