-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Added typings #27
Added typings #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for this!
I think this may be more than what we actually need for including typings.
A few of my repos have been PR'd with types & all you really need is the *.d.ts
to be added, add that same file to files
array in package.json
and then add a new "types": "{NAME}.d.ts"
to the package.json
as well.
If things have drastically changed, let me know, but I dont imagine that they have.
readme.md
Outdated
@@ -160,6 +160,9 @@ If [`options.maxAttempts`](#optionsmaxattempts) has not been exceeded, enqueues | |||
|
|||
Initializes a new `WebSocket` — used on initialization and by [`reconnect()`](#reconnect). | |||
|
|||
## TypeScript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not include this. Those who have TS on will see it automatically.
tsconfig.json
Outdated
@@ -0,0 +1,13 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure we don't need this file either.
package.json
Outdated
@@ -1,6 +1,7 @@ | |||
{ | |||
"name": "sockette", | |||
"version": "2.0.0", | |||
"typeScriptVersion": "2.8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need this bad boy.
Okay, thanks for the info! Is the entry in files in package.json required? In my test environment it works without it. I also couldn't find any reference to this in the official guide: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html |
Yeah, it's required. The |
Looks good, thank you~! |
See sockette PR#27 lukeed/sockette#27
Merging the types into the main repository is definitely better than having a separate one, I agree(See PR #24).
Let me just explain the added files:
And obviously an added hint in the Readme.
I just specified the latest Version of TypeScript in the package.json, although it should probably work with older ones as well. We're not really using any special features.