@adguard/agtree
Version:
Tool set for working with adblock filter lists
49 lines (48 loc) • 1.44 kB
TypeScript
/**
* @file Cosmetic rule separator finder and categorizer.
*/
import { CosmeticRuleSeparator } from '../nodes/index.js';
export interface CosmeticRuleSeparatorFinderResult {
/**
* Separator type.
*/
separator: CosmeticRuleSeparator;
/**
* Separator start position.
*/
start: number;
/**
* Separator end position.
*/
end: number;
}
/**
* Utility class for cosmetic rule separators.
*/
export declare class CosmeticRuleSeparatorUtils {
/**
* Checks whether the specified separator is an exception.
*
* @param separator Separator to check.
*
* @returns `true` if the separator is an exception, `false` otherwise.
*/
static isException(separator: CosmeticRuleSeparator): boolean;
/**
* Checks whether the specified separator is marks an Extended CSS cosmetic rule.
*
* @param separator Separator to check.
*
* @returns `true` if the separator is marks an Extended CSS cosmetic rule, `false` otherwise.
*/
static isExtendedCssMarker(separator: CosmeticRuleSeparator): boolean;
/**
* Looks for the cosmetic rule separator in the rule. This is a simplified version that
* masks the recursive function.
*
* @param rule Raw rule.
*
* @returns Separator result or null if no separator was found.
*/
static find(rule: string): CosmeticRuleSeparatorFinderResult | null;
}