-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
VoidFunction interface should be defined for ES5 target #61009
Comments
@sandersn, could you provide your opinion about this tiny issue? I linked a fix. |
We don't add helper types they're required for dts emit; I don't think we would add this. |
@jakebailey, helper types like those in dom.lib have been widely used by the TypeScript community. However, Node.js developers face a challenge since dom.lib isn’t used, and we often need to recreate these helpers in every project. What does the TypeScript team recommend to address this?
For now, I’ve only identified |
Being widely used does not mean we add them for everyone. Notably, https://github.com/search?q=%2F%5CbVoidFunction%5Cb%2F+language%3ATypeScript&type=code shows that most uses of this name are people declaring the type, not using the one from the DOM types. To your three questions, my personal opinion is "no" for all three. This is a one line type; most people would not declare |
it makes sense. I'm closing the issue and the PR. Thanks for your time! |
⚙ Compilation target
ES5
⚙ Library
lib.es5.d.ts
Missing / Incorrect Definition
In lib.dom.d.ts and similar files produced by TypeScript-DOM-lib-generator we have:
This interface is commonly used for frontend development, but it is not defined with recommended Node.js configuration
Adding this interface to lib.es5.d.ts will simplify FullStack practices
Sample Code
Documentation Link
No response
The text was updated successfully, but these errors were encountered: