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 typings #27

Merged
merged 4 commits into from Jun 15, 2022

Conversation

stretchkennedy
Copy link
Contributor

@stretchkennedy stretchkennedy commented Jun 15, 2022

Summary

Adds typescript typings. This will allow typescript users to use random-words with no extra effort.

What are the specific steps to test this change?

  • Find a typescript project scaffold somewhere
  • Run yarn add 'git+https://github.com/stretchkennedy/random-words.git#upstream-ts-declarations'
  • See if you can import and use random-words

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

Other information:

Adapted from work I did in my nodejs fork. I'm putting it here in case it's useful to anyone else. See #7 for prior work, though this PR uses a separate function declaration for options that set join to avoid a return type of string | string[].

I don't think it needs documentation and I don't think tests would be useful for typescript typings (but I'm happy to write both if a maintainer can point me in the right direction).

@stretchkennedy stretchkennedy changed the title Add typescript bindings Add typescript typings Jun 15, 2022
@boutell boutell merged commit 1ee29eb into apostrophecms:main Jun 15, 2022
@juicycool92
Copy link

looks good to me, and seems like its commit to master branch.
when will this module update on npm?
im expecting to use it when it start support ts

@boutell
Copy link
Member

boutell commented Jun 16, 2022

This has just been published to npm. Thanks to @stretchkennedy

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.

None yet

4 participants