UNPKG

matterbridge-dyson-robot

Version:

A Matterbridge plugin that connects Dyson robot vacuums and air treatment devices to the Matter smart home ecosystem via their local or cloud MQTT APIs.

24 lines 1.94 kB
import EventEmitter from 'events'; import { AnsiLogger } from 'matterbridge/logger'; import { MaybePromise } from 'matterbridge/matter'; import { IErrorDetail } from 'ts-interface-checker'; export declare const MS = 1000; export type Constructor<T = object> = new (...args: any[]) => T; export type AbstractConstructor<T = object> = abstract new (...args: any[]) => T; export type UnionToIntersection<U> = (U extends unknown ? (x: U) => unknown : never) extends (x: infer I) => unknown ? I : never; export declare function assertIsDefined<Type>(value: Type): asserts value is NonNullable<Type>; export declare function assertIsNotUndefined<Type>(value: Type): asserts value is Exclude<Type, undefined>; export declare function assertIsBoolean(value: unknown): asserts value is boolean; export declare function assertIsNumber(value: unknown): asserts value is number; export declare function assertIsInstanceOf<Type extends object>(value: unknown, type: Constructor<Type>): asserts value is Type; export declare function logError(log: AnsiLogger, when: string, err: unknown): void; export declare function formatMilliseconds(ms: number, maxParts?: number): string; export declare function formatSeconds(seconds: number, maxParts?: number): string; export declare function formatDateISO8601(date: Date, separator: '' | '-'): string; export declare function formatList(items: string[]): string; export declare function plural(count: number, noun: string | [string, string], showCount?: boolean): string; export declare function columns(rows: string[][], separator?: string): string[]; export declare function deepMerge(...objects: object[]): object; export declare function getValidationTree(errors: IErrorDetail[]): string[]; export declare function tryListener<T extends unknown[]>(emitter: EventEmitter, op: (...args: T) => MaybePromise, errorHandler?: (err: unknown) => void): (...args: T) => void; //# sourceMappingURL=utils.d.ts.map