import { BehaviorSubject, Observable } from 'rxjs';
import { IMotionMasterMessage } from './types';
export interface MotionMasterReqResSocket {
    /**
     * Emits a boolean value when socket gets opened or closed.
     */
    readonly opened$: BehaviorSubject<boolean>;
    /**
     * Emits close events with code and reason data.
     * @link https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event
     */
    readonly close$: Observable<{
        code: number;
        reason: string;
    }>;
    /**
     * Motion Master is considered alive when it sends messages in regular time interval.
     */
    readonly alive$: BehaviorSubject<boolean>;
    /**
     * Decoded message instances coming from Motion Master.
     */
    readonly message$: Observable<IMotionMasterMessage>;
    /**
     * URL set in call to open.
     */
    get url(): string | undefined;
    /**
     * Send ping system messages to Motion Master with a fixed time delay between each call.
     */
    get pingSystemInterval(): number | undefined;
    /**
     * How long in milliseconds to consider Motion Master alive.
     */
    get systemAliveTimeout(): number | undefined;
    /**
     * Open socket.
     *
     * The connected$ and eventually alive$ observables will emit true values.
     */
    open(url: string, pingSystemInterval?: number, systemAliveTimeout?: number): void;
    /**
     * Close socket.
     *
     * The opened$ and alive$ observables will emit false values.
     */
    close(): void;
    /**
     * Reopen socket.
     *
     * Reopen if closed using the same url, pingSystemInterval, and systemAliveTimeout previously set in open.
     */
    reopen(): void;
    /**
     * Send an instance of a message.
     *
     * Subscribe to the message$ observable in order to receive the response messages.
     */
    send(message: IMotionMasterMessage): void;
}
