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

can't be used from TypeScript #4

Open
RohanHart opened this issue Mar 14, 2018 · 4 comments
Open

can't be used from TypeScript #4

RohanHart opened this issue Mar 14, 2018 · 4 comments

Comments

@RohanHart
Copy link

The index.d.ts provided has insufficient details - particularly no constructor.
The index.d.ts generated by tsc seems to be correct so there should be no need to override.

@ForbesLindesay
Copy link
Member

I don't know what index.d.ts you are referring to. We auto-generate one via tsc, but we don't manually define one anywhere in this module.

@RohanHart
Copy link
Author

RohanHart commented Mar 15, 2018

The last line of prepare.js overwrites the index.d.ts
writeFileSync(__dirname + '/lib/index.d.ts', 'export default Promise;');

@ForbesLindesay
Copy link
Member

Ahhh, that makes sense. What's your tsconfig? I think we might be assuming you have es2016 enabled.

I think we don't accept the default config since it made it difficult to pass a LazyPromise to a function that expects a Promise.

@RohanHart
Copy link
Author

Yes, targeting es2015. I've created a local typing which says that LazyPromise just implements PromiseLike as that's enough for what I need.

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

2 participants