/// <reference types="node" />
import { AxiosRequestConfig } from "axios";
import * as FormData from 'form-data';
import { Stream } from "stream";
/**
 * `http`/`get`
 */
export declare function get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
/**
 * `http`/`post`
 */
export declare function post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
/**
 * `http`/`post`/`json`
 */
export declare function postJson<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
/**
 * `http`/`post`/`form`
 */
export declare function postForm<T = any>(url: string, formdata?: any, data?: any, config?: AxiosRequestConfig): Promise<T>;
/**
 * 上传文件?
 */
export declare function postFile<T = any>(url: string, data: FormData, config?: AxiosRequestConfig): Promise<T>;
/**
 * 下载文件
 *
 * ```
 * import { downloadFile } from "refs/nslib";
 *
 * let buf = await downloadFile('https://image-cn.keytop.cn/452/172.19.2.6/2022/08/25/20220825143509132_172.19.2.6_024231.jpg');
 * ```
 * @throws {@link Error}
 */
export declare function downloadFile(url: string, config?: AxiosRequestConfig): Promise<Buffer>;
/**
 * 下载文件
 *
 * ```
 * import { downloadFileStream } from "refs/nslib";
 *
 * let stream = await downloadFileStream('https://image-cn.keytop.cn/452/172.19.2.6/2022/08/25/20220825143509132_172.19.2.6_024231.jpg');
 * ```
 * @throws {@link Error}
 */
export declare function downloadFileStream(url: string, config?: AxiosRequestConfig): Promise<Stream>;
/**
 * 下载文件并转`base64`
 *
 * 下载失败则返回空字符串，不会抛出异常
 */
export declare function downloadFile2Base64(url: string, config?: AxiosRequestConfig): Promise<string>;
