From 927576a006086e023413a6cd831b9d97d9170c24 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 1 Sep 2022 00:58:51 -0600 Subject: [PATCH] refactor: mv types.js index.js (and rexport request.js) --- index.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..b179e44 --- /dev/null +++ b/index.js @@ -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.} [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.>} Headers + */