import { int32 } from '@fable-org/fable-library-js/Int32.js';
import { Record } from '@fable-org/fable-library-js/Types.js';
import { IComparable, IEquatable } from '@fable-org/fable-library-js/Util.js';
import { TypeInfo } from '@fable-org/fable-library-js/Reflection.js';
import { Option } from '@fable-org/fable-library-js/Option.js';
import { FSharpList } from '@fable-org/fable-library-js/List.js';
export interface ParseResult$1<t> {
    status: boolean;
    value: t;
}
export interface IParserOffSet {
    column: int32;
    line: int32;
    offset: int32;
}
export declare class TokenPosition extends Record implements IEquatable<TokenPosition>, IComparable<TokenPosition> {
    readonly offset: int32;
    readonly line: int32;
    readonly column: int32;
    constructor(offset: int32, line: int32, column: int32);
}
export declare function TokenPosition_$reflection(): TypeInfo;
export declare class NodeResult$1<t> extends Record implements IEquatable<NodeResult$1<t>>, IComparable<NodeResult$1<t>> {
    readonly name: string;
    readonly value: t;
    readonly start: TokenPosition;
    readonly end: TokenPosition;
    constructor(name: string, value: t, start: TokenPosition, end: TokenPosition);
}
export declare function NodeResult$1_$reflection(gen0: TypeInfo): TypeInfo;
export interface IParser$1<t> {
    atLeast(arg0: int32): IParser$1<t[]>;
    atMost(arg0: int32): IParser$1<t[]>;
    fallback(arg0: t): IParser$1<t>;
    many(): IParser$1<t[]>;
    map<u>(arg0: ((arg0: t) => u)): IParser$1<u>;
    notFollowedBy<u>(arg0: IParser$1<u>): IParser$1<t>;
    parse(arg0: string): ParseResult$1<t>;
    sepBy<u>(arg0: IParser$1<u>): IParser$1<t[]>;
    sepBy1<u>(arg0: IParser$1<u>): IParser$1<t[]>;
    skip<u>(arg0: IParser$1<u>): IParser$1<t>;
    times(arg0: int32): IParser$1<t[]>;
    times(arg0: int32, arg1: int32): IParser$1<t[]>;
    trim<u>(arg0: IParser$1<u>): IParser$1<t>;
}
export declare function Parsimmon_parseRaw<t>(input: string, parser: IParser$1<t>): ParseResult$1<t>;
export declare function Parsimmon_parse<t>(input: string, parser: IParser$1<t>): Option<t>;
export declare const Parsimmon_index: IParser$1<IParserOffSet>;
/**
 * Returns a new parser which tries parser, and if it fails uses otherParser. Example:
 */
export declare function Parsimmon_orTry<t>(otherParser: IParser$1<t>, parser: IParser$1<t>): IParser$1<t>;
/**
 * Returns a new parser that tries to parse the input exactly `n` times
 */
export declare function Parsimmon_times<t>(n: int32, parser: IParser$1<t>): IParser$1<t[]>;
/**
 * Expects parser at least n times. Yields an array of the results.
 */
export declare function Parsimmon_atLeast<t>(n: int32, parser: IParser$1<t>): IParser$1<t[]>;
/**
 * Expects parser at most n times. Yields an array of the results.
 */
export declare function Parsimmon_atMost<t>(n: int32, parser: IParser$1<t>): IParser$1<t[]>;
export declare function Parsimmon_skip<u, t>(skipped: IParser$1<u>, keep: IParser$1<t>): IParser$1<t>;
export declare function Parsimmon_many<t>(parser: IParser$1<t>): IParser$1<t[]>;
export declare const Parsimmon_ofLazy: ((arg0: (() => IParser$1<t>)) => IParser$1<t>);
/**
 * This is the same as Parsimmon.sepBy, but matches the parser at least once.
 */
export declare function Parsimmon_seperateByAtLeastOne<u, t>(seperator: IParser$1<u>, parser: IParser$1<t>): IParser$1<t[]>;
/**
 * Expects parser "after" to follow parser "before", and yields the result of "before".
 */
export declare function Parsimmon_chain<u, t>(after: IParser$1<u>, before: IParser$1<t>): IParser$1<u>;
/**
 * Returns a new parser which tries parser "p", and on success calls the function "f" with the result of the parse, which is expected to return another parser, which will be tried next. This allows you to dynamically decide how to continue the parse, which is impossible with the other combinators.
 */
export declare function Parsimmon_bind<t, u>(f: ((arg0: t) => IParser$1<u>), p: IParser$1<t>): IParser$1<u>;
export declare const Parsimmon_letter: IParser$1<string>;
/**
 * Returns a parser that tries `parser` and succeeds if `parser` is able to parse between `min` and `max` times
 */
export declare function Parsimmon_timesBetween<u>(min: int32, max: int32, parser: IParser$1<u>): IParser$1<u[]>;
export declare const Parsimmon_letters: IParser$1<string[]>;
export declare const Parsimmon_endOfFile: IParser$1<string>;
/**
 * Returns a parser that looks for anything but whatever "p" wants to parse, and does not consume it. Yields the same result as "before".
 */
export declare function Parsimmon_notFollowedBy<u, t>(p: IParser$1<u>, before: IParser$1<t>): IParser$1<t>;
export declare const Parsimmon_succeed: ((arg0: t) => IParser$1<t>);
export declare const Parsimmon_lookahead: ((arg0: IParser$1<t>) => IParser$1<string>);
export declare const Parsimmon_digit: IParser$1<string>;
export declare const Parsimmon_digits: IParser$1<string[]>;
/**
 * Returns a new parser which tries "parser" and, if it fails, yields value without consuming any input.
 */
export declare function Parsimmon_fallback<t>(value: t, parser: IParser$1<t>): IParser$1<t>;
export declare function Parsimmon_seperateBy<u, t>(content: IParser$1<u>, others: IParser$1<t>): IParser$1<t[]>;
export declare function Parsimmon_between<t, u, v>(left: IParser$1<t>, right: IParser$1<u>, middle: IParser$1<v>): IParser$1<v>;
/**
 * Transforms the parsed value of the given parser.
 */
export declare function Parsimmon_map<t, u>(f: ((arg0: t) => u), parser: IParser$1<t>): IParser$1<u>;
/**
 * Alias of Parsimmon.concat
 */
export declare function Parsimmon_tie(parser: IParser$1<string[]>): IParser$1<string>;
export declare const Parsimmon_any: IParser$1<string>;
/**
 * Accepts any number of parsers, yielding the value of the first one that succeeds, backtracking in between.
 */
export declare function Parsimmon_choose<t>(ps: FSharpList<IParser$1<t>>): IParser$1<t>;
export declare const Parsimmon_all: IParser$1<string>;
export declare const Parsimmon_fail: ((arg0: string) => IParser$1<string>);
export declare const Parsimmon_satisfy: ((arg0: ((arg0: string) => boolean)) => IParser$1<string>);
export declare const Parsimmon_takeWhile: ((arg0: ((arg0: string) => boolean)) => IParser$1<string>);
export declare const Parsimmon_str: ((arg0: string) => IParser$1<string>);
export declare const Parsimmon_oneOf: ((arg0: string) => IParser$1<string>);
export declare const Parsimmon_whitespace: IParser$1<string>;
export declare const Parsimmon_optionalWhitespace: IParser$1<string>;
/**
 * Returns a parser that succeeds one or more times
 */
export declare function Parsimmon_atLeastOneOrMany<t>(parser: IParser$1<t>): IParser$1<t[]>;
export declare function Parsimmon_stringReturn<t>(input: string, value: t): IParser$1<t>;
export declare const Parsimmon_noneOf: ((arg0: string) => IParser$1<string>);
export declare const Parsimmon_seq2: ((arg0: IParser$1<t>) => ((arg0: IParser$1<u>) => IParser$1<[t, u]>));
export declare function Parsimmon_trim<a, t>(trimmed: IParser$1<a>, p: IParser$1<t>): IParser$1<t>;
/**
 * Equivalent to `parser.map (String.concat "")`
 */
export declare function Parsimmon_concat(parser: IParser$1<string[]>): IParser$1<string>;
export declare const Parsimmon_seq3: ((arg0: IParser$1<t>) => ((arg0: IParser$1<u>) => ((arg0: IParser$1<v>) => IParser$1<[t, u, v]>)));
export declare const Parsimmon_seq4: ((arg0: IParser$1<t>) => ((arg0: IParser$1<u>) => ((arg0: IParser$1<v>) => ((arg0: IParser$1<w>) => IParser$1<[t, u, v, w]>))));
export declare const Parsimmon_seq5: ((arg0: IParser$1<t>) => ((arg0: IParser$1<u>) => ((arg0: IParser$1<v>) => ((arg0: IParser$1<w>) => ((arg0: IParser$1<q>) => IParser$1<[t, u, v, w, q]>)))));
/**
 * Equivalent to `parser.node("description")`
 */
export declare function Parsimmon_node<t>(description: string, p: IParser$1<t>): IParser$1<NodeResult$1<t>>;
//# sourceMappingURL=Parsimmon.fs.d.ts.map