@ray-js/lock-sdk 1.2.0-beta.8 → 1.2.0

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.
Files changed (239) hide show
  1. package/lib/api/fit.d.ts +55 -2
  2. package/lib/api/fit.js +43 -1
  3. package/lib/api/gesture.d.ts +11 -0
  4. package/lib/api/gesture.js +18 -0
  5. package/lib/api/log.d.ts +52 -4
  6. package/lib/api/log.js +22 -0
  7. package/lib/api/temp.d.ts +21 -0
  8. package/lib/api/temp.js +24 -0
  9. package/lib/api/video.d.ts +4 -0
  10. package/lib/api/video.js +10 -0
  11. package/lib/config/dp-code/index.d.ts +1 -1
  12. package/lib/config/dp-code/index.js +1 -0
  13. package/lib/entries/main/bootstrap/bootstrap-lock-instance.d.ts +2 -1
  14. package/lib/entries/main/bootstrap/bootstrap-lock-instance.js +23 -8
  15. package/lib/entries/main/bootstrap/bootstrap.d.ts +3 -2
  16. package/lib/entries/main/bootstrap/bootstrap.js +10 -6
  17. package/lib/entries/main/bootstrap/primary-instance.d.ts +1 -2
  18. package/lib/entries/main/bootstrap/primary-instance.js +1 -1
  19. package/lib/entries/main/bootstrap/resolve-runtime-from-export-this.js +1 -1
  20. package/lib/entries/main/build-instance.d.ts +6 -3
  21. package/lib/entries/main/build-instance.js +13 -1
  22. package/lib/entries/main/exports/capability.d.ts +2 -0
  23. package/lib/entries/main/exports/capability.js +7 -1
  24. package/lib/entries/main/exports/fit-sdk/binding.d.ts +10 -0
  25. package/lib/entries/{fit/exports → main/exports/fit-sdk}/binding.js +6 -3
  26. package/lib/entries/{fit/exports → main/exports/fit-sdk}/device.d.ts +11 -10
  27. package/lib/entries/{fit/exports → main/exports/fit-sdk}/device.js +20 -20
  28. package/lib/entries/{fit/exports → main/exports/fit-sdk}/index.d.ts +1 -0
  29. package/lib/entries/{fit/exports → main/exports/fit-sdk}/index.js +1 -0
  30. package/lib/entries/main/exports/fit-sdk/log.d.ts +3 -0
  31. package/lib/entries/main/exports/fit-sdk/log.js +5 -0
  32. package/lib/entries/main/exports/fit-sdk/temp.d.ts +40 -0
  33. package/lib/entries/main/exports/fit-sdk/temp.js +59 -0
  34. package/lib/entries/main/exports/gesture.d.ts +6 -0
  35. package/lib/entries/main/exports/gesture.js +8 -0
  36. package/lib/entries/main/exports/index.d.ts +5 -0
  37. package/lib/entries/main/exports/index.js +5 -0
  38. package/lib/entries/main/exports/log.d.ts +2 -0
  39. package/lib/entries/main/exports/log.js +7 -1
  40. package/lib/entries/main/exports/media.d.ts +3 -1
  41. package/lib/entries/main/exports/media.js +8 -2
  42. package/lib/entries/main/exports/misc.d.ts +4 -2
  43. package/lib/entries/main/exports/misc.js +2 -2
  44. package/lib/entries/main/index.d.ts +3 -3
  45. package/lib/entries/main/index.js +11 -5
  46. package/lib/feature/fit/bind-lock-to-fit.d.ts +1 -0
  47. package/lib/feature/fit/bind-lock-to-fit.js +53 -0
  48. package/lib/feature/fit/ble-key.d.ts +10 -4
  49. package/lib/feature/fit/ble-key.js +145 -4
  50. package/lib/feature/fit/device-bv.d.ts +2 -0
  51. package/lib/feature/fit/device-bv.js +15 -0
  52. package/lib/feature/fit/invalid-password.d.ts +10 -0
  53. package/lib/feature/fit/invalid-password.js +43 -0
  54. package/lib/feature/fit/list.d.ts +12 -2
  55. package/lib/feature/fit/list.js +54 -5
  56. package/lib/feature/fit/log.d.ts +7 -0
  57. package/lib/feature/fit/log.js +123 -0
  58. package/lib/feature/fit/method/add-flow.js +2 -2
  59. package/lib/feature/fit/method/add-password.js +2 -2
  60. package/lib/feature/fit/method/update-remove.js +40 -14
  61. package/lib/feature/fit/password-list.d.ts +37 -0
  62. package/lib/feature/fit/password-list.js +44 -1
  63. package/lib/feature/fit/security-channel.d.ts +3 -0
  64. package/lib/feature/fit/security-channel.js +43 -0
  65. package/lib/feature/fit/shared.d.ts +8 -0
  66. package/lib/feature/fit/shared.js +40 -1
  67. package/lib/feature/fit/sync.d.ts +4 -2
  68. package/lib/feature/fit/sync.js +63 -22
  69. package/lib/feature/fit/temp-password.d.ts +23 -0
  70. package/lib/feature/fit/temp-password.js +95 -3
  71. package/lib/feature/fit/users.d.ts +1 -0
  72. package/lib/feature/fit/users.js +1 -0
  73. package/lib/feature/gesture/gesture.d.ts +6 -0
  74. package/lib/feature/gesture/gesture.js +3 -0
  75. package/lib/feature/log/log.d.ts +5 -1
  76. package/lib/feature/log/log.js +53 -6
  77. package/lib/feature/media/camera.d.ts +12 -2
  78. package/lib/feature/media/camera.js +3 -0
  79. package/lib/feature/media/media.d.ts +2 -1
  80. package/lib/feature/media/media.js +4 -1
  81. package/lib/feature/misc/ble-control.js +2 -2
  82. package/lib/feature/misc/capability.d.ts +2 -0
  83. package/lib/feature/misc/capability.js +33 -31
  84. package/lib/feature/misc/connect-device.d.ts +1 -1
  85. package/lib/feature/misc/connect-device.js +7 -6
  86. package/lib/feature/misc/is-use-near-channel-for-runtime.js +8 -1
  87. package/lib/feature/password/temporary/offline-create.d.ts +14 -0
  88. package/lib/feature/password/temporary/offline-create.js +77 -1
  89. package/lib/feature/service/goto-service.d.ts +1 -1
  90. package/lib/feature/state/clear.js +1 -0
  91. package/lib/feature/state/device-status.js +17 -6
  92. package/lib/feature/state/init-state.js +18 -10
  93. package/lib/feature/state/platform-routing.js +12 -3
  94. package/lib/feature/state/remote-permissions.js +17 -0
  95. package/lib/feature/state/sync/remote-serect-key.js +7 -0
  96. package/lib/feature/storage/swr-cache.d.ts +7 -0
  97. package/lib/feature/storage/swr-cache.js +54 -0
  98. package/lib/feature/unlock/method/add-flow.js +2 -2
  99. package/lib/feature/unlock/method/add-password.js +2 -2
  100. package/lib/feature/user/sync-user.js +4 -2
  101. package/lib/feature/utils/index.d.ts +1 -0
  102. package/lib/feature/utils/index.js +1 -0
  103. package/lib/interface.d.ts +29 -0
  104. package/lib/platform/device.d.ts +4 -3
  105. package/lib/platform/ipc.d.ts +3 -0
  106. package/lib/platform/ipc.js +13 -0
  107. package/lib/platform/storage.d.ts +1 -1
  108. package/lib/runtime/LockDeviceRuntime.js +3 -0
  109. package/lib/runtime/lock-config.d.ts +5 -1
  110. package/lib/runtime/lock-config.js +6 -0
  111. package/lib/runtime/runtime-state-types.d.ts +6 -0
  112. package/lib/utils/constant.d.ts +1 -0
  113. package/lib/utils/constant.js +6 -0
  114. package/lib/utils/index.d.ts +2 -1
  115. package/lib/utils/index.js +1 -0
  116. package/package.json +1 -11
  117. package/lib/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  118. package/lib/bootstrap/bootstrap-lock-instance.js +0 -16
  119. package/lib/bootstrap/bootstrap.d.ts +0 -4
  120. package/lib/bootstrap/bootstrap.js +0 -53
  121. package/lib/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  122. package/lib/bootstrap/lock-instance-runtime-ref.js +0 -7
  123. package/lib/bootstrap/primary-instance.d.ts +0 -6
  124. package/lib/bootstrap/primary-instance.js +0 -24
  125. package/lib/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  126. package/lib/bootstrap/resolve-runtime-from-export-this.js +0 -29
  127. package/lib/bootstrap/top-level-runtime.d.ts +0 -2
  128. package/lib/bootstrap/top-level-runtime.js +0 -9
  129. package/lib/entries/ble/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  130. package/lib/entries/ble/bootstrap/bootstrap-lock-instance.js +0 -12
  131. package/lib/entries/ble/bootstrap/bootstrap.d.ts +0 -4
  132. package/lib/entries/ble/bootstrap/bootstrap.js +0 -53
  133. package/lib/entries/ble/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  134. package/lib/entries/ble/bootstrap/lock-instance-runtime-ref.js +0 -7
  135. package/lib/entries/ble/bootstrap/primary-instance.d.ts +0 -6
  136. package/lib/entries/ble/bootstrap/primary-instance.js +0 -24
  137. package/lib/entries/ble/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  138. package/lib/entries/ble/bootstrap/resolve-runtime-from-export-this.js +0 -29
  139. package/lib/entries/ble/bootstrap/top-level-runtime.d.ts +0 -2
  140. package/lib/entries/ble/bootstrap/top-level-runtime.js +0 -9
  141. package/lib/entries/ble/build-instance.d.ts +0 -9
  142. package/lib/entries/ble/build-instance.js +0 -50
  143. package/lib/entries/ble/exports/capability.d.ts +0 -6
  144. package/lib/entries/ble/exports/capability.js +0 -17
  145. package/lib/entries/ble/exports/config.d.ts +0 -3
  146. package/lib/entries/ble/exports/config.js +0 -5
  147. package/lib/entries/ble/exports/dp.d.ts +0 -9
  148. package/lib/entries/ble/exports/dp.js +0 -13
  149. package/lib/entries/ble/exports/index.d.ts +0 -16
  150. package/lib/entries/ble/exports/index.js +0 -16
  151. package/lib/entries/ble/exports/linkage.d.ts +0 -5
  152. package/lib/entries/ble/exports/linkage.js +0 -15
  153. package/lib/entries/ble/exports/log.d.ts +0 -9
  154. package/lib/entries/ble/exports/log.js +0 -21
  155. package/lib/entries/ble/exports/media.d.ts +0 -4
  156. package/lib/entries/ble/exports/media.js +0 -12
  157. package/lib/entries/ble/exports/misc.d.ts +0 -19
  158. package/lib/entries/ble/exports/misc.js +0 -30
  159. package/lib/entries/ble/exports/offline-dps.d.ts +0 -8
  160. package/lib/entries/ble/exports/offline-dps.js +0 -24
  161. package/lib/entries/ble/exports/open/do-open-close-action.d.ts +0 -2
  162. package/lib/entries/ble/exports/open/do-open-close-action.js +0 -36
  163. package/lib/entries/ble/exports/open/index.d.ts +0 -18
  164. package/lib/entries/ble/exports/open/index.js +0 -45
  165. package/lib/entries/ble/exports/signal.d.ts +0 -6
  166. package/lib/entries/ble/exports/signal.js +0 -14
  167. package/lib/entries/ble/exports/sleep.d.ts +0 -13
  168. package/lib/entries/ble/exports/sleep.js +0 -31
  169. package/lib/entries/ble/exports/state.d.ts +0 -6
  170. package/lib/entries/ble/exports/state.js +0 -19
  171. package/lib/entries/ble/exports/temporary.d.ts +0 -31
  172. package/lib/entries/ble/exports/temporary.js +0 -91
  173. package/lib/entries/ble/exports/unlock/sync.d.ts +0 -1
  174. package/lib/entries/ble/exports/unlock/sync.js +0 -5
  175. package/lib/entries/ble/exports/unlock-method.d.ts +0 -19
  176. package/lib/entries/ble/exports/unlock-method.js +0 -58
  177. package/lib/entries/ble/exports/user/index.d.ts +0 -23
  178. package/lib/entries/ble/exports/user/index.js +0 -22
  179. package/lib/entries/ble/exports/user/sync.d.ts +0 -1
  180. package/lib/entries/ble/exports/user/sync.js +0 -5
  181. package/lib/entries/ble/index.d.ts +0 -8
  182. package/lib/entries/ble/index.js +0 -39
  183. package/lib/entries/fit/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  184. package/lib/entries/fit/bootstrap/bootstrap-lock-instance.js +0 -12
  185. package/lib/entries/fit/bootstrap/bootstrap.d.ts +0 -4
  186. package/lib/entries/fit/bootstrap/bootstrap.js +0 -69
  187. package/lib/entries/fit/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  188. package/lib/entries/fit/bootstrap/lock-instance-runtime-ref.js +0 -7
  189. package/lib/entries/fit/bootstrap/primary-instance.d.ts +0 -6
  190. package/lib/entries/fit/bootstrap/primary-instance.js +0 -24
  191. package/lib/entries/fit/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  192. package/lib/entries/fit/bootstrap/resolve-runtime-from-export-this.js +0 -29
  193. package/lib/entries/fit/bootstrap/top-level-runtime.d.ts +0 -2
  194. package/lib/entries/fit/bootstrap/top-level-runtime.js +0 -9
  195. package/lib/entries/fit/build-instance.d.ts +0 -9
  196. package/lib/entries/fit/build-instance.js +0 -57
  197. package/lib/entries/fit/exports/binding.d.ts +0 -8
  198. package/lib/entries/fit/exports/temp.d.ts +0 -19
  199. package/lib/entries/fit/exports/temp.js +0 -18
  200. package/lib/entries/fit/index.d.ts +0 -8
  201. package/lib/entries/fit/index.js +0 -36
  202. package/lib/entries/main/exports/open.d.ts +0 -16
  203. package/lib/entries/main/exports/open.js +0 -44
  204. package/lib/entries/screen/bootstrap/bootstrap-lock-instance.d.ts +0 -7
  205. package/lib/entries/screen/bootstrap/bootstrap-lock-instance.js +0 -12
  206. package/lib/entries/screen/bootstrap/bootstrap.d.ts +0 -4
  207. package/lib/entries/screen/bootstrap/bootstrap.js +0 -69
  208. package/lib/entries/screen/bootstrap/lock-instance-runtime-ref.d.ts +0 -3
  209. package/lib/entries/screen/bootstrap/lock-instance-runtime-ref.js +0 -7
  210. package/lib/entries/screen/bootstrap/primary-instance.d.ts +0 -6
  211. package/lib/entries/screen/bootstrap/primary-instance.js +0 -24
  212. package/lib/entries/screen/bootstrap/resolve-runtime-from-export-this.d.ts +0 -5
  213. package/lib/entries/screen/bootstrap/resolve-runtime-from-export-this.js +0 -29
  214. package/lib/entries/screen/bootstrap/top-level-runtime.d.ts +0 -2
  215. package/lib/entries/screen/bootstrap/top-level-runtime.js +0 -9
  216. package/lib/entries/screen/build-instance.d.ts +0 -9
  217. package/lib/entries/screen/build-instance.js +0 -57
  218. package/lib/entries/screen/exports/bind-events.d.ts +0 -4
  219. package/lib/entries/screen/exports/bind-events.js +0 -8
  220. package/lib/entries/screen/exports/binding.d.ts +0 -6
  221. package/lib/entries/screen/exports/binding.js +0 -15
  222. package/lib/entries/screen/exports/device.d.ts +0 -16
  223. package/lib/entries/screen/exports/device.js +0 -41
  224. package/lib/entries/screen/exports/event.d.ts +0 -3
  225. package/lib/entries/screen/exports/event.js +0 -5
  226. package/lib/entries/screen/exports/index.d.ts +0 -5
  227. package/lib/entries/screen/exports/index.js +0 -5
  228. package/lib/entries/screen/exports/user.d.ts +0 -2
  229. package/lib/entries/screen/exports/user.js +0 -8
  230. package/lib/entries/screen/index.d.ts +0 -8
  231. package/lib/entries/screen/index.js +0 -36
  232. package/lib/feature/unlock/door/door-action.d.ts +0 -2
  233. package/lib/feature/unlock/door/door-action.js +0 -32
  234. package/lib/fit.d.ts +0 -4
  235. package/lib/fit.js +0 -3
  236. package/lib/runtime/device-status/compute-device-status.d.ts +0 -25
  237. package/lib/runtime/device-status/compute-device-status.js +0 -94
  238. package/lib/screen.d.ts +0 -4
  239. package/lib/screen.js +0 -3
