/**
* A zero-dependency parser for the single file Lynx XML markup format.
*
* It is written without `DOMParser` or any third party XML library so that it
* can run inside a Web Worker.
*
* The grammar accepted here is intentionally tiny:
*
* ```xml
*
*
*
*
*
*
* ```
*/
/**
* The structured error describing why a document could not be parsed.
*/
export interface LynxXMLParseError {
/**
* The offset inside the source where the failure was detected, counted in
* JavaScript string indices, i.e. UTF-16 code units. Note that the reference
* implementation counts UTF-8 bytes instead, so for documents containing
* non-ASCII text before the failure the two numbers differ.
*/
offset: number;
/**
* The human readable reason, without the offset prefix.
*/
message: string;
/**
* The full message, formatted exactly like the reference implementation:
* `invalid TemplateBundle XML at offset : `.
*/
formattedMessage: string;
}
/**
* The result of a successful parse.
*/
export interface LynxXMLParseSuccess {
success: true;
/**
* The content of the `