fix(types): add RequestOptions
This commit is contained in:
parent
88ae1a2086
commit
968926cdc5
|
@ -1,4 +1,5 @@
|
||||||
/**
|
/**
|
||||||
|
* @typedef {import('./types.js').RequestOptions} RequestOptions
|
||||||
* @typedef {import('./types.js').Response} Response
|
* @typedef {import('./types.js').Response} Response
|
||||||
* @typedef {import('./types.js').Headers} Headers
|
* @typedef {import('./types.js').Headers} Headers
|
||||||
*/
|
*/
|
||||||
|
|
18
types.js
18
types.js
|
@ -4,16 +4,20 @@ module.exports._typesOnly = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @callback Request
|
* @callback Request
|
||||||
* @param {Object} opts
|
* @param {RequestOptions} opts
|
||||||
* @param {any} [opts.body]
|
|
||||||
* @param {Object.<String,any>} [opts.form]
|
|
||||||
* @param {Headers} [opts.headers]
|
|
||||||
* @param {String} [opts.method]
|
|
||||||
* @param {Boolean | any} [opts.json]
|
|
||||||
* @param {String} opts.url
|
|
||||||
* @returns {Response}
|
* @returns {Response}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} RequestOptions
|
||||||
|
* @prop {any} [opts.body]
|
||||||
|
* @prop {Object.<String,any>} [opts.form]
|
||||||
|
* @prop {Headers} [opts.headers]
|
||||||
|
* @prop {String} [opts.method]
|
||||||
|
* @prop {Boolean | any} [opts.json]
|
||||||
|
* @prop {String} opts.url
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Response
|
* @typedef {Object} Response
|
||||||
* @prop {any} body
|
* @prop {any} body
|
||||||
|
|
Loading…
Reference in New Issue