-
Notifications
You must be signed in to change notification settings - Fork 30k
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
typings: improve typings #40222
typings: improve typings #40222
Conversation
targos
commented
Sep 26, 2021
getUptime(): number; | ||
getTotalMem(): number; | ||
getFreeMem(): number; | ||
getCPUs(): Array<string | 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.
getCPUs(): Array<string | number>; | |
getCPUs(): (string | number)[]; |
for consistency with other dts
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.
I have a preference to use type[]
for simple types and Array<types>
for more complex ones
typings/internalBinding/os.d.ts
Outdated
getTotalMem(): number; | ||
getFreeMem(): number; | ||
getCPUs(): Array<string | number>; | ||
getInterfaceAddresses(ctx: object): Array<string | number | boolean> | undefined; |
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.
getInterfaceAddresses(ctx: object): Array<string | number | boolean> | undefined; | |
getInterfaceAddresses(ctx: object): (string | number | boolean)[] | undefined; |
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.
LGTM
Commit Queue failed- Loading data for nodejs/node/pull/40222 ✔ Done loading data for nodejs/node/pull/40222 ----------------------------------- PR info ------------------------------------ Title typings: improve typings (#40222) Author Michaël Zasso (@targos) Branch targos:typings -> nodejs:master Labels author ready, typings Commits 5 - typings: fix declaration of primordials - typings: define types for timers binding - typings: add missing types to options and util bindings - typings: define types for os binding - fixup! typings: define types for os binding Committers 1 - Michaël Zasso PR-URL: https://github.com/nodejs/node/pull/40222 Fixes: https://github.com/https://github.com/nodejs/node/issues/40144 Reviewed-By: Tobias Nießen Reviewed-By: Evan Lucas Reviewed-By: Zijian Liu Reviewed-By: James M Snell Reviewed-By: Michael Dawson ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/40222 Fixes: https://github.com/https://github.com/nodejs/node/issues/40144 Reviewed-By: Tobias Nießen Reviewed-By: Evan Lucas Reviewed-By: Zijian Liu Reviewed-By: James M Snell Reviewed-By: Michael Dawson -------------------------------------------------------------------------------- ℹ This PR was created on Sun, 26 Sep 2021 14:36:03 GMT ✔ Approvals: 5 ✔ - Tobias Nießen (@tniessen) (TSC): https://github.com/nodejs/node/pull/40222#pullrequestreview-763706951 ✔ - Evan Lucas (@evanlucas): https://github.com/nodejs/node/pull/40222#pullrequestreview-764570178 ✔ - Zijian Liu (@Lxxyx): https://github.com/nodejs/node/pull/40222#pullrequestreview-766148910 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/40222#pullrequestreview-767943198 ✔ - Michael Dawson (@mhdawson) (TSC): https://github.com/nodejs/node/pull/40222#pullrequestreview-769403509 ✔ Last GitHub Actions successful ℹ Green GitHub Actions CI is sufficient -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/master up to date... From https://github.com/nodejs/node * branch master -> FETCH_HEAD ✔ origin/master is now up-to-date - Downloading patch for 40222 From https://github.com/nodejs/node * branch refs/pull/40222/merge -> FETCH_HEAD ✔ Fetched commits as eaa59571e0fd..795db39025ef -------------------------------------------------------------------------------- [master 0b4ed8fe7f] typings: fix declaration of primordials Author: Michaël Zasso Date: Sun Sep 26 12:22:11 2021 +0200 1 file changed, 5 insertions(+), 1 deletion(-) [master c5028c4cfb] typings: define types for timers binding Author: Michaël Zasso Date: Sun Sep 26 15:47:14 2021 +0200 2 files changed, 9 insertions(+) create mode 100644 typings/internalBinding/timers.d.ts [master 7b025d4363] typings: add missing types to options and util bindings Author: Michaël Zasso Date: Sun Sep 26 16:07:13 2021 +0200 2 files changed, 2 insertions(+) [master 03be0fbe11] typings: define types for os binding Author: Michaël Zasso Date: Sun Sep 26 16:28:40 2021 +0200 2 files changed, 22 insertions(+) create mode 100644 typings/internalBinding/os.d.ts [master 88e9b9da17] fixup! typings: define types for os binding Author: Michaël Zasso Date: Mon Sep 27 16:50:49 2021 +0200 1 file changed, 7 insertions(+), 7 deletions(-) ✔ Patches applied There are 5 commits in the PR. Attempting autorebase. Rebasing (2/9)https://github.com/nodejs/node/actions/runs/1323958359 |
Landed in 8068f40...9467cba |
PR-URL: #40222 Fixes: #40144 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
PR-URL: #40222 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
PR-URL: #40222 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
PR-URL: #40222 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
PR-URL: #40222 Fixes: #40144 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
PR-URL: #40222 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
PR-URL: #40222 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
PR-URL: #40222 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>