Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add typescript type definitions #95

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

0vidiu
Copy link

@0vidiu 0vidiu commented Jun 5, 2020

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 the fixtures method based on the request method.

Screenshots:
Screenshot 2020-06-05 at 15 06 34
Screenshot 2020-06-05 at 15 06 52
Screenshot 2020-06-05 at 15 07 05

@pkuczynski
Copy link

@Slashgear @DevSide any chance to get this merged and released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants