import * as stream from 'stream';
import { type Response } from 'express';
import { type AxiosError, type AxiosResponse } from 'axios';
import { type AppContext } from '@gravity-ui/nodekit';
import { UIBatchError } from '../../shared/utils/error';
import { type YTError } from '../../@types/types';
export declare function isProductionEnv(): boolean;
export declare function isLocalModeByEnvironment(): boolean;
export declare function getInterfaceVersion(): any;
export declare function prepareErrorToSend(e: unknown): YTError | Record<string, any>;
export declare function sendResponse(res: Response, data: object): Response<any, Record<string, any>>;
export declare function sendError(res: Response, error: unknown, errCode?: number): Response<any, Record<string, any>>;
export declare const UNEXPECTED_PIPE_AXIOS_RESPONSE = "Unexpected behavior: response.data should be an instance of stream.Readable";
export declare const UNEXPECTED_PIPE_AXIOS_ERROR = "Unexpected behavior: e.response.data should be an instance of stream.Readable";
export declare function pipeAxiosErrorOrFalse(ctx: AppContext, dst: Response, e: AxiosError): Promise<PipedResponseSize | undefined>;
interface PipedResponseSize {
    headerContentLength?: string;
    pipedDataSize: number;
}
export type ReadableStreamTyped<T> = stream.Readable & {
    __data: T;
};
export declare function pipeAxiosResponseTyped<ResponseDataT>(ctx: AppContext, dst: Response<ResponseDataT>, src: AxiosResponse<ReadableStreamTyped<NoInfer<ResponseDataT>>>, logMsgPrefix?: string, transformHeaders?: <T>(headers: T) => T): Promise<PipedResponseSize | undefined>;
/**
 * pipeAxiosResponse is a helper function to forward stream-content to the browser
 *
 * `ResponseDataT` just allows to declare response type, it affects nothing,
 * but allows link highlight connection between modules from src/ui and src/server
 */
export declare function pipeAxiosResponse<ResponseDataT>(ctx: AppContext, dst: Response<ResponseDataT>, src?: AxiosResponse<stream.Readable | unknown>, logMsgPrefix?: string, transformHeaders?: (headers: any) => typeof headers): Promise<PipedResponseSize | undefined>;
export declare function pipeResponse(logMsgPrefix: string, ctx: AppContext, dst: Response, data: stream.Readable, headers?: any, status?: number, transformHeaders?: (headers: any) => typeof headers): Promise<{
    headerContentLength: any;
    pipedDataSize: number;
}>;
export declare function pipeReadableToWriteable(ctx: AppContext, dst: stream.Writable, src: stream.Readable, logMsgPrefix: string): Promise<number>;
export declare function sendAndLogError(ctx: AppContext, res: Response, status: number | null, e: Error | AxiosError | unknown, extra?: any): Promise<Response<any, Record<string, any>> | undefined>;
export declare const makeAuthClusterCookieName: (ytAuthCluster: string) => string;
export declare class ErrorWithCode extends UIBatchError {
    httpStatusCode: number;
    constructor(httpStatusCode: number, error: string | YTError<{
        attributes?: object;
    }>);
}
export {};
