@ledvance/base 1.2.82 → 1.2.83

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 (165) hide show
  1. package/.babelrc +31 -31
  2. package/.eslintignore +5 -5
  3. package/.eslintrc.js +27 -27
  4. package/.prettierrc.js +1 -1
  5. package/.versionrc +5 -5
  6. package/localazy.json +848 -848
  7. package/localazy.keys.json +4 -4
  8. package/package.json +74 -74
  9. package/rn-cli.config.js +8 -8
  10. package/src/api/native.d.ts +71 -71
  11. package/src/api/native.ts +423 -423
  12. package/src/api/nativeEventEmitter.d.ts +3 -3
  13. package/src/api/nativeEventEmitter.ts +125 -125
  14. package/src/components/AdvanceCard.d.ts +25 -25
  15. package/src/components/AdvanceCard.tsx +117 -117
  16. package/src/components/AdvanceList.d.ts +9 -9
  17. package/src/components/AdvanceList.tsx +69 -69
  18. package/src/components/ApplyForDeviceItem.d.ts +6 -6
  19. package/src/components/ApplyForDeviceItem.tsx +83 -83
  20. package/src/components/ApplyForDeviceList.d.ts +7 -7
  21. package/src/components/ApplyForDeviceList.tsx +61 -61
  22. package/src/components/ApplyForText.d.ts +6 -6
  23. package/src/components/ApplyForText.tsx +52 -52
  24. package/src/components/Card.d.ts +10 -10
  25. package/src/components/Card.tsx +40 -40
  26. package/src/components/Cell.d.ts +21 -21
  27. package/src/components/Cell.tsx +69 -69
  28. package/src/components/CircularProgress.d.ts +8 -8
  29. package/src/components/CircularProgress.tsx +42 -42
  30. package/src/components/ColorAdjustView.d.ts +12 -12
  31. package/src/components/ColorAdjustView.tsx +64 -64
  32. package/src/components/ColorExtractor.d.ts +73 -73
  33. package/src/components/ColorExtractor.tsx +374 -374
  34. package/src/components/ColorTempAdjustView.d.ts +13 -13
  35. package/src/components/ColorTempAdjustView.tsx +57 -57
  36. package/src/components/ColorsLine.d.ts +7 -7
  37. package/src/components/ColorsLine.tsx +47 -47
  38. package/src/components/CustomListDialog.d.ts +15 -15
  39. package/src/components/CustomListDialog.tsx +66 -65
  40. package/src/components/DeleteButton.d.ts +10 -10
  41. package/src/components/DeleteButton.tsx +40 -40
  42. package/src/components/Dialog.d.ts +10 -10
  43. package/src/components/Dialog.tsx +38 -38
  44. package/src/components/DrawToolView.d.ts +46 -46
  45. package/src/components/DrawToolView.tsx +262 -262
  46. package/src/components/FanAdjustView.d.ts +23 -23
  47. package/src/components/FanAdjustView.tsx +141 -141
  48. package/src/components/InfoText.d.ts +11 -11
  49. package/src/components/InfoText.tsx +45 -45
  50. package/src/components/LampAdjustView.d.ts +10 -10
  51. package/src/components/LampAdjustView.tsx +75 -75
  52. package/src/components/LampAdjustView2.d.ts +24 -24
  53. package/src/components/LampAdjustView2.tsx +104 -104
  54. package/src/components/LinearGradientLine.d.ts +9 -9
  55. package/src/components/LinearGradientLine.tsx +63 -63
  56. package/src/components/LoadingView.tsx +39 -39
  57. package/src/components/MoodColorsLine.d.ts +9 -9
  58. package/src/components/MoodColorsLine.tsx +38 -38
  59. package/src/components/Page.d.ts +21 -21
  60. package/src/components/Page.tsx +104 -104
  61. package/src/components/Popup.d.ts +7 -7
  62. package/src/components/Popup.tsx +71 -71
  63. package/src/components/Segmented.d.ts +14 -14
  64. package/src/components/Segmented.tsx +76 -76
  65. package/src/components/ShowSelect.d.ts +1 -1
  66. package/src/components/ShowSelect.tsx +158 -158
  67. package/src/components/SocketItem.d.ts +13 -13
  68. package/src/components/SocketItem.tsx +87 -87
  69. package/src/components/Spacer.d.ts +7 -7
  70. package/src/components/Spacer.tsx +13 -13
  71. package/src/components/Stepper.d.ts +19 -19
  72. package/src/components/Stepper.tsx +130 -130
  73. package/src/components/StripAdjustView.d.ts +16 -16
  74. package/src/components/StripAdjustView.tsx +129 -129
  75. package/src/components/StripLightView.d.ts +14 -14
  76. package/src/components/StripLightView.tsx +24 -24
  77. package/src/components/Summary.tsx +116 -116
  78. package/src/components/Tag.d.ts +8 -8
  79. package/src/components/Tag.tsx +56 -56
  80. package/src/components/TextButton.d.ts +9 -9
  81. package/src/components/TextButton.tsx +31 -31
  82. package/src/components/TextField.d.ts +9 -9
  83. package/src/components/TextField.tsx +92 -92
  84. package/src/components/TextFieldStyleButton.d.ts +8 -8
  85. package/src/components/TextFieldStyleButton.tsx +85 -85
  86. package/src/components/UATabTitle.d.ts +6 -6
  87. package/src/components/UATabTitle.tsx +31 -31
  88. package/src/components/UATabs.d.ts +12 -12
  89. package/src/components/UATabs.tsx +77 -77
  90. package/src/components/connect.d.ts +10 -10
  91. package/src/components/connect.tsx +20 -20
  92. package/src/components/ldvColorBrightness.d.ts +1 -1
  93. package/src/components/ldvColorBrightness.tsx +18 -18
  94. package/src/components/ldvColorSlider.d.ts +14 -14
  95. package/src/components/ldvColorSlider.tsx +131 -131
  96. package/src/components/ldvItemView.d.ts +12 -12
  97. package/src/components/ldvItemView.tsx +43 -43
  98. package/src/components/ldvPickerView.d.ts +13 -13
  99. package/src/components/ldvPickerView.tsx +97 -97
  100. package/src/components/ldvPresetView.d.ts +2 -2
  101. package/src/components/ldvPresetView.tsx +86 -86
  102. package/src/components/ldvSaturation.d.ts +2 -2
  103. package/src/components/ldvSaturation.tsx +22 -22
  104. package/src/components/ldvSlider.d.ts +15 -15
  105. package/src/components/ldvSlider.tsx +103 -103
  106. package/src/components/ldvSwitch.d.ts +10 -10
  107. package/src/components/ldvSwitch.tsx +52 -52
  108. package/src/components/ldvTemperatureSlider.d.ts +13 -13
  109. package/src/components/ldvTemperatureSlider.tsx +139 -139
  110. package/src/components/ldvTopBar.d.ts +10 -10
  111. package/src/components/ldvTopBar.tsx +76 -76
  112. package/src/components/ldvTopName.d.ts +9 -9
  113. package/src/components/ldvTopName.tsx +63 -63
  114. package/src/components/segmentControl.d.ts +1 -1
  115. package/src/components/segmentControl.tsx +65 -65
  116. package/src/components/weekSelect.d.ts +7 -7
  117. package/src/components/weekSelect.tsx +98 -98
  118. package/src/composeLayout.d.ts +30 -30
  119. package/src/composeLayout.tsx +261 -261
  120. package/src/config/dark-theme.ts +61 -61
  121. package/src/config/light-theme.ts +61 -61
  122. package/src/hooks/Hooks.d.ts +2 -2
  123. package/src/hooks/Hooks.ts +8 -8
  124. package/src/i18n/index.d.ts +16 -16
  125. package/src/i18n/index.ts +37 -37
  126. package/src/i18n/strings.d.ts +15953 -15953
  127. package/src/i18n/strings.ts +23723 -23723
  128. package/src/main.tsx +9 -9
  129. package/src/models/GlobalParams.d.ts +14 -14
  130. package/src/models/GlobalParams.ts +14 -14
  131. package/src/models/TuyaApi.d.ts +29 -29
  132. package/src/models/TuyaApi.ts +92 -92
  133. package/src/models/combine.d.ts +26 -26
  134. package/src/models/combine.ts +17 -17
  135. package/src/models/configureStore.d.ts +9 -9
  136. package/src/models/configureStore.ts +33 -33
  137. package/src/models/index.d.ts +31 -31
  138. package/src/models/index.ts +22 -22
  139. package/src/models/modules/NativePropsSlice.d.ts +61 -61
  140. package/src/models/modules/NativePropsSlice.tsx +467 -467
  141. package/src/models/modules/Result.d.ts +14 -14
  142. package/src/models/modules/Result.ts +15 -15
  143. package/src/models/modules/common.d.ts +44 -44
  144. package/src/models/modules/common.ts +161 -161
  145. package/src/res/index.d.ts +70 -70
  146. package/src/res/index.ts +73 -73
  147. package/src/utils/ColorParser.d.ts +66 -66
  148. package/src/utils/ColorParser.ts +189 -189
  149. package/src/utils/ColorUtils.d.ts +71 -71
  150. package/src/utils/ColorUtils.tsx +448 -448
  151. package/src/utils/Support.d.ts +13 -13
  152. package/src/utils/Support.ts +108 -108
  153. package/src/utils/TypeUtils.d.ts +3 -3
  154. package/src/utils/cctUtils.d.ts +1 -1
  155. package/src/utils/cctUtils.ts +110 -110
  156. package/src/utils/common.d.ts +35 -35
  157. package/src/utils/common.ts +379 -379
  158. package/src/utils/index.d.ts +26 -26
  159. package/src/utils/index.ts +191 -191
  160. package/src/utils/interface.d.ts +6 -6
  161. package/src/utils/interface.ts +50 -11
  162. package/src/utils/loopsCompare.d.ts +1 -1
  163. package/src/utils/loopsCompare.ts +62 -62
  164. package/tsconfig.json +50 -50
  165. package/update-localazy.py +52 -52
