Closed kostysh closed 2 months ago
This PR should fix the following typing problem:
import { Job, JobAttributesData, Pulse } from '@pulsecron/pulse'; interface CustomJobData extends JobAttributesData { myOption: string; } const jobCreationHelper = async <T extends CustomJobData = CustomJobData>( queue: Pulse, name: string, data: T, ): Promise<Job<T>> => { const job = await queue.schedule<T>('in 5 seconds', name, data); return job; // <-- Type 'JobAttributesData' is missing the following properties from type 'CustomJobData': myOption (2322) };
This typing issue appears because returned Job instances are not properly typed using T from the template type. See:
Job
I have refactored typing in the /src/pulse/schedule.ts to fix the issue. Tests are passing.
/src/pulse/schedule.ts
:tada: This PR is included in version 1.5.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
This PR should fix the following typing problem:
This typing issue appears because returned
Job
instances are not properly typed using T from the template type. See:I have refactored typing in the
/src/pulse/schedule.ts
to fix the issue. Tests are passing.