From 331c0f356e209c00b039f83e32efa5beeabc0f65 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Wed, 22 Sep 2021 14:55:16 -0700 Subject: [PATCH] mqtt: better typing --- plugins/mqtt/package-lock.json | 4 ++-- plugins/mqtt/package.json | 2 +- plugins/mqtt/src/api/mqtt-client.ts | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/mqtt/package-lock.json b/plugins/mqtt/package-lock.json index 458cbd359..4d28881e6 100644 --- a/plugins/mqtt/package-lock.json +++ b/plugins/mqtt/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/mqtt", - "version": "0.0.17", + "version": "0.0.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/mqtt", - "version": "0.0.17", + "version": "0.0.18", "dependencies": { "@types/node": "^16.6.1", "aedes": "^0.46.1", diff --git a/plugins/mqtt/package.json b/plugins/mqtt/package.json index af0f20baf..2b4cb89c6 100644 --- a/plugins/mqtt/package.json +++ b/plugins/mqtt/package.json @@ -35,5 +35,5 @@ "devDependencies": { "@scrypted/sdk": "file:../../sdk" }, - "version": "0.0.17" + "version": "0.0.18" } diff --git a/plugins/mqtt/src/api/mqtt-client.ts b/plugins/mqtt/src/api/mqtt-client.ts index 6c6de1a64..6cf3386a1 100644 --- a/plugins/mqtt/src/api/mqtt-client.ts +++ b/plugins/mqtt/src/api/mqtt-client.ts @@ -1,5 +1,3 @@ -import { ScryptedInterface } from "@scrypted/sdk"; - export interface MqttEvent { buffer?: Buffer; json?: any; @@ -16,6 +14,6 @@ export interface MqttHandler { export interface MqttClient { subscribe(subscriptions: MqttSubscriptions, options?: any): void; - handle(handler?: T, ...interfaces: string[]): void; + handle(handler?: T & object, ...interfaces: string[]): void; publish(topic: string, value: any): Promise; }