/** * @file Base class for rule converters * * TS doesn't support abstract static methods, so we should use * a workaround and extend this class instead of implementing it */ import { type Node } from '../../nodes/index.js'; import { type NodeConversionResult } from './conversion-result.js'; import { BaseConverter } from './base-converter.js'; /** * Basic class for rule converters */ export declare class RuleConverterBase extends BaseConverter { /** * Converts an adblock filtering rule to AdGuard format, if possible. * * @param rule Rule node to convert * @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains * the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted. * If the rule was not converted, the result array will contain the original node with the same object reference * @throws If the rule is invalid or cannot be converted */ static convertToAdg(rule: Node): NodeConversionResult; /** * Converts an adblock filtering rule to Adblock Plus format, if possible. * * @param rule Rule node to convert * @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains * the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted. * If the rule was not converted, the result array will contain the original node with the same object reference * @throws If the rule is invalid or cannot be converted */ static convertToAbp(rule: Node): NodeConversionResult; /** * Converts an adblock filtering rule to uBlock Origin format, if possible. * * @param rule Rule node to convert * @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains * the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted. * If the rule was not converted, the result array will contain the original node with the same object reference * @throws If the rule is invalid or cannot be converted */ static convertToUbo(rule: Node): NodeConversionResult; }