fix: resolve several vscode type errors inside fetchers code (#4579)
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
co-authored by
Alexandr
parent
2df35521d7
commit
bf021b0670
+2
-7
@@ -1,15 +1,10 @@
|
||||
import axios from "axios";
|
||||
|
||||
/**
|
||||
* @typedef {import('axios').AxiosRequestConfig['data']} AxiosRequestConfigData Axios request data.
|
||||
* @typedef {import('axios').AxiosRequestConfig['headers']} AxiosRequestConfigHeaders Axios request headers.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Send GraphQL request to GitHub API.
|
||||
*
|
||||
* @param {AxiosRequestConfigData} data Request data.
|
||||
* @param {AxiosRequestConfigHeaders} headers Request headers.
|
||||
* @param {import('axios').AxiosRequestConfig['data']} data Request data.
|
||||
* @param {import('axios').AxiosRequestConfig['headers']} headers Request headers.
|
||||
* @returns {Promise<any>} Request response.
|
||||
*/
|
||||
const request = (data, headers) => {
|
||||
|
||||
@@ -13,14 +13,14 @@ const RETRIES = process.env.NODE_ENV === "test" ? 7 : PATs;
|
||||
|
||||
/**
|
||||
* @typedef {import("axios").AxiosResponse} AxiosResponse Axios response.
|
||||
* @typedef {(variables: object, token: string, retriesForTests?: number) => Promise<AxiosResponse>} FetcherFunction Fetcher function.
|
||||
* @typedef {(variables: any, token: string, retriesForTests?: number) => Promise<AxiosResponse>} FetcherFunction Fetcher function.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Try to execute the fetcher function until it succeeds or the max number of retries is reached.
|
||||
*
|
||||
* @param {FetcherFunction} fetcher The fetcher function.
|
||||
* @param {object} variables Object with arguments to pass to the fetcher function.
|
||||
* @param {any} variables Object with arguments to pass to the fetcher function.
|
||||
* @param {number} retries How many times to retry.
|
||||
* @returns {Promise<any>} The response from the fetcher function.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user