Skip to content

Commit

Permalink
Merge pull request #407 from ahocevar/request-arg-types
Browse files Browse the repository at this point in the history
Fix types of the request() method
  • Loading branch information
constantinius authored Nov 16, 2023
2 parents 07f9007 + 6e6f981 commit 1f9e65a
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 1f9e65a

Please sign in to comment.