import { type KeyFormatter } from '../key-formatter.js';
import { type Node } from './node.js';
export declare class Lexer {
    readonly tokens: Map<string, string>;
    private readonly formatter;
    private readonly _roots;
    private readonly flatMapper;
    private _rendered;
    constructor(tokens: Map<string, string>, formatter?: KeyFormatter);
    get rendered(): boolean;
    private set rendered(value);
    get rootNodes(): Node[];
    get tree(): Map<string, Node>;
    nodeFor(key: string): Node;
    addValue(key: string, value: string | null): void;
    addOrReplaceObject(key: string, value: object | null): void;
    addOrReplaceArray<T>(key: string, values: T[] | null): void;
    private addOrReplaceArrayElement;
    addOrReplaceValue(key: string, value: string | null): void;
    replaceValue(node: Node, value: string | null): void;
    /**
     * Parses the token map and returns all the root nodes.
     *
     * @returns {Node[]} The root nodes.
     */
    renderTrees(): void;
    private processKeys;
    private rootNodeFor;
    private processSegments;
    /**
     * Processes an array segment. This method will create the necessary node to represent the array index.
     *
     * @param root {LexerInternalNode} the root node of this segment.
     * @param value {string} the value of the key.
     * @param segment {string} the segment to process.
     * @param index {number} the index of the segment in the array.
     * @param segments {string[]} the array of segments.
     * @return {Node} the new root node which should be used as the current root or null if no intermediate/leaf node was
     * created.
     * @private
     */
    private processArraySegment;
    private processIntermediateSegment;
    private processLeafNode;
}