@@ -1,36 +0,0 @@
1
- import { clearStateForRuntime } from "../../feature/state/clear";
2
- import { removeEvents } from "../../feature/state/platform-routing";
3
- import { bootstrapRegisteredScreenInstance } from "./bootstrap/bootstrap-lock-instance";
4
- import { clearPrimaryScreenSDKInstance, setPrimaryScreenSDKInstance, } from "./bootstrap/primary-instance";
5
- import { clearAllRuntimes, listRegisteredRuntimes, } from "../../runtime/registry";
6
- import { getLaunchOptionsSync } from "../../platform/device";
7
- import { getError } from "../../utils/errors";
8
- export * from "./exports";
9
- export const createScreenSDK = async (options) => {
10
- const { instance } = await bootstrapRegisteredScreenInstance({
11
- ...options,
12
- preFetch: false,
13
- });
14
- return instance;
15
- };
16
- export const initScreen = async (options) => {
17
- const opts = { ...options };
18
- const { devInfo, deviceId } = opts;
19
- if (!devInfo && !deviceId) {
20
- const { query } = getLaunchOptionsSync();
21
- opts.deviceId = query.deviceId;
22
- if (!opts.deviceId) {
23
- throw getError(1000);
24
- }
25
- }
26
- const { instance } = await bootstrapRegisteredScreenInstance(opts);
27
- setPrimaryScreenSDKInstance(instance);
28
- };
29
- export const destroyScreen = () => {
30
- removeEvents();
31
- for (const rt of listRegisteredRuntimes()) {
32
- clearStateForRuntime(rt);
33
- }
34
- clearAllRuntimes();
35
- clearPrimaryScreenSDKInstance();
36
- };
@@ -1,2 +0,0 @@
1
- import type { LockDeviceRuntime } from "../../../runtime/LockDeviceRuntime";
2
- export declare const doOpenCloseActionForRuntime: (this: unknown, rt: LockDeviceRuntime, isOpen: boolean, timeout: number) => Promise<void>;
@@ -1,32 +0,0 @@
1
- import { parallelOnlyForRuntime } from "../../utils";
2
- import { checkRemoteEnabledForRuntime } from "./check-remote";
3
- import { getCurrentUserForRuntime } from "../../user/current-user";
4
- import { resolveOpenClosePath } from "./open-close-path";
5
- import { executeOpenCloseMatterLan } from "./door-matter-lan";
6
- import { executeOpenCloseNearDualMode } from "./door-near-dual-mode";
7
- import { executeOpenCloseBleOnly } from "./door-ble-only";
8
- import { executeOpenCloseRemoteCloud } from "./door-remote-cloud";
9
- export const doOpenCloseActionForRuntime = parallelOnlyForRuntime(async function doOpenCloseActionForRuntime(rt, isOpen, timeout) {
10
- await checkRemoteEnabledForRuntime(rt);
11
- const path = resolveOpenClosePath(rt);
12
- const currentUser = await getCurrentUserForRuntime(rt);
13
- const memberId = currentUser.lockUserId !== 0 ? currentUser.lockUserId : currentUser.userId;
14
- switch (path) {
15
- case "matter_lan":
16
- await executeOpenCloseMatterLan(rt, isOpen);
17
- return;
18
- case "near_dual_mode":
19
- await executeOpenCloseNearDualMode(rt, isOpen, timeout, memberId);
20
- return;
21
- case "ble_only":
22
- await executeOpenCloseBleOnly(rt, isOpen, timeout, memberId);
23
- return;
24
- case "remote_cloud":
25
- await executeOpenCloseRemoteCloud(rt, isOpen, timeout, memberId);
26
- return;
27
- default: {
28
- const _exhaustive = path;
29
- return _exhaustive;
30
- }
31
- }
32
- });
package/lib/fit.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from "./entries/fit/index";
2
- export * from "./interface";
3
- export * from "./constant";
4
- export type { SDKLogConfig, SDKLogEntry, SDKLogLevel, SDKLogSink, } from "./utils/sdk-log";
package/lib/fit.js DELETED
@@ -1,3 +0,0 @@
1
- export * from "./entries/fit/index";
2
- export * from "./interface";
3
- export * from "./constant";
@@ -1,25 +0,0 @@
1
- import { ProductCommunicationType } from "../../constant";
2
- import type { DeviceStatus } from "../../interface";
3
- export type ComputeDeviceStatusConfigSlice = {
4
- onlineType: number;
5
- devInfo: {
6
- isCloudOnline: boolean;
7
- isOnline: boolean;
8
- wifiEnableState?: number;
9
- isMatter?: boolean;
10
- };
11
- };
12
- export type ComputeDeviceStatusDeps = {
13
- hasCapability: (t: ProductCommunicationType) => boolean;
14
- hasDp: (code: string) => boolean;
15
- getDpValue: (code: string) => unknown;
16
- isSupportBleControl: () => boolean;
17
- isShareThread: () => boolean;
18
- readIsSleep: () => boolean;
19
- registeredRuntimeCount: number;
20
- getDormantPeriod: () => {
21
- start: number;
22
- end: number;
23
- };
24
- };
25
- export declare function computeDeviceStatus(config: ComputeDeviceStatusConfigSlice, deps: ComputeDeviceStatusDeps): DeviceStatus;
@@ -1,94 +0,0 @@
1
- import dpCodes from "../../config/dp-code";
2
- import { ProductCommunicationType } from "../../constant";
3
- import { isOnlineByType } from "../../utils";
4
- export function computeDeviceStatus(config, deps) {
5
- const { onlineType, devInfo: { isCloudOnline, isOnline, wifiEnableState, isMatter }, } = config;
6
- const supportWifi = deps.hasCapability(ProductCommunicationType.WIFI);
7
- const supportBle = deps.hasCapability(ProductCommunicationType.BLUETOOTH);
8
- const supportThread = deps.hasCapability(ProductCommunicationType.THREAD);
9
- const status = {
10
- type: isOnline ? "online" : "offline",
11
- connectEnable: false,
12
- onlineType: "unknown",
13
- onlineTypes: [],
14
- isWifiActive: wifiEnableState !== 1,
15
- isWifiMatter: !!isMatter && supportWifi,
16
- };
17
- const isMatterLocal = isOnlineByType(onlineType, 8);
18
- const isBleOnline = isOnlineByType(onlineType, 2);
19
- const isLocalOnline = !isCloudOnline && isOnlineByType(onlineType, 1);
20
- const hasWirelessAwakeDp = deps.hasDp(dpCodes.wirelessAwake);
21
- const wirelessAwake = deps.getDpValue(dpCodes.wirelessAwake);
22
- status.connectEnable = deps.isSupportBleControl() && !isOnline;
23
- if (supportWifi) {
24
- if (!status.connectEnable) {
25
- if (isCloudOnline) {
26
- status.connectEnable =
27
- hasWirelessAwakeDp && wirelessAwake === false && !isBleOnline;
28
- }
29
- }
30
- }
31
- if (isOnline) {
32
- if (isCloudOnline) {
33
- if (hasWirelessAwakeDp) {
34
- if (wirelessAwake) {
35
- status.onlineTypes.push("cloud");
36
- }
37
- else {
38
- status.type = "offline";
39
- }
40
- }
41
- else {
42
- status.onlineTypes.push("cloud");
43
- }
44
- }
45
- if (isLocalOnline) {
46
- status.onlineTypes.push("local");
47
- }
48
- if (isMatterLocal) {
49
- if (!status.onlineTypes.includes("local")) {
50
- status.onlineTypes.push("local");
51
- }
52
- }
53
- if (isBleOnline) {
54
- status.onlineTypes.push("ble");
55
- }
56
- }
57
- if (status.onlineTypes.length === 0 && isOnline) {
58
- status.onlineTypes.push("unknown");
59
- }
60
- if (supportThread && supportBle) {
61
- const isShareThread = deps.isShareThread();
62
- if (isShareThread && isOnline) {
63
- if (!status.onlineTypes.includes("local")) {
64
- status.onlineTypes = ["local"];
65
- }
66
- }
67
- }
68
- if (status.onlineTypes.includes("ble")) {
69
- status.onlineType = "ble";
70
- }
71
- else if (status.onlineTypes.includes("cloud")) {
72
- status.onlineType = "cloud";
73
- }
74
- else if (status.onlineTypes.includes("local")) {
75
- status.onlineType = "local";
76
- }
77
- else {
78
- status.onlineType = "unknown";
79
- }
80
- if (!isOnline) {
81
- if (deps.readIsSleep()) {
82
- status.type = "sleep";
83
- }
84
- }
85
- if (status.type === "sleep") {
86
- if (deps.getDpValue(dpCodes.dormantSwitch) ||
87
- deps.getDpValue(dpCodes.onlineSwitch)) {
88
- if (deps.registeredRuntimeCount === 1) {
89
- status.sleepPeriod = deps.getDormantPeriod();
90
- }
91
- }
92
- }
93
- return status;
94
- }
package/lib/screen.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from "./entries/screen/index";
2
- export * from "./interface";
3
- export * from "./constant";
4
- export type { SDKLogConfig, SDKLogEntry, SDKLogLevel, SDKLogSink, } from "./utils/sdk-log";
package/lib/screen.js DELETED
@@ -1,3 +0,0 @@
1
- export * from "./entries/screen/index";
2
- export * from "./interface";
3
- export * from "./constant";