@ledvance/base 1.0.13 → 1.0.15
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/package.json +1 -1
- package/src/api/native.d.ts +2 -1
- package/src/api/native.ts +24 -1
- package/src/i18n/strings.d.ts +460 -0
- package/src/i18n/strings.ts +1669 -804
package/package.json
CHANGED
package/src/api/native.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { NativeResult } from '../models/modules/Result';
|
|
1
|
+
import { NativeResult, Result } from '../models/modules/Result';
|
|
2
2
|
export declare class NativeApi {
|
|
3
3
|
static back(): void;
|
|
4
4
|
static log(msg: string): void;
|
|
5
5
|
static logObj(msg: any): void;
|
|
6
6
|
static showObj(obj: any): void;
|
|
7
|
+
static getAllTaskTimer(devId: string, type?: number): Promise<Result<any>>;
|
|
7
8
|
static timerList(deviceId: string): Promise<any>;
|
|
8
9
|
static addTimer(deviceId: string, value: any, callback?: (res: any) => void): void;
|
|
9
10
|
static editTimer(deviceId: string, value: any, callback?: (res: any) => void): void;
|
package/src/api/native.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {NativeModules} from 'react-native'
|
|
2
|
-
import {NativeResult} from '../models/modules/Result'
|
|
2
|
+
import {NativeResult, Result} from '../models/modules/Result'
|
|
3
3
|
|
|
4
4
|
interface LDVDevicePanelManager {
|
|
5
5
|
back: () => void
|
|
6
6
|
control: (params: any, callback: (result: any) => void) => void
|
|
7
7
|
setTimer: (params: any, callback: (result: any) => void) => void
|
|
8
|
+
getAllTaskTimer: (deviceId: string, type: number, callback: (res: NativeResult<string>) => void) => void
|
|
8
9
|
deleteDevice: (deviceId: string, isReset: boolean, callback: (result: any) => void) => void
|
|
9
10
|
rename: (deviceId: string, name: string, callback: (result: any) => void) => void
|
|
10
11
|
toDeviceSettingsPage: (deviceId: string) => void
|
|
@@ -66,6 +67,16 @@ const deleteTimer = (devId, value, callback: any = undefined) => {
|
|
|
66
67
|
})
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
/**
|
|
71
|
+
* 获取所有Timer,不区分TASK
|
|
72
|
+
* @param devId 涂鸦 设备 ID 或群组 ID
|
|
73
|
+
* @param type 0:设备,1:群组
|
|
74
|
+
* @param callback
|
|
75
|
+
*/
|
|
76
|
+
function getAllTaskTimer(devId: string, type: number = 0, callback: ((res: NativeResult<string>) => void)) {
|
|
77
|
+
devicePanel.getAllTaskTimer(devId, type, callback)
|
|
78
|
+
}
|
|
79
|
+
|
|
69
80
|
const setDp = <T>(deviceId: string, key: string, value: any) => {
|
|
70
81
|
return new Promise<NativeResult<T>>((resolve, _reject) => {
|
|
71
82
|
control(deviceId, {[key]: value}, res => {
|
|
@@ -123,6 +134,18 @@ export class NativeApi {
|
|
|
123
134
|
showObj(obj)
|
|
124
135
|
}
|
|
125
136
|
|
|
137
|
+
static getAllTaskTimer(devId: string, type: number = 0): Promise<Result<any>> {
|
|
138
|
+
return new Promise<Result<any>>((resolve, _reject) => {
|
|
139
|
+
getAllTaskTimer(devId, type, res => {
|
|
140
|
+
resolve({
|
|
141
|
+
success: res.result,
|
|
142
|
+
data: res.result ? JSON.parse(res.data || '[]') : undefined,
|
|
143
|
+
msg: res.msg,
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
|
|
126
149
|
static timerList(deviceId: string): Promise<any> {
|
|
127
150
|
return timerList(deviceId)
|
|
128
151
|
}
|