pulsecron / pulse

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

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

Closed kostysh closed 3 months ago

kostysh commented 3 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 3 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 3 months ago

@kostysh Sure! We welcome your participation!

kostysh commented 3 months ago

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