skysync-cli
Version:
SkySync Command Line Interface
15 lines (14 loc) • 895 B
TypeScript
/// <reference types="node" />
import { HttpClient, IAuthorizationToken } from './http-client';
import { Readable } from 'stream';
import { CancellationToken } from '../';
export declare type FetchApi = (url: string, request: any) => Promise<any>;
export declare class FetchHttpClient extends HttpClient<any, any> {
private fetch;
private formDataType;
constructor(fetch: FetchApi, formDataType: any, baseAddress: string, token: IAuthorizationToken, site?: string);
protected executeJsonRequest(req: any, callback: (err: any, response?: any, body?: string) => void, token?: CancellationToken): Promise<void>;
protected getStatusCode(response: any): number;
protected getHeadersValue(headers: any, key: string): string;
download(path: string, handler: (fileName: string, output: Readable) => Promise<any>, token?: CancellationToken): Promise<unknown>;
}