export type IModuleProperties = Record; /** Force output static type evaluation for Arrays */ export type StaticEnsure = T extends infer R ? R : never; /** Infers the Output Parameter for a Parser */ export type StaticParser = Parser extends IParser ? Output : unknown; export type IMapping = (input: Input, context: any) => Output; /** Maps input to output. This is the default Mapping */ export declare const Identity: (value: unknown) => unknown; /** Maps the output as the given parameter T */ export declare const As: (mapping: T) => ((value: unknown) => T); export interface IParser { type: string; mapping: IMapping; } export type ContextParameter<_Left extends IParser, Right extends IParser> = (StaticParser); export interface IContext extends IParser { type: 'Context'; left: IParser; right: IParser; } /** `[Context]` Creates a Context Parser */ export declare function Context>>(left: Left, right: Right, mapping: Mapping): IContext>; /** `[Context]` Creates a Context Parser */ export declare function Context(left: Left, right: Right): IContext>; export type ArrayParameter = StaticEnsure[]>; export interface IArray extends IParser { type: 'Array'; parser: IParser; } /** `[EBNF]` Creates an Array Parser */ export declare function Array>>(parser: Parser, mapping: Mapping): IArray>; /** `[EBNF]` Creates an Array Parser */ export declare function Array(parser: Parser): IArray>; export interface IConst extends IParser { type: 'Const'; value: string; } /** `[TERM]` Creates a Const Parser */ export declare function Const>(value: Value, mapping: Mapping): IConst>; /** `[TERM]` Creates a Const Parser */ export declare function Const(value: Value): IConst; export interface IRef extends IParser { type: 'Ref'; ref: string; } /** `[BNF]` Creates a Ref Parser. This Parser can only be used in the context of a Module */ export declare function Ref>(ref: string, mapping: Mapping): IRef>; /** `[BNF]` Creates a Ref Parser. This Parser can only be used in the context of a Module */ export declare function Ref(ref: string): IRef; export interface IString extends IParser { type: 'String'; options: string[]; } /** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ export declare function String>(options: string[], mapping: Mapping): IString>; /** `[TERM]` Creates a String Parser. Options are an array of permissable quote characters */ export declare function String(options: string[]): IString; export interface IIdent extends IParser { type: 'Ident'; } /** `[TERM]` Creates an Ident Parser where Ident matches any valid JavaScript identifier */ export declare function Ident>(mapping: Mapping): IIdent>; /** `[TERM]` Creates an Ident Parser where Ident matches any valid JavaScript identifier */ export declare function Ident(): IIdent; export interface INumber extends IParser { type: 'Number'; } /** `[TERM]` Creates an Number Parser */ export declare function Number>(mapping: Mapping): INumber>; /** `[TERM]` Creates an Number Parser */ export declare function Number(): INumber; export type OptionalParameter] | []> = (Result); export interface IOptional extends IParser { type: 'Optional'; parser: IParser; } /** `[EBNF]` Creates an Optional Parser */ export declare function Optional>>(parser: Parser, mapping: Mapping): IOptional>; /** `[EBNF]` Creates an Optional Parser */ export declare function Optional(parser: Parser): IOptional>; export type TupleParameter = StaticEnsure>]> : Result>; export interface ITuple extends IParser { type: 'Tuple'; parsers: IParser[]; } /** `[BNF]` Creates a Tuple Parser */ export declare function Tuple>>(parsers: [...Parsers], mapping: Mapping): ITuple>; /** `[BNF]` Creates a Tuple Parser */ export declare function Tuple(parsers: [...Parsers]): ITuple>; export type UnionParameter = StaticEnsure> : Result>; export interface IUnion extends IParser { type: 'Union'; parsers: IParser[]; } /** `[BNF]` Creates a Union parser */ export declare function Union>>(parsers: [...Parsers], mapping: Mapping): IUnion>; /** `[BNF]` Creates a Union parser */ export declare function Union(parsers: [...Parsers]): IUnion>;