///
///
import { CppConnection } from './binding.js';
import { TypedEmitter } from './utils/TypedEmitter.js';
/**
* @internal
*/
export declare enum HttpServiceType {
Management = "MGMT",
Views = "VIEW",
Query = "QUERY",
Search = "SEARCH",
Analytics = "ANALYTICS",
Eventing = "EVENTING"
}
/**
* @internal
*/
export declare enum HttpMethod {
Get = "GET",
Post = "POST",
Put = "PUT",
Delete = "DELETE"
}
/**
* @internal
*/
export interface HttpRequestOptions {
type: HttpServiceType;
method: HttpMethod;
path: string;
contentType?: string;
body?: string | Buffer;
timeout: number;
}
/**
* @internal
*/
export interface HttpResponse {
requestOptions: HttpRequestOptions;
statusCode: number;
headers: {
[key: string]: string;
};
body: Buffer;
}
/**
* @internal
*/
export declare class HttpExecutor {
private _conn;
/**
* @internal
*/
constructor(conn: CppConnection);
/**
* @internal
*/
streamRequest(options: HttpRequestOptions): TypedEmitter<{
meta: (metadata: {
statusCode: number;
headers: Record;
}) => void;
data: (data: Buffer) => void;
error: (err: Error) => void;
end: () => void;
}>;
request(options: HttpRequestOptions): Promise;
}