@iotize/tap
Version:
IoTize Device client for Javascript
32 lines (31 loc) • 850 B
TypeScript
export declare namespace MonitorEngine {
enum State {
START = 0,
PAUSE = 1,
STOP = 2
}
interface StartOptions {
dueTime?: number | Date;
period?: number;
}
type EventType = 'START' | 'STOP' | 'PAUSE' | 'READ_ERROR' | 'READ_SUCCESS';
interface Event<PayloadType = any> {
type: EventType;
payload: PayloadType;
}
interface VariableMonitoringUpdate<DataType> {
update(totalMs: number): Promise<DataType>;
}
}
export interface MonitorEngineInterface {
start(options?: MonitorEngine.StartOptions): this;
/**
* Stop monitoring
* It will terminates values and event streams (complete will be called on your subsriptions)
*/
stop(): this;
/**
* Pause monitoring
*/
pause(): this;
}