package/src/main.tsx CHANGED
@@ -1,9 +1,9 @@
1
- import {createNavigator, GlobalTheme, NavigationRoute} from 'tuya-panel-kit'
2
- import ComposeLayout from './composeLayout'
3
-
4
- export function Navigation(router: NavigationRoute[]) {
5
- return ComposeLayout(createNavigator<{ theme: GlobalTheme }>({
6
- router: router,
7
- screenOptions: {},
8
- }))
9
- }
1
+ import {createNavigator, GlobalTheme, NavigationRoute} from 'tuya-panel-kit'
2
+ import ComposeLayout from './composeLayout'
3
+
4
+ export function Navigation(router: NavigationRoute[]) {
5
+ return ComposeLayout(createNavigator<{ theme: GlobalTheme }>({
6
+ router: router,
7
+ screenOptions: {},
8
+ }))
9
+ }
@@ -1,14 +1,14 @@
1
- interface DpSchemaProperty extends Record<string, any> {
2
- type: string;
3
- }
4
- export interface DpSchema {
5
- name: string;
6
- dp: number;
7
- type: string;
8
- mode: string;
9
- property: DpSchemaProperty;
10
- }
11
- export declare class GlobalParams {
12
- static dpSchemaMap: Record<string, DpSchema>;
13
- }
14
- export {};
1
+ interface DpSchemaProperty extends Record<string, any> {
2
+ type: string;
3
+ }
4
+ export interface DpSchema {
5
+ name: string;
6
+ dp: number;
7
+ type: string;
8
+ mode: string;
9
+ property: DpSchemaProperty;
10
+ }
11
+ export declare class GlobalParams {
12
+ static dpSchemaMap: Record<string, DpSchema>;
13
+ }
14
+ export {};
@@ -1,15 +1,15 @@
1
- interface DpSchemaProperty extends Record<string, any> {
2
- type: string
3
- }
4
-
5
- export interface DpSchema {
6
- name: string
7
- dp: number
8
- type: string
9
- mode: string
10
- property: DpSchemaProperty
11
- }
12
-
13
- export class GlobalParams {
14
- static dpSchemaMap: Record<string, DpSchema> = {}
1
+ interface DpSchemaProperty extends Record<string, any> {
2
+ type: string
3
+ }
4
+
5
+ export interface DpSchema {
6
+ name: string
7
+ dp: number
8
+ type: string
9
+ mode: string
10
+ property: DpSchemaProperty
11
+ }
12
+
13
+ export class GlobalParams {
14
+ static dpSchemaMap: Record<string, DpSchema> = {}
15
15
  }
@@ -1,29 +1,29 @@
1
- export interface PagingResult<T> {
2
- data: T;
3
- hasNext: boolean;
4
- currentOffset: number;
5
- }
6
- export interface DpReportSataResData {
7
- dps: DpReportSataData[];
8
- hasNext: boolean;
9
- total: number;
10
- }
11
- export interface DpReportSataData {
12
- timeStamp: number;
13
- dpId: number;
14
- timeStr: string;
15
- value: string;
16
- }
17
- export declare function getDpReportSataData(deviceId: string, dpIds: string[], offset: number, limit: number, sortType?: 'ASC' | 'DESC'): Promise<DpReportSataResData>;
18
- export interface DpResultByMonthResData {
19
- years: object;
20
- thisDay: string;
21
- sum: string;
22
- }
23
- export declare function getDpResultByMonth(devId: string, dpId: string, type: 'sum' | 'minux' | 'mac'): Promise<DpResultByMonthResData>;
24
- export interface DpResultByDataWithSpecifiedResData {
25
- result: object;
26
- min: string;
27
- }
28
- export declare function getDataWithSpecified(devId: string, dpId: string, startDay: string, endDay: string, type: 'sum' | 'minux' | 'avg'): Promise<DpResultByDataWithSpecifiedResData>;
29
- export declare function getDpResultByHour(devId: string, dpId: string, date: string, type: 'sum' | 'minux' | 'avg'): Promise<DpResultByDataWithSpecifiedResData>;
1
+ export interface PagingResult<T> {
2
+ data: T;
3
+ hasNext: boolean;
4
+ currentOffset: number;
5
+ }
6
+ export interface DpReportSataResData {
7
+ dps: DpReportSataData[];
8
+ hasNext: boolean;
9
+ total: number;
10
+ }
11
+ export interface DpReportSataData {
12
+ timeStamp: number;
13
+ dpId: number;
14
+ timeStr: string;
15
+ value: string;
16
+ }
17
+ export declare function getDpReportSataData(deviceId: string, dpIds: string[], offset: number, limit: number, sortType?: 'ASC' | 'DESC'): Promise<DpReportSataResData>;
18
+ export interface DpResultByMonthResData {
19
+ years: object;
20
+ thisDay: string;
21
+ sum: string;
22
+ }
23
+ export declare function getDpResultByMonth(devId: string, dpId: string, type: 'sum' | 'minux' | 'mac'): Promise<DpResultByMonthResData>;
24
+ export interface DpResultByDataWithSpecifiedResData {
25
+ result: object;
26
+ min: string;
27
+ }
28
+ export declare function getDataWithSpecified(devId: string, dpId: string, startDay: string, endDay: string, type: 'sum' | 'minux' | 'avg'): Promise<DpResultByDataWithSpecifiedResData>;
29
+ export declare function getDpResultByHour(devId: string, dpId: string, date: string, type: 'sum' | 'minux' | 'avg'): Promise<DpResultByDataWithSpecifiedResData>;
@@ -1,93 +1,93 @@
1
- import {commonApi} from '@tuya/tuya-panel-api'
2
-
3
- export interface PagingResult<T> {
4
- data: T
5
- hasNext: boolean
6
- currentOffset: number
7
- }
8
-
9
- export interface DpReportSataResData {
10
- dps: DpReportSataData[]
11
- hasNext: boolean
12
- total: number
13
- }
14
-
15
- export interface DpReportSataData {
16
- timeStamp: number
17
- dpId: number
18
- timeStr: string
19
- value: string
20
- }
21
-
22
- export async function getDpReportSataData(
23
- deviceId: string,
24
- dpIds: string[],
25
- offset: number,
26
- limit: number,
27
- sortType?: 'ASC' | 'DESC',
28
- ): Promise<DpReportSataResData> {
29
- const params = {
30
- devId: deviceId,
31
- dpIds: dpIds.join(','),
32
- offset: offset,
33
- limit: limit,
34
- sortType: sortType || 'DESC',
35
- }
36
- return commonApi.statApi.getDpReportLog(params)
37
- }
38
-
39
- export interface DpResultByMonthResData {
40
- years: object;
41
- thisDay: string;
42
- sum: string;
43
- }
44
-
45
- export async function getDpResultByMonth(
46
- devId: string,
47
- dpId: string,
48
- type: 'sum' | 'minux' | 'mac',
49
- ): Promise<DpResultByMonthResData> {
50
- const params = {
51
- devId,
52
- dpId,
53
- type,
54
- }
55
- return commonApi.statApi.getDpResultByMonth(params) as any
56
- }
57
-
58
- export interface DpResultByDataWithSpecifiedResData {
59
- result: object;
60
- min: string;
61
- }
62
-
63
- export async function getDataWithSpecified(
64
- devId: string,
65
- dpId: string,
66
- startDay: string,
67
- endDay: string,
68
- type: 'sum' | 'minux' | 'avg',
69
- ): Promise<DpResultByDataWithSpecifiedResData> {
70
- const params = {
71
- devId,
72
- dpId,
73
- startDay,
74
- endDay,
75
- type,
76
- }
77
- return commonApi.statApi.getDataWithSpecified(params) as any
78
- }
79
-
80
- export async function getDpResultByHour(
81
- devId: string,
82
- dpId: string,
83
- date: string,
84
- type: 'sum' | 'minux' | 'avg',
85
- ): Promise<DpResultByDataWithSpecifiedResData> {
86
- const params = {
87
- devId,
88
- dpId,
89
- date,
90
- type,
91
- }
92
- return commonApi.statApi.getDpResultByHour(params) as any
1
+ import {commonApi} from '@tuya/tuya-panel-api'
2
+
3
+ export interface PagingResult<T> {
4
+ data: T
5
+ hasNext: boolean
6
+ currentOffset: number
7
+ }
8
+
9
+ export interface DpReportSataResData {
10
+ dps: DpReportSataData[]
11
+ hasNext: boolean
12
+ total: number
13
+ }
14
+
15
+ export interface DpReportSataData {
16
+ timeStamp: number
17
+ dpId: number
18
+ timeStr: string
19
+ value: string
20
+ }
21
+
22
+ export async function getDpReportSataData(
23
+ deviceId: string,
24
+ dpIds: string[],
25
+ offset: number,
26
+ limit: number,
27
+ sortType?: 'ASC' | 'DESC',
28
+ ): Promise<DpReportSataResData> {
29
+ const params = {
30
+ devId: deviceId,
31
+ dpIds: dpIds.join(','),
32
+ offset: offset,
33
+ limit: limit,
34
+ sortType: sortType || 'DESC',
35
+ }
36
+ return commonApi.statApi.getDpReportLog(params)
37
+ }
38
+
39
+ export interface DpResultByMonthResData {
40
+ years: object;
41
+ thisDay: string;
42
+ sum: string;
43
+ }
44
+
45
+ export async function getDpResultByMonth(
46
+ devId: string,
47
+ dpId: string,
48
+ type: 'sum' | 'minux' | 'mac',
49
+ ): Promise<DpResultByMonthResData> {
50
+ const params = {
51
+ devId,
52
+ dpId,
53
+ type,
54
+ }
55
+ return commonApi.statApi.getDpResultByMonth(params) as any
56
+ }
57
+
58
+ export interface DpResultByDataWithSpecifiedResData {
59
+ result: object;
60
+ min: string;
61
+ }
62
+
63
+ export async function getDataWithSpecified(
64
+ devId: string,
65
+ dpId: string,
66
+ startDay: string,
67
+ endDay: string,
68
+ type: 'sum' | 'minux' | 'avg',
69
+ ): Promise<DpResultByDataWithSpecifiedResData> {
70
+ const params = {
71
+ devId,
72
+ dpId,
73
+ startDay,
74
+ endDay,
75
+ type,
76
+ }
77
+ return commonApi.statApi.getDataWithSpecified(params) as any
78
+ }
79
+
80
+ export async function getDpResultByHour(
81
+ devId: string,
82
+ dpId: string,
83
+ date: string,
84
+ type: 'sum' | 'minux' | 'avg',
85
+ ): Promise<DpResultByDataWithSpecifiedResData> {
86
+ const params = {
87
+ devId,
88
+ dpId,
89
+ date,
90
+ type,
91
+ }
92
+ return commonApi.statApi.getDpResultByHour(params) as any
93
93
  }
@@ -1,26 +1,26 @@
1
- export declare const reducers: {
2
- dpState: import("redux-actions").ReduxCompatibleReducer<import("./modules/common").DpState, import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>> | (Partial<import("./modules/common").DpState> & {
3
- [key: string]: string | number | boolean;
4
- })>;
5
- devInfo: import("redux-actions").ReduxCompatibleReducer<import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>, import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>>;
6
- logs: import("redux-actions").ReduxCompatibleReducer<import("./modules/common").Log[], import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>> | (Partial<import("./modules/common").DpState> & {
7
- [key: string]: string | number | boolean;
8
- }) | undefined>;
9
- ldvModules: import("@reduxjs/toolkit").Reducer<import("./modules/NativePropsSlice").NativeProps, import("@reduxjs/toolkit").AnyAction>;
10
- };
11
- declare type Reducers = typeof reducers;
12
- export declare type ReduxState = {
13
- [K in keyof Reducers]: ReturnType<Reducers[K]>;
14
- };
15
- export declare const rootReducers: import("redux").Reducer<import("redux").CombinedState<{
16
- dpState: import("./modules/common").DpState;
17
- devInfo: import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>;
18
- logs: import("./modules/common").Log[];
19
- ldvModules: import("./modules/NativePropsSlice").NativeProps;
20
- }>, import("redux").AnyAction>;
21
- export declare const rootEpics: import("redux-observable").Epic<import("redux-actions").Action<Partial<import("./modules/common").DpState> & {
22
- [key: string]: string | number | boolean;
23
- }>, import("redux-actions").Action<Partial<import("./modules/common").DpState> & {
24
- [key: string]: string | number | boolean;
25
- }>, void, any>;
26
- export {};
1
+ export declare const reducers: {
2
+ dpState: import("redux-actions").ReduxCompatibleReducer<import("./modules/common").DpState, import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>> | (Partial<import("./modules/common").DpState> & {
3
+ [key: string]: string | number | boolean;
4
+ })>;
5
+ devInfo: import("redux-actions").ReduxCompatibleReducer<import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>, import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>>;
6
+ logs: import("redux-actions").ReduxCompatibleReducer<import("./modules/common").Log[], import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>> | (Partial<import("./modules/common").DpState> & {
7
+ [key: string]: string | number | boolean;
8
+ }) | undefined>;
9
+ ldvModules: import("@reduxjs/toolkit").Reducer<import("./modules/NativePropsSlice").NativeProps, import("@reduxjs/toolkit").AnyAction>;
10
+ };
11
+ declare type Reducers = typeof reducers;
12
+ export declare type ReduxState = {
13
+ [K in keyof Reducers]: ReturnType<Reducers[K]>;
14
+ };
15
+ export declare const rootReducers: import("redux").Reducer<import("redux").CombinedState<{
16
+ dpState: import("./modules/common").DpState;
17
+ devInfo: import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>;
18
+ logs: import("./modules/common").Log[];
19
+ ldvModules: import("./modules/NativePropsSlice").NativeProps;
20
+ }>, import("redux").AnyAction>;
21
+ export declare const rootEpics: import("redux-observable").Epic<import("redux-actions").Action<Partial<import("./modules/common").DpState> & {
22
+ [key: string]: string | number | boolean;
23
+ }>, import("redux-actions").Action<Partial<import("./modules/common").DpState> & {
24
+ [key: string]: string | number | boolean;
25
+ }>, void, any>;
26
+ export {};
@@ -1,17 +1,17 @@
1
- import {combineReducers} from 'redux'
2
- import {combineEpics} from 'redux-observable'
3
- import {epics as commonEpics, reducers as commonReducers} from './modules/common'
4
-
5
- export const reducers = {
6
- ...commonReducers,
7
- }
8
-
9
- type Reducers = typeof reducers;
10
-
11
- export type ReduxState = { [K in keyof Reducers]: ReturnType<Reducers[K]> };
12
-
13
- export const rootReducers = combineReducers(reducers)
14
-
15
- const allEpics = [...commonEpics]
16
-
17
- export const rootEpics = combineEpics(...allEpics)
1
+ import {combineReducers} from 'redux'
2
+ import {combineEpics} from 'redux-observable'
3
+ import {epics as commonEpics, reducers as commonReducers} from './modules/common'
4
+
5
+ export const reducers = {
6
+ ...commonReducers,
7
+ }
8
+
9
+ type Reducers = typeof reducers;
10
+
11
+ export type ReduxState = { [K in keyof Reducers]: ReturnType<Reducers[K]> };
12
+
13
+ export const rootReducers = combineReducers(reducers)
14
+
15
+ const allEpics = [...commonEpics]
16
+
17
+ export const rootEpics = combineEpics(...allEpics)
@@ -1,9 +1,9 @@
1
- import { ReduxState } from './combine';
2
- export default function configureStore(initialState?: Partial<ReduxState>): import("redux").Store<import("redux").CombinedState<{
3
- dpState: import("./modules/common").DpState;
4
- devInfo: import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>;
5
- logs: import("./modules/common").Log[];
6
- ldvModules: import("./modules/NativePropsSlice").NativeProps;
7
- }>, import("redux").AnyAction> & {
8
- dispatch: unknown;
9
- };
1
+ import { ReduxState } from './combine';
2
+ export default function configureStore(initialState?: Partial<ReduxState>): import("redux").Store<import("redux").CombinedState<{
3
+ dpState: import("./modules/common").DpState;
4
+ devInfo: import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>;
5
+ logs: import("./modules/common").Log[];
6
+ ldvModules: import("./modules/NativePropsSlice").NativeProps;
7
+ }>, import("redux").AnyAction> & {
8
+ dispatch: unknown;
9
+ };
@@ -1,33 +1,33 @@
1
- import {applyMiddleware, compose, createStore} from 'redux'
2
- import {createLogger} from 'redux-logger'
3
- import {createEpicMiddleware} from 'redux-observable'
4
- import {ReduxState, rootEpics, rootReducers} from './combine'
5
-
6
- const epicMiddleware = createEpicMiddleware()
7
-
8
- const mWindow: any = window
9
-
10
- const isDebuggingInChrome = __DEV__ && !!mWindow.navigator.userAgent
11
- const logger = createLogger({
12
- predicate: () => isDebuggingInChrome,
13
- collapsed: true,
14
- duration: true,
15
- })
16
-
17
- const middleware = isDebuggingInChrome ? [epicMiddleware, logger] : [epicMiddleware]
18
-
19
- export default function configureStore(initialState?: Partial<ReduxState>) {
20
- const appliedMiddleware = applyMiddleware(...middleware)
21
-
22
- const store = createStore(
23
- rootReducers,
24
- initialState,
25
- compose(
26
- appliedMiddleware,
27
- isDebuggingInChrome && mWindow.devToolsExtension ? mWindow.devToolsExtension() : (f: any) => f,
28
- ),
29
- )
30
-
31
- epicMiddleware.run(rootEpics)
32
- return store
33
- }
1
+ import {applyMiddleware, compose, createStore} from 'redux'
2
+ import {createLogger} from 'redux-logger'
3
+ import {createEpicMiddleware} from 'redux-observable'
4
+ import {ReduxState, rootEpics, rootReducers} from './combine'
5
+
6
+ const epicMiddleware = createEpicMiddleware()
7
+
8
+ const mWindow: any = window
9
+
10
+ const isDebuggingInChrome = __DEV__ && !!mWindow.navigator.userAgent
11
+ const logger = createLogger({
12
+ predicate: () => isDebuggingInChrome,
13
+ collapsed: true,
14
+ duration: true,
15
+ })
16
+
17
+ const middleware = isDebuggingInChrome ? [epicMiddleware, logger] : [epicMiddleware]
18
+
19
+ export default function configureStore(initialState?: Partial<ReduxState>) {
20
+ const appliedMiddleware = applyMiddleware(...middleware)
21
+
22
+ const store = createStore(
23
+ rootReducers,
24
+ initialState,
25
+ compose(
26
+ appliedMiddleware,
27
+ isDebuggingInChrome && mWindow.devToolsExtension ? mWindow.devToolsExtension() : (f: any) => f,
28
+ ),
29
+ )
30
+
31
+ epicMiddleware.run(rootEpics)
32
+ return store
33
+ }
@@ -1,31 +1,31 @@
1
- import { ReduxState } from './combine';
2
- export * from './combine';
3
- export * from './configureStore';
4
- declare const actions: {
5
- common: {
6
- devInfoChange: import("redux-actions").ActionFunction1<import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>>, import("redux-actions").Action<import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>>>>;
7
- deviceChange: import("redux-actions").ActionFunction1<import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>>, import("redux-actions").Action<import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>>>>;
8
- responseUpdateDp: import("redux-actions").ActionFunction1<Partial<import("./modules/common").DpState> & {
9
- [key: string]: string | number | boolean;
10
- }, import("redux-actions").Action<Partial<import("./modules/common").DpState> & {
11
- [key: string]: string | number | boolean;
12
- }>>;
13
- updateDp: import("redux-actions").ActionFunction1<Partial<import("./modules/common").DpState> & {
14
- [key: string]: string | number | boolean;
15
- }, import("redux-actions").Action<Partial<import("./modules/common").DpState> & {
16
- [key: string]: string | number | boolean;
17
- }>>;
18
- consoleChange: import("redux-actions").ActionFunctionAny<import("redux-actions").Action<any>>;
19
- clearConsole: import("redux-actions").ActionFunctionAny<import("redux-actions").Action<any>>;
20
- };
21
- };
22
- export { actions };
23
- export declare const store: import("redux").Store<import("redux").CombinedState<{
24
- dpState: import("./modules/common").DpState;
25
- devInfo: import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>;
26
- logs: import("./modules/common").Log[];
27
- ldvModules: import("./modules/NativePropsSlice").NativeProps;
28
- }>, import("redux").AnyAction> & {
29
- dispatch: unknown;
30
- };
31
- export declare function useSelector<TSelected>(selector: (state: ReduxState) => TSelected, equalityFn?: (left: TSelected, right: TSelected) => boolean): TSelected;
1
+ import { ReduxState } from './combine';
2
+ export * from './combine';
3
+ export * from './configureStore';
4
+ declare const actions: {
5
+ common: {
6
+ devInfoChange: import("redux-actions").ActionFunction1<import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>>, import("redux-actions").Action<import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>>>>;
7
+ deviceChange: import("redux-actions").ActionFunction1<import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>>, import("redux-actions").Action<import("tuya-panel-kit").DevInfo<Record<string, import("tuya-panel-kit").DpType>>>>;
8
+ responseUpdateDp: import("redux-actions").ActionFunction1<Partial<import("./modules/common").DpState> & {
9
+ [key: string]: string | number | boolean;
10
+ }, import("redux-actions").Action<Partial<import("./modules/common").DpState> & {
11
+ [key: string]: string | number | boolean;
12
+ }>>;
13
+ updateDp: import("redux-actions").ActionFunction1<Partial<import("./modules/common").DpState> & {
14
+ [key: string]: string | number | boolean;
15
+ }, import("redux-actions").Action<Partial<import("./modules/common").DpState> & {
16
+ [key: string]: string | number | boolean;
17
+ }>>;
18
+ consoleChange: import("redux-actions").ActionFunctionAny<import("redux-actions").Action<any>>;
19
+ clearConsole: import("redux-actions").ActionFunctionAny<import("redux-actions").Action<any>>;
20
+ };
21
+ };
22
+ export { actions };
23
+ export declare const store: import("redux").Store<import("redux").CombinedState<{
24
+ dpState: import("./modules/common").DpState;
25
+ devInfo: import("tuya-panel-kit").DevInfo<import("./modules/common").DpState>;
26
+ logs: import("./modules/common").Log[];
27
+ ldvModules: import("./modules/NativePropsSlice").NativeProps;
28
+ }>, import("redux").AnyAction> & {
29
+ dispatch: unknown;
30
+ };
31
+ export declare function useSelector<TSelected>(selector: (state: ReduxState) => TSelected, equalityFn?: (left: TSelected, right: TSelected) => boolean): TSelected;
@@ -1,22 +1,22 @@
1
- import {shallowEqual, useSelector as useSelectorBase} from 'react-redux'
2
- import {actions as CommonActions} from './modules/common'
3
- import {ReduxState} from './combine'
4
- import configureStore from './configureStore'
5
-
6
- export * from './combine'
7
- export * from './configureStore'
8
-
9
- const actions = {
10
- common: CommonActions,
11
- }
12
-
13
- export {actions}
14
-
15
- export const store = configureStore()
16
-
17
- export function useSelector<TSelected>(
18
- selector: (state: ReduxState) => TSelected,
19
- equalityFn?: (left: TSelected, right: TSelected) => boolean,
20
- ) {
21
- return useSelectorBase<ReduxState, TSelected>(selector, equalityFn || shallowEqual)
22
- }
1
+ import {shallowEqual, useSelector as useSelectorBase} from 'react-redux'
2
+ import {actions as CommonActions} from './modules/common'
3
+ import {ReduxState} from './combine'
4
+ import configureStore from './configureStore'
5
+
6
+ export * from './combine'
7
+ export * from './configureStore'
8
+
9
+ const actions = {
10
+ common: CommonActions,
11
+ }
12
+
13
+ export {actions}
14
+
15
+ export const store = configureStore()
16
+
17
+ export function useSelector<TSelected>(
18
+ selector: (state: ReduxState) => TSelected,
19
+ equalityFn?: (left: TSelected, right: TSelected) => boolean,
20
+ ) {
21
+ return useSelectorBase<ReduxState, TSelected>(selector, equalityFn || shallowEqual)
22
+ }