UNPKG

@rr0/time

Version:
45 lines 1.08 kB
/** * @abstract * @template P The result type of parsing */ export class EDTFParser<P> { /** * Creates an EDTF parser. * * @protected * @param {string} name The name of the component to parse. * @param {string} format The Regexp pattern to match. */ protected constructor(); /** * @readonly * @type RegExp */ readonly regExp: RegExp; name: string; /** * @protected * @param {string} str * @return {{[p: string]: string}} */ protected regexGroups(str: string): { [p: string]: string; }; /** * @abstract * @protected * @param {{[p: string]: string}} groups The regex groups * @return {Record<string, any>} The parsing result. */ protected parseGroups(groups: { [p: string]: string; }): Record<string, any>; /** * Parses an EDTF string. * * @param {string} str An EDTF string to parse. * @return {P} The parse result object. */ parse(str: string): P; } //# sourceMappingURL=EDTFParser.d.mts.map