Skip to content
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

Provide type information for requireNode #380

Open
jacobq opened this issue Dec 18, 2018 · 3 comments
Open

Provide type information for requireNode #380

jacobq opened this issue Dec 18, 2018 · 3 comments

Comments

@jacobq
Copy link
Collaborator

jacobq commented Dec 18, 2018

I'm using TypeScript and was seeing this warning / error:

TS2304: Cannot find name 'requireNode'.

I can make it go away by adding this line, but I know there must be a more automatic way to provide type information from the package itself (or at least from a @types/... package):

declare var requireNode: (name:string) => any;

Could we include support for that somehow?

@RobbieTheWagner
Copy link
Member

I just started converting my app to TS and hit this issue too. Is requireNode something internal to this package or shipped from Ember?

@bendemboski
Copy link
Member

bendemboski commented Dec 4, 2020

It's an ember-electron thing, helping to resolve the naming conflict between Node's require() and Ember/loader.js' require(). We talk about it in the documentation.

I don't think it would be hard to provide typings for it. I'm not sure if it would also be helpful to provide type info for our window.require -- not sure if the two require() signatures are exactly the same, or if it would make sense to provide overload signatures.

While we're at it, we may as well provide type info for moduleNode and processNode.

@RobbieTheWagner
Copy link
Member

RobbieTheWagner commented Dec 4, 2020

Anyone volunteering to do this work? 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants