UNPKG

@worker-tools/html-rewriter

Version:

WASM-based implementation of Cloudflare's HTML Rewriter for use in Deno, browsers, etc.

13 lines (12 loc) 675 B
import type { ContentTypeOptions, Element, EndTag, Comment, TextChunk, Doctype, DocumentEnd, ElementHandlers, DocumentHandlers } from "./vendor/html_rewriter_2"; export type { ContentTypeOptions, Element, EndTag, Comment, TextChunk, Doctype, DocumentEnd, ElementHandlers, DocumentHandlers, }; declare const kEnableEsiTags: unique symbol; export declare class HTMLRewriter { #private; [kEnableEsiTags]: boolean; constructor(); on(selector: string, handlers: ElementHandlers): this; onDocument(handlers: DocumentHandlers): this; transform(response: Response): Response; } export declare function withEnableEsiTags(rewriter: HTMLRewriter): HTMLRewriter;