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

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
@@ -15,24 +15,24 @@ declare const IpcUtils: {
15
15
  setNativeStorage: <T_8>(key: string, data: T_8) => Promise<import("./kit/interface").IRes<T_8>>;
16
16
  removeNativeStorage: <T_9>(key: string) => Promise<import("./kit/interface").IRes<T_9>>;
17
17
  publishDps: <T_10>(deviceId: string, dps: any) => Promise<import("./kit/interface").IRes<T_10>>;
18
- getDpStateValue: (deviceId: string, dpCode: string) => Promise<import("./kit/interface").IRes<T>>;
19
- getDpIdByCode: (deviceId: string, dpCode: string) => Promise<import("./kit/interface").IRes<T>>;
20
- goToMiniProgramByShortLink: <T_11>(url: string, position?: string) => Promise<import("./kit/interface").IRes<T_11>>;
21
- getVideoBitrateKbps: <T_12>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_12>>;
18
+ getDpStateValue: <T_11>(deviceId: string, dpCode: string) => Promise<import("./kit/interface").IRes<T_11>>;
19
+ getDpIdByCode: <T_12>(deviceId: string, dpCode: string) => Promise<import("./kit/interface").IRes<T_12>>;
20
+ goToMiniProgramByShortLink: <T_13>(url: string, position?: string) => Promise<import("./kit/interface").IRes<T_13>>;
21
+ getVideoBitrateKbps: <T_14>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_14>>;
22
22
  networkStatusDidChangedEvent: (callback: any) => void;
23
- getMobileOrientation: <T_13>() => Promise<import("./kit/interface").IRes<T_13>>;
24
- jumpToWebView: <T_14>(url: string) => Promise<import("./kit/interface").IRes<T_14>>;
25
- setScreenOrientation: <T_15>(pageOrientation: string) => Promise<import("./kit/interface").IRes<T_15>>;
26
- isSupportFloatWindow: <T_16>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_16>>;
27
- openFloatWindow: <T_17>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_17>>;
28
- isSupportedTalk: <T_18>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_18>>;
29
- getCurrentSupportedTalkMode: <T_19>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_19>>;
30
- goToIpcPageNativeRoute: (url: string, deviceId: string, theme?: "dark" | "light", extraParams?: {
23
+ getMobileOrientation: <T_15>() => Promise<import("./kit/interface").IRes<T_15>>;
24
+ jumpToWebView: <T_16>(url: string) => Promise<import("./kit/interface").IRes<T_16>>;
25
+ setScreenOrientation: <T_17>(pageOrientation: string) => Promise<import("./kit/interface").IRes<T_17>>;
26
+ isSupportFloatWindow: <T_18>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_18>>;
27
+ openFloatWindow: <T_19>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_19>>;
28
+ isSupportedTalk: <T_20>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_20>>;
29
+ getCurrentSupportedTalkMode: <T_21>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_21>>;
30
+ goToIpcPageNativeRoute: <T_22>(url: string, deviceId: string, theme?: "dark" | "light", extraParams?: {
31
31
  [key: string]: any;
32
- } | undefined, isGeneral?: false | undefined) => Promise<import("./kit/interface").IRes<T>>;
33
- goToGeneralHelpMini: () => Promise<import("./kit/interface").IRes<T>>;
34
- goToIpcHelpMini: (errCode: number, deviceId: string, helpNum: number, helpFeedBack: boolean, brandColor?: string) => Promise<import("./kit/interface").IRes<T>>;
35
- getIsSupprtedCloudStorageSync: (deviceId: string) => Promise<{
32
+ } | undefined, isGeneral?: false | undefined) => Promise<import("./kit/interface").IRes<T_22>>;
33
+ goToGeneralHelpMini: <T_23>() => Promise<import("./kit/interface").IRes<T_23>>;
34
+ goToIpcHelpMini: <T_24>(errCode: number, deviceId: string, helpNum: number, helpFeedBack: boolean, brandColor?: string) => Promise<import("./kit/interface").IRes<T_24>>;
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_25>(deviceId: string, dps?: {}) => Promise<import("./kit/interface").IRes<T_25>>;
45
+ wakeUpDevice: <T_26>(deviceId: string, dps?: {}) => Promise<import("./kit/interface").IRes<T_26>>;
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,17 @@ 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({
54
+ code: 0,
51
55
  data: res
52
56
  });
53
57
  },
54
- fail: error => {
58
+ fail: err => {
59
+ console.log('res===wakeUpDevice err', err);
55
60
  resolve({
56
61
  code: -1,
57
- msg: error
62
+ msg: err
58
63
  });
59
64
  }
60
65
  });
@@ -34,13 +34,13 @@ export declare const publishDps: <T>(deviceId: string, dps: any) => Promise<IRes
34
34
  * @param key 保存的key属性
35
35
  *
36
36
  */
37
- export declare const getDpStateValue: (deviceId: string, dpCode: string) => Promise<IRes<T>>;
37
+ export declare const getDpStateValue: <T>(deviceId: string, dpCode: string) => Promise<IRes<T>>;
38
38
  /**
39
39
  * 根据DPCode获取DpId
40
40
  * @param key 保存的key属性
41
41
  *
42
42
  */
43
- export declare const getDpIdByCode: (deviceId: string, dpCode: string) => Promise<IRes<T>>;
43
+ export declare const getDpIdByCode: <T>(deviceId: string, dpCode: string) => Promise<IRes<T>>;
44
44
  /**
45
45
  * 通过短链形式跳转小程序
46
46
  * @param url 小程序链接
@@ -106,13 +106,13 @@ export declare const getCurrentSupportedTalkMode: <T>(deviceId: string, extendPa
106
106
  * @param {boolean} isGeneral 是否为通用页面,IPC原生业务页面不用传, 默认false
107
107
  *
108
108
  */
109
- export declare const goToIpcPageNativeRoute: (url: string, deviceId: string, theme?: 'dark' | 'light', extraParams?: {
109
+ export declare const goToIpcPageNativeRoute: <T>(url: string, deviceId: string, theme?: 'dark' | 'light', extraParams?: {
110
110
  [key: string]: any;
111
111
  } | undefined, isGeneral?: false) => Promise<IRes<T>>;
112
112
  /**
113
113
  * 跳转 通用帮助反馈小程序
114
114
  */
115
- export declare const goToGeneralHelpMini: () => Promise<IRes<T>>;
115
+ export declare const goToGeneralHelpMini: <T>() => Promise<IRes<T>>;
116
116
  /**
117
117
  * 跳转 Ipc帮助反馈小程序
118
118
  * @param {number} errCode 错误码
@@ -121,13 +121,13 @@ export declare const goToGeneralHelpMini: () => Promise<IRes<T>>;
121
121
  * @param {boolean} helpFeedBack 是否是反馈
122
122
  * @param {string} brandColor 品牌色
123
123
  */
124
- export declare const goToIpcHelpMini: (errCode: number, deviceId: string, helpNum: number, helpFeedBack: boolean, brandColor?: string) => Promise<IRes<T>>;
124
+ export declare const goToIpcHelpMini: <T>(errCode: number, deviceId: string, helpNum: number, helpFeedBack: boolean, brandColor?: string) => Promise<IRes<T>>;
125
125
  /**
126
126
  *
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-9",
4
4
  "description": "IPC 工具库",
5
5
  "main": "lib/index",
6
6
  "files": [