import stream, { Readable } from 'node:stream';
type Deserialize = (data: Buffer) => {
    contentType?: string;
    data: unknown;
} | unknown;
export declare const contentTypes: Map<string, {
    serialize?: unknown;
    deserialize?: Deserialize;
    serializeStream?: unknown;
    compressible?: boolean;
    q?: number;
}>;
export declare function registerContentHandlers(app: any): void;
/**
 * This is returns the best serializer for the request's Accept header (content negotiation)
 * @param incomingMessage
 * @returns {{serializer, type: string, parameters: {q: number}}|{serializer(): void}}
 */
export declare function findBestSerializer(incomingMessage: any): {
    serializer: any;
    type: any;
    parameters: any;
};
/**
 * Serialize a response
 * @param responseData
 * @param request
 * @param responseObject
 * @returns {Uint8Array|*}
 */
export declare function serialize(responseData: any, request: any, responseObject: any): any;
/**
 * Serialize a message, may be use multiple times (like with WebSockets)
 * @param message
 * @param request
 * @returns {*}
 */
export declare function serializeMessage(message: any, request?: Request, inAsyncContinuation?: boolean): Buffer | string | Promise<Buffer | string>;
/**
 * This can be called during serialization indicating that an object requires asynchronous serialization (or async completion of a task prior to serialization) to be properly serialized.
 * A promise for when the object is ready to be serialized. Typically serialization will be re-executed and this object should be ready to be synchronously serialized
 * @param promiseToSerialize
 */
export declare function asyncSerialization(promiseToSerialize: Promise<any>): void;
export declare function hasAsyncSerialization(): boolean;
/**
 * Given a content-type header string, get a deserializer function that can be used to parse the body.
 */
export declare function getDeserializer(contentTypeString: string, streaming: false): Deserialize;
export declare function getDeserializer(contentTypeString: string, streaming: true): (stream: Readable) => Promise<ReturnType<Deserialize>>;
/**
 * Converts JS objects/arrays/iterators to a CSV stream. Should support iterators with full backpressure handling
 * @param data
 * @returns stream
 */
export declare function toCsvStream(data: any, columns: any): stream.Transform;
export {};
