import { Instant } from './Instant.js'; import { DurationSpec } from './DurationSpec.js'; declare const BRAND: unique symbol; export declare class Duration { private readonly momentDuration; private [BRAND]; private constructor(); /** * Accepts an ISO-8601 duration string, e.g. "PT15M" for "fifteen minutes", and turns it into * an appropriate {@link Duration}. */ static parse(durationString: string): Duration; /** * Converts to an ISO-8601 duration string, e.g. "PT15M" for "fifteen minutes". */ toString(): string; static of({ years, days, hours, minutes, seconds, millis }: DurationSpec): Duration; static ofYears(years: T): T; static ofYears(years: number): Duration; static ofYears(years: number | T): Duration | T; static ofDays(days: T): T; static ofDays(days: number): Duration; static ofDays(days: number | T): Duration | T; static ofHours(hours: T): T; static ofHours(hours: number): Duration; static ofHours(hours: number | T): Duration | T; static ofMinutes(minutes: T): T; static ofMinutes(minutes: number): Duration; static ofMinutes(minutes: number | T): Duration | T; static ofSeconds(seconds: T): T; static ofSeconds(seconds: number): Duration; static ofSeconds(seconds: number | T): Duration | T; static ofMilliseconds(milliseconds: T): T; static ofMilliseconds(milliseconds: number): Duration; static ofMilliseconds(milliseconds: number | T): Duration | T; static between(fromExcl: Instant, toIncl: Instant): Duration; static get ZERO(): Duration; /** * This {@link Duration} expressed in number of days, rounded down. In other words: the * total number of whole days that fit in this {@link Duration}. Not to be confused with * {@link .days}. A fixed day length of 24 hours is used. */ get asDays(): number; /** * This {@link Duration} expressed in number of hours, rounded down. In other words: the * total number of whole hours that fit in this {@link Duration}. Not to be confused with * {@link .hours}. */ get asHours(): number; /** * This {@link Duration} expressed in number of minutes, rounded down. In other words: the * total number of whole minutes that fit in this {@link Duration}. Not to be confused with * {@link .minutes}. */ get asMinutes(): number; /** * This {@link Duration} expressed in number of seconds, rounded down. In other words: the * total number of whole seconds that fit in this {@link Duration}. Not to be confused with * {@link .seconds}. */ get asSeconds(): number; /** * This {@link Duration} expressed in number of milliseconds. Not to be confused with * {@link .milliseconds}. */ get asMillis(): number; /** * The years component in this {@link Duration}. Note: NOT 'the entire length of this duration * expressed in years' —for that, use {@link .asYears}. */ get years(): number; /** * The months component in this {@link Duration}. Note: NOT 'the entire length of this duration * expressed in months'. */ get months(): number; /** * The days component in this {@link Duration}. Note: NOT 'the entire length of this duration * expressed in days'. */ get days(): number; /** * The hours component in this {@link Duration}. Note: NOT 'the entire length of this duration * expressed in hours' —for that, use {@link .asHours}. */ get hours(): number; /** * The minutes component in this {@link Duration}. Note: NOT 'the entire length of this duration * expressed in minutes' —for that, use {@link .asMinutes}. */ get minutes(): number; /** * The seconds component in this {@link Duration}. Note: NOT 'the entire length of this duration * expressed in seconds' —for that, use {@link .asSeconds}. */ get seconds(): number; /** * The milliseconds component in this {@link Duration}. Note: NOT 'the entire length of this duration * expressed in milliseconds' —for that, use {@link .asMillis}. */ get milliseconds(): number; /** * * @param formatString A string describing the serialization * format with the following placeholders: *
    *
  • Y years component. E.g.: 23, 23237
  • *
  • D days component. E.g.: 6, 237
  • *
  • H hours component, unpadded. E.g.: 2, 23
  • *
  • HH hours component, padded to two digits. E.g.: 02, 23
  • *
  • m minutes component, unpadded. E.g.: 8, 48
  • *
  • mm minutes component, padded to two digits. E.g.: 08, 48
  • *
  • s seconds component, unpadded. E.g.: 8, 55
  • *
  • ss seconds component, padded to two digits. E.g.: 08, 55
  • *
  • SS milliseconds component, unpadded. E.g.: 8, 273
  • *
  • SSS milliseconds component, padded to three digits. E.g.: 008, 273
  • *
* Any literal strings that should not be substituted as above should be surrounded * by brackets (`[]`). */ format(formatString: string): string; static isInstance(value: any): value is Duration; } export declare const millis: typeof Duration.ofMilliseconds; export declare const milliseconds: typeof Duration.ofMilliseconds; export declare const seconds: typeof Duration.ofSeconds; export declare const minutes: typeof Duration.ofMinutes; export declare const hours: typeof Duration.ofHours; export declare const days: typeof Duration.ofDays; export declare const years: typeof Duration.ofYears; export {};