From 843d09bf7859996093331e2fb9d5ac826cfb5bf0 Mon Sep 17 00:00:00 2001 From: Lundarl Gholoi Date: Tue, 14 May 2019 17:24:31 -0400 Subject: [PATCH] [cron] Fix global function issue (#35411) --- types/cron/cron-tests.ts | 3 +-- types/cron/index.d.ts | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/types/cron/cron-tests.ts b/types/cron/cron-tests.ts index f152498eca..d91956c2a4 100644 --- a/types/cron/cron-tests.ts +++ b/types/cron/cron-tests.ts @@ -53,7 +53,7 @@ var job = new CronJob('00 30 11 * * 1-5', 'ls', { command: 'ls', args: ['./'] }, ); // For good measure -var job = new CronJob({ +var job = cron.job({ cronTime: '00 30 11 * * 1-5', onTick: () => { /* @@ -91,4 +91,3 @@ try { new CronTime('* * * * * *'); new CronTime(new Date()); new CronTime(moment()); - diff --git a/types/cron/index.d.ts b/types/cron/index.d.ts index de4398333c..e7a5e63f7e 100644 --- a/types/cron/index.d.ts +++ b/types/cron/index.d.ts @@ -139,9 +139,8 @@ export declare class CronJob { public addCallback(callback: Function): void; } -export declare var job: - ((cronTime: string | Date | Moment, onTick: () => void, onComplete?: CronCommand, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean) => CronJob) - | ((options: CronJobParameters) => CronJob); -export declare var time: (source: string | Date | Moment, zone?: string) => CronTime; -export declare var sendAt: (cronTime: string | Date | Moment) => Moment; -export declare var timeout: (cronTime: string | Date | Moment) => number; +export declare function job(options: CronJobParameters): CronJob; +export declare function job(cronTime: string | Date | Moment, onTick: () => void, onComplete?: CronCommand, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean): CronJob; +export declare function time(source: string | Date | Moment, zone?: string): CronTime; +export declare function sendAt(cronTime: string | Date | Moment): Moment; +export declare function timeout(cronTime: string | Date | Moment): number;