import type { ParjsCombinator, Parjser } from "./parjser"; import type { ParjsResult } from "./result"; import type { ParsingState, UserState } from "./state"; /** A marker class used for storing the parser's user state. */ export declare class ParserUserState implements UserState { [key: string]: unknown; } export type ParjserDebugFunction = (ps: ParsingState, current: Parjser, startingPosition: number) => void; export declare const defaultDebugFunction: ParjserDebugFunction; /** * Returns a parser that will parse the string `str` and yield the text that was parsed. If it * can't, it will fail softly without consuming input. * * @param str The string to parse. */ export declare function string(str: T): Parjser; /** * The internal base Parjs parser class, which supports only basic parsing operations. Should not be * used in user code. */ export declare abstract class ParjserBase implements Parjser { abstract type: string; abstract expecting: string; private debugFunction?; expects(expecting: string): Parjser; debug(fn?: ParjserDebugFunction): Parjser; /** * Apply the parser to the given state. * * @param ps The parsing state. */ apply(ps: ParsingState): void; /** * The internal operation performed by the PARSER. This will be overriden by derived classes. * * @param ps */ protected abstract _apply(ps: ParsingState): void; parse(input: string, initialState?: UserState): ParjsResult; pipe(cmb1?: ParjsCombinator, cmb2?: ParjsCombinator, cmb3?: ParjsCombinator, cmb4?: ParjsCombinator, cmb5?: ParjsCombinator, cmb6?: ParjsCombinator): Parjser; } /** * Returns a parser that will try to match the regular expression at the current position and yield * the result set. If it can't, the parser will fail softly. The match must start at the current * position. It can't skip any part of the input. * * @param origRegexp */ export declare function regexp(origRegexp: RegExp): Parjser; //# sourceMappingURL=parser.d.ts.map