@adguard/agtree
Version:
Tool set for working with adblock filter lists
50 lines (49 loc) • 1.97 kB
TypeScript
/**
* @file Possible adblock syntaxes are listed here.
*/
/**
* Possible adblock syntaxes (supported by this library)
*/
export declare const AdblockSyntax: {
/**
* Common syntax, which is supported by more than one adblocker (or by all adblockers).
*
* We typically use this syntax when we cannot determine the concrete syntax of the rule,
* because the syntax is used by more than one adblocker natively.
*
* @example
* - `||example.org^$important` is a common syntax, since it is used by all adblockers natively, and
* we cannot determine at parsing level whether `important` is a valid option or not, and if it is valid,
* then which adblocker supports it.
*/
readonly Common: "Common";
/**
* Adblock Plus syntax.
*
* @example
* - `example.org#$#abort-on-property-read alert` is an Adblock Plus syntax, since it is not used by any other
* adblockers directly (probably supported by some on-the-fly conversion, but this is not the native syntax).
* @see {@link https://adblockplus.org/}
*/
readonly Abp: "AdblockPlus";
/**
* uBlock Origin syntax.
*
* @example
* - `example.com##+js(set, atob, noopFunc)` is an uBlock Origin syntax, since it is not used by any other
* adblockers directly (probably supported by some on-the-fly conversion, but this is not the native syntax).
* @see {@link https://github.com/gorhill/uBlock}
*/
readonly Ubo: "UblockOrigin";
/**
* AdGuard syntax.
*
* @example
* - `example.org#%#//scriptlet("abort-on-property-read", "alert")` is an AdGuard syntax, since it is not used
* by any other adblockers directly (probably supported by some on-the-fly conversion, but this is not the native
* syntax).
* @see {@link https://adguard.com/}
*/
readonly Adg: "AdGuard";
};
export type AdblockSyntax = typeof AdblockSyntax[keyof typeof AdblockSyntax];