//#region src/scan/parseHtml.d.ts /** * Tiny dependency-free HTML extraction helpers. * * The hosted backend audit relies on Cheerio + a real browser, but the CLI scan * must stay dependency-light. These regex-based helpers cover the handful of * head/anchor signals the score needs. They are intentionally forgiving: when a * tag can't be parsed it is simply skipped rather than throwing. */ /** Compute the UTF-8 byte length of a string in both Node and browser builds. */ export declare const byteLength: (text: string) => number; /** Extract the `lang` attribute of the `` element, if present. */ export declare const extractHtmlLang: (html: string) => string | undefined; /** Extract the `dir` attribute of the `` element, if present. */ export declare const extractHtmlDir: (html: string) => string | undefined; /** Extract the document `` text. */ export declare const extractTitle: (html: string) => string; /** Extract the `<meta name="description">` content. */ export declare const extractMetaDescription: (html: string) => string; /** Extract the `<meta property="og:image">` content. */ export declare const extractOgImage: (html: string) => string | undefined; /** Whether a `<link rel="canonical">` element is present. */ export declare const hasCanonical: (html: string) => boolean; /** A parsed `<link rel="alternate" hreflang>` element. */ export type HreflangLink = { hreflang: string; href: string; }; /** Extract every `<link rel="alternate" hreflang="…" href="…">` element. */ export declare const extractHreflangs: (html: string) => HreflangLink[]; /** * Extract every eagerly-loaded script URL: `<script src>`, * `<link rel="modulepreload">` and `<link rel="preload" as="script">`. * * @param html - The raw HTML document. * @param baseUrl - Base URL used to resolve relative script URLs. * @returns Absolute, de-duplicated script URLs. */ export declare const extractScriptUrls: (html: string, baseUrl: string) => string[]; /** A parsed `<a href>` anchor. */ export type Anchor = { href: string; text: string; }; /** Extract every `<a href="…">text</a>` anchor from the document. */ export declare const extractAnchors: (html: string) => Anchor[]; /** * Extract visible text snippets from an HTML document (scripts, styles and * tags stripped). Used to approximate the rendered content size without a DOM. */ export declare const extractVisibleTextStrings: (html: string) => string[]; //#endregion //# sourceMappingURL=parseHtml.d.ts.map