export interface FilePosition {
    offset: number;
    line: number;
    column: number;
}
export interface FileRange {
    start: FilePosition;
    end: FilePosition;
    source: string;
}
export interface LiteralExpectation {
    type: "literal";
    text: string;
    ignoreCase: boolean;
}
export interface ClassParts extends Array<string | ClassParts> {
}
export interface ClassExpectation {
    type: "class";
    parts: ClassParts;
    inverted: boolean;
    ignoreCase: boolean;
}
export interface AnyExpectation {
    type: "any";
}
export interface EndExpectation {
    type: "end";
}
export interface OtherExpectation {
    type: "other";
    description: string;
}
export type Expectation = LiteralExpectation | ClassExpectation | AnyExpectation | EndExpectation | OtherExpectation;
declare class _PeggySyntaxError extends Error {
    static buildMessage(expected: Expectation[], found: string | null): string;
    message: string;
    expected: Expectation[];
    found: string | null;
    location: FileRange;
    name: string;
    constructor(message: string, expected: Expectation[], found: string | null, location: FileRange);
    format(sources: {
        source?: any;
        text: string;
    }[]): string;
}
export interface TraceEvent {
    type: string;
    rule: string;
    result?: any;
    location: FileRange;
}
export interface ParseOptions {
    filename?: string;
    startRule?: "VersionRange" | "Or" | "And" | "VersionRangeAtom" | "Parens" | "Anchor" | "VersionSpec" | "FlavorAtom" | "Not" | "Any" | "None" | "CmpOp" | "ExtendedVersion" | "EmverVersionRange" | "EmverVersionRangeAtom" | "EmverParens" | "EmverAnchor" | "EmverNot" | "Emver" | "Flavor" | "FlavorString" | "String" | "Version" | "PreRelease" | "PreReleaseSegment" | "VersionNumber" | "Digit" | "_";
    tracer?: any;
    [key: string]: any;
}
export type ParseFunction = <Options extends ParseOptions>(input: string, options?: Options) => Options extends {
    startRule: infer StartRule;
} ? StartRule extends "VersionRange" ? VersionRange : StartRule extends "Or" ? Or : StartRule extends "And" ? And : StartRule extends "VersionRangeAtom" ? VersionRangeAtom : StartRule extends "Parens" ? Parens : StartRule extends "Anchor" ? Anchor : StartRule extends "VersionSpec" ? VersionSpec : StartRule extends "FlavorAtom" ? FlavorAtom : StartRule extends "Not" ? Not : StartRule extends "Any" ? Any : StartRule extends "None" ? None : StartRule extends "CmpOp" ? CmpOp : StartRule extends "ExtendedVersion" ? ExtendedVersion : StartRule extends "EmverVersionRange" ? EmverVersionRange : StartRule extends "EmverVersionRangeAtom" ? EmverVersionRangeAtom : StartRule extends "EmverParens" ? EmverParens : StartRule extends "EmverAnchor" ? EmverAnchor : StartRule extends "EmverNot" ? EmverNot : StartRule extends "Emver" ? Emver : StartRule extends "Flavor" ? Flavor : StartRule extends "FlavorString" ? FlavorString : StartRule extends "String" ? String_1 : StartRule extends "Version" ? Version : StartRule extends "PreRelease" ? PreRelease : StartRule extends "PreReleaseSegment" ? PreReleaseSegment : StartRule extends "VersionNumber" ? VersionNumber : StartRule extends "Digit" ? Digit : StartRule extends "_" ? _ : VersionRange : VersionRange;
export declare const parse: ParseFunction;
export declare const PeggySyntaxError: typeof _PeggySyntaxError;
export type PeggySyntaxError = _PeggySyntaxError;
export type VersionRange = [
    VersionRangeAtom,
    [
        _,
        [Or | And, _] | null,
        VersionRangeAtom
    ][]
];
export type Or = "||";
export type And = "&&";
export type VersionRangeAtom = Parens | Anchor | Not | Any | None | FlavorAtom;
export type Parens = {
    type: "Parens";
    expr: VersionRange;
};
export type Anchor = {
    type: "Anchor";
    operator: CmpOp | null;
    version: VersionSpec;
};
export type VersionSpec = {
    flavor: NonNullable<Flavor | null> | null;
    upstream: Version;
    downstream: any;
};
export type FlavorAtom = {
    type: "Flavor";
    flavor: FlavorString;
};
export type Not = {
    type: "Not";
    value: VersionRangeAtom;
};
export type Any = {
    type: "Any";
};
export type None = {
    type: "None";
};
export type CmpOp = ">=" | "<=" | ">" | "<" | "=" | "!=" | "^" | "~";
export type ExtendedVersion = {
    flavor: NonNullable<Flavor | null> | null;
    upstream: Version;
    downstream: Version;
};
export type EmverVersionRange = [
    EmverVersionRangeAtom,
    [
        _,
        [Or | And, _] | null,
        EmverVersionRangeAtom
    ][]
];
export type EmverVersionRangeAtom = EmverParens | EmverAnchor | EmverNot | Any | None;
export type EmverParens = {
    type: "Parens";
    expr: EmverVersionRange;
};
export type EmverAnchor = {
    type: "Anchor";
    operator: CmpOp | null;
    version: Emver;
};
export type EmverNot = {
    type: "Not";
    value: EmverVersionRangeAtom;
};
export type Emver = {
    flavor: null;
    upstream: {
        number: [Digit, Digit, Digit];
        prerelease: [];
    };
    downstream: {
        number: [0 | NonNullable<Digit | null>];
        prerelease: [];
    };
};
export type Flavor = FlavorString;
export type FlavorString = string;
export type String_1 = string;
export type Version = {
    number: VersionNumber;
    prerelease: never[] | NonNullable<PreRelease | null>;
};
export type PreRelease = PreReleaseSegment[];
export type PreReleaseSegment = Digit | String_1;
export type VersionNumber = Digit[];
export type Digit = number;
export type _ = string[];
export {};
