import { TimeUnit } from './TimeUnit'; /** * Represents a period of time. * * NOTE: This class is only accurate to 5 decimal places! */ export declare class TimeSpan { #private; /** * A [[TimeSpan]] instance representing no time. */ static readonly zero: TimeSpan; /** * A [[TimeSpan]] instance representing the maximum time which may be represented. */ static readonly maximum: TimeSpan; /** * Initializes a new instance of the [[TimeSpan]] class. * @param value The time value. * @param unit The time unit. */ constructor(value: number, unit: TimeUnit); /** * Creates a [[TimeSpan]] instance for the specified time in milliseconds. * @param milliseconds The time span in milliseconds. * @returns A new [[TimeSpan]] instance. * @throws [[InvalidParameterError]] If milliseconds is too large to be represented as a [[TimeSpan]]. */ static fromMilliseconds(milliseconds: number): TimeSpan; /** * Creates a [[TimeSpan]] instance for the specified time in seconds. * @param seconds The time span in seconds. * @returns A new [[TimeSpan]] instance. */ static fromSeconds(seconds: number): TimeSpan; /** * Creates a [[TimeSpan]] instance for the specified time in minutes. * @param minutes The time span in minutes. * @returns A new [[TimeSpan]] instance. */ static fromMinutes(minutes: number): TimeSpan; /** * Creates a [[TimeSpan]] instance for the specified time in hours. * @param hours The time span in hours. * @returns A new [[TimeSpan]] instance. */ static fromHours(hours: number): TimeSpan; /** * Creates a [[TimeSpan]] instance for the specified time in days. * @param days The time span in days. * @returns A new [[TimeSpan]] instance. */ static fromDays(days: number): TimeSpan; /** * Creates a [[TimeSpan]] instance for the specified time in weeks. * @param weeks The time span in weeks. * @returns A new [[TimeSpan]] instance. */ static fromWeeks(weeks: number): TimeSpan; /** * Creates a [[TimeSpan]] instance for the specified time in years. * @param years The time span in years. * @returns A new [[TimeSpan]] instance. */ static fromYears(years: number): TimeSpan; /** * Creates a [[TimeSpan]] instance for the specified time string. * * Example: "1 hour", "30 s", "1.5 days", or "1m 30s". * * Supported time units are: * * y / year / years * * w / week / weeks * * d / day / days * * h / hour /hours * * m / minute / minutes * * s / second / seconds * * ms / millisecond / milliseconds * @param timeString The time string to convert to a [[TimeSpan]] instance. * @returns A new [[TimeSpan]] instance. */ static fromTimeString(timeString: string): TimeSpan; /** * Gets just the milliseconds portion of time span. */ get milliseconds(): number; /** * Gets just the seconds portion of time span. */ get seconds(): number; /** * Gets just the minutes portion of time span. */ get minutes(): number; /** * Gets just the hours portion of time span. */ get hours(): number; /** * Gets just the days portion of time span. */ get days(): number; /** * Gets just the weeks portion of time span. */ get weeks(): number; /** * Gets just the years portion of time span. */ get years(): number; /** * Gets the total time span represented as milliseconds. */ get totalMilliseconds(): number; /** * Gets the total time span represented as seconds. */ get totalSeconds(): number; /** * Gets the total time span represented as minutes. */ get totalMinutes(): number; /** * Gets the total time span represented as hours. */ get totalHours(): number; /** * Gets the total time span represented as days. */ get totalDays(): number; /** * Gets the total time span represented as weeks. */ get totalWeeks(): number; /** * Gets the total time span represented as years. */ get totalYears(): number; /** * Creates a string representation of the [[TimeSpan]]. * @returns A string representation of the time span. */ toString(): string; /** * Returns a JSON representation of the current object instance. * @returns A JSON representation of the current object instance. */ toJSON(): object; }