@ray-js/robot-data-stream 0.0.12-beta-12 → 0.0.12-beta-13

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.
@@ -1,5 +1,5 @@
1
1
  import { PromiseWithRejection } from './promise';
2
- type TRequestPassword = () => PromiseWithRejection;
2
+ type TRequestPassword = () => PromiseWithRejection | Promise<void>;
3
3
  type TSetPassword = (params: {
4
4
  password: string;
5
5
  oldPassword?: string;
@@ -17,7 +17,7 @@ export const usePassword = devId => {
17
17
 
18
18
  return {
19
19
  requestPassword: () => {
20
- if (!useMqtt) return null;
20
+ if (!useMqtt) return Promise.reject(new Error('useMqtt is not used'));
21
21
  const params = createSetCommonParams({
22
22
  deviceId: devId,
23
23
  reqType: PasswordEnum.query
@@ -15,7 +15,7 @@ export const useRoomProperty = devId => {
15
15
 
16
16
  return {
17
17
  requestRoomProperty: () => {
18
- if (!useMqtt) return null;
18
+ if (!useMqtt) return Promise.reject(new Error('useMqtt is not used'));
19
19
  const params = createSetCommonParams({
20
20
  deviceId: devId,
21
21
  reqType: RoomPropertyEnum.query
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/robot-data-stream",
3
- "version": "0.0.12-beta-12",
3
+ "version": "0.0.12-beta-13",
4
4
  "description": "扫地机P2P数据流标准化组件",
5
5
  "main": "lib/index",
6
6
  "files": [