2022-09-01 06:06:19 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
module.exports._typesOnly = true;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @callback Request
|
2022-09-01 06:33:01 +00:00
|
|
|
* @param {RequestOptions} opts
|
2022-09-01 06:06:19 +00:00
|
|
|
* @returns {Response}
|
|
|
|
*/
|
|
|
|
|
2022-09-01 06:33:01 +00:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
|
2022-09-01 06:06:19 +00:00
|
|
|
/**
|
|
|
|
* @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
|
2022-09-01 06:06:19 +00:00
|
|
|
* @prop {String} status
|
|
|
|
* @prop {Number} statusCode
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {Object.<String,String|Array<String>>} Headers
|
|
|
|
*/
|