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 } function device(options: DeviceOptions): Promise }