Add deprecated process.bindings to node.js #24521
Add deprecated process.bindings to node.js #24521mohsen1 wants to merge 5 commits intoDefinitelyTyped:masterfrom mohsen1:patch-30
Conversation
|
@mohsen1 Thank you for submitting this PR! 🔔 @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
|
@mohsen1 One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
ajafff
left a comment
There was a problem hiding this comment.
Why add it if it's already deprecated? Without the type declaration you cannot use it anyway.
Also note that the PR you linked is about process.bindings, which is a function.
|
@ajafff I've seen many deprecated APIs in this repo. I think we do add them to not break builds |
|
🔔 @ajafff - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate? |
Flarna
left a comment
There was a problem hiding this comment.
There is not process.bindings. I can find process.binding but this is actually a function taking a string
|
@Flarna good catch! fixed! |
|
By the way, usually internals are not added here. I recommend to use a local .d.ts file holding such extensions; e.g. something like this: |
|
It's not internal. It's deprecated public api |
|
If it's not documented, it's not intended for public use. |
|
It's documented in older versions. |
| * Using process.binding() in general should be avoided. | ||
| * The type checking methods in particular can be replaced by using util.types. | ||
| */ | ||
| binding: { [key: string]: string; }; |
There was a problem hiding this comment.
I think it should be binding(internalModule: string): any;.
| /** | ||
| * @deprecated | ||
| * Using process.binding() in general should be avoided. | ||
| * The type checking methods in particular can be replaced by using util.types. |
There was a problem hiding this comment.
It's not clear to me what this comment should tell me. What related to process.binding should be replaced by util.types?
nodejs/node#2768
Please fill in this template.
npm test.)npm run lint package-name(ortscif notslint.jsonis present).Select one of these and delete the others:
If adding a new definition:
dts-gen --dt, not by basing it on an existing project.tslint.jsonshould be present, andtsconfig.jsonshould havenoImplicitAny,noImplicitThis,strictNullChecks, andstrictFunctionTypesset totrue.If changing an existing definition:
tslint.jsoncontaining{ "extends": "dtslint/dt.json" }.If removing a declaration:
notNeededPackages.json.