Skip to content

Add TypeScript type definitions #26

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

Merged
merged 4 commits into from
Oct 15, 2018

Conversation

theraccoonbear
Copy link
Contributor

@theraccoonbear theraccoonbear commented Oct 14, 2018

This is my first time writing type defs for an existing JS module. In my testing this provides auto-completion in VSCode and makes the TS compiler happy when importing the module.

Closes #25

@infusion
Copy link
Collaborator

Looks pretty complete now. I don't know if you want to support the constructor (numerator: number, denominator: number); syntax for all operator methods like add, sub, ... as well. The second thing is, you had the module name Fraction before. I like this better than with the .js suffix in the ts world. Does this cause any problems?

@theraccoonbear
Copy link
Contributor Author

Good call. I've updated the methods to support the same arguments as the constructor. I also renamed the module to Fraction. Again, I am new to this, but I don't think the module name in this type def is strictly required.

@infusion
Copy link
Collaborator

infusion commented Oct 15, 2018

That looks pretty! Do you still have something in the making? Otherwise I would merge.

@theraccoonbear
Copy link
Contributor Author

@infusion I think this is complete at this point. Please merge whenever you have a chance. Thanks!

@infusion infusion merged commit bbf90dc into rawify:master Oct 15, 2018
@infusion
Copy link
Collaborator

Thank you!

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.

2 participants