import './custom-xhr-override';
import { IClientEventResponse } from './interfaces/IClientEventResponse';
import { IDataFetcherRecaller } from './recaller/IDataFetcherRecaller';
export declare class DataFetcher {
  private static appTagName;
  private static instance;
  private static requestListener;
  private static messageBuilder;
  private static readonly SERVICE_BROKER_STATUS;
  private ready;
  private watingRequestsById;
  private application;
  private graphqlPath;
  private static clientEventsByID;
  private static getMessage;
  static get(): DataFetcher;
  private static getGraphQLPath;
  static addRequestListener(listener: RequestListener): void;
  static removeRequestListener(listener: RequestListener): void;
  private processGraphQlErrorInfo;
  private processServiceBrokerErrorInfo;
  private isDevMode;
  callGraphQL(req: any, quietMode?: boolean): Promise<any>;
  private resolveURL;
  private proccesGraphQLClientEvents;
  private processServiceBrokerClientEvents;
  private processPrinting;
  private getContext;
  callServiceBroker(serviceName: string, payload: string | Object, options?: Options): Promise<any>;
  private addUrlParams;
  private isServiceBrokerError;
  private getReqKey;
  private getQueryTemplate;
  private pause;
  private resume;
  private executePendingRequest;
  private buildGraphQlURL;
  private fecthGraphQL;
  private isHttpError;
  private normalizeErrorResponse;
  static addClientEvent(eventID: String, handler: ClientEventHandler): void;
  static hasClientEvent(eventID: String): boolean;
  static removeClientEvent(eventID: String): boolean;
}
type ClientEventHandler = (clientEvent: IClientEventResponse, dataFetcherReacaller: IDataFetcherRecaller) => void | Promise<void>;
export interface RequestListener {
  onRequestStart(param: RequestListenerParams): void;
  onRequestEnd(param: RequestListenerParams): void;
}
export interface RequestListenerParams {
  requestId: string;
  url: string;
  requestBody?: any;
}
export interface ServiceBrokerResponse<T = Object> {
  pendingPrinting: string;
  status: number;
  responseBody?: T;
  serviceName: string;
  clientEvents?: Array<{
    id: string;
  }>;
  statusMessage?: string;
  transactionId: string;
  tsError?: {
    tsErrorCode: string;
    tsErrorLevel: "ERROR" | "WARNING";
  };
}
export interface ServiceBrokerPayload<T = Object> {
  serviceName: string;
  requestBody: {
    [key: string]: T;
  };
}
export interface Options {
  urlParams: URLParams;
}
export interface URLParams {
  [key: string]: any;
}
export {};
