Skip to content

Feature/add typescript type definitions#95

Open
0vidiu wants to merge 3 commits intoBedrockStreaming:masterfrom
0vidiu:feature/add-typescript-type-definitions
Open

Feature/add typescript type definitions#95
0vidiu wants to merge 3 commits intoBedrockStreaming:masterfrom
0vidiu:feature/add-typescript-type-definitions

Conversation

@0vidiu
Copy link
Copy Markdown

@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
Copy Markdown

@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