refactor: mv types.js index.js (and rexport request.js)

This commit is contained in:
AJ ONeal 2022-09-01 00:58:51 -06:00
parent 5948928cb8
commit 927576a006
No known key found for this signature in database
GPG Key ID: 585419CA6DB0AA23
1 changed files with 34 additions and 0 deletions

34
index.js Normal file
View File

@ -0,0 +1,34 @@
'use strict';
module.exports = require('./request.js');
/**
* @callback Request
* @param {RequestOptions} opts
* @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
* @prop {any} body
* @prop {Headers} headers
* @prop {Boolean} ok
* @prop {any} [response] - TODO (browser only)
* @prop {any} [request] - TODO
* @prop {String} status
* @prop {Number} statusCode
*/
/**
* @typedef {Object.<String,String|Array<String>>} Headers
*/