import { AppMode } from '@searchspring/snap-toolbox'; import { NetworkCache } from '../NetworkCache/NetworkCache'; import { CacheConfig, HTTPHeaders, GenericGlobals } from '../../types'; export type Json = any; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery; }; export type HTTPBody = Json | FormData | URLSearchParams; export interface RequestOpts { path: string; method: HTTPMethod; headers: HTTPHeaders; query?: HTTPQuery; body?: HTTPBody; subDomain?: string; } export declare class API { configuration: ApiConfiguration; private retryDelay; private retryCount; cache: NetworkCache; constructor(configuration: ApiConfiguration); protected get mode(): AppMode; protected request(context: RequestOpts, cacheKey?: string): Promise; private createFetchParams; private fetchApi; } export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; export interface ApiConfigurationParameters { mode?: keyof typeof AppMode | AppMode; origin?: string; fetchApi?: FetchAPI; queryParamsStringify?: (params: HTTPQuery) => string; headers?: HTTPHeaders; maxRetry?: number; cache?: CacheConfig; globals?: GenericGlobals; initiator?: string; } export declare class ApiConfiguration { private config; constructor(config?: ApiConfigurationParameters); get cache(): CacheConfig; get maxRetry(): number; get origin(): string; get fetchApi(): FetchAPI; get queryParamsStringify(): (params: HTTPQuery) => string; get headers(): HTTPHeaders; set headers(newHeaders: HTTPHeaders); get globals(): GenericGlobals; set globals(newGlobals: GenericGlobals); get mode(): AppMode; get initiator(): string; } export declare function querystring(params: HTTPQuery, prefix?: string): string; //# sourceMappingURL=Abstract.d.ts.map