Merge pull request #11610 from georgeedwards/master

Fix #11609
This commit is contained in:
Vladimir Matveev
2016-09-29 11:06:57 -07:00
committed by GitHub
+28 -28
View File
@@ -13,7 +13,7 @@ declare module 'node-schedule' {
* The callback executed by a Job
*/
export interface JobCallback {
():void;
(): void;
}
/**
@@ -25,7 +25,7 @@ declare module 'node-schedule' {
/**
* This Job's name. read-only.
*/
name:string;
name: string;
/**
* Use the function scheduleJob() to create new Job objects.
@@ -36,7 +36,7 @@ declare module 'node-schedule' {
* @param {JobCallback|Function} job either this Job's callback or an optional callback function
* @param {Function} callback optional callback that is executed right before the JobCallback
*/
constructor(name: string|JobCallback, job?: JobCallback|Function, callback?: Function);
constructor(name: string | JobCallback, job?: JobCallback | Function, callback?: Function);
/**
* Adds an Invocation to this job. For internal use.
@@ -44,7 +44,7 @@ declare module 'node-schedule' {
* @param {Invocation} invokation
* @return {boolean} whether the invocation could be added
*/
trackInvocation(invokation:Invocation):boolean;
trackInvocation(invokation: Invocation): boolean;
/**
* removes an Invocation from this Job's tracking list. For internal use.
@@ -52,69 +52,69 @@ declare module 'node-schedule' {
* @param invocation {Invocation}
* @return boolean whether the invocation was successful. Removing an Invocation that doesn't exist, returns false.
*/
stopTrackingInvocation(invocation:Invocation):boolean;
stopTrackingInvocation(invocation: Invocation): boolean;
/**
* @internal
* @return {number} the number of currently running instances of this Job.
*/
triggeredJobs():number;
triggeredJobs(): number;
/**
* set the number of currently running Jobs.
* @internal
* @param triggeredJobs
*/
setTriggeredJobs(triggeredJobs:number):void;
setTriggeredJobs(triggeredJobs: number): void;
/**
* cancel all pending Invocations of this Job.
* @param reschedule {boolean} whether to reschedule the canceled Invocations.
*/
cancel(reschedule?:boolean):boolean;
cancel(reschedule?: boolean): boolean;
/**
* cancel the next Invocation of this Job.
* @param reschedule {boolean} whether to reschedule the canceled Invocation.
* @return {boolean} whether cancelation was successful
*/
cancelNext(reschedule?:boolean):boolean;
cancelNext(reschedule?: boolean): boolean;
/**
* Changes the scheduling information for this Job.
* @param spec {RecurrenceRule|string|number} the
* @return {boolean} whether the reschedule was successful
*/
reschedule(spec:RecurrenceRule|string|number):boolean;
reschedule(spec: RecurrenceRule | string | number): boolean;
/**
* Returns the Date on which this Job will be run next.
* @return {Date}
*/
nextInvocation():Date;
nextInvocation(): Date;
/**
* @return Invocation[] a list of all pending Invocations
*/
pendingInvocations():Invocation[];
pendingInvocations(): Invocation[];
/**
* run this Job immediately.
*/
invoke():void;
invoke(): void;
/**
* schedule this Job to be run on the specified date.
* @param date {Date}
*/
runOnDate(date:Date): void;
runOnDate(date: Date): void;
/**
* set scheduling information
* @param {Date|string|number} date
* @public
*/
schedule(date: Date|string|number): boolean;
schedule(date: Date | string | number): boolean;
}
/**
@@ -160,7 +160,7 @@ declare module 'node-schedule' {
* @public
* @type {number|Array<number|Range>}
*/
dayOfWeek: number|Array<number|Range>;
dayOfWeek: number | Array<number | Range>;
/**
* Hour.
@@ -202,15 +202,15 @@ declare module 'node-schedule' {
*/
year: number;
constructor(year:number,
month:number,
date:number,
dayOfWeek:number|Array<number|Range>,
hour:number,
minute:number,
second:number);
constructor(year?: number,
month?: number,
date?: number,
dayOfWeek?: number | Array<number | Range>,
hour?: number,
minute?: number,
second?: number);
nextInvocationDate(base:Date):Date;
nextInvocationDate(base: Date): Date;
}
/**
@@ -269,7 +269,7 @@ declare module 'node-schedule' {
* @param {RecurrenceRule|Date|string} rule either the scheduling info or the JobCallback
* @param {JobCallback} callback The callback to be executed on each invocation.
*/
export function scheduleJob(name:string|RecurrenceRule|Date, rule: RecurrenceRule|Date|string|JobCallback, callback?: JobCallback): Job;
export function scheduleJob(name: string | RecurrenceRule | Date, rule: RecurrenceRule | Date | string | JobCallback, callback?: JobCallback): Job;
/**
* Changes the timing of a Job, canceling all pending invocations.
@@ -278,12 +278,12 @@ declare module 'node-schedule' {
* @param spec {JobCallback} the new timing for this Job
* @return {Job} if the job could be rescheduled, {null} otherwise.
*/
export function rescheduleJob(job:Job|string, spec:RecurrenceRule|Date|string):Job;
export function rescheduleJob(job: Job | string, spec: RecurrenceRule | Date | string): Job;
/**
* Dictionary of all Jobs, accessible by name.
*/
export let scheduledJobs:{[jobName:string]:Job};
export let scheduledJobs: { [jobName: string]: Job };
/**
* Cancels the job.
@@ -291,5 +291,5 @@ declare module 'node-schedule' {
* @param {Job} job The job.
* @returns {boolean} {true} if the job has been cancelled with success, otherwise, {false}.
*/
export function cancelJob(job: Job|string): boolean;
export function cancelJob(job: Job | string): boolean;
}