chrono-node
Version:
A natural language date parser in Javascript
22 lines (21 loc) • 800 B
TypeScript
import { OpUnitType, QUnitType } from "dayjs";
export declare const WEEKDAY_DICTIONARY: {
[word: string]: number;
};
export declare const MONTH_DICTIONARY: {
[word: string]: number;
};
export declare const INTEGER_WORD_DICTIONARY: {
[word: string]: number;
};
export declare const TIME_UNIT_DICTIONARY: {
[word: string]: OpUnitType | QUnitType;
};
export declare const NUMBER_PATTERN: string;
export declare function parseNumberPattern(match: string): number;
export declare const YEAR_PATTERN = "[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";
export declare function parseYear(match: string): number;
export declare const TIME_UNITS_PATTERN: string;
export declare function parseTimeUnits(timeunitText: any): {
[c in OpUnitType | QUnitType]?: number;
};