import { Page } from "@smallstack/api-shared"; import { StringProvider } from "@smallstack/utils"; import { AxiosInstance, AxiosRequestConfig } from "axios"; import { Configuration } from "./generated"; export interface ApiClientConfiguration { apiUrl: string; tenantId?: StringProvider; authTenantId?: StringProvider; resellerId?: StringProvider; token?: StringProvider; axiosConfig?: AxiosRequestConfig; axiosInstance?: AxiosInstance; } export declare class AxiosApiClient { apiClientConfiguration: ApiClientConfiguration; constructor(apiClientConfiguration: ApiClientConfiguration); /** * Loads all pages of an endpoint. Please provide a function that returns a @smallstack/core-common/Page */ static loadAllPages(apiCallFn: (page: number) => Promise>): Promise; /** * Returns a new AxiosApiClient with an overwritten token. All other configuration options stay the same * @param token a jwt, access or service token */ withToken(token: string): AxiosApiClient; /** Returns a new AxiosApiClient with an extended configuration. */ withConfiguration(extendedConfiguration: Partial): AxiosApiClient; /** Returns a new AxiosApiClient with an extended configuration based on a models meta data. */ withConfigFromMeta(model: { _meta?: { tenantId?: string; resellerId?: string; }; }): AxiosApiClient; get(Api: new (configuration: Configuration, basePath: string, axiosInstance: AxiosInstance) => T, axiosInstance?: AxiosInstance): T; }