import type { Constructor, PropertyAccessor } from '@cratis/fundamentals'; import type { IGraphEdgeFromBuilder } from './IGraphEdgeFromBuilder.js'; import type { IGraphEdgeRemovedWithBuilder } from './IGraphEdgeRemovedWithBuilder.js'; /** * Defines a builder for an edge. * @template TEdge - The type of edge. */ export interface IGraphEdgeBuilder { /** * Names the edge type. Not needed when the class of the edge has the edge decorator. * @param type - The edge type, for example MEMBER_OF. * @returns The builder for continuation. */ named(type: string): IGraphEdgeBuilder; /** * Declares the property that identifies the edge among edges of the same type between the same two nodes. * Not needed when the property has the graphKey decorator. * @param identityAccessor - Accessor for the identifying property. * @returns The builder for continuation. */ identifiedBy(identityAccessor: PropertyAccessor): IGraphEdgeBuilder; /** * Creates or updates the edge when an event is observed. Both end nodes are created when they do not exist. * @param eventType - The event constructor. * @param configure - Callback for the keys of the end nodes and the properties. * @returns The builder for continuation. */ from(eventType: Constructor, configure: (builder: IGraphEdgeFromBuilder) => void): IGraphEdgeBuilder; /** * Deletes the edge when an event is observed. The nodes at both ends stay. * @param eventType - The event constructor. * @param configure - Callback for the keys of the end nodes. * @returns The builder for continuation. */ removedWith(eventType: Constructor, configure: (builder: IGraphEdgeRemovedWithBuilder) => void): IGraphEdgeBuilder; } //# sourceMappingURL=IGraphEdgeBuilder.d.ts.map