@adguard/agtree
Version:
Tool set for working with adblock filter lists
25 lines (24 loc) • 860 B
TypeScript
import { type Hint } from '../../nodes/index.js';
import { type OutputByteBuffer } from '../../utils/output-byte-buffer.js';
import { BaseSerializer } from '../base-serializer.js';
/**
* `HintSerializer` is responsible for serializing 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 HintSerializer extends BaseSerializer {
/**
* Serializes a hint node to binary format.
*
* @param node Node to serialize.
* @param buffer ByteBuffer for writing binary data.
*/
static serialize(node: Hint, buffer: OutputByteBuffer): void;
}