import { BodyDecoder, TapRequestFrame, TapResponseFrame } from '@iotize/tap/client/api';
import { ResponseInterface } from './response-interface';
export declare class TapResponse<DataType> implements ResponseInterface<DataType> {
    private _tapResponse;
    request?: TapRequestFrame | undefined;
    private bodyDecoder?;
    /**
     *
     */
    private _bodyCache?;
    private error?;
    static SUCCESS(data?: Uint8Array): TapResponse<any>;
    static ERROR(errorCode?: number): TapResponse<any>;
    static create(codeRet: number, data?: Uint8Array): TapResponse<any>;
    private get data();
    constructor(_tapResponse: TapResponseFrame, request?: TapRequestFrame | undefined, bodyDecoder?: BodyDecoder<DataType> | undefined);
    body<T = DataType>(decoder?: BodyDecoder<T>): T;
    rawBody(): Uint8Array;
    setBodyDecoder(decoder: BodyDecoder<DataType> | undefined): this;
    hasBody(): boolean;
    codeRet(): number;
    get status(): number;
    toString(): string;
    toBytes(): Uint8Array;
    setBody(body: DataType | undefined): void;
    isSuccessful(): boolean;
    setError(err: Error): Error;
    successful(): void;
    setRequest(request: TapRequestFrame): void;
}
export { TapResponse as ServiceResponse };
