import type { Option } from 'fp-ts/Option' import type { Token } from '../Html/Tokenizer' /** * Represents a token and its pre-computed metadata which can be accessed in tight * inner loops while scraping. * * @category model * @since 0.0.1 */ export interface TagInfo { /** * The parsed token. */ readonly token: Token /** * The offset from the parsed token to the token that contains its closing tag, * if present. The only tokens that will have an offset are `TagOpen` tokens. */ readonly closeOffset: Option } /** * @category constructors * @since 0.0.1 */ export declare const TagInfo: (token: Token, closeOffset: Option) => TagInfo /** * Annotates each parsed tag with the the offset to its closing tag, if present. * * @category constructors * @since 0.0.1 */ export declare const annotateTags: (tokens: ReadonlyArray) => ReadonlyArray