class ASTViewerService

AST Viewer Service for parsing and analyzing adblock rules.

Static Methods

Get a human-readable description of a rule.

formatAST(
ast: AnyRule,
indent?: number,
): string

Format AST as pretty-printed JSON.

Generate a summary of parsed rules.

getExampleRules(): string[]

Get example rules for demonstration.

parseRule(ruleText: string): ParsedRuleInfo

Parse a single rule and return display-friendly information.

parseRules(rules: string[]): ParsedRuleInfo[]

Parse multiple rules.

Parse rules from a multi-line string.