import { Decoder, Encoder } from '@iotize/common/converter/api';
import { ComProtocol, ConnectionStateChangeEvent } from '@iotize/tap/protocol/api';
import { Observable } from 'rxjs';
import { RequestInterceptorType } from './definitions';
import { TapRequestFrame, TapResponseFrame } from './generated/models';
export interface ProtocolChangeEvent {
    newProtocol: ComProtocol;
    oldProtocol?: ComProtocol;
}
export interface TapClientInterface {
    commandEncoder: Encoder<TapRequestFrame, Uint8Array>;
    responseDecoder: Decoder<Uint8Array, TapResponseFrame>;
    /**
     * Get current protocol
     * @throw an error if no protocol
     */
    getCurrentProtocol(): ComProtocol;
    addComProtocol(newProtocol: ComProtocol, id: string): this;
    switchProtocol(type: string): this;
    useComProtocol(protocol: ComProtocol | string): this;
    connect(): Observable<any>;
    disconnect(): Observable<any>;
    request<T>(request: TapRequestFrame): Observable<TapResponseFrame>;
    onConnectionStateChange(): Observable<ConnectionStateChangeEvent>;
    isConnected(): boolean;
    send<T>(dataIn: Uint8Array): Observable<TapResponseFrame>;
    addInterceptor(interceptor: RequestInterceptorType): this;
}
