Skip to content

Commit

Permalink
🐛 Fix catcher and resolve callback argument type.
Browse files Browse the repository at this point in the history
should solve #177
  • Loading branch information
elbywan committed Apr 11, 2023
1 parent 1812c73 commit 76c295f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export interface Wretch<Self = unknown, Chain = unknown, Resolver = undefined> {
* @param errorId - Error code or name
* @param catcher - The catcher method
*/
catcher(this: Self & Wretch<Self, Chain, Resolver>, errorId: number | string, catcher: (error: WretchError, originalRequest: Wretch<Self, Chain, Resolver>) => any): this
catcher(this: Self & Wretch<Self, Chain, Resolver>, errorId: number | string, catcher: (error: WretchError, originalRequest: this) => any): this

/**
* Defer one or multiple request chain methods that will get called just before the request is sent.
Expand Down Expand Up @@ -358,7 +358,7 @@ export interface Wretch<Self = unknown, Chain = unknown, Resolver = undefined> {
Clear extends true ?
Chain & WretchResponseChain<Self, Chain, undefined> :
Resolver,
originalRequest: Wretch<Self, Chain, Clear extends true ? undefined : Resolver>
originalRequest: Self & Wretch<Self, Chain, Clear extends true ? undefined : Resolver>
) => ResolverReturn,
clear?: Clear
): Self & Wretch<Self, Chain, ResolverReturn>
Expand Down

0 comments on commit 76c295f

Please sign in to comment.