import { ComProtocolConnectOptions, ComProtocolDisconnectOptions, ConnectionState } from '@iotize/tap/protocol/api';
import { QueueComProtocol } from '@iotize/tap/protocol/core';
import { Observable, Subject } from 'rxjs';
import { RouteType } from './definitions';
import { MockRouter } from './mock-router';
export interface MockCallback {
    afterWrite(data: any): void;
    beforeWrite(message: any): void;
    afterRead(result: any): void;
    beforeRead(): void;
}
export interface RouteMapping {
    [key: string]: RouteType;
}
export declare function createMockProtocol(): MockProtocol;
export declare namespace MockProtocol {
    interface Callback {
        afterRead(result: Observable<Uint8Array>): void;
        beforeRead(): void;
        afterWrite(request: Uint8Array): void;
        beforeWrite(request: Uint8Array): 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: MockRouter;
    callback?: MockProtocol.Callback;
    mockOptions: {
        connect: {
            delay: number;
        };
        disconnect: {
            delay: number;
        };
        write: {
            delay: number;
        };
    };
    input: Subject<Uint8Array>;
    output: Subject<Uint8Array>;
    private lastReceivedData?;
    private lastTranseiveData?;
    constructor();
    static MIRROR(): MockProtocol;
    setConnectionState(connectionState: ConnectionState): this;
    setConnectDelay(connectDelay: number): this;
    getDisconnectDelay(): number;
    setDisconnectDelay(disconnectDelay: number): this;
    setOutputData(inputData: Uint8Array): void;
    setInputData(outputData: Uint8Array): void;
    setCallback(callback: MockProtocol.Callback): void;
    _connect(options?: ComProtocolConnectOptions): Observable<any>;
    _disconnect(options?: ComProtocolDisconnectOptions): Observable<any>;
    write(request: Uint8Array): Promise<any>;
    read(): Promise<Uint8Array>;
}
