-
-
Notifications
You must be signed in to change notification settings - Fork 12
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 types #8
Conversation
Thanks for creating a TypeScript definition. 🙌 Can you follow this styleguide? Some examples: |
@sindresorhus done. |
|
||
if(await isPortReachable(3000)) { | ||
// start server | ||
} |
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.
Use the same example as the readme.
index.d.ts
Outdated
} | ||
``` | ||
*/ | ||
declare function isPortReachable(port: number, opts?: {timeout?: number, host?: string}): Promise<boolean>; |
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.
Options should follow the style here: https://github.com/sindresorhus/typescript-definition-style-guide#documentation
@sindresorhus done |
index.d.ts
Outdated
|
||
@default 1000 | ||
*/ | ||
timeout?: number; |
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.
Use tab-indentation.
index.d.ts
Outdated
/** | ||
Can be a domain or an IP. | ||
|
||
@default localhost |
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.
@default localhost | |
@default 'localhost' |
package.json
Outdated
}, | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"index.d.ts" |
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.
Incorrect indentation
index.d.ts
Outdated
@@ -0,0 +1,31 @@ | |||
interface IsPortReachableOptions { |
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.
interface IsPortReachableOptions { | |
interface Options { |
The pull request needs a proper title. |
@sindresorhus done |
Add typescript definition file to solve ts(7016)
Fixes #5