Skip to content

Commit

Permalink
Fix types of the request() method
Browse files Browse the repository at this point in the history
  • Loading branch information
ahocevar committed Nov 15, 2023
1 parent 07f9007 commit 6e6f981
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/source/client/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export class BaseClient {

/**
* Send a request with the options
* @param {object} [options]
* @param {{headers: HeadersInit, credentials: RequestCredentials, signal: AbortSignal}} [options={}]
* @returns {Promise<BaseResponse>}
*/
async request({ headers, credentials, signal } = {}) { // eslint-disable-line no-unused-vars
throw new Error('request is not implemented');
Expand Down
4 changes: 4 additions & 0 deletions src/source/client/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export class FetchClient extends BaseClient {
this.credentials = credentials;
}

/**
* @param {{headers: HeadersInit, credentials: RequestCredentials, signal: AbortSignal}} [options={}]
* @returns {Promise<FetchResponse>}
*/
async request({ headers, credentials, signal } = {}) {
const response = await fetch(this.url, {
headers, credentials, signal,
Expand Down

0 comments on commit 6e6f981

Please sign in to comment.