Skip to content

Conversation

@6xtvo
Copy link

@6xtvo 6xtvo commented Dec 11, 2021

Added a typings file for TypeScript users.

Edit: I forgot to add the classes in the typings file

@psibean psibean changed the base branch from master to main December 11, 2021 22:34
@psibean
Copy link
Owner

psibean commented Dec 11, 2021

This change is definitely overdue, I'm thinking at this point a typings file is going to be easier than my full TS re-write as the types can be made a little more explicit and less generic.

Does the empty typings file by itself just get rid of the missing types error? Does it default all the types to any, or do they not exist without definition? I haven't checked yet. Time over the holiday season is limited!

Happy to pull this in as-is and just not publish the file until the types are done - most of which I have or are pretty straight forward. I've been tempted to change the way the defaults work too, to make the types a bit easier.

@6xtvo
Copy link
Author

6xtvo commented Dec 11, 2021

Adding the typing file and declaring the module fixes the issue, but then since you’re not exporting anything there is nothing to import, so you’ll have to export everything with their types.

@psibean
Copy link
Owner

psibean commented Jan 3, 2022

Adding the typing file and declaring the module fixes the issue, but then since you’re not exporting anything there is nothing to import, so you’ll have to export everything with their types.

This is what I had expected would happen.

So does this typing file really do anything on it's own? The warning might go away, but you still can't use anything without defining the types. I'll hopefully give a fully-fleshed typing file a shot some time soon

@6xtvo
Copy link
Author

6xtvo commented Jul 12, 2022

Adding the typing file and declaring the module fixes the issue, but then since you’re not exporting anything there is nothing to import, so you’ll have to export everything with their types.

This is what I had expected would happen.

So does this typing file really do anything on it's own? The warning might go away, but you still can't use anything without defining the types. I'll hopefully give a fully-fleshed typing file a shot some time soon

It basically gives the JavaScript stuff types that TypeScript can detect (otherwise this'll happen), not sure if setting the skipLibCheck in a tsconfig.json file will work, haven't tried yet.

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.

2 participants