Schema for a parsed adblock-syntax rule
Callback fired synchronously or asynchronously after a transformation successfully completes.
Union type of all possible diagnostic events
AST Viewer Service for parsing and analyzing adblock rules.
Abstract base class for async transformations. Use this for transformations that need to fetch external resources or perform I/O.
Base class for output formatters. Extend this class to create custom output formatters.
Schema for async batch requests (max 100 items)
Schema for BatchRequest validation (worker)
Schema for sync batch requests (max 10 items)
Callback fired synchronously or asynchronously before a transformation processes its rule array.
Schema for benchmark metrics that matches the CompilationMetrics interface. Present when benchmark mode is enabled during compilation.
Result of a benchmark measurement for a single stage.
Circuit Breaker implementation for fault tolerance
Circuit breaker states
Schema for CLI arguments (matches ParsedArguments interface in ArgumentParser.ts)
Compilation-related defaults
Custom error class for compilation errors
Aggregated metrics for a compilation run.
Result of compilation with optional metrics and diagnostics.
Schema for compilation result output
Convenience function for compiling a filter list. Maintains backward compatibility with the original API.
Schema for CompileRequest validation (worker)
Event emitter that wraps ICompilerEvents callbacks. Provides safe event emission with error handling and type safety.
Combines multiple fetchers, trying each in order. First fetcher that can handle the source wins.
Transformation that compresses the final list by removing redundant rules. Also converts /etc/hosts rules to adblock-style rules.
Schema for IConfiguration validation
Validates configuration objects against the expected schema. Uses Zod for runtime validation with TypeScript integration.
Result of conflict detection
Transformation that detects conflicting rules
Transformation that converts non-ASCII domain names to Punycode.
Creates a child tracing context that inherits from a parent
Create a hook configuration that bridges the transformation hook system
into the compiler's ICompilerEvents / CompilerEventEmitter event bus.
Factory function to create the appropriate emitter. Returns a singleton NoOpEventEmitter if no handlers are provided for efficiency.
Creates a new logger with the given options
Creates a logger with configuration from environment variables. Reads the following environment variables:
Create a hook configuration that logs transformation start/complete/error
messages to any object implementing { info, error }.
Create a hook configuration that records per-transformation timing and rule-count diff data to an arbitrary metrics collector.
Creates a no-op tracing context (for when diagnostics are disabled)
Creates a new OpenTelemetry diagnostics collector with specified options
Creates a simple plugin from a transformation function
Creates a new tracing context
Transformation that removes duplicate rules while preserving order. Also removes preceding comments when a duplicate rule is removed.
All defaults combined for easy access
Detects conflicts in a list of rules without applying transformation
Base interface for all diagnostic events
Default implementation of IDiagnosticsCollector that stores events in memory and can optionally emit them to console for debugging.
Generates diff reports between filter list compilations
Options for diff generation
Complete diff report
Summary statistics for diff
Schema for Worker environment bindings and runtime env vars
Error utility functions providing consistent error handling across the codebase.
Schema for a parsed /etc/hosts-syntax rule
Safely evaluates a boolean expression for preprocessor conditions.
Transformation that excludes rules matching specified patterns.
Main compiler class for hostlist compilation. Orchestrates the entire compilation process using async operations throughout.
Options for configuring the FilterCompiler.
Service for downloading and preparing filter wildcards. Uses fully asynchronous operations for optimal performance.
Formats rules to the specified output format
Convenience function to generate a diff report
Convenience function to generate a markdown diff report
Gets all known platform identifiers
Global plugin registry instance
Generates headers for filter lists and sources. Follows Single Responsibility Principle - only handles header generation.
Health status levels
Fetches content over HTTP/HTTPS using the standard Fetch API. This is the default fetcher for URL-based sources.
Schema for HTTP fetcher options
Basic logger interface with essential methods Follows Interface Segregation Principle
Event emitted when compilation completes
Event emitted when compilation begins, after configuration validation has passed but before any source is downloaded or processed.
Callback function types for compiler events.
Main configuration for the hostlist compiler
Content fetcher abstraction - provides content from any source. This allows the compiler to work with pre-fetched content or custom fetch implementations.
Detailed logger interface with debug capabilities Extends IBasicLogger for advanced logging needs
Diagnostic collector interface for aggregating events
Downloader interface for dependency injection Allows different downloader implementations
File system operations interface for dependency injection Allows testing and different implementations
Common interface for filterable entities Follows Interface Segregation Principle - shared filter properties
HTTP client interface for dependency injection Allows testing and different HTTP implementations
Options for HTTP-based content fetching.
Transformation that includes only rules matching specified patterns.
Result of incremental compilation
Incremental compiler that caches source compilations
Options for incremental compilation
Transformation that ensures the file ends with a newline.
Transformation that inverts blocking rules to allow rules. Adds @@ prefix to non-comment, non-hosts, non-allow rules.
Platform-agnostic compiler configuration that extends the base configuration.
Checks if an identifier is a known platform
Event emitted when a source completes successfully
Structured log entry for production observability Designed for log aggregation systems (CloudWatch, Datadog, Splunk)
Common interface for transformable entities Follows Interface Segregation Principle - shared transformation properties
Event emitted when a transformation completes
A single validation error for a rule
Collection of validation errors for a compilation
Console-based logger implementation for Deno
Default logger instance
Logger configuration options
Log levels for filtering output
Log level type for structured logging Maps to standard syslog severity levels
Module-specific log level overrides
Network-related default configuration
No-op implementation of IDiagnosticsCollector for when diagnostics are disabled
No-op event emitter for when no events are registered. Provides the same interface but does nothing, avoiding overhead. Uses a more elegant approach with frozen empty object.
A TransformationHookManager that does absolutely nothing.
DiagnosticsCollector that exports events to OpenTelemetry.
Configuration options for OpenTelemetry exporter
Event emitted when an operation completes successfully
Event emitted when an operation encounters an error
Optimizes a list of rules
Output format options
Package name as published to JSR
Parsed rule with display-friendly information.
Parses module overrides from environment variable. Expected format: "module1:level1,module2:level2" Example: "compiler:debug,downloader:trace"
Schema for platform compiler options Note: preFetchedContent and customFetcher are not validated as they are runtime objects
Platform-agnostic filter downloader. Uses IContentFetcher for all source access.
Options for the platform-agnostic downloader
Creates a transformation wrapper from a plugin transformation
Pre-fetched content map - allows passing content directly without network/file access. Keys are source identifiers (URLs or names), values are the content strings.
Fetches content from a pre-populated content map. This allows compilation without network or file system access.
Schema for request/job priority level. Shared between CompileRequestSchema, BatchRequestSchema, CliArgumentsSchema, and worker schemas.
Transformation that removes all comment lines from the rules. Comments are lines starting with ! or #
Transformation that removes empty lines from the rules.
Transformation that removes unsupported modifiers from adblock-style rules.
Represents a conflict between rules
Transformation that optimizes rules
Rule types for statistics
Utility class for working with filtering rules. Uses AGTree for robust parsing and validation.
Silent logger that discards all output (useful for testing)
Compiles an individual source according to its configuration. Supports tracing and diagnostics for observability.
Schema for ISource validation
Source type for filter lists
Structured logger implementation for production observability Outputs JSON-formatted logs compatible with log aggregation systems (CloudWatch, Datadog, Splunk, etc.)
Abstract base class for synchronous transformations. These transformations perform CPU-bound operations without I/O. The sync method is wrapped in a resolved Promise for consistency with async operations.
TLD utilities for parsing and validating domain names.
Wrapper function for tracing asynchronous operations
Event categories for tracing
Trace severity levels
Wrapper function for tracing synchronous operations
Context for tracing operations through the compilation pipeline
Declarative hook configuration object.
Shared context object passed to every hook callback.
Manages a collection of before/after/error hooks and executes them around each transformation in the pipeline.
Executes an ordered sequence of named transformations over a rule array, with optional lifecycle hooks, exclusion/inclusion pattern filtering, and event emission.
Registry for transformation classes. Implements the Registry pattern for managing transformation instances.
Enum of all available transformation types
Callback fired when a transformation throws an unhandled error.
Transformation that removes leading and trailing whitespace from lines.
User agent string for HTTP requests
Validation transformation that allows IP addresses.
Transformation that validates rules for DNS blockers. Uses AGTree for robust parsing and validation. Removes invalid rules and their preceding comments.
Validation-related defaults
Schema for a single validation error
Type of validation error
Schema for validation error type enum
Schema for validation report
Schema for validation result (compilation result with validation report)
Severity level of validation error
Schema for validation severity enum
Package version - should match deno.json Updated automatically by version bump scripts.
Result of compilation with optional metrics and diagnostics.
Schema for worker compilation result (extends CompilationResultSchema with optional metrics)
Web Worker / Cloudflare Worker compatible compiler. Designed to run in environments without file system access.
Factory function to create formatters (backward compatible wrapper)
Logger interface for backward compatibility
Legacy class-based API for backward compatibility.