import type { IdfObject } from './object.js'; /** One field of one object pointing at a name. */ export interface ReferenceEdge { readonly from: IdfObject; readonly field: string; readonly target: string; /** * Repeat index, when the field lives inside an extensible group. Absent for * ordinary positional fields, which is what distinguishes the two. */ readonly index?: number; } /** * Live index of every name-to-name reference in a document. * * Kept current by the document as objects are added, removed, renamed, and * edited, so `referencing()` is a lookup rather than a scan. EnergyPlus models * are dense with references (every surface names a zone and a construction, * every construction names materials), and the rename-propagation behaviour * that makes the library useful depends on this being exact. * * Names are matched case-insensitively, because EnergyPlus resolves them that * way, but the original casing is preserved for round-tripping. */ export declare class ReferenceGraph { #private; /** Record that `obj.field` points at `target`. */ add(obj: IdfObject, field: string, target: string, index?: number): void; /** Index every reference field of an object at once. */ addObject(obj: IdfObject): void; /** Drop every edge originating from an object. */ removeObject(obj: IdfObject): void; /** Update the edge for a single field after its value changed. */ updateField(obj: IdfObject, field: string, previous: unknown, next: unknown): void; /** Edges pointing at a name. */ referencing(name: string): ReferenceEdge[]; /** Objects that reference a name, deduplicated. */ referencingObjects(name: string): IdfObject[]; /** Names an object points at. */ referencedBy(obj: IdfObject): string[]; /** Whether anything points at this name. */ isReferenced(name: string): boolean; /** * Rewrite every edge pointing at `previous` to point at `next`. * * Only updates the index. The document is responsible for writing the new * value into the referencing objects' fields, which it does without going * back through the setter hook to avoid re-entering this method. */ retarget(previous: string, next: string): ReferenceEdge[]; /** Edges whose target does not exist. `valid` holds lowercased names. */ dangling(valid: ReadonlySet): ReferenceEdge[]; clear(): void; get size(): number; } //# sourceMappingURL=references.d.ts.map