import { JSONObject } from "kuzzle-sdk"; import { Deprecation } from "../../types"; import { KuzzleError } from "../../kerror/errors/kuzzleError"; export declare class Headers { headers: JSONObject; private namesMap; private proxy; constructor(); /** * Gets a header value * * @param name Header name. Could be a string (case-insensitive) or a symbol */ getHeader(name: any): string | void; removeHeader(name: string): boolean; setHeader(name: string, value: string): boolean; } /** * Kuzzle normalized API response */ export declare class RequestResponse { /** * If sets to true, "result" content will not be wrapped in a Kuzzle response */ raw: boolean; constructor(request: any); /** * Get the parent request deprecations */ get deprecations(): Array | void; /** * Set the parent request deprecations * @param {Object[]} deprecations */ set deprecations(deprecations: Array | void); /** * Get the parent request status * @returns {number} */ get status(): number; set status(s: number); /** * Request error */ get error(): KuzzleError | null; set error(e: KuzzleError | null); /** * Request external ID */ get requestId(): string | null; /** * API controller name */ get controller(): string | null; /** * API action name */ get action(): string | null; /** * Collection name */ get collection(): string | null; /** * Index name */ get index(): string | null; /** * Volatile object */ get volatile(): JSONObject | null; /** * Response headers */ get headers(): JSONObject; /** * Request result */ get result(): any; set result(r: any); /** * Node identifier */ get node(): string; /** * Configure the response * * @param [options] * @param [options.headers] - Additional protocol headers * @param [options.status=200] - HTTP status code * @param [options.format] - Response format, standard or raw * * @returns void */ configure(options?: { headers?: JSONObject; status?: number; format?: "standard" | "raw"; }): void; /** * Gets a header value (case-insensitive) */ getHeader(name: string): string | null; /** * Deletes a header (case-insensitive) */ removeHeader(name: string): any; /** * Sets a new array. Behaves the same as Node.js' HTTP response.setHeader * method (@see https://nodejs.org/api/http.html#http_response_setheader_name_value) */ setHeader(name: string, value: string): any; /** * Adds new multiple headers. */ setHeaders(headers: JSONObject, ifNotPresent?: boolean): void; /** * Serializes the response. */ toJSON(): JSONObject; }