/** @import { EDTFParser } from "../../EDTFParser.mjs" */ /** @import { LevelFactory } from "../../LevelFactory.mjs" */ /** @import { Level2Date } from "../date/Level2Date.mjs" */ /** @import { Level2Year } from "../year/Level2Year.mjs" */ /** @import { Level2Month } from "../month/Level2Month.mjs" */ /** @import { Level2Day } from "../day/Level2Day.mjs" */ /** @import { Level2Hour } from "../hour/Level2Hour.mjs" */ /** @import { Level2Minute } from "../minute/Level2Minute.mjs" */ /** @import { Level2Second } from "../second/Level2Second.mjs" */ /** * @typedef {Object} Level2DurationInSpec * @property {Level2Year|number} [years] * @property {Level2Month|number} [months] * @property {Level2Day|number} [days] * @property {Level2Hour|number} [hours] * @property {Level2Minute|number} [minutes] * @property {Level2Second|number} [seconds] * @property {Level2Millisecond|number} [milliseconds] */ /** * @typedef {Object} Level2DurationOutSpec * @property {Level2Year} [years] * @property {Level2Month} [months] * @property {Level2Day} [days] * @property {Level2Hour} [hours] * @property {Level2Minute} [minutes] * @property {Level2Second} [seconds] * @property {Level2Millisecond} [milliseconds] */ /** * @template {Level2Year} [Y=Level2Year] * @template {Level2Month} [M=Level2Month] * @template {Level2Day} [D=Level2Day] * @template {Level2Hour} [H=Level2Hour] * @template {Level2Minute} [M=Level2Minute] * @template {Level2Second} [S=Level2Second] * @template {Level2Millisecond} [C=Level2Millisecond] * @extends Level1Duration */ export class Level2Duration extends Level1Duration { /** * @readonly * @type {string[]} */ static readonly componentNames: string[]; /** * @param {Level2DurationInSpec} spec * @return {number} */ static valueFromSpec(spec: Level2DurationInSpec): number; /** * @template D=Level2Duration * @template O=Level2DurationOutSpec * @param {D} comp * @param {LevelFactory} [factory] * @return {O} */ static toSpec(comp: D_1, factory?: LevelFactory): O; /** * @param {string} str The duration string to parse. * @param {EDTFParser} [parser] The parser to use. * @return {Level2Duration} */ static fromString(str: string, parser?: EDTFParser): Level2Duration; /** * @param {Level2Date} beforeDate * @param {Level2Date} afterDate * @return {Level2Duration} */ static between(beforeDate: Level2Date, afterDate: Level2Date): Level2Duration; /** * @param {Level2DurationInSpec|number} spec The duration spec in years, months, etc., or value in milliseconds. */ constructor(spec: Level2DurationInSpec | number); /** * The components that have been specified, with their qualification, as opposed to the ones deduced from the duration value. * * @return {Level2DurationOutSpec|undefined} */ get components(): Level2DurationOutSpec; /** * @return {boolean} Whether the whole duration is uncertain ("?P1Y2M", "P1Y2M?"). */ get uncertainDuration(): boolean; /** * @return {boolean} Whether the whole duration is approximate ("~P1Y2M", "P1Y2M~"). */ get approximateDuration(): boolean; /** * @return {boolean} Whether some specified component has a qualification of its own ("P~1Y2M"), which has to be kept apart from the others. */ get hasQualifiedComponent(): boolean; /** * @return {Level2DurationOutSpec} */ toSpec(): Level2DurationOutSpec; #private; } export type Level2DurationInSpec = { years?: Level2Year | number; months?: Level2Month | number; days?: Level2Day | number; hours?: Level2Hour | number; minutes?: Level2Minute | number; seconds?: Level2Second | number; milliseconds?: Level2Millisecond | number; }; export type Level2DurationOutSpec = { years?: Level2Year; months?: Level2Month; days?: Level2Day; hours?: Level2Hour; minutes?: Level2Minute; seconds?: Level2Second; milliseconds?: Level2Millisecond; }; import type { Level2Year } from "../year/Level2Year.mjs"; import type { Level2Month } from "../month/Level2Month.mjs"; import type { Level2Day } from "../day/Level2Day.mjs"; import type { Level2Hour } from "../hour/Level2Hour.mjs"; import type { Level2Second } from "../second/Level2Second.mjs"; import { Level1Duration } from "../../level1/duration/Level1Duration.mjs"; import type { LevelFactory } from "../../LevelFactory.mjs"; import { EDTFParser } from "../../EDTFParser.mjs"; import type { Level2Date } from "../date/Level2Date.mjs"; import type { Level2Minute } from "../minute/Level2Minute.mjs"; //# sourceMappingURL=Level2Duration.d.mts.map