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 type definitions #12

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Conversation

jclusso
Copy link
Member

@jclusso jclusso commented Jan 16, 2024

Closes #6

@jclusso jclusso mentioned this pull request Jan 17, 2024
@jclusso jclusso requested a review from n-older February 20, 2024 22:09
@n-older
Copy link

n-older commented Feb 20, 2024

I know you're not a fan of TypeScript but we should really avoid using any as it defeats the purpose of TypeScript. If this is just to be compliant for some third party then fair enough.

@jclusso
Copy link
Member Author

jclusso commented Feb 20, 2024

If this is just to be compliant for some third party then fair enough.

The library currently doesn't need updates if we add new options or new response data to our API and I'd like to keep it that way. This is just to appease Typescript users and I have no intention of us supporting it anymore than the bare minimum if it burdens the library with more updates.

@jclusso jclusso merged commit e86f98a into master Feb 21, 2024
4 checks passed
@jclusso jclusso deleted the add_typescript_definitions branch February 21, 2024 16:03
@ktwbc
Copy link

ktwbc commented Mar 3, 2024

If this is just to be compliant for some third party then fair enough.

The library currently doesn't need updates if we add new options or new response data to our API and I'd like to keep it that way. This is just to appease Typescript users and I have no intention of us supporting it anymore than the bare minimum if it burdens the library with more updates.

But that completely defeats the point of typing, which is what TypeScript is. If you update the API with more info in the response, the type what type-hints at what is available and flags things at compile time.

If your source code was typed in the first place (i.e. it was natively .ts) then your contracts/typing are part of your source code, and it gets compiled down to .js with the typing file automatically by tsc (or esbuild or webpack or whatever bundler you're using).

@jclusso
Copy link
Member Author

jclusso commented Mar 3, 2024

If your source code was typed in the first place (i.e. it was natively .ts) then your contracts/typing are part of your source code, and it gets compiled down to .js with the typing file automatically by tsc (or esbuild or webpack or whatever bundler you're using).

This is not a Typescript library and never will be. This was to appease those looking to use the library in Typescript projects.

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.

Need Typescript Support
3 participants