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

Typescript support #18

Open
Bechrissed opened this issue Dec 18, 2020 · 6 comments
Open

Typescript support #18

Bechrissed opened this issue Dec 18, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Bechrissed
Copy link

Add type annotations so the module can be used in ts projects

@HarTstaRx
Copy link

HarTstaRx commented Mar 24, 2021

I've submited a PR to DefinitelyTyped, in the meantime this worked for my project:

  • Create a index.d.ts file under a new "types" folder in the root of the project.
  • Make sure your tsconfig.json has baseUrl and paths correctly filled.

imagen

@kopax
Copy link
Contributor

kopax commented Mar 25, 2021

@HarTstaRx why not just PR your typing here so we can have a ts version. Just clone this project, use npm i $path_clone_dir from within your project, then run npm run build:lib:watch to watch for change, add the typing, if you got any issue just ping me here and I'll have a look.

@kopax kopax added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Mar 25, 2021
@HarTstaRx
Copy link

@kopax because the issue was unattended for 3+ months and commits were made 3 days after the issue was open.
The package for the types is already published on npm, you can check the typings here.

@HarTstaRx HarTstaRx removed their assignment Mar 26, 2021
@kopax
Copy link
Contributor

kopax commented Mar 26, 2021

@HarTstaRx ok I understand now. This could be added into README. I personally do not use type so I don't know how to test and validate it. I'll leave the issue open until someone resolve it somehow.

@HarTstaRx
Copy link

HarTstaRx commented Mar 26, 2021

@kopax no worries, the issue can be closed, the typings are publicly available now and everybody should be able to work with this library on typescript from now on. Thanks for your work on the library, saved me a lot of work :)

@kopax
Copy link
Contributor

kopax commented Mar 26, 2021

Okay, thanks for sharing your typings to the community too, you are welcome to star and follow cause it helps :)

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 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants