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

Add Typescript definitions #138

Merged
merged 8 commits into from
Mar 16, 2018
Merged

Add Typescript definitions #138

merged 8 commits into from
Mar 16, 2018

Conversation

BehindTheMath
Copy link
Collaborator

No description provided.

@BehindTheMath
Copy link
Collaborator Author

Never mind.

According to Typescript's documentation, if the package is not written in Typescript, it's preferable to add the type definitions to the DefinitelyTyped repo.

@BehindTheMath BehindTheMath deleted the feature/ts-defs branch March 11, 2018 04:42
@BehindTheMath BehindTheMath restored the feature/ts-defs branch March 14, 2018 19:42
@BehindTheMath
Copy link
Collaborator Author

Actually, DefinitelyTyped's recommendation is:

If you are the library author, or can make a pull request to the library, bundle types instead of publishing to DefinitelyTyped.

So I'm reopening this PR to add the definitions here.

@BehindTheMath BehindTheMath reopened this Mar 14, 2018
@robinnorth
Copy link
Collaborator

LGTM, though I'm not a Typescript user. You might want to add a note to the readme to the effect that any PRs should ideally include updated Typescript definitions if necessary, in addition to passing tests.

@BehindTheMath
Copy link
Collaborator Author

I'm going to try to figure out if there's an easy way to write tests for this. Then we could include that in the testing workflow.

Copy link
Collaborator

@robinnorth robinnorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, sounds good to me. Feel free to merge when you're happy!

I haven't added any tooling for this test. To check it, Typescript
needs to be installed. Then run:
    tsc --noEmit ./tests/test.ts
@BehindTheMath
Copy link
Collaborator Author

BehindTheMath commented Mar 15, 2018

I haven't added any tooling for actually running or automating the tests. To run it, Typescript would need to be installed, and I don't want to deal with that now.

To run it manually, install Typescript (either locally or globally), and then run:

tsc --noEmit ./tests/test.ts

@BehindTheMath BehindTheMath merged commit 5e41a32 into master Mar 16, 2018
@BehindTheMath BehindTheMath deleted the feature/ts-defs branch March 16, 2018 01:16
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