vue-axios
vue-axios copied to clipboard
Migrate to Typescript
Convert the current code to Typescript could help to solve some problems with type definition
👋 I'd be happy to help with this. I'm curious about what kind of type problems you have currently?
@callmehiphop This package has some problem with typing on TS: it isn't correct and enough for some people.
So I've been having a go at this today. I think I understand the issues now - I'm not sure its possible to support both version 2 and version 3 in the same package since it involves augmenting 2 modules where 1 of them is most certainly going to be absent. Seems like we want to export these separately. Thoughts on that?
So as I understand, it means we will have a breaking change because of 2 different entry points?
I'm unclear on the OP, but this might be similar to the issue I was going to raise. Are you saying you are not getting type safety and IntelliSense? That is certainly true here:
const axios: any = inject('axios') // inject axios
... and VS Code is not going to be helpful in using axios at all, no IntelliSense. I was looking at a solution like using InjectionKey: https://logaretm.com/blog/2020-12-23-type-safe-provide-inject
@dapug I think your problem is related too. As I am not an expert on both TS and Vue3, I just raise it here to get some helps/suggestions on resolving all TS-related problems.