@expo/xdl
Version:
The Expo Development Library
21 lines (20 loc) • 1.08 kB
TypeScript
import { AxiosRequestConfig, Canceler } from 'axios';
import FormData from 'form-data';
declare type HttpMethod = 'get' | 'post' | 'put' | 'delete';
declare type RequestOptions = AxiosRequestConfig & {
formData?: FormData;
};
declare type ProgressCallback = (progressPercentage: number) => void;
declare type RetryCallback = (cancel: Canceler) => void;
/** @deprecated use ApiV2, got or GraphQL depending on use case. */
export default class ApiClient {
static host: string;
static port: number;
static setClientName(name: string): void;
static callMethodAsync(methodName: string, args: any, method?: HttpMethod, requestBody?: any, requestOptions?: RequestOptions, returnEntireResponse?: boolean): Promise<any>;
static callPathAsync(path: string, method?: HttpMethod, requestBody?: any, requestOptions?: RequestOptions): Promise<any>;
static downloadAsync(url: string, outputPath: string, { extract }?: {
extract?: boolean | undefined;
}, progressFunction?: ProgressCallback, retryFunction?: RetryCallback): Promise<void>;
}
export {};