import { IHeader, IQueryParameter } from '@kentico/kontent-core'; import { IDeliveryClientConfig } from '../../config'; import { IDeliveryNetworkResponse, IKontentResponse, IQueryConfig } from '../../models'; import { QueryService } from '../../services'; export declare abstract class BaseQuery { protected config: IDeliveryClientConfig; protected queryService: QueryService; protected parameters: IQueryParameter[]; protected customUrl?: string; protected abstract _queryConfig: TQueryConfig; constructor(config: IDeliveryClientConfig, queryService: QueryService); /** * Gets URL of the query */ abstract getUrl(): string; /** * Gets promise for query execution */ abstract toPromise(): Promise>; /** * Maps json data to response */ abstract map(json: any): TResponse; /** * Adds custom parameter to query * @param name Name of parameter * @param value Value of parameter */ withCustomParameter(name: string, value: string): this; /** * Adds parameter to query * @param name Name of parameter * @param value Value of parameter */ withParameter(parameter: IQueryParameter): this; /** * Adds parameters to query * @param parameters Array of parameters */ withParameters(parameters: IQueryParameter[]): this; /** * Gets headers used by this query */ getHeaders(): IHeader[]; /** * Sets request headers */ withHeaders(headers: IHeader[]): this; /** * Sets request header */ withHeader(header: IHeader): this; /** * Sets custom URL of request (overrides default URL of the query) */ withCustomUrl(url: string): this; /** * Gets all query parameter currently applied to query */ getParameters(): IQueryParameter[]; /** * Used to configure query * @param queryConfig Query configuration */ queryConfig(queryConfig: TQueryConfig): this; protected resolveUrlInternal(action: string): string; protected processDefaultLanguageParameter(): void; }