graphql-devtools
graphql-devtools copied to clipboard
fix ts types
Let's start a discussion here and define what we want, so we have a plan to "fix" this issue and @dielduarte adds in the issue description a list as we agree in new things. I would start suggesting to use types over an interface, there are many articles comparing both, such as interface vs type alias. The point is that type makes more sense semantically for our use, we are mainly using it for type inference and not as an interface to be implemented. Another big point here is that type alias allows you to play better with advanced types of the typescript as the projects grow more complex.
I've had read the post and that makes sense in our case, the main point is to keep consistency in the codebase.
to get rid of this "issue" here, I would suggest a few changes in our codebase:
- move from interfaces to types
- get rid of
details: any
adding a global type definition, this is about the details params returned by the WebRequest API events callbacks https://developer.chrome.com/extensions/webRequest - get rid of
requestExist = (context: any,
this context is about CoreContext
what do you think @assuncaocharles ?
It works for me
- [ ] Replace interface for types
- [ ] Get rid of requestExist = (context: any, this context is about CoreContext
- [ ] Get rid of
details: any
adding a global type definition, this is about the details params returned by the WebRequest API events callbacks
@assuncaocharles niceeee! let's do it 🚀