pulsecron / pulse

The modern MongoDB-powered job scheduler library for Node.js
https://pulsecron.com
MIT License
111 stars 11 forks source link

Return type of the `CreateMethod` is not correct #20

Closed kostysh closed 6 months ago

kostysh commented 6 months ago

Here is the type of the CreateMethod:

export type CreateMethod = <T extends JobAttributesData>(name: string, data: T) => Job; // `Job` is not properly typed

Job itself has the following type:

declare class Job<T extends JobAttributesData = JobAttributesData> { /* ... */ }

This way a return type of the CreateMethod has to look like this:

export type CreateMethod = <T extends JobAttributesData>(name: string, data: T) => Job<T>;
kostysh commented 6 months ago

@code-xhyun maybe it will be more helpful if I will create PRs from time to time? Not too often )

code-xhyun commented 6 months ago

@kostysh Sure! We welcome your participation!

kostysh commented 6 months ago

https://github.com/pulsecron/pulse/pull/21