UNPKG

made-runtime

Version:
99 lines (98 loc) 4.12 kB
import { IEquatable } from "./IEquatable"; /** * Defines a representation for a duration of time. */ export declare class TimeSpan implements IEquatable<TimeSpan> { static readonly TicksPerMillisecond = 10000; static readonly TicksPerSecond: number; static readonly TicksPerMinute: number; static readonly TicksPerHour: number; static readonly TicksPerDay: number; static readonly Zero: TimeSpan; private _ticks; /** * Initializes a new instance of the TimeSpan class with a specified number of days, hours, minutes, seconds, and milliseconds. */ constructor(days?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number); /** * Gets the number of ticks that represent the value of the current TimeSpan. * @returns {number} The number of ticks that represent the value of this instance. */ ticks(): number; /** * Gets the days component of the current TimeSpan. * @returns {number} The days component of this instance. */ days(): number; /** * Gets the hours component of the current TimeSpan. * @returns {number} The hours component of this instance. */ hours(): number; /** * Gets the minutes component of the current TimeSpan. * @returns {number} The minutes component of this instance. */ minutes(): number; /** * Gets the seconds component of the current TimeSpan. * @returns {number} The seconds component of this instance. */ seconds(): number; /** * Gets the milliseconds component of the current TimeSpan. * @returns {number} The milliseconds component of this instance. */ milliseconds(): number; /** * Gets the value of the current TimeSpan expressed in whole and fractional days. * @returns {number} The total number of days represented by this instance. */ totalDays(): number; /** * Gets the value of the current TimeSpan expressed in whole and fractional hours. * @returns {number} The total number of hours represented by this instance. */ totalHours(): number; /** * Gets the value of the current TimeSpan expressed in whole and fractional minutes. * @returns {number} The total number of minutes represented by this instance. */ totalMinutes(): number; /** * Gets the value of the current TimeSpan expressed in whole and fractional seconds. * @returns {number} The total number of seconds represented by this instance. */ totalSeconds(): number; /** * Gets the value of the current TimeSpan expressed in whole and fractional milliseconds. * @returns {number} The total number of milliseconds represented by this instance. */ totalMilliseconds(): number; /** * Returns a new TimeSpan whose value is the sum of the specified TimeSpan and this instance. * @param ts The TimeSpan to add. * @returns {TimeSpan} A new TimeSpan that represents the value of this instance plus the value of ts. */ add(ts: TimeSpan): TimeSpan; /** * Returns a new TimeSpan whose value is the difference of the specified TimeSpan and this instance. * @param ts The TimeSpan to subtract. * @returns {TimeSpan} A new TimeSpan that represents the value of this instance minus the value of ts. */ subtract(ts: TimeSpan): TimeSpan; /** * Returns a new TimeSpan whose value is the multiplication of the specified factor and this instance. * @param factor The factor to multiply by. * @returns {TimeSpan} A new TimeSpan that represents the value of this instance multiplied by the value of factor. */ multiply(factor: number): TimeSpan; /** * Returns a new TimeSpan whose value is the division of the specified factor and this instance. * @param factor The factor to divide by. * @returns {TimeSpan} A new TimeSpan that represents the value of this instance divided by the value of factor. */ divide(factor: number): TimeSpan; equals(other: TimeSpan): boolean; toString(): string; }