import { ComProtocol, ConnectionStateChangeEvent } from "../../protocol/api";
import { Observable } from 'rxjs';
import { Command } from "../../client/api/request";
import { Response } from "../../client/api/response";
import { BodyDecoder } from "./converter";
import { RequestInterceptorType } from "../impl/interceptors";
import { Decoder, Encoder } from "../../core/converter";
export interface ProtocolChangeEvent {
    newProtocol: ComProtocol;
    oldProtocol?: ComProtocol;
}
export interface IoTizeClient {
    commandEncoder: Encoder<Command, Uint8Array>;
    responseDecoder: Decoder<Uint8Array, Response<any>>;
    getCurrentProtocol(): ComProtocol;
    addComProtocol(newProtocol: ComProtocol, id: string): this;
    switchProtocol(type: string): this;
    useComProtocol(protocol: ComProtocol | string): this;
    connect(): Observable<any>;
    disconnect(): Observable<any>;
    command<T>(request: Command, bodyDecoder?: BodyDecoder<T>): Observable<Response<T>>;
    onConnectionStateChange(): Observable<ConnectionStateChangeEvent>;
    isConnected(): boolean;
    send<T>(dataIn: Uint8Array, bodyDecoder?: BodyDecoder<T>): Observable<Response<T>>;
    addInterceptor(interceptor: RequestInterceptorType): this;
}
