ol-th / pdf-img-convert.js

Simple node package to convert a PDF into images.
MIT License
161 stars 38 forks source link

TS compabilty -> .then does not exist | not so useless - useless await #25

Closed BannukDE closed 1 year ago

BannukDE commented 1 year ago

First example definitly not running with ts: Property 'then' does not exist on type '(string | Uint8Array)[]'.ts(2339)

Second example runs, once we enter some var declarations: 'await' has no effect on the type of this expression.ts(80007)

So here my little fix to your d.ts file: Line 13 -> ): Promise<string[]|Uint8Array[]>

As you correctly mentioned your async function returns a resolveable Promise, we have to tell that ts.

Thanks for your work and sharing!

ol-th commented 1 year ago

Thanks for the suggestion, this will be added to the next release :)