import { TreeMap } from "../maps"; /** * An attribute is simply a function that we can call passing in the node * identifier and getting back some value. The details of how the value * is computed (lazy, caching, etc) are hidden. */ export interface Attribute { (nid: T): R; } /** * The `AttributeTypes` type is simply a mapping of attribute name * to the type of that attribute. */ export declare type AttributeTypes = Record; /** * Given an `AttributesTypes` type, formulate the type of the * `attrs` argument containing previously defined attributes * when evaluating a new attribute. */ export declare type DefinedAttributes = { [P in keyof A]: Attribute; }; export declare type ExtendedBy = DefinedAttributes>; export declare type AttributeConstructor = (tree: TreeMap, base: DefinedAttributes, ext: DefinedAttributes) => ExtendedBy;