From 968926cdc5a08a3bb0476863d7f6ac783766db94 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 1 Sep 2022 00:33:01 -0600 Subject: [PATCH] fix(types): add RequestOptions --- local-types.js | 1 + types.js | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/local-types.js b/local-types.js index bdfbe74..e52085c 100644 --- a/local-types.js +++ b/local-types.js @@ -1,4 +1,5 @@ /** + * @typedef {import('./types.js').RequestOptions} RequestOptions * @typedef {import('./types.js').Response} Response * @typedef {import('./types.js').Headers} Headers */ diff --git a/types.js b/types.js index f5770ad..4a75e07 100644 --- a/types.js +++ b/types.js @@ -4,16 +4,20 @@ module.exports._typesOnly = true; /** * @callback Request - * @param {Object} opts - * @param {any} [opts.body] - * @param {Object.} [opts.form] - * @param {Headers} [opts.headers] - * @param {String} [opts.method] - * @param {Boolean | any} [opts.json] - * @param {String} opts.url + * @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