tell-me-when
Version:
human relative date and time parser
34 lines • 1.05 kB
TypeScript
export declare class ParseState {
input: string;
index: number;
readonly start: number;
readonly end: number;
readonly flags: string;
constructor(input: string, { start, end, flags, }?: {
/**
* The starting index (defaults to 0)
*/
start?: number;
/**
* The ending index (defaults to input.length)
*/
end?: number;
/**
* Flags to add to all regexes
*/
flags?: string;
});
get done(): boolean;
/**
* If pattern matches the input at the current index, returns the match,
* but doesn't advance the index.
*/
peek(pattern: string | RegExp): RegExpExecArray | undefined;
/**
* If pattern matches the input at the current index, returns the match,
* and advances the index to the end of the match.
*/
match(pattern: string | RegExp): RegExpExecArray | undefined;
}
export declare function toRegExp(s: string, flags?: string): RegExp;
//# sourceMappingURL=ParseState.d.ts.map