Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Add typescript types #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add typescript types #58

wants to merge 1 commit into from

Conversation

corollari
Copy link

This PR adds typescript types to the public API. I tried to be the least invasive possible with the current code and setup (without sacrificing type checking) so I simply converted some files into typescript and made typescript emit the declaration files.

The only changes to the build process will be:

  • When building the code, npm run build-ts will need to be run in order to generate currencies.js and wallet_address_validator.js
  • These two .js files should be treated as simple build artifacts, all new code changes should be applied to the .ts files instead.

@corollari
Copy link
Author

@GusGold thoughts?

name: string,
symbol: string,
validator: {
// `currency` must be `any` to avoid recureferences
Copy link

Choose a reason for hiding this comment

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

Currently the typescript seems to have no problem with recursive types. Or is it not so? Perhaps it is worth updating the request?

@dartess
Copy link

dartess commented Nov 1, 2021

@mdcuk34 Do you plan to update the request to make merge possible?

@GusGold How do you look at this request? #49 here you are not against typescript. Should @mdcuk34 update this request?

Personally, it seems to me that in this case it would be more correct to put the declaration file at the root, instead of changing the build process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants