Feature/add typescript type definitions #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why:
(Hi!) We've been using your wonderful module in a Front-End project that uses Typescript and to make things clearer for the devs (IDE intellisense) we wrote custom declaration files for it and included in the project itself. Although that works perfectly for us, we thought it might benefit others too, hence this PR.
How:
Given the fact that the module itself is written in JavaScript, we cannot automatically generate the declaration file. This means we wrote it manually by cross-referencing documentation and source code. Any updates to the module should be reflected in the declaration files as well to keep them up to date.
Need help:
Although I am comfortable writing Typescript, I'm by no means an expert at it, so I invite the community to improve my work.
One idea for the future would be to extend the
Config
interface by making it a generic interface, therefore Typescript could infer the return type of thefixtures
method based on the request method.Screenshots: