import { CommandComponent } from '../types/CommandComponent'; import { CommandTreeNode, CommandTreeNodes } from '../types/CommandTree'; import { Parser } from '../types/Parser'; import { ParsingContext } from '../types/ParsingContext'; import { StringReader } from '../utils/StringReader'; export declare class CommandParser implements Parser { /** * Whether the line should begin with a slash (`/`). * `true` - Should. Will throw untolerable errors if the line doesn't match. * `false` - Shouldn't. Will throw untolerable errors if the line doesn't match. * `null` - Not care. */ private readonly leadingSlash; /** * The entry point will be used to access `tree`. */ private readonly entryPoint; /** * Allow the command not hitting executable nodes. */ private readonly allowPartial; constructor( /** * Whether the line should begin with a slash (`/`). * `true` - Should. Will throw untolerable errors if the line doesn't match. * `false` - Shouldn't. Will throw untolerable errors if the line doesn't match. * `null` - Not care. */ leadingSlash?: boolean | null, /** * The entry point will be used to access `tree`. */ entryPoint?: 'line' | 'commands', /** * Allow the command not hitting executable nodes. */ allowPartial?: boolean); private static getParser; parse(reader: StringReader, ctx: ParsingContext): ParserResult; parseSingle(reader: StringReader, ctx: ParsingContext, key: string, node: CommandTreeNode, parsedLine: CommandComponent, isTheSoleChild?: boolean, optional?: boolean): void; parseChildren(reader: StringReader, ctx: ParsingContext, children: CommandTreeNodes, parsedLine: CommandComponent, optional?: boolean, isFirstArgument?: boolean): void; private parseAlwaysValidates; private parseSwitchableChildren; private parseNormalChildren; /** * @returns If parsed successfully. */ private tryParsingNodeInChildren; getHintsInChildren(ctx: ParsingContext, node: CommandTreeNode): string[]; } declare type ParserResult = { data: CommandComponent; }; export {};