UNPKG

chrono-node

Version:

A natural language date parser in Javascript

33 lines (32 loc) 1.33 kB
import { Duration } from "../../calculation/duration.js"; import { Timeunit, Weekday } from "../../types.js"; export declare const WEEKDAY_DICTIONARY: { [word: string]: Weekday; }; export declare const FULL_MONTH_NAME_DICTIONARY: { [word: string]: number; }; export declare const MONTH_DICTIONARY: { [word: string]: number; }; export declare const INTEGER_WORD_DICTIONARY: { [word: string]: number; }; export declare const ORDINAL_WORD_DICTIONARY: { [word: string]: number; }; export declare const TIME_UNIT_DICTIONARY_NO_ABBR: { [word: string]: Timeunit; }; export declare const TIME_UNIT_DICTIONARY: { [word: string]: Timeunit; }; export declare const NUMBER_PATTERN: string; export declare function parseNumberPattern(match: string): number; export declare const ORDINAL_NUMBER_PATTERN: string; export declare function parseOrdinalNumberPattern(match: string): number; export declare const YEAR_PATTERN = "(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3}|[0-9]{2}(?!\\w|:\\d|\\s+(?:am|pm|o\\s*clock|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)))"; export declare function parseYear(match: string): number; export declare const TIME_UNITS_PATTERN: string; export declare const TIME_UNITS_NO_ABBR_PATTERN: string; export declare function parseDuration(timeunitText: any): null | Duration;