UNPKG

lib-comfoair

Version:

Library to communicate with Zehnder ComfoAirQ ventilation unit through the ComfoControl gateway

15 lines (14 loc) 872 B
/** * Creates a promise that resolves after a given number of milliseconds. * @param ms The number of milliseconds to wait before resolving the promise. * @returns A promise that resolves after the given number of milliseconds. */ export declare function wait(ms: number): Promise<void>; /** * Utility function to add a timeout to a promise, the promise will be rejected with an error if it does not resolve within the given time. * @param promise The promise to add a timeout to. * @param ms The number of milliseconds to wait before rejecting the promise. * @param errorMessage The error message to use when the promise times out. * @returns A promise that resolves when the given promise resolves or rejects when the given promise rejects or times out. */ export declare function timeout<T>(promise: Promise<T>, ms: number, errorMessage: string): Promise<T>;