@ray-js/ray-ipc-utils 1.1.0-beta-7 → 1.1.0-beta-8

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/lib/index.d.ts CHANGED
@@ -32,7 +32,7 @@ declare const IpcUtils: {
32
32
  } | undefined, isGeneral?: false | undefined) => Promise<import("./kit/interface").IRes<T>>;
33
33
  goToGeneralHelpMini: () => Promise<import("./kit/interface").IRes<T>>;
34
34
  goToIpcHelpMini: (errCode: number, deviceId: string, helpNum: number, helpFeedBack: boolean, brandColor?: string) => Promise<import("./kit/interface").IRes<T>>;
35
- getIsSupprtedCloudStorageSync: (deviceId: string) => Promise<{
35
+ getIsSupportedCloudStorageSync: (deviceId: string) => Promise<{
36
36
  code: number;
37
37
  data: boolean;
38
38
  msg?: undefined;
@@ -41,8 +41,8 @@ declare const IpcUtils: {
41
41
  data: boolean;
42
42
  msg: string | boolean | import("./kit/interface").IApiError | undefined;
43
43
  }>;
44
- requestWifiSignal: <T_20>(deviceId: string, dps?: {}) => Promise<any>;
45
- wakeUpDevice: <T_21>(deviceId: string, dps?: {}) => Promise<any>;
44
+ requestWifiSignal: <T_20>(deviceId: string, dps?: {}) => Promise<import("./kit/interface").IRes<T_20>>;
45
+ wakeUpDevice: <T_21>(deviceId: string, dps?: {}) => Promise<import("./kit/interface").IRes<T_21>>;
46
46
  useTrafficViewTip: () => boolean;
47
47
  };
48
48
  export default IpcUtils;
@@ -5,11 +5,11 @@ import { IRes } from '../interface';
5
5
  * @param dps 扩展参数
6
6
  * @returns
7
7
  */
8
- export declare const requestWifiSignal: <T>(deviceId: string, dps?: {}) => Promise<IRes>;
8
+ export declare const requestWifiSignal: <T>(deviceId: string, dps?: {}) => Promise<IRes<T>>;
9
9
  /**
10
10
  * IPC-低功耗唤醒:低功耗唤醒,唤醒门铃设备
11
11
  * 需引入DeviceKit,且在>=3.1.0-ipcwake.1版本才可使用
12
12
  * @param deviceId
13
13
  * @returns
14
14
  */
15
- export declare const wakeUpDevice: <T>(deviceId: string, dps?: {}) => Promise<IRes>;
15
+ export declare const wakeUpDevice: <T>(deviceId: string, dps?: {}) => Promise<IRes<T>>;
@@ -12,12 +12,14 @@ export const requestWifiSignal = function (deviceId) {
12
12
  deviceId,
13
13
  dps: dps,
14
14
  success: res => {
15
+ console.log('res===requestWifiSignal success', res);
15
16
  resolve({
16
17
  code: 0,
17
18
  data: res
18
19
  });
19
20
  },
20
21
  fail: err => {
22
+ console.log('res===requestWifiSignal err', err);
21
23
  resolve({
22
24
  code: -1,
23
25
  msg: err
@@ -47,14 +49,16 @@ export const wakeUpDevice = function (deviceId) {
47
49
  deviceId,
48
50
  dps: dps,
49
51
  success: res => {
52
+ console.log('res===wakeUpDevice success', res);
50
53
  resolve({
51
54
  data: res
52
55
  });
53
56
  },
54
- fail: error => {
57
+ fail: err => {
58
+ console.log('res===wakeUpDevice err', err);
55
59
  resolve({
56
60
  code: -1,
57
- msg: error
61
+ msg: err
58
62
  });
59
63
  }
60
64
  });
@@ -127,7 +127,7 @@ export declare const goToIpcHelpMini: (errCode: number, deviceId: string, helpNu
127
127
  * @param deviceId 设备id
128
128
  * @returns true/false
129
129
  */
130
- export declare const getIsSupprtedCloudStorageSync: (deviceId: string) => Promise<{
130
+ export declare const getIsSupportedCloudStorageSync: (deviceId: string) => Promise<{
131
131
  code: number;
132
132
  data: boolean;
133
133
  msg?: undefined;
@@ -297,11 +297,14 @@ export const getVideoBitrateKbps = function (deviceId) {
297
297
  deviceId,
298
298
  extendParam: extendParam,
299
299
  success: res => {
300
+ console.log('res===getVideoBitrateKbps success', res);
300
301
  resolve({
302
+ code: 0,
301
303
  data: res
302
304
  });
303
305
  },
304
306
  fail: err => {
307
+ console.log('res===getVideoBitrateKbps err', err);
305
308
  resolve({
306
309
  code: -1,
307
310
  msg: err
@@ -338,14 +341,17 @@ export const getMobileOrientation = () => {
338
341
  const {
339
342
  deviceOrientation = ''
340
343
  } = res;
344
+ console.log('res===getMobileOrientation success', deviceOrientation);
341
345
  resolve({
346
+ code: 0,
342
347
  data: deviceOrientation
343
348
  });
344
349
  },
345
- fail: error => {
350
+ fail: err => {
351
+ console.log('res===getMobileOrientation err', err);
346
352
  resolve({
347
353
  code: -1,
348
- msg: error
354
+ msg: err
349
355
  });
350
356
  }
351
357
  });
@@ -403,14 +409,17 @@ export const setScreenOrientation = pageOrientation => {
403
409
  ty.setPageOrientation({
404
410
  pageOrientation: pageOrientation,
405
411
  success: res => {
412
+ console.log('res===setScreenOrientation success', res);
406
413
  resolve({
414
+ code: 0,
407
415
  data: res
408
416
  });
409
417
  },
410
- fail: error => {
418
+ fail: err => {
419
+ console.log('res===setScreenOrientation err', err);
411
420
  resolve({
412
421
  code: -1,
413
- msg: error
422
+ msg: err
414
423
  });
415
424
  }
416
425
  });
@@ -437,14 +446,17 @@ export const isSupportFloatWindow = function (deviceId) {
437
446
  deviceId,
438
447
  extendParam: extendParam,
439
448
  success: res => {
449
+ console.log('res===isSupportFloatWindow success', res);
440
450
  resolve({
451
+ code: 0,
441
452
  data: res
442
453
  });
443
454
  },
444
- fail: error => {
455
+ fail: err => {
456
+ console.log('res===isSupportFloatWindow err', err);
445
457
  resolve({
446
458
  code: -1,
447
- msg: error
459
+ msg: err
448
460
  });
449
461
  }
450
462
  });
@@ -471,11 +483,14 @@ export const openFloatWindow = function (deviceId) {
471
483
  deviceId,
472
484
  extendParam: extendParam,
473
485
  success: res => {
486
+ console.log('res===openFloatWindow success', res);
474
487
  resolve({
488
+ code: 0,
475
489
  data: res
476
490
  });
477
491
  },
478
492
  fail: err => {
493
+ console.log('res===openFloatWindow err', err);
479
494
  resolve({
480
495
  code: -1,
481
496
  msg: err
@@ -505,14 +520,17 @@ export const isSupportedTalk = function (deviceId) {
505
520
  deviceId,
506
521
  extendParam: extendParam,
507
522
  success: res => {
523
+ console.log('res===isSupportedTalk success', res);
508
524
  resolve({
525
+ code: 0,
509
526
  data: res
510
527
  });
511
528
  },
512
- fail: error => {
529
+ fail: err => {
530
+ console.log('res===isSupportedTalk err', err);
513
531
  resolve({
514
532
  code: -1,
515
- msg: error
533
+ msg: err
516
534
  });
517
535
  }
518
536
  });
@@ -539,15 +557,17 @@ export const getCurrentSupportedTalkMode = function (deviceId) {
539
557
  deviceId,
540
558
  extendParam: extendParam,
541
559
  success: res => {
560
+ console.log('res===getCurrentSupportedTalkMode success', res);
542
561
  resolve({
543
562
  code: 0,
544
563
  data: res
545
564
  });
546
565
  },
547
- fail: error => {
566
+ fail: err => {
567
+ console.log('res===getCurrentSupportedTalkMode err', err);
548
568
  resolve({
549
569
  code: -1,
550
- msg: error
570
+ msg: err
551
571
  });
552
572
  }
553
573
  });
@@ -720,7 +740,7 @@ export const goToIpcHelpMini = async function (errCode, deviceId, helpNum, helpF
720
740
  * @param deviceId 设备id
721
741
  * @returns true/false
722
742
  */
723
- export const getIsSupprtedCloudStorageSync = async deviceId => {
743
+ export const getIsSupportedCloudStorageSync = async deviceId => {
724
744
  const res = await getDevInfo(deviceId);
725
745
  const {
726
746
  code,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ray-ipc-utils",
3
- "version": "1.1.0-beta-7",
3
+ "version": "1.1.0-beta-8",
4
4
  "description": "IPC 工具库",
5
5
  "main": "lib/index",
6
6
  "files": [