@types/cron
Advanced tools
Comparing version 1.7.3 to 2.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for cron 1.7 | ||
// Type definitions for cron 2.0 | ||
// Project: https://www.npmjs.com/package/cron | ||
@@ -10,3 +10,3 @@ // Definitions by: Hiroki Horiuchi <https://github.com/horiuchi> | ||
import { Moment } from 'moment'; | ||
import { DateTime } from 'luxon'; | ||
import { SpawnOptions } from "child_process"; | ||
@@ -19,7 +19,7 @@ | ||
* Create a new ```CronTime```. | ||
* @param source The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. | ||
* @param zone Timezone name. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). | ||
* @param source The time to fire off your job. This can be in the form of cron syntax, a JS ```Date``` object, or a luxon ```DateTime``` object. | ||
* @param zone Timezone name. Can be any string accepted by luxon's ```DateTime.setZone()``` (https://moment.github.io/luxon/api-docs/index.html#datetimesetzone). | ||
* @param utcOffset UTC offset. Don't use both ```zone``` and ```utcOffset``` together or weird things may happen. | ||
*/ | ||
constructor(source: string | Date | Moment, zone?: string, utcOffset?: string | number); | ||
constructor(source: string | Date | DateTime, zone?: string, utcOffset?: string | number); | ||
@@ -29,9 +29,9 @@ /** | ||
*/ | ||
public sendAt(): Moment; | ||
public sendAt(): DateTime; | ||
/** | ||
* Tells you when ```CronTime``` will be run. | ||
* @param i Indicate which turn of run after now. If not given return next run time. | ||
* @returns A `Moment` when the source passed in the constructor is a `Date` or a `Moment` and an array of `Moment` when the source is a string | ||
* @returns A ```DateTime``` when the source passed in the constructor is a ```Date``` or a ```DateTime``` and an array of ```DateTime``` when the source is a string. | ||
*/ | ||
public sendAt(i?: number): Moment | Moment[]; | ||
public sendAt(i?: number): DateTime | DateTime[]; | ||
/** | ||
@@ -45,5 +45,5 @@ * Get the number of milliseconds in the future at which to fire our callbacks. | ||
/** | ||
* The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. | ||
* The time to fire off your job. This can be in the form of cron syntax, a JS ```Date``` object, or a luxon ```DateTime``` object. | ||
*/ | ||
cronTime: string | Date | Moment; | ||
cronTime: string | Date | DateTime; | ||
/** | ||
@@ -62,3 +62,3 @@ * The function to fire at the specified time. If an ```onComplete``` callback was provided, ```onTick``` will receive it as an argument. ```onTick``` may call ```onComplete``` when it has finished its work. | ||
/** | ||
* Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen. | ||
* Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. Can be any string accepted by luxon's ```DateTime.setZone()``` (https://moment.github.io/luxon/api-docs/index.html#datetimesetzone). Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen. | ||
*/ | ||
@@ -99,4 +99,4 @@ timeZone?: string | undefined; | ||
* @param onComplete A function that will fire when the job is complete, when it is stopped. | ||
* @param start Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your onTick function, it just gives you more control over the behavior of your jobs. | ||
* @param timeZone Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). | ||
* @param startNow Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your onTick function, it just gives you more control over the behavior of your jobs. | ||
* @param timeZone Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. Can be any string accepted by luxon's ```DateTime.setZone()``` (https://moment.github.io/luxon/api-docs/index.html#datetimesetzone). | ||
* @param context The context within which to execute the onTick method. This defaults to the cronjob itself allowing you to call ```this.stop()```. However, if you change this you'll have access to the functions and values within your context object. | ||
@@ -107,3 +107,3 @@ * @param runOnInit This will immediately fire your ```onTick``` function as soon as the requisit initialization has happened. This option is set to ```false``` by default for backwards compatibility. | ||
*/ | ||
constructor(cronTime: string | Date | Moment, onTick: CronCommand, onComplete?: CronCommand | null, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean); | ||
constructor(cronTime: string | Date | DateTime, onTick: CronCommand, onComplete?: CronCommand | null, startNow?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean); | ||
/** | ||
@@ -135,10 +135,10 @@ * Create a new ```CronJob```. | ||
*/ | ||
public nextDate(): Moment; | ||
public nextDates(): Moment; | ||
public nextDate(): DateTime; | ||
public nextDates(): DateTime; | ||
/** | ||
* Tells you when a ```CronTime``` will be run. | ||
* @param i Indicate which turn of run after now. If not given return next run time. | ||
* @returns A `Moment` when the cronTime passed in the constructor is a `Date` or a `Moment` and an array of `Moment` when the cronTime is a string | ||
* @returns A `DateTime` when the cronTime passed in the constructor is a `Date` or a `DateTime` and an array of `DateTime` when the cronTime is a string. | ||
*/ | ||
public nextDates(i?: number): Moment | Moment[]; | ||
public nextDates(i?: number): DateTime | DateTime[]; | ||
/** | ||
@@ -152,5 +152,5 @@ * Add another ```onTick``` function. | ||
export declare function job(options: CronJobParameters): CronJob; | ||
export declare function job(cronTime: string | Date | Moment, onTick: () => void, onComplete?: CronCommand | null, 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; | ||
export declare function job(cronTime: string | Date | DateTime, onTick: () => void, onComplete?: CronCommand | null, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean): CronJob; | ||
export declare function time(source: string | Date | DateTime, zone?: string): CronTime; | ||
export declare function sendAt(cronTime: string | Date | DateTime): DateTime; | ||
export declare function timeout(cronTime: string | Date | DateTime): number; |
{ | ||
"name": "@types/cron", | ||
"version": "1.7.3", | ||
"version": "2.0.0", | ||
"description": "TypeScript definitions for cron", | ||
@@ -33,7 +33,7 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cron", | ||
"dependencies": { | ||
"@types/node": "*", | ||
"moment": ">=2.14.0" | ||
"@types/luxon": "*", | ||
"@types/node": "*" | ||
}, | ||
"typesPublisherContentHash": "615fac5282118fb0aa30ddf948474b0ab5c0d6cd1c7aaa1f62d13bf658219438", | ||
"typeScriptVersion": "3.6" | ||
"typesPublisherContentHash": "4dabe7dd0faf56377dd01490eeddf0a82f11653f7e18adc4beeec0eaa483f798", | ||
"typeScriptVersion": "3.9" | ||
} |
@@ -11,4 +11,4 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 06 Jul 2021 20:32:31 GMT | ||
* Dependencies: [@types/moment](https://npmjs.com/package/@types/moment), [@types/node](https://npmjs.com/package/@types/node) | ||
* Last updated: Wed, 11 May 2022 14:31:35 GMT | ||
* Dependencies: [@types/luxon](https://npmjs.com/package/@types/luxon), [@types/node](https://npmjs.com/package/@types/node) | ||
* Global values: none | ||
@@ -15,0 +15,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12009
143
+ Added@types/luxon@*
+ Added@types/luxon@3.4.2(transitive)
- Removedmoment@>=2.14.0
- Removedmoment@2.30.1(transitive)