/** * @module trie * @description A Trie data structure implementation that supports wildcard matching * @template T The type of values stored in the trie */ export type Parts = string[]; /** * Trie class for storing and matching hierarchical key-value pairs with wildcard support * @template T The type of values stored in the trie */ export declare class Trie { #private; private separator; private wildcardOne; private wildcardSubtree; private reservedPrefix; private looseCompare; /** * Creates a new Trie instance * @param looseCompare Whether to use loose comparison for object values */ constructor(looseCompare?: boolean); /** * Matches a child node with the given key parts * @param child The child node key to match * @param parts Remaining parts of the key to match * @returns Array of matched values */ matchChild(child: string, parts: Parts): Array; /** * Matches a key against the trie * @param key The key to match * @returns Array of matched values */ match(key: string): T[]; /** * Internal method to match reserved prefix keys * @param parts Parts of the key to match * @returns Array of matched values */ private _matchPrefix; /** * Internal method to match keys with wildcard support * @param parts Parts of the key to match * @returns Array of matched values */ private _match; /** * Adds a value to the trie at the specified key * @param key The key to add the value at * @param value The value to add */ add(key: string, value: T): void; /** * Internal method to recursively add a value * @param parts Parts of the key to add at * @param value The value to add */ private _add; /** * Removes a value from the trie at the specified key * @param key The key to remove the value from * @param value The value to remove */ /** * Removes a value from the trie at the specified key * @param key The key to remove the value from * @param value The value (or partial object) to remove */ remove(key: string, value: Partial | T): void; /** * Internal method to recursively remove a value * @param parts Parts of the key to remove from * @param value The value to remove */ private _remove; /** * Creates a filter function for removing values * Supports partial object matching when looseCompare is enabled or when matching objects. * @param value The value (or partial value) to filter against * @returns Filter function (returns true to KEEP the item, false to REMOVE it) */ private filter; } //# sourceMappingURL=trie.d.ts.map