import { ApiRequest as CommandInterface, DefaultCommandDecoder, DefaultResponseEncoder, Response } from '@iotize/device-client.js/client/impl';
import { ComProtocolConnectOptions, ComProtocolDisconnectOptions, ConnectionState } from '@iotize/device-client.js/protocol/api';
import { QueueComProtocol } from '@iotize/device-client.js/protocol/core';
import { Observable } from 'rxjs';
import { FilterFunction, Predicate, ResponseAdapter, ResponseAdapterFunction, RouteType } from './definitions';
import { Router } from './util';
export interface MockCallback {
    afterWrite(data: any): void;
    beforeWrite(message: any): void;
    afterRead(result: any): void;
    beforeRead(): void;
}
export interface RouteMapping {
    [key: string]: RouteType;
}
/**
 *
 * <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;
    get 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: RouteMapping): MockProtocol;
}
