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

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
@@ -12,7 +12,7 @@ declare const IpcUtils: {
12
12
  getInitUtmTid: () => string;
13
13
  getDevInfo: <T_6>(deviceId: string) => Promise<import("./kit/interface").IRes<T_6>>;
14
14
  getNativeStorage: <T_7>(key: string) => Promise<import("./kit/interface").IRes<T_7>>;
15
- setNativeStorage: <T_8>(key: string, data: T_8) => Promise<import("./kit/interface").IRes<T_8>>;
15
+ setNativeStorage: <T_8>(key: string, data: string) => 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
18
  getDpStateValue: <T_11>(deviceId: string, dpCode: string) => Promise<import("./kit/interface").IRes<T_11>>;
@@ -20,6 +20,7 @@ declare const IpcUtils: {
20
20
  goToMiniProgramByShortLink: <T_13>(url: string, position?: string) => Promise<import("./kit/interface").IRes<T_13>>;
21
21
  getVideoBitrateKbps: <T_14>(deviceId: string, extendParam?: {}) => Promise<import("./kit/interface").IRes<T_14>>;
22
22
  networkStatusDidChangedEvent: (callback: any) => void;
23
+ offNetworkStatusDidChangedEvent: (callback: any) => void;
23
24
  getMobileOrientation: <T_15>() => Promise<import("./kit/interface").IRes<T_15>>;
24
25
  jumpToWebView: <T_16>(url: string) => Promise<import("./kit/interface").IRes<T_16>>;
25
26
  setScreenOrientation: <T_17>(pageOrientation: string) => Promise<import("./kit/interface").IRes<T_17>>;
@@ -41,8 +42,9 @@ declare const IpcUtils: {
41
42
  data: boolean;
42
43
  msg: string | boolean | import("./kit/interface").IApiError | undefined;
43
44
  }>;
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>>;
45
+ ipcTTTOperatorLog: <T_25>(ipcLogString: string) => Promise<import("./kit/interface").IRes<T_25>>;
46
+ requestWifiSignal: <T_26>(deviceId: string, dps?: {}) => Promise<import("./kit/interface").IRes<T_26>>;
47
+ wakeUpDevice: <T_27>(deviceId: string, dps?: {}) => Promise<import("./kit/interface").IRes<T_27>>;
46
48
  useTrafficViewTip: () => boolean;
47
49
  };
48
50
  export default IpcUtils;
@@ -16,7 +16,7 @@ export declare const getNativeStorage: <T>(key: string) => Promise<IRes<T>>;
16
16
  * @param key 保存的key属性
17
17
  *
18
18
  */
19
- export declare const setNativeStorage: <T>(key: string, data: T) => Promise<IRes<T>>;
19
+ export declare const setNativeStorage: <T>(key: string, data: string) => Promise<IRes<T>>;
20
20
  /**
21
21
  * 清除本地缓存
22
22
  * @param key 保存的key属性
@@ -56,6 +56,7 @@ export declare const goToMiniProgramByShortLink: <T>(url: string, position?: str
56
56
  */
57
57
  export declare const getVideoBitrateKbps: <T>(deviceId: string, extendParam?: {}) => Promise<IRes<T>>;
58
58
  export declare const networkStatusDidChangedEvent: (callback: any) => void;
59
+ export declare const offNetworkStatusDidChangedEvent: (callback: any) => void;
59
60
  /**
60
61
  * 获取手机当前横竖屏状态
61
62
  * 需引入IPCKit,且在>=1.0.0-TTT432.1版本才可使用
@@ -123,7 +124,7 @@ export declare const goToGeneralHelpMini: <T>() => Promise<IRes<T>>;
123
124
  */
124
125
  export declare const goToIpcHelpMini: <T>(errCode: number, deviceId: string, helpNum: number, helpFeedBack: boolean, brandColor?: string) => Promise<IRes<T>>;
125
126
  /**
126
- *
127
+ * 获取是否支持云存储
127
128
  * @param deviceId 设备id
128
129
  * @returns true/false
129
130
  */
@@ -136,3 +137,9 @@ export declare const getIsSupportedCloudStorageSync: (deviceId: string) => Promi
136
137
  data: boolean;
137
138
  msg: string | boolean | import("../interface").IApiError | undefined;
138
139
  }>;
140
+ /**
141
+ * 预埋业务日志
142
+ * @param ipcLogString 日志字符串
143
+ * @returns true/false
144
+ */
145
+ export declare const ipcTTTOperatorLog: <T>(ipcLogString: string) => Promise<IRes<T>>;
@@ -82,7 +82,7 @@ export const setNativeStorage = (key, data) => {
82
82
  success: res => {
83
83
  resolve({
84
84
  code: 0,
85
- data: res || true
85
+ data: res
86
86
  });
87
87
  },
88
88
  fail: err => {
@@ -115,7 +115,7 @@ export const removeNativeStorage = key => {
115
115
  success: res => {
116
116
  resolve({
117
117
  code: 0,
118
- data: res || true
118
+ data: res
119
119
  });
120
120
  },
121
121
  fail: err => {
@@ -327,6 +327,9 @@ export const getVideoBitrateKbps = function (deviceId) {
327
327
  export const networkStatusDidChangedEvent = callback => {
328
328
  ty.onNetworkStatusChange(callback);
329
329
  };
330
+ export const offNetworkStatusDidChangedEvent = callback => {
331
+ ty.offNetworkStatusChange(callback);
332
+ };
330
333
 
331
334
  /**
332
335
  * 获取手机当前横竖屏状态
@@ -736,7 +739,7 @@ export const goToIpcHelpMini = async function (errCode, deviceId, helpNum, helpF
736
739
  };
737
740
 
738
741
  /**
739
- *
742
+ * 获取是否支持云存储
740
743
  * @param deviceId 设备id
741
744
  * @returns true/false
742
745
  */
@@ -766,4 +769,38 @@ export const getIsSupportedCloudStorageSync = async deviceId => {
766
769
  data: false,
767
770
  msg: msg
768
771
  };
772
+ };
773
+
774
+ /**
775
+ * 预埋业务日志
776
+ * @param ipcLogString 日志字符串
777
+ * @returns true/false
778
+ */
779
+ export const ipcTTTOperatorLog = ipcLogString => {
780
+ return new Promise(resolve => {
781
+ try {
782
+ ty.ipc.ipcTTTOperatorLog({
783
+ ipcLogString,
784
+ success: res => {
785
+ console.log(res, 'res');
786
+ resolve({
787
+ code: 0,
788
+ data: res
789
+ });
790
+ },
791
+ fail: error => {
792
+ console.log(error, 'error');
793
+ resolve({
794
+ code: -1,
795
+ msg: error
796
+ });
797
+ }
798
+ });
799
+ } catch (err) {
800
+ resolve({
801
+ code: -1,
802
+ msg: String(err)
803
+ });
804
+ }
805
+ });
769
806
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ray-ipc-utils",
3
- "version": "1.1.0-beta-9",
3
+ "version": "1.1.0-beta-10",
4
4
  "description": "IPC 工具库",
5
5
  "main": "lib/index",
6
6
  "files": [