Closed blakeembrey closed 8 years ago
Cool, thanks.
A couple more things. #19 added "registration shortcuts". These are just bare imports that don't export anything, e.g.:
require('any-promise/register/bluebird')
// is shorthand for
require('any-promise/register')('bluebird', {Promise: require('bluebird'))
Would there be any reason to add definitions for these shortcuts?
Also, #15 (optional import) is probably coming soon in some form. The interface is still being discussed so I'll probably bug you again when that lands.
Thanks again!
@kevinbeaty Committed the changes. On the registration shortcuts, I've copied the plain Promise
re-exporting. If, at some point, each promise implementation actually adds type definitions, you could import those and re-export those instead.
On the registration shortcuts, I've copied the plain Promise re-exporting.
I'm a bit confused now. Those shortcuts are used only for the side-effect of register
, nothing is exported. Why do we declare it as exporting the Promise
? (Or maybe it was just a misunderstanding?)
@kevinbeaty Oh, I read it wrong - I thought it was exporting the promises directly. Let me double check.
@kevinbeaty Switched it to empty exports so that the ES6 import will work (E.g. import 'any-promise/register/bluebird'
). Module augmentation with global doesn't currently work, so it won't magically appear in the global with TypeScript (yet).
Cool thanks. Do you recommend anything to help test definitions are correct? If not, I can take your word for it on this one, but it certainly would be nice.
Only using the TypeScript compiler itself, that would ensure they're correct (but not functionally correct).
Awesome, cheers! Looking forward to this release, I have a few modules to update now 😄
Published in v 1.3.0
Closes https://github.com/kevinbeaty/any-promise/issues/18. I can add this as the first project to https://github.com/typings/typings/issues/480, when I get to it 😄 Hopefully that'll always give you somewhere you can get help, just in case. But you can always ping me with changes also, it's pretty easy to pick up.