email-scrubber-core
Version:
A privacy-focused email sanitizer that removes trackers and cleans URLs, powered by the ClearURLs ruleset.
26 lines • 986 B
TypeScript
import { type ClearUrlRules } from "./cleaners/LinkCleaner.js";
/**
* Returns a set of handler objects that can be attached to an HTMLRewriter instance.
* This function decouples the sanitization logic from the Cloudflare-specific environment.
* The caller is responsible for creating the HTMLRewriter instance.
*
* @param rules The ClearURL rules for cleaning links.
* @returns An object containing `linkHandler` and `pixelHandler` for use with `HTMLRewriter`.
*/
export declare function getStreamingHandlers(rules: ClearUrlRules): {
/**
* An HTMLRewriter element handler for sanitizing anchor (`<a>`) tags.
* Attach to a selector like "a[href]".
*/
linkHandler: {
element(element: Element): void;
};
/**
* An HTMLRewriter element handler for removing tracking pixels.
* Attach to a selector like "img".
*/
pixelHandler: {
element(element: Element): void;
};
};
//# sourceMappingURL=stream-sanitizer.d.ts.map