Comparing version 4.0.74 to 4.0.75
{ | ||
"name": "croner", | ||
"version": "4.0.74", | ||
"version": "4.0.75", | ||
"description": "Trigger functions in javascript using Cron syntax. No deps. All features.", | ||
@@ -55,3 +55,3 @@ "author": "Hexagon <github.com/hexagon>", | ||
"module": "./src/croner.js", | ||
"types": "types/croner.d.ts", | ||
"types": "types/croner.single.d.ts", | ||
"exports": { | ||
@@ -58,0 +58,0 @@ ".": { |
@@ -18,3 +18,3 @@ <p align="center"> | ||
* **Experimental feature:** Schedule in specific target timezones | ||
* Includes [TypeScript](https://www.typescriptlang.org/) typings | ||
* Includes [TypeScript](https://www.typescriptlang.org/) typings, see Usage/Typescript | ||
@@ -46,2 +46,4 @@ Quick examples: | ||
JavaScript | ||
```javascript | ||
@@ -55,2 +57,15 @@ // ESM Import ... | ||
TypeScript | ||
*Note that only default export is available in Node.js TypeScript, as the commonjs module is used internally.* | ||
```typescript | ||
import Cron from "croner"; | ||
const scheduler : Cron = new Cron("* * * * * *", () => { | ||
console.log("This will run every second."); | ||
}); | ||
``` | ||
### Deno | ||
@@ -73,3 +88,3 @@ | ||
let scheduler : Cron = new Cron("* * * * * *", () => { | ||
const _scheduler : Cron = new Cron("* * * * * *", () => { | ||
console.log("This will run every second."); | ||
@@ -76,0 +91,0 @@ }); |
@@ -39,4 +39,4 @@ /* ------------------------------------------------------------------------------------ | ||
* @property {number} [maxRuns] - Maximum nuber of executions | ||
* @property {string | date} [startAt] - When to start running | ||
* @property {string | date} [stopAt] - When to stop running | ||
* @property {string | Date} [startAt] - When to start running | ||
* @property {string | Date} [stopAt] - When to stop running | ||
* @property {string} [timezone] - Time zone in Europe/Stockholm format | ||
@@ -132,4 +132,4 @@ */ | ||
* | ||
* @param {date} [prev] - Input pattern | ||
* @returns {date | null} - Next run time | ||
* @param {Date} [prev] - Input pattern | ||
* @returns {Date | null} - Next run time | ||
*/ | ||
@@ -158,3 +158,3 @@ Cron.prototype.next = function (prev) { | ||
* | ||
* @returns {date | null} - Previous run time | ||
* @returns {Date | null} - Previous run time | ||
*/ | ||
@@ -198,3 +198,3 @@ Cron.prototype.previous = function () { | ||
* | ||
* @param {date} [prev] - Starting date, defaults to now | ||
* @param {Date} [prev] - Starting date, defaults to now | ||
* @returns {number | null} | ||
@@ -201,0 +201,0 @@ */ |
@@ -31,3 +31,3 @@ import convertTZ from "./timezone.js"; | ||
* | ||
* @param {date} date - Input date | ||
* @param {Date} date - Input date | ||
* @param {boolean} fromLocal - Target already in local time | ||
@@ -71,3 +71,3 @@ */ | ||
* | ||
* @param {date} date - Input date | ||
* @param {Date} date - Input date | ||
*/ | ||
@@ -90,3 +90,3 @@ CronDate.prototype.apply = function () { | ||
* | ||
* @param {date} date - Input date | ||
* @param {Date} date - Input date | ||
*/ | ||
@@ -232,3 +232,3 @@ CronDate.prototype.fromString = function (str) { | ||
* @param {boolean} internal - If this is an internal call | ||
* @returns {date} | ||
* @returns {Date} | ||
*/ | ||
@@ -250,3 +250,3 @@ CronDate.prototype.getDate = function (internal) { | ||
* @param {boolean} internal - If this is an internal call | ||
* @returns {date} | ||
* @returns {Date} | ||
*/ | ||
@@ -253,0 +253,0 @@ CronDate.prototype.getTime = function (internal) { |
@@ -25,7 +25,7 @@ export default Cron; | ||
*/ | ||
startAt?: string | any; | ||
startAt?: string | Date; | ||
/** | ||
* - When to stop running | ||
*/ | ||
stopAt?: string | any; | ||
stopAt?: string | Date; | ||
/** | ||
@@ -66,6 +66,6 @@ * - Time zone in Europe/Stockholm format | ||
* | ||
* @param {date} [prev] - Input pattern | ||
* @returns {date | null} - Next run time | ||
* @param {Date} [prev] - Input pattern | ||
* @returns {Date | null} - Next run time | ||
*/ | ||
next(prev?: any): any | null; | ||
next(prev?: Date): Date | null; | ||
/** | ||
@@ -82,5 +82,5 @@ * Is running? | ||
* | ||
* @returns {date | null} - Previous run time | ||
* @returns {Date | null} - Previous run time | ||
*/ | ||
public previous(): any | null; | ||
public previous(): Date | null; | ||
private _next; | ||
@@ -91,6 +91,6 @@ /** | ||
* | ||
* @param {date} [prev] - Starting date, defaults to now | ||
* @param {Date} [prev] - Starting date, defaults to now | ||
* @returns {number | null} | ||
*/ | ||
public msToNext(prev?: any): number | null; | ||
public msToNext(prev?: Date): number | null; | ||
/** | ||
@@ -97,0 +97,0 @@ * Stop execution |
@@ -44,5 +44,5 @@ /** | ||
* @param {boolean} internal - If this is an internal call | ||
* @returns {date} | ||
* @returns {Date} | ||
*/ | ||
public getDate(internal: boolean): any; | ||
public getDate(internal: boolean): Date; | ||
/** | ||
@@ -53,6 +53,6 @@ * Convert current state back to a javascript Date() and return UTC milliseconds | ||
* @param {boolean} internal - If this is an internal call | ||
* @returns {date} | ||
* @returns {Date} | ||
*/ | ||
public getTime(internal: boolean): any; | ||
public getTime(internal: boolean): Date; | ||
private parseISOLocal; | ||
} |
Sorry, the diff of this file is not supported yet
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
113261
241