cronTrigger jsdocs

This commit is contained in:
Matt Aitken
2023-07-05 19:32:35 +01:00
parent 5048a27acb
commit 931be39912
3 changed files with 9 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
cronTrigger jsdocs
@@ -24,6 +24,7 @@ export const CronOptionsSchema = z.object({
cron: z.string(),
});
/** The options for a `cronTrigger()` */
export type CronOptions = z.infer<typeof CronOptionsSchema>;
export const CronMetadataSchema = z.object({
@@ -122,6 +122,9 @@ export class CronTrigger implements Trigger<ScheduledEventSpecification> {
}
}
/** `cronTrigger()` is set as a [Job's trigger](https://trigger.dev/docs/sdk/job) to trigger a Job on a recurring schedule using a CRON expression.
* @param options An object containing options about the CRON schedule.
*/
export function cronTrigger(options: CronOptions) {
return new CronTrigger(options);
}