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

Create TypeScript definitions #3

Open
pburrows opened this issue Jan 2, 2019 · 4 comments
Open

Create TypeScript definitions #3

pburrows opened this issue Jan 2, 2019 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@pburrows
Copy link
Owner

pburrows commented Jan 2, 2019

Need to create / add typescript definitions during build (in /lib)

@pburrows pburrows added enhancement New feature or request good first issue Good for newcomers labels Jan 2, 2019
@shivanikohlii
Copy link

Could you explain a bit more about what you're looking for via an example, please?

@pburrows
Copy link
Owner Author

pburrows commented Feb 28, 2019

Currently, to use rangy in a project which uses typescript (such as angular), you need to include the module separately and consume it in code like this:

declare const rangy: any;

This gives you no type information when using it, and you wind up having to depend heavily on the documentation to learn methods.

It would be easy to start from the type definitions created by Rudolph Gottesheim here:
https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rangy

These probably cover a good bit of the existing functionality already (though many of the modules are missing).

To get started with this, it makes sense to create a new folder at the root called types and put the existing type definitions from the link above in there. After that we would want to write some tests which used typescript.

@ohze
Copy link

ohze commented Apr 4, 2019

@pburrows
Copy link
Owner Author

pburrows commented Apr 4, 2019

Thsi is great @ohze ! If you want to make a PR to add these definitions straight to rangy here, that would be great. Then we wouldn't even need to include @types/rangy to use them (people using the old rangy would still need them, but anyone using rangy-updated would not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants