import { TreeMap } from "../maps/treemap"; import { Attribute, AttributeConstructor, AttributeTypes, DefinedAttributes } from "./attributes"; /** * Arguments available when computing a derived attribute. */ export interface DerivedArgs { node: T & A; } /** * Type signature of the function that computes derived attributes. */ export declare type DerivedFunction = (args: DerivedArgs) => R; /** * Options associated with computed derived attributes. */ export interface DerivedOptions { memoize?: boolean; } /** * This function creates an `Attribute` that returns the value of the derived * attribute. It will invoke the provided `evaluate` function to do this, but * it will try to minimize the invocation of that function. * * This attribute is a degenerative case of both synthetic and inherited * attributes that don't depend on any other nodes except the target node * itself. Using a derived attribute ensures that there are no inadvertent * evaluations of "neighboring" nodes. * @param evaluate * @param tree * @param attrs * @param memoize * @returns */ export declare function derivedAttribute(evaluate: DerivedFunction, tree: TreeMap, attrs: DefinedAttributes, memoize: boolean): Attribute; export declare function derived(name: N, f: DerivedFunction, memoize?: boolean): AttributeConstructor;