import { Maybe } from "purify-ts/Maybe"; import { TreeMap } from "../maps/treemap"; import { Attribute, AttributeConstructor, AttributeTypes, DefinedAttributes } from "./attributes"; /** * Arguments available when computing a inherited attribute. */ export interface InheritedArgs { root: boolean; parent: Maybe; node: T & A; } /** * Type signature of the function that computes inherited attributes. */ export declare type InheritedFunction = (args: InheritedArgs) => R; /** * Options associated with computed inherited attributes. */ export interface InheritedOptions { memoize?: boolean; } /** * This function creates an `Attribute` that returns the value of the inherited * attribute. It will invoke the provided `evaluate` function to do this, but * it will try to minimize the invocation of that function. It also manages * "walking the tree" to retrieve parent values. * @param evaluate * @param tree * @param attrs * @param memoize * @returns */ export declare function inheritedAttribute(evaluate: InheritedFunction, map: TreeMap, attrs: DefinedAttributes, memoize: boolean): Attribute; export declare function inherited(name: N, f: InheritedFunction, memoize?: boolean): AttributeConstructor;