@adguard/agtree
Version:
Tool set for working with adblock filter lists
24 lines (23 loc) • 1.08 kB
TypeScript
/**
* @file CSS injection rule converter
*/
import { type CssInjectionRule } from '../../nodes/index.js';
import { RuleConverterBase } from '../base-interfaces/rule-converter-base.js';
import { type NodeConversionResult } from '../base-interfaces/conversion-result.js';
/**
* CSS injection rule converter class
*
* @todo Implement `convertToUbo` and `convertToAbp`
*/
export declare class CssInjectionRuleConverter extends RuleConverterBase {
/**
* Converts a CSS injection 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: CssInjectionRule): NodeConversionResult<CssInjectionRule>;
}