node-miio 0.14.0 → 0.15.1
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/LICENSE.md +25 -0
- package/README.md +5 -6
- package/dist/lib/connect_to_device.d.ts +2 -2
- package/dist/lib/device.d.ts +36 -60
- package/dist/lib/device.js +81 -24
- package/dist/lib/device.js.map +1 -1
- package/dist/lib/device_info.d.ts +1 -1
- package/dist/lib/device_info.js.map +1 -1
- package/dist/lib/devices/air-monitor.d.ts +8 -2
- package/dist/lib/devices/air-monitor.js +6 -3
- package/dist/lib/devices/air-monitor.js.map +1 -1
- package/dist/lib/devices/air-purifier.d.ts +14 -6
- package/dist/lib/devices/air-purifier.js +7 -2
- package/dist/lib/devices/air-purifier.js.map +1 -1
- package/dist/lib/devices/capabilities/battery-level.d.ts +5 -22
- package/dist/lib/devices/capabilities/battery-level.js +6 -5
- package/dist/lib/devices/capabilities/battery-level.js.map +1 -1
- package/dist/lib/devices/capabilities/buzzer.d.ts +24 -30
- package/dist/lib/devices/capabilities/buzzer.js +32 -49
- package/dist/lib/devices/capabilities/buzzer.js.map +1 -1
- package/dist/lib/devices/capabilities/changeable-led-brightness.d.ts +13 -29
- package/dist/lib/devices/capabilities/changeable-led-brightness.js +16 -24
- package/dist/lib/devices/capabilities/changeable-led-brightness.js.map +1 -1
- package/dist/lib/devices/capabilities/colorable.d.ts +5 -21
- package/dist/lib/devices/capabilities/colorable.js +6 -6
- package/dist/lib/devices/capabilities/colorable.js.map +1 -1
- package/dist/lib/devices/capabilities/device_capability.d.ts +7 -0
- package/dist/lib/devices/capabilities/device_capability.js +10 -0
- package/dist/lib/devices/capabilities/device_capability.js.map +1 -0
- package/dist/lib/devices/capabilities/dimmable.d.ts +5 -21
- package/dist/lib/devices/capabilities/dimmable.js +6 -6
- package/dist/lib/devices/capabilities/dimmable.js.map +1 -1
- package/dist/lib/devices/capabilities/mode.d.ts +5 -21
- package/dist/lib/devices/capabilities/mode.js +6 -5
- package/dist/lib/devices/capabilities/mode.js.map +1 -1
- package/dist/lib/devices/capabilities/power.d.ts +5 -21
- package/dist/lib/devices/capabilities/power.js +6 -5
- package/dist/lib/devices/capabilities/power.js.map +1 -1
- package/dist/lib/devices/capabilities/sensor.d.ts +29 -15
- package/dist/lib/devices/capabilities/sensor.js +56 -41
- package/dist/lib/devices/capabilities/sensor.js.map +1 -1
- package/dist/lib/devices/capabilities/switchable-led.d.ts +13 -29
- package/dist/lib/devices/capabilities/switchable-led.js +18 -30
- package/dist/lib/devices/capabilities/switchable-led.js.map +1 -1
- package/dist/lib/devices/chuangmi.plug.v1.d.ts +10 -29
- package/dist/lib/devices/chuangmi.plug.v1.js +39 -31
- package/dist/lib/devices/chuangmi.plug.v1.js.map +1 -1
- package/dist/lib/devices/eyecare-lamp2.d.ts +29 -59
- package/dist/lib/devices/eyecare-lamp2.js +49 -38
- package/dist/lib/devices/eyecare-lamp2.js.map +1 -1
- package/dist/lib/devices/gateway/controllers.d.ts +60 -0
- package/dist/lib/devices/gateway/controllers.js +137 -0
- package/dist/lib/devices/gateway/controllers.js.map +1 -0
- package/dist/lib/devices/gateway/ctrl_ln1.d.ts +5 -7
- package/dist/lib/devices/gateway/ctrl_ln1.js +8 -33
- package/dist/lib/devices/gateway/ctrl_ln1.js.map +1 -1
- package/dist/lib/devices/gateway/ctrl_ln2.d.ts +5 -7
- package/dist/lib/devices/gateway/ctrl_ln2.js +8 -41
- package/dist/lib/devices/gateway/ctrl_ln2.js.map +1 -1
- package/dist/lib/devices/gateway/ctrl_neutral1.d.ts +5 -7
- package/dist/lib/devices/gateway/ctrl_neutral1.js +8 -33
- package/dist/lib/devices/gateway/ctrl_neutral1.js.map +1 -1
- package/dist/lib/devices/gateway/ctrl_neutral2.d.ts +5 -7
- package/dist/lib/devices/gateway/ctrl_neutral2.js +8 -41
- package/dist/lib/devices/gateway/ctrl_neutral2.js.map +1 -1
- package/dist/lib/devices/gateway/gateway-light.d.ts +27 -0
- package/dist/lib/devices/gateway/gateway-light.js +64 -0
- package/dist/lib/devices/gateway/gateway-light.js.map +1 -0
- package/dist/lib/devices/gateway/light-channel.d.ts +29 -7
- package/dist/lib/devices/gateway/light-channel.js +58 -8
- package/dist/lib/devices/gateway/light-channel.js.map +1 -1
- package/dist/lib/devices/gateway/plug.d.ts +10 -5
- package/dist/lib/devices/gateway/plug.js +16 -12
- package/dist/lib/devices/gateway/plug.js.map +1 -1
- package/dist/lib/devices/gateway/sensors.d.ts +37 -0
- package/dist/lib/devices/gateway/sensors.js +86 -0
- package/dist/lib/devices/gateway/sensors.js.map +1 -0
- package/dist/lib/devices/gateway/subdevice.d.ts +80 -60
- package/dist/lib/devices/gateway/subdevice.js +112 -127
- package/dist/lib/devices/gateway/subdevice.js.map +1 -1
- package/dist/lib/devices/gateway/subdevices.d.ts +6 -49
- package/dist/lib/devices/gateway/subdevices.js +27 -15
- package/dist/lib/devices/gateway/subdevices.js.map +1 -1
- package/dist/lib/devices/gateway/voltage.d.ts +8 -23
- package/dist/lib/devices/gateway/voltage.js +11 -12
- package/dist/lib/devices/gateway/voltage.js.map +1 -1
- package/dist/lib/devices/gateway.d.ts +61 -67
- package/dist/lib/devices/gateway.js +127 -111
- package/dist/lib/devices/gateway.js.map +1 -1
- package/dist/lib/devices/humidifier.d.ts +23 -10
- package/dist/lib/devices/humidifier.js +33 -36
- package/dist/lib/devices/humidifier.js.map +1 -1
- package/dist/lib/devices/philips-light-bulb.d.ts +14 -6
- package/dist/lib/devices/philips-light-bulb.js +23 -21
- package/dist/lib/devices/philips-light-bulb.js.map +1 -1
- package/dist/lib/devices/power-plug.d.ts +9 -28
- package/dist/lib/devices/power-plug.js +15 -8
- package/dist/lib/devices/power-plug.js.map +1 -1
- package/dist/lib/devices/power-strip.d.ts +11 -5
- package/dist/lib/devices/power-strip.js +17 -9
- package/dist/lib/devices/power-strip.js.map +1 -1
- package/dist/lib/devices/vacuums/dreamevacuum.d.ts +3 -24
- package/dist/lib/devices/vacuums/dreamevacuum.js +4 -5
- package/dist/lib/devices/vacuums/dreamevacuum.js.map +1 -1
- package/dist/lib/devices/vacuums/miot-vacuum.d.ts +3 -27
- package/dist/lib/devices/vacuums/miot-vacuum.js +3 -6
- package/dist/lib/devices/vacuums/miot-vacuum.js.map +1 -1
- package/dist/lib/devices/vacuums/vacuum.d.ts +6 -26
- package/dist/lib/devices/vacuums/vacuum.js +13 -8
- package/dist/lib/devices/vacuums/vacuum.js.map +1 -1
- package/dist/lib/devices/vacuums/vacuum_device.d.ts +1 -1
- package/dist/lib/devices/vacuums/vacuum_device.js +3 -3
- package/dist/lib/devices/vacuums/vacuum_device.js.map +1 -1
- package/dist/lib/devices/vacuums/vacuum_errors.d.ts +4 -3
- package/dist/lib/devices/vacuums/vacuum_errors.js +5 -7
- package/dist/lib/devices/vacuums/vacuum_errors.js.map +1 -1
- package/dist/lib/devices/vacuums/vacuum_thing.d.ts +13 -0
- package/dist/lib/devices/vacuums/vacuum_thing.js +19 -0
- package/dist/lib/devices/vacuums/vacuum_thing.js.map +1 -0
- package/dist/lib/devices/vacuums/viomivacuum.d.ts +3 -24
- package/dist/lib/devices/vacuums/viomivacuum.js +4 -5
- package/dist/lib/devices/vacuums/viomivacuum.js.map +1 -1
- package/dist/lib/devices/yeelight.color.d.ts +13 -2
- package/dist/lib/devices/yeelight.color.js +101 -3
- package/dist/lib/devices/yeelight.color.js.map +1 -1
- package/dist/lib/devices/yeelight.d.ts +36 -154
- package/dist/lib/devices/yeelight.js +36 -144
- package/dist/lib/devices/yeelight.js.map +1 -1
- package/dist/lib/devices/yeelight.mono.d.ts +13 -2
- package/dist/lib/devices/yeelight.mono.js +34 -3
- package/dist/lib/devices/yeelight.mono.js.map +1 -1
- package/dist/lib/discovery.js +2 -2
- package/dist/lib/discovery.js.map +1 -1
- package/dist/lib/events.d.ts +1 -1
- package/dist/lib/index.d.ts +0 -5
- package/dist/lib/models.d.ts +26 -239
- package/dist/lib/models.js +26 -29
- package/dist/lib/models.js.map +1 -1
- package/dist/lib/protocol.d.ts +10 -2
- package/dist/lib/things/capabilities/actions.d.ts +21 -0
- package/dist/lib/things/capabilities/actions.js +36 -0
- package/dist/lib/things/capabilities/actions.js.map +1 -0
- package/dist/lib/things/capabilities/battery-level.d.ts +13 -0
- package/dist/lib/things/capabilities/battery-level.js +26 -0
- package/dist/lib/things/capabilities/battery-level.js.map +1 -0
- package/dist/lib/things/capabilities/charging.d.ts +20 -0
- package/dist/lib/things/capabilities/charging.js +40 -0
- package/dist/lib/things/capabilities/charging.js.map +1 -0
- package/dist/lib/things/capabilities/children.d.ts +78 -0
- package/dist/lib/things/capabilities/children.js +173 -0
- package/dist/lib/things/capabilities/children.js.map +1 -0
- package/dist/lib/things/capabilities/cleaning.d.ts +40 -0
- package/dist/lib/things/capabilities/cleaning.js +85 -0
- package/dist/lib/things/capabilities/cleaning.js.map +1 -0
- package/dist/lib/things/capabilities/error-state.d.ts +15 -0
- package/dist/lib/things/capabilities/error-state.js +33 -0
- package/dist/lib/things/capabilities/error-state.js.map +1 -0
- package/dist/lib/things/capabilities/fan-speed.d.ts +36 -0
- package/dist/lib/things/capabilities/fan-speed.js +59 -0
- package/dist/lib/things/capabilities/fan-speed.js.map +1 -0
- package/dist/lib/things/capabilities/index.d.ts +14 -0
- package/dist/lib/things/capabilities/index.js +31 -0
- package/dist/lib/things/capabilities/index.js.map +1 -0
- package/dist/lib/things/capabilities/lights/brightness.d.ts +44 -0
- package/dist/lib/things/capabilities/lights/brightness.js +87 -0
- package/dist/lib/things/capabilities/lights/brightness.js.map +1 -0
- package/dist/lib/things/capabilities/lights/color-temperature.d.ts +21 -0
- package/dist/lib/things/capabilities/lights/color-temperature.js +43 -0
- package/dist/lib/things/capabilities/lights/color-temperature.js.map +1 -0
- package/dist/lib/things/capabilities/lights/colorable.d.ts +37 -0
- package/dist/lib/things/capabilities/lights/colorable.js +57 -0
- package/dist/lib/things/capabilities/lights/colorable.js.map +1 -0
- package/dist/lib/things/capabilities/lights/fading.d.ts +13 -0
- package/dist/lib/things/capabilities/lights/fading.js +23 -0
- package/dist/lib/things/capabilities/lights/fading.js.map +1 -0
- package/dist/lib/things/capabilities/lights/index.d.ts +5 -0
- package/dist/lib/things/capabilities/lights/index.js +22 -0
- package/dist/lib/things/capabilities/lights/index.js.map +1 -0
- package/dist/lib/things/capabilities/lights/light.d.ts +25 -0
- package/dist/lib/things/capabilities/lights/light.js +23 -0
- package/dist/lib/things/capabilities/lights/light.js.map +1 -0
- package/dist/lib/things/capabilities/mode.d.ts +45 -0
- package/dist/lib/things/capabilities/mode.js +75 -0
- package/dist/lib/things/capabilities/mode.js.map +1 -0
- package/dist/lib/things/capabilities/nameable.d.ts +18 -0
- package/dist/lib/things/capabilities/nameable.js +28 -0
- package/dist/lib/things/capabilities/nameable.js.map +1 -0
- package/dist/lib/things/capabilities/power.d.ts +40 -0
- package/dist/lib/things/capabilities/power.js +68 -0
- package/dist/lib/things/capabilities/power.js.map +1 -0
- package/dist/lib/things/capabilities/sensors.d.ts +91 -0
- package/dist/lib/things/capabilities/sensors.js +198 -0
- package/dist/lib/things/capabilities/sensors.js.map +1 -0
- package/dist/lib/things/capabilities/target-humidity.d.ts +36 -0
- package/dist/lib/things/capabilities/target-humidity.js +59 -0
- package/dist/lib/things/capabilities/target-humidity.js.map +1 -0
- package/dist/lib/things/capability.d.ts +24 -0
- package/dist/lib/things/capability.js +21 -0
- package/dist/lib/things/capability.js.map +1 -0
- package/dist/lib/things/color.d.ts +66 -0
- package/dist/lib/things/color.js +303 -0
- package/dist/lib/things/color.js.map +1 -0
- package/dist/lib/things/compose.d.ts +25 -0
- package/dist/lib/things/compose.js +105 -0
- package/dist/lib/things/compose.js.map +1 -0
- package/dist/lib/things/index.d.ts +14 -0
- package/dist/lib/things/index.js +39 -0
- package/dist/lib/things/index.js.map +1 -0
- package/dist/lib/things/registry.d.ts +19 -0
- package/dist/lib/things/registry.js +18 -0
- package/dist/lib/things/registry.js.map +1 -0
- package/dist/lib/things/thing.d.ts +110 -0
- package/dist/lib/things/thing.js +325 -0
- package/dist/lib/things/thing.js.map +1 -0
- package/dist/lib/things/values.d.ts +123 -0
- package/dist/lib/things/values.js +258 -0
- package/dist/lib/things/values.js.map +1 -0
- package/docs/devices/vacuum.md +1 -2
- package/package.json +4 -3
- package/snapshots/vacuum-specs.json.gz +0 -0
- package/dist/lib/devices/gateway/86sw1.d.ts +0 -7
- package/dist/lib/devices/gateway/86sw1.js +0 -20
- package/dist/lib/devices/gateway/86sw1.js.map +0 -1
- package/dist/lib/devices/gateway/86sw2.d.ts +0 -7
- package/dist/lib/devices/gateway/86sw2.js +0 -36
- package/dist/lib/devices/gateway/86sw2.js.map +0 -1
- package/dist/lib/devices/gateway/cube.d.ts +0 -6
- package/dist/lib/devices/gateway/cube.js +0 -49
- package/dist/lib/devices/gateway/cube.js.map +0 -1
- package/dist/lib/devices/gateway/light-mixin.d.ts +0 -2
- package/dist/lib/devices/gateway/light-mixin.js +0 -59
- package/dist/lib/devices/gateway/light-mixin.js.map +0 -1
- package/dist/lib/devices/gateway/magnet.d.ts +0 -6
- package/dist/lib/devices/gateway/magnet.js +0 -23
- package/dist/lib/devices/gateway/magnet.js.map +0 -1
- package/dist/lib/devices/gateway/magnet2.d.ts +0 -5
- package/dist/lib/devices/gateway/magnet2.js +0 -9
- package/dist/lib/devices/gateway/magnet2.js.map +0 -1
- package/dist/lib/devices/gateway/motion.d.ts +0 -6
- package/dist/lib/devices/gateway/motion.js +0 -21
- package/dist/lib/devices/gateway/motion.js.map +0 -1
- package/dist/lib/devices/gateway/motion2.d.ts +0 -6
- package/dist/lib/devices/gateway/motion2.js +0 -25
- package/dist/lib/devices/gateway/motion2.js.map +0 -1
- package/dist/lib/devices/gateway/sensor_ht.d.ts +0 -5
- package/dist/lib/devices/gateway/sensor_ht.js +0 -13
- package/dist/lib/devices/gateway/sensor_ht.js.map +0 -1
- package/dist/lib/devices/gateway/switch.d.ts +0 -6
- package/dist/lib/devices/gateway/switch.js +0 -24
- package/dist/lib/devices/gateway/switch.js.map +0 -1
- package/dist/lib/devices/gateway/switch2.d.ts +0 -6
- package/dist/lib/devices/gateway/switch2.js +0 -19
- package/dist/lib/devices/gateway/switch2.js.map +0 -1
- package/dist/lib/devices/gateway/weather.d.ts +0 -5
- package/dist/lib/devices/gateway/weather.js +0 -16
- package/dist/lib/devices/gateway/weather.js.map +0 -1
- package/dist/types/abstract-things/climate/index.d.ts +0 -431
- package/dist/types/abstract-things/electricals/index.d.ts +0 -5
- package/dist/types/abstract-things/index.d.ts +0 -206
- package/dist/types/abstract-things/lights/index.d.ts +0 -14
- package/dist/types/abstract-things/values/index.d.ts +0 -12
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
declare module "abstract-things" {
|
|
2
|
-
/** The instance type of a class (or of a constructor type, e.g. a mixin) */
|
|
3
|
-
type Proto<T> = T extends abstract new (...args: never[]) => infer I
|
|
4
|
-
? I
|
|
5
|
-
: T extends { prototype: infer P }
|
|
6
|
-
? P
|
|
7
|
-
: never;
|
|
8
|
-
|
|
9
|
-
export class Thing {
|
|
10
|
-
constructor(...args: unknown[]);
|
|
11
|
-
|
|
12
|
-
id: string | null;
|
|
13
|
-
metadata: Record<string, unknown> & {
|
|
14
|
-
types: string[];
|
|
15
|
-
capabilities: string[];
|
|
16
|
-
addCapabilities(...capabilities: string[]): void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
init(): Promise<undefined | this>;
|
|
20
|
-
initCallback(): Promise<void>;
|
|
21
|
-
|
|
22
|
-
destroy(): Promise<void>;
|
|
23
|
-
destroyCallback(): Promise<void>;
|
|
24
|
-
|
|
25
|
-
debug(...parts: unknown[]): void;
|
|
26
|
-
matches(...tags: string[]): boolean;
|
|
27
|
-
|
|
28
|
-
propertyUpdated(key: string, value: unknown, oldValue?: unknown): void;
|
|
29
|
-
|
|
30
|
-
emitEvent(event: string, data?: unknown, options?: unknown): void;
|
|
31
|
-
on(event: string, listener: (...args: never[]) => void): unknown;
|
|
32
|
-
off(event: string, listener: (...args: never[]) => void): unknown;
|
|
33
|
-
// on: InstanceType<typeof EventEmitter>["on"];
|
|
34
|
-
// off: InstanceType<typeof EventEmitter>["off"];
|
|
35
|
-
// onAny: InstanceType<typeof EventEmitter>["onAny"];
|
|
36
|
-
// offAny: InstanceType<typeof EventEmitter>["offAny"];
|
|
37
|
-
|
|
38
|
-
static with<
|
|
39
|
-
T1 extends { prototype: unknown },
|
|
40
|
-
constructorArgs extends unknown[],
|
|
41
|
-
>(t1: T1): new (...args: constructorArgs) => Thing & Proto<T1>;
|
|
42
|
-
|
|
43
|
-
static with<
|
|
44
|
-
T1 extends { prototype: unknown },
|
|
45
|
-
T2 extends { prototype: unknown },
|
|
46
|
-
constructorArgs extends unknown[],
|
|
47
|
-
>(
|
|
48
|
-
t1: T1,
|
|
49
|
-
t2: T2,
|
|
50
|
-
): new (...args: constructorArgs) => Thing & Proto<T1> & Proto<T2>;
|
|
51
|
-
|
|
52
|
-
static with<
|
|
53
|
-
T1 extends { prototype: unknown },
|
|
54
|
-
T2 extends { prototype: unknown },
|
|
55
|
-
T3 extends { prototype: unknown },
|
|
56
|
-
constructorArgs extends unknown[],
|
|
57
|
-
>(
|
|
58
|
-
t1: T1,
|
|
59
|
-
t2: T2,
|
|
60
|
-
t3: T3,
|
|
61
|
-
): new (
|
|
62
|
-
...args: constructorArgs
|
|
63
|
-
) => Thing & Proto<T1> & Proto<T2> & Proto<T3>;
|
|
64
|
-
|
|
65
|
-
static with<
|
|
66
|
-
T1 extends { prototype: unknown },
|
|
67
|
-
T2 extends { prototype: unknown },
|
|
68
|
-
T3 extends { prototype: unknown },
|
|
69
|
-
T4 extends { prototype: unknown },
|
|
70
|
-
constructorArgs extends unknown[],
|
|
71
|
-
>(
|
|
72
|
-
t1: T1,
|
|
73
|
-
t2: T2,
|
|
74
|
-
t3: T3,
|
|
75
|
-
t4: T4,
|
|
76
|
-
): new (
|
|
77
|
-
...args: constructorArgs
|
|
78
|
-
) => Thing & Proto<T1> & Proto<T2> & Proto<T3> & Proto<T4>;
|
|
79
|
-
|
|
80
|
-
static with<
|
|
81
|
-
T1 extends { prototype: unknown },
|
|
82
|
-
T2 extends { prototype: unknown },
|
|
83
|
-
T3 extends { prototype: unknown },
|
|
84
|
-
T4 extends { prototype: unknown },
|
|
85
|
-
T5 extends { prototype: unknown },
|
|
86
|
-
constructorArgs extends unknown[],
|
|
87
|
-
>(
|
|
88
|
-
t1: T1,
|
|
89
|
-
t2: T2,
|
|
90
|
-
t3: T3,
|
|
91
|
-
t4: T4,
|
|
92
|
-
t5: T5,
|
|
93
|
-
): new (
|
|
94
|
-
...args: constructorArgs
|
|
95
|
-
) => Thing & Proto<T1> & Proto<T2> & Proto<T3> & Proto<T4> & Proto<T5>;
|
|
96
|
-
|
|
97
|
-
static with<
|
|
98
|
-
T1 extends { prototype: unknown },
|
|
99
|
-
T2 extends { prototype: unknown },
|
|
100
|
-
T3 extends { prototype: unknown },
|
|
101
|
-
T4 extends { prototype: unknown },
|
|
102
|
-
T5 extends { prototype: unknown },
|
|
103
|
-
T6 extends { prototype: unknown },
|
|
104
|
-
constructorArgs extends unknown[],
|
|
105
|
-
>(
|
|
106
|
-
t1: T1,
|
|
107
|
-
t2: T2,
|
|
108
|
-
t3: T3,
|
|
109
|
-
t4: T4,
|
|
110
|
-
t5: T5,
|
|
111
|
-
t6: T6,
|
|
112
|
-
): new (
|
|
113
|
-
...args: constructorArgs
|
|
114
|
-
) => Thing &
|
|
115
|
-
Proto<T1> &
|
|
116
|
-
Proto<T2> &
|
|
117
|
-
Proto<T3> &
|
|
118
|
-
Proto<T4> &
|
|
119
|
-
Proto<T5> &
|
|
120
|
-
Proto<T6>;
|
|
121
|
-
|
|
122
|
-
static with<
|
|
123
|
-
T1 extends { prototype: unknown },
|
|
124
|
-
T2 extends { prototype: unknown },
|
|
125
|
-
T3 extends { prototype: unknown },
|
|
126
|
-
T4 extends { prototype: unknown },
|
|
127
|
-
T5 extends { prototype: unknown },
|
|
128
|
-
T6 extends { prototype: unknown },
|
|
129
|
-
T7 extends { prototype: unknown },
|
|
130
|
-
constructorArgs extends unknown[],
|
|
131
|
-
>(
|
|
132
|
-
t1: T1,
|
|
133
|
-
t2: T2,
|
|
134
|
-
t3: T3,
|
|
135
|
-
t4: T4,
|
|
136
|
-
t5: T5,
|
|
137
|
-
t6: T6,
|
|
138
|
-
t7: T7,
|
|
139
|
-
): new (
|
|
140
|
-
...args: constructorArgs
|
|
141
|
-
) => Thing &
|
|
142
|
-
Proto<T1> &
|
|
143
|
-
Proto<T2> &
|
|
144
|
-
Proto<T3> &
|
|
145
|
-
Proto<T4> &
|
|
146
|
-
Proto<T5> &
|
|
147
|
-
Proto<T6> &
|
|
148
|
-
Proto<T7>;
|
|
149
|
-
|
|
150
|
-
static type<U, constructorArgs extends unknown[]>(
|
|
151
|
-
func: (
|
|
152
|
-
Parent: typeof Thing,
|
|
153
|
-
) => new (...args: constructorArgs) => U & Thing,
|
|
154
|
-
): new (...args: constructorArgs) => U & Thing;
|
|
155
|
-
static mixin<U, constructorArgs extends unknown[]>(
|
|
156
|
-
func: (
|
|
157
|
-
Parent: typeof Thing,
|
|
158
|
-
) => new (...args: constructorArgs) => U & Thing,
|
|
159
|
-
): new (...args: constructorArgs) => U & Thing;
|
|
160
|
-
static mixinDynamic<U, constructorArgs extends unknown[]>(
|
|
161
|
-
func: (
|
|
162
|
-
Parent: typeof Thing,
|
|
163
|
-
) => new (...args: constructorArgs) => U & Thing,
|
|
164
|
-
): new (...args: constructorArgs) => U & Thing;
|
|
165
|
-
|
|
166
|
-
extendWith<T>(...mixins: T[]): T & Thing;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export class Polling extends Thing {
|
|
170
|
-
updatePollDuration(duration: number): void;
|
|
171
|
-
updateMaxPollFailures(failures: number): void;
|
|
172
|
-
poll(isInitial?: boolean): Promise<void>;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export class BatteryLevel extends Thing {
|
|
176
|
-
batteryLevel(): Promise<number>;
|
|
177
|
-
updateBatteryLevel(level: number): void;
|
|
178
|
-
}
|
|
179
|
-
export class ChargingState extends Thing {
|
|
180
|
-
get charging(): Promise<boolean>;
|
|
181
|
-
updateCharging(charging: boolean): void;
|
|
182
|
-
}
|
|
183
|
-
export abstract class AutonomousCharging extends Thing {
|
|
184
|
-
abstract activateCharging(): Promise<void>;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export class Children extends Thing {}
|
|
188
|
-
export class State extends Thing {
|
|
189
|
-
state(): Promise<Record<string, unknown>>;
|
|
190
|
-
getState<T>(name: string): T;
|
|
191
|
-
updateState<T>(name: string, value: T): boolean;
|
|
192
|
-
}
|
|
193
|
-
export class ErrorState extends State {
|
|
194
|
-
get error(): Promise<string | null>;
|
|
195
|
-
updateError(
|
|
196
|
-
error: { code: string; message?: string } | string | null,
|
|
197
|
-
): void;
|
|
198
|
-
}
|
|
199
|
-
export class Nameable extends Thing {}
|
|
200
|
-
export class SwitchablePower extends Thing {
|
|
201
|
-
updatePower<T>(value: T): void;
|
|
202
|
-
}
|
|
203
|
-
export class SwitchableMode extends Thing {
|
|
204
|
-
updateMode<T>(value: T): void;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare module "abstract-things/lights" {
|
|
2
|
-
import { Thing } from "abstract-things";
|
|
3
|
-
import type { Color } from "abstract-things/values";
|
|
4
|
-
export class Light extends Thing {}
|
|
5
|
-
export class Dimmable extends Thing {
|
|
6
|
-
updateBrightness(value: number): void;
|
|
7
|
-
}
|
|
8
|
-
export class Fading extends Thing {}
|
|
9
|
-
export class Colorable extends Thing {
|
|
10
|
-
updateColor(value: Color): void;
|
|
11
|
-
}
|
|
12
|
-
export class ColorTemperature extends Thing {}
|
|
13
|
-
export class ColorFull extends Thing {}
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare module "abstract-things/values" {
|
|
2
|
-
export function boolean(value: unknown): boolean;
|
|
3
|
-
export function string(value: unknown): string;
|
|
4
|
-
export const color: Color;
|
|
5
|
-
|
|
6
|
-
export interface Color {
|
|
7
|
-
is: (model: unknown) => boolean;
|
|
8
|
-
temperature: (value: unknown) => Color;
|
|
9
|
-
rgb: (red: unknown, green: unknown, blue: unknown) => Color;
|
|
10
|
-
hsv: (hue: unknown, saturation: unknown, brightness: unknown) => Color;
|
|
11
|
-
}
|
|
12
|
-
}
|