@ngreatorex/homie-device
Version:
Homie Device for NodeJS
34 lines • 1.48 kB
TypeScript
/// <reference types="node" />
import { EventEmitter } from "events";
import { IClientPublishOptions } from "mqtt";
import * as winston from "winston";
export declare type PermittedAttributeValues = number | boolean | string | undefined | null;
export default abstract class HomieTopologyBase extends EventEmitter {
get name(): string;
get friendlyName(): string;
set friendlyName(value: string);
get isConnected(): boolean;
protected readonly logger: winston.Logger;
private name$;
private friendlyName$;
private isConnected$;
constructor(name: string, friendlyName: string);
publish: (path: string, value: string, options: IClientPublishOptions | boolean | null | undefined) => void;
subscribe: (path: string) => void;
onConnect(): void;
onDisconnect(): void;
onOffline(): void;
onError(err: Error): void;
onStatsInterval(): void;
protected abstract rawPublish(path: string, value: string, options: IClientPublishOptions | null | undefined): void;
protected publishAttribute: (name: string, value: string) => void;
protected publishAttributes: (attributes: {
[key: string]: PermittedAttributeValues;
}) => void;
protected publishProperty: (name: string, value: string) => void;
protected publishStats: (stats: {
[key: string]: PermittedAttributeValues;
}) => void;
protected abstract rawSubscribe(path: string): void;
}
//# sourceMappingURL=HomieTopologyBase.d.ts.map