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

Missing generic for progress object #53

Open
kibertoad opened this issue Jul 20, 2023 · 3 comments
Open

Missing generic for progress object #53

kibertoad opened this issue Jul 20, 2023 · 3 comments

Comments

@kibertoad
Copy link

It would be great if it was possible to provide generic for Job progress object

@manast
Copy link
Contributor

manast commented Jul 20, 2023

@kibertoad do you have an example on how you would like it to look like?

@kibertoad
Copy link
Author

kibertoad commented Jul 20, 2023

Currently Job is typed like this:

export declare class JobPro<DataType = any, ReturnType = any, NameType extends string = string> extends Job<DataType, ReturnType, NameType> {

I would expect this to look something like

export declare class JobPro<DataType = any, ReturnType = any, NameType extends string = string, ProgressType = number | object> extends Job<DataType, ReturnType, NameType, ProgressType> {

Currently numbers or objects are supported, and it would also be great to narrow it down on a generic level to what is actually used and not have to do safe guards inside the code.

@manast
Copy link
Contributor

manast commented Jul 20, 2023

I see. This would be useful in standard BullMQ as well.

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