export declare type HTML = string;
export declare type NestedParseFunction = ((source: string, state: ParsingState, config: IParserConfig) => SyntaxContent);
export declare type NestedOutputFunction = ((node: ISyntaxNode, state: ParsingState) => HTML);
export declare type ParseFunction = ((match: RegExpExecArray, parse: NestedParseFunction, state: ParsingState, config: IParserConfig) => ISyntaxNode);
export declare type HtmlFunction = ((node: ISyntaxNode, output: NestedOutputFunction, state: ParsingState) => HTML);
export declare type SyntaxContent = ISyntaxNode[] | HTML;
export declare type Rules = IRule[];
export interface IParserConfig {
rules: Rules;
initialState: ParsingState;
allowHtml: boolean;
debug: boolean;
}
export declare enum ParsingState {
INLINE = 0,
BLOCK = 1,
ANY = 2
}
export interface IRule {
name: string;
state: ParsingState;
regex: RegExp;
parse: ParseFunction;
html: HtmlFunction;
}
export interface ISyntaxNode {
content: SyntaxContent;
rule: IRule;
meta?: T;
}
export declare const defaultParserConfig: IParserConfig;