shellcheck
Version:
Wrapper to download shellcheck
59 lines (58 loc) • 1.14 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import type http from 'node:http';
import type url from 'node:url';
/**
* Request arguments.
*/
export type RequestArgs<T> = {
/**
* URL.
*/
url: url.URL;
/**
* User agent.
*/
userAgent?: string;
/**
* Token.
*/
token?: string;
/**
* Callback.
*/
cb: (res: http.IncomingMessage) => T | Promise<T>;
};
/**
* Request.
*
* @param args - Arguments.
* @returns T.
*/
export declare function request<T>(args: RequestArgs<T>): Promise<T>;
/**
* Request download arguments.
*/
export type RequestDownloadArgs = Omit<RequestArgs<void>, 'cb'> & {
/**
* Destination path.
*/
destination: string;
};
/**
* Request download.
*
* @param args - Arguments.
*/
export declare function requestDownload(args: RequestDownloadArgs): Promise<void>;
/**
* Request download arguments.
*/
export type RequestJSONArgs<T> = Omit<RequestArgs<T>, 'cb'>;
/**
* Request JSON.
*
* @param args - Arguments.
* @returns T.
*/
export declare function requestJSON<T>(args: RequestJSONArgs<T>): Promise<T>;