/// import { Tokenizer } from './'; import { BS } from './bs'; import { Parser } from './parser'; /** * Defines a document parser. * @public */ export declare class DocumentParser { private tokenizer; private openElement?; constructor(tokenizer: Tokenizer); /** * Defines how a set of nodes should be parsed * @public * @param path - a node name of a path to a node (similar to file path, this is not a xpath) * @param parser - a parser to be applied */ on(path: string, parser: Parser.IParser): Parser.IParser; /** * Defines, as for `on()` how the whole document should be parsed * @param parser - parser to be applied */ onRoot(parser: Parser.IParser): void; /** * Writes xml chunks to the parser * @remarks * Before writing a new chunk the current one should be exhausted (all tokens have been processed, this means {@link DocumentParser.next} has returned `undefined`) * @param chunk- byte sequence (utf8) */ write(chunk: BS | string | Buffer | Uint8Array): void; /** * Getting the next element */ next(): any; private resolveTag; }