aurelia / aurelia/fetch-client

invalid type definition for RetryInterceptor

Open
#122 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
74
Forks
45
PR merge metrics
No merged PRs in 30d

Description

there seems to be an error in the type definition of RetryInterceptor

aurelia-fetch-client 1.8.0
typescript 3.2.4

https://github.com/aurelia/fetch-client/blob/fa53ec779f2e0937129010e952c57568842bd46b/dist/aurelia-fetch-client.d.ts#L310`

```
error TS2416: Property 'response' in type 'RetryInterceptor' is not assignable to the same property in base type 'Interceptor'.
Type '(response: Response, request: Request) => Response' is not assignable to type '(response: Response, request?: Request | undefined) => Response | Promise'.
Types of parameters 'request' and 'request' are incompatible.
Type 'Request | undefined' is not assignable to type 'Request'.
Type 'undefined' is not assignable to type 'Request'.
```

Contributor guide

Open the contributing guide

Research direction

Open dist/aurelia-fetch-client.d.ts at line 310 and inspect the RetryInterceptor response definition alongside the Interceptor signature shown in the TypeScript error. Reproduce the reported TypeScript 3.2.4 compilation error, then verify that the corrected declaration compiles without TS2416.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.