@rr0/time
Version:
EDTF parsing
61 lines • 1.44 kB
text/typescript
/**
* @typedef {Object} Level0DurationParseResult
* @property {number} [seconds]
* @property {number} [minutes]
* @property {number} [hours]
* @property {number} [days]
* @property {number} [months]
* @property {number} [years]
*/
/**
* Parses duration strings in the ISO-8601/EDTF "PxxHyyMzzS" format,
* with support for component-level fuzziness.
*/
export class Level2DurationParser extends Level2ComponentParser {
/**
* @readonly
* @type {string}
*/
static readonly yearsGroup: string;
/**
* @readonly
* @type {string}
*/
static readonly monthsGroup: string;
/**
* @readonly
* @type {string}
*/
static readonly daysGroup: string;
/**
* @readonly
* @type {string}
*/
static readonly hoursGroup: string;
/**
* @readonly
* @type {string}
*/
static readonly minutesGroup: string;
/**
* @readonly
* @type {string}
*/
static readonly secondsGroup: string;
/**
* @param {string} prefix
* @return {string}
*/
static format(prefix?: string): string;
constructor();
}
export type Level0DurationParseResult = {
seconds?: number;
minutes?: number;
hours?: number;
days?: number;
months?: number;
years?: number;
};
import { Level2ComponentParser } from "../component/Level2ComponentParser.mjs";
//# sourceMappingURL=Level2DurationParser.d.mts.map