request.js/types.js

31 lines
642 B
JavaScript
Raw Normal View History

'use strict';
module.exports._typesOnly = true;
/**
* @callback Request
* @param {Object} opts
2022-09-01 06:30:14 +00:00
* @param {any} [opts.body]
* @param {Object.<String,any>} [opts.form]
2022-09-01 06:30:14 +00:00
* @param {Headers} [opts.headers]
* @param {String} [opts.method]
2022-09-01 06:30:14 +00:00
* @param {Boolean | any} [opts.json]
* @param {String} opts.url
* @returns {Response}
*/
/**
* @typedef {Object} Response
* @prop {any} body
* @prop {Headers} headers
* @prop {Boolean} ok
* @prop {any} [response] - TODO (browser only)
2022-09-01 06:30:14 +00:00
* @prop {any} [request] - TODO
* @prop {String} status
* @prop {Number} statusCode
*/
/**
* @typedef {Object.<String,String|Array<String>>} Headers
*/