chronos-ts
Version:
A comprehensive TypeScript package for handling time periods, intervals, and date-related operations.
62 lines (61 loc) • 2.22 kB
TypeScript
export declare class Interval {
private minutes;
private hours;
private days;
private weeks;
private months;
/**
* Constructs a new instance of the Interval class.
*
* @param minutes - The number of minutes (default is 0).
* @param hours - The number of hours (default is 0).
* @param days - The number of days (default is 0).
* @param weeks - The number of weeks (default is 0).
* @param months - The number of months (default is 0).
*/
private constructor();
/**
* Creates an Interval instance representing the specified number of minutes.
*
* @param minutes - The number of minutes for the interval.
* @returns An Interval instance representing the specified number of minutes.
*/
static minutes(minutes: number): Interval;
/**
* Creates an Interval instance representing the given number of hours.
*
* @param hours - The number of hours for the interval.
* @returns An Interval instance with the specified hours.
*/
static hours(hours: number): Interval;
/**
* Creates an Interval instance representing the specified number of days.
*
* @param days - The number of days for the interval.
* @returns An Interval instance with the specified number of days.
*/
static days(days: number): Interval;
/**
* Creates an Interval instance representing the specified number of weeks.
*
* @param weeks - The number of weeks for the interval.
* @returns An Interval instance with the specified number of weeks.
*/
static weeks(weeks: number): Interval;
/**
* Creates an Interval instance representing a specified number of months.
*
* @param months - The number of months for the interval.
* @returns An Interval instance with the specified number of months.
*/
static months(months: number): Interval;
/**
* Calculates the total interval in minutes.
*
* This method sums up the minutes, hours, days, weeks, and months
* to return the total interval in minutes.
*
* @returns {number} The total interval in minutes.
*/
getMinutesInterval(): number;
}