///
import { Span } from '@sentry/tracing';
import { PromiseReadable } from 'promise-readable';
import { Field } from "../fields";
import { responseTransform } from "./response";
import { MessageType, Response } from "./types";
declare type Options = {
transactionId?: number;
type: T;
args: Field[];
};
declare type ResponseType = T extends Response ? T : never;
declare type Data = ReturnType]>;
/**
* Representation of a set of fields sequenced into a known message format.
*/
export declare class Message {
/**
* Read a single mesasge via a readable stream
*/
static fromStream(stream: PromiseReadable, expect: T, span: Span): Promise>;
/**
* The transaction ID is used to associate responses to their requests.
*/
transactionId?: number;
readonly type: T;
readonly args: Field[];
constructor({ transactionId, type, args }: Options);
/**
* The byte serialization of the message
*/
get buffer(): Buffer;
/**
* The JS representation of the message.
*
* Currently only supports representing response messages.
*/
get data(): Data;
}
export {};