@busymango/fetch-driver
Version:
fetch with middlewares for the browser
22 lines (21 loc) • 669 B
TypeScript
export declare const generate: {
/**
* see https://fetch.spec.whatwg.org/#methods
*
* @param {any} RequestInit
*/
method: ({ method }?: RequestInit) => string | void;
/**
* @param {object={}} options
* @param {object|Headers} options.headers
* @returns {HeaderParams} An Object with the header info
*/
header: ({ headers }?: RequestInit) => string | void;
body: ({ body }?: RequestInit) => string | void;
compress: ({ headers }?: RequestInit) => string;
};
/**
* @param {string|URL} uri
* @param {RequestInit} init
*/
export declare const fetch2curl: (uri: string | URL, init?: RequestInit) => string;