@adguard/agtree
Version:
Tool set for working with adblock filter lists
26 lines (25 loc) • 962 B
TypeScript
import { type Agent } from '../../nodes/index.js';
import { BaseDeserializer } from '../base-deserializer.js';
import { type InputByteBuffer } from '../../utils/input-byte-buffer.js';
/**
* `AgentDeserializer` is responsible for deserializing single adblock agent elements.
*
* @example
* If the adblock agent rule is
* ```adblock
* [Adblock Plus 2.0; AdGuard]
* ```
* then the adblock agents are `Adblock Plus 2.0` and `AdGuard`, and this
* class is responsible for parsing them. The rule itself is parsed by
* `AgentCommentSerializer`, which uses this class to parse single agents.
*/
export declare class AgentDeserializer extends BaseDeserializer {
/**
* Deserializes an agent node from binary format.
*
* @param buffer ByteBuffer for reading binary data.
* @param node Destination node.
* @throws If the binary data is malformed.
*/
static deserialize(buffer: InputByteBuffer, node: Partial<Agent>): void;
}