import { Observable } from 'rxjs';
import { Tap } from '../device/iotize-device';
export declare const DEFAULT_KEEP_ALIVE_PERIOD_MS = 5000;
export declare type KeepAliveEvent = KeepAliveEventError | KeepAliveEventTick | KeepAliveEventScheduleTick | {
    type: 'start';
} | {
    type: 'stop';
};
interface KeepAliveEventError {
    type: 'error';
    error: Error;
}
interface KeepAliveEventTick {
    type: 'tick';
}
interface KeepAliveEventScheduleTick {
    type: 'rescheduleKeepAlive';
    timeout: number;
}
export interface KeepAliveOptions {
    period: number;
}
declare module '../device/iotize-device' {
    interface IoTizeDevice {
        _keepAliveTask?: KeepAliveEngine;
        keepAlive: KeepAliveEngine;
        setupKeepAliveFromConfig(): Promise<void>;
    }
}
export declare class KeepAliveEngine {
    private tap;
    options: KeepAliveOptions;
    private timeoutId?;
    private _lastResponseTime;
    private _isStopped;
    readonly events: Observable<KeepAliveEvent>;
    private _events;
    constructor(tap: Tap, options: KeepAliveOptions);
    readonly running: boolean;
    start(): void;
    stop(): void;
    private _setupNextTimeout;
}
export {};
