-
Notifications
You must be signed in to change notification settings - Fork 47
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
Typescript support #4
Comments
Yeah, sure! |
Hey @wilk, thanks for this package & being willing to rewrite it in Typescript! I'm looking for a clarification – is it currently possible to use it with Typescript (as an untyped library), or is it just not possible before the rewrite? I was playing around with it and I can't seem to get around this error:
Thanks! |
@nomeyer I'm a TypeScript user and have tried using it with TypeScript. Do you have a reduced test case? |
Hey @wilk, thanks a lot for that release, much appreciated 😁 Unfortunately, I'm still getting the same error ( FWIW after gradually stripping things out of my worker function I managed to get this to work: export function doStuff(data: IStuff): Promise<IStuff> {
console.log(data);
return Promise.resolve(data);
} And I get the export async function doStuff(data: IStuff): Promise<IStuff> {
console.log(data);
return data;
} |
Hi @nomeyer ! Thank you for using it and for reporting this issue! Well, I don't understand why it's giving you that error but it makes sense using an async function instead of a sync one with a export function doStuff(data: IStuff): IStuff {
console.log(data);
return data;
} If you think this should be better highlighted inside the docs, then I'll put it asap. |
Thanks for your quick reply 🙂
No I think the docs are pretty clear that one can use a sync or async function 👍 My jobs are async so I was hoping to do something like this, that's why I'm trying to get |
Ok, thanks, then feel free to open a new issue for the related problem 💪 |
Any love for the Typescript users?
The text was updated successfully, but these errors were encountered: