summaryrefslogtreecommitdiff
path: root/src/@types/miio.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/@types/miio.d.ts')
-rw-r--r--src/@types/miio.d.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/@types/miio.d.ts b/src/@types/miio.d.ts
new file mode 100644
index 0000000..0e277af
--- /dev/null
+++ b/src/@types/miio.d.ts
@@ -0,0 +1,26 @@
+declare module 'miio' {
+ type PrimitiveTypes = string | number | boolean
+
+ interface DeviceOptions {
+ address: string
+ port?: number
+ token?: string
+ }
+
+ interface DeviceInfo {
+ id: number
+ token: string
+ model: string
+ }
+
+ interface DeviceHandle {
+ api: DeviceInfo
+ }
+
+ interface Device {
+ handle: DeviceHandle
+ call(method: string, arguments: PrimitiveTypes[]): Promise<PrimitiveTypes[]>
+ }
+
+ function device(options: DeviceOptions): Promise<Device>
+}