import { Logger } from '@nu-art/ts-common'; import { HttpMethod, TypedApi } from './types.js'; import { HttpException, TS_Progress } from './request-types.js'; import { ApiErrorResponse } from '@nu-art/ts-common/core/exceptions/types'; export declare abstract class BaseHttpRequest> { key: string; requestData: any; protected origin?: string; protected headers: { [s: string]: string[]; }; protected method: HttpMethod; protected timeout: number; protected body: API['B']; protected url: string; protected params: { [K in keyof API['P']]?: API['P'][K]; }; protected responseType: string; protected label: string; protected onProgressListener: (ev: TS_Progress) => void; protected aborted: boolean; protected compress: boolean; protected logger?: Logger; private onCompleted?; private onError?; constructor(requestKey: string, requestData?: any); resolveTypedException(exception: HttpException | unknown): API['E'] | undefined; setLogger(logger?: Logger): this; getRequestData(): any; setOrigin(origin?: string): this; setOnProgressListener(onProgressListener: (ev: TS_Progress) => void): this; setLabel(label: string): this; setMethod(method: HttpMethod): this; setResponseType(responseType: string): this; setUrlParams(params: API['P']): this; setUrlParam(key: K, value: API['P'][K]): this; setUrl(url: string): this; getUrl(): string; setRelativeUrl(relativeUrl: string): this; setTimeout(timeout: number): this; setHeaders(headers: { [s: string]: string | string[]; }): this; addHeaders(headers: { [s: string]: string | string[]; }): this; setHeader(_key: string, value: string | string[]): this; addHeader(_key: string, value: string | string[]): this; removeHeader(key: string): this; protected _addHeaderImpl(key: string, value: string | string[]): this; protected prepareJsonBody(bodyObject: API['B']): any; setBodyAsJson(bodyObject: API['B'], compress?: boolean): this; setBody(bodyAsString: any, _compress?: boolean): this; isValidStatus(statusCode: number): boolean; protected print(): void; executeSync(print?: boolean): Promise; execute(onSuccess?: (response: API['R'], data?: string) => Promise | void, onError?: (reason: HttpException) => any): this; clearOnCompleted: () => void; setOnCompleted: (onCompleted?: (response: API["R"], input: API["P"] | API["B"], request: BaseHttpRequest) => Promise) => this; setOnError(onError?: (errorResponse: HttpException, input: API['P'] | API['B'], request: BaseHttpRequest) => Promise): this; protected abstract getResponse(): API['R']; abstract getErrorResponse(): ApiErrorResponse; protected abstract abortImpl(): void; abstract getStatus(): number; getResponseHeader(headerKey: string): string | string[] | undefined; abstract _getResponseHeader(headerKey: string): string | string[] | undefined; abort(): void; protected abstract executeImpl(): Promise; }