import { QueueComProtocol } from "../queue-com-protocol";
import { Router } from "./util";
import { DefaultResponseEncoder } from "../../../client/impl/converter/response-encoder";
import { DefaultCommandDecoder } from "../../../client/impl/converter/default-command-decoder";
import { Response } from "../../../client/impl/response/response";
import { ConnectionState, ComProtocolDisconnectOptions, ComProtocolConnectOptions } from "../../api";
import { Observable } from "rxjs";
import { Command as CommandInterface } from "../../../client/api/request/command";
import { Predicate, FilterFunction, ResponseAdapterFunction, ResponseAdapter, RouteType } from "./definitions";
export interface MockCallback {
    afterWrite(data: any): void;
    beforeWrite(message: any): void;
    afterRead(result: any): void;
    beforeRead(): void;
}
/**
 *
 * <p>
 * This is a mock com protocol for testing only
 * <p>
 * We can simulate iotize response according to the request message
 */
export declare class MockProtocol extends QueueComProtocol {
    _router: Router;
    responseEncoder: DefaultResponseEncoder;
    commandDecoder: DefaultCommandDecoder;
    outputData: Uint8Array;
    inputData: Uint8Array;
    callback: any;
    mockOptions: {
        connect: {
            delay: number;
        };
        disconnect: {
            delay: number;
        };
        write: {
            delay: number;
        };
    };
    constructor();
    static MIRROR(): MockProtocol;
    readonly router: Router;
    setConnectionState(connectionState: ConnectionState): this;
    setConnectDelay(connectDelay: number): this;
    getDisconnectDelay(): number;
    setDisconnectDelay(disconnectDelay: number): this;
    private hasNewData;
    setInputData(inputData: Uint8Array): void;
    setOutputData(outputData: Uint8Array): void;
    setCallback(callback: any): void;
    _connect(options?: ComProtocolConnectOptions): Observable<any>;
    _disconnect(options?: ComProtocolDisconnectOptions): Observable<any>;
    write(message: Uint8Array): Promise<any>;
    read(): Promise<any>;
    /**
     * @deprecated in favor of {@link #addRoute}
     */
    mapResponse<T>(left: FilterFunction<CommandInterface> | Predicate<CommandInterface> | CommandInterface, right: ResponseAdapterFunction<T> | ResponseAdapter<T> | Response<T> | Uint8Array): this;
    addRoute<T>(left: FilterFunction<CommandInterface> | Predicate<CommandInterface> | CommandInterface, right: ResponseAdapterFunction<T> | ResponseAdapter<T> | Response<T> | Uint8Array): this;
    /**
     * Create a new instance from roote mapping
     */
    static createFromRoutes(map: {
        [key: string]: RouteType;
    }): MockProtocol;
}
