import { Attribute } from "./kinds/attributes"; import { AttributeDefinition } from "./kinds/definitions"; import { ArborPlugin } from "./plugin"; import { ReificationOptions } from "./kinds/options"; import TypedEmitter from "typed-emitter"; /** The set of possible (tree) mutation events. */ export interface MutationEvents { /** Instructs caches to invalidate any entries for `n` that are for `synthetic` and/or `inherited` attributes. */ invalidate(synthetic: Set, inherited: Set): void; /** Invalidate entire cache for a given attribute. */ invalidateAttribute(def: AttributeDefinition): void; /** Used when the root node of the tree is changed. */ reroot(root: T): void; /** Finalize any structural changes */ finalize(): void; } /** A subset of the event emmiter interface that is read only. */ export declare type MutationMonitor = Pick, "on" | "once" | "off" | "removeListener">; /** A typed event emitter that specifically handles the event described by the `MutationEvents` interfaces. */ export declare type MutationEmitter = TypedEmitter>; /** The set of possible events related to an `Arbor` instance. */ export interface ArborEvents { created: () => void; connected: (plugin: ArborPlugin) => void; added: (d: AttributeDefinition, a: Attribute) => void; initialized: (reificationOptions: Partial) => void; invocation: (d: AttributeDefinition, n: T, result: R) => void; evaluation: (a: Attribute, n: T, result: R) => void; } /** A subset of the event emmiter interface that is read only. */ export declare type ArborMonitor = Pick, "on" | "once" | "off" | "removeListener">; /** A typed event emitter that specifically handles the event described by the `ArborEvents` interfaces. */ export declare type ArborEmitter = TypedEmitter>; /** A function for creating typed event emitters in a typesafe way */ export declare function typedEmitter(): TypedEmitter;