@adguard/agtree
Version:
Tool set for working with adblock filter lists
31 lines (30 loc) • 1.08 kB
TypeScript
/**
* @file AdGuard Hints
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#hints}
*/
import { type Hint } from '../../nodes/index.js';
import { BaseParser } from '../base-parser.js';
/**
* `HintParser` is responsible for parsing AdGuard hints.
*
* @example
* If the hint rule is
* ```adblock
* !+ NOT_OPTIMIZED PLATFORM(windows)
* ```
* then the hints are `NOT_OPTIMIZED` and `PLATFORM(windows)`, and this
* class is responsible for parsing them. The rule itself is parsed by
* the `HintRuleParser`, which uses this class to parse single hints.
*/
export declare class HintParser extends BaseParser {
/**
* Parses a raw rule as a hint.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
* @returns Hint rule AST or null
* @throws If the syntax is invalid
*/
static parse(raw: string, options?: import("../index.js").ParserOptions, baseOffset?: number): Hint;
}