import { IContextUtil } from "./i-context-util"; import { FoveaDOMAstNode } from "../../dom/fovea-dom-ast/i-fovea-dom-ast"; import { IContext } from "./i-context"; import { HostIdentifier } from "@fovea/common"; /** * A class that helps with operations having to do with a current compilation context */ export declare class ContextUtil implements IContextUtil { /** * A WeakMap between Nodes and the template-declared variables they can access from their position in the DOM * @type {WeakMap} */ private readonly nodeToTemplateVariablesMap; /** * A WeakMap between Nodes and a map between template variables and additional host identifiers that should be observed * @type {WeakMap} */ private readonly nodeToTemplateVariableToAdditionalHostIdentifiersMap; /** * A Map between Nodes and the current compilation context * @type {WeakMap} */ private readonly nodeToContextMap; /** * Gets the current IContext for the given node * @param {FoveaDOMAstNode} node * @returns {IContext} */ getContextForNode(node: FoveaDOMAstNode): IContext; /** * Adds the current IContext for the given node * @param {FoveaDOMAstNode} node * @param {IContext} context */ addContextForNode(node: FoveaDOMAstNode, context: IContext): void; /** * Disposes the current Context for a Node * @param {FoveaDOMAstNode} node */ disposeContextForNode(node: FoveaDOMAstNode): void; /** * Gets all the template-declared variables the given node has access to from its position in the DOM * @param {FoveaDOMAstNode} node * @returns {string[]} */ getTemplateVariablesForNode(node: FoveaDOMAstNode): string[]; /** * Adds the given template-declared variables for the given node * @param {FoveaDOMAstNode} node * @param {Iterable} templateVariables */ addTemplateVariablesForNode(node: FoveaDOMAstNode, templateVariables: Iterable): void; /** * Disposes the template-declared variables for the given node * @param {FoveaDOMAstNode} node */ disposeTemplateVariablesForNode(node: FoveaDOMAstNode): void; /** * Gets all the additional host identifiers for a given template variable for a node * @param {FoveaDOMAstNode} node * @param {string} templateVariable * @returns {string[]} */ getAdditionalHostIdentifiersForTemplateVariableForNode(node: FoveaDOMAstNode, templateVariable: string): HostIdentifier[]; /** * Gets all the additional host identifiers for a given node * @param {FoveaDOMAstNode} node * @returns {string[]} */ getAdditionalHostIdentifiersForNode(node: FoveaDOMAstNode): Map; /** * Adds the given additional host identifiers for a template variable for a node * @param {FoveaDOMAstNode} node * @param {string} templateVariable * @param {Iterable} hostIdentifiers */ addAdditionalHostIdentifiersForTemplateVariableForNode(node: FoveaDOMAstNode, templateVariable: string, hostIdentifiers: Iterable): void; /** * Disposes the additional host identifiers for a Node * @param {FoveaDOMAstNode} node */ disposeAdditionalHostIdentifiersForNode(node: FoveaDOMAstNode): void; }