import { Field, RelationDeleteAction, RootEntityType } from '../index'; declare enum RelationFieldSide { FROM_SIDE = "FROM_SIDE", TO_SIDE = "TO_SIDE" } /** * A view on a relation without taking the perspective of one of the types */ export declare class Relation { /** * The type declaring the forward relation */ readonly fromType: RootEntityType; /** * The field declaring the forward relation */ readonly fromField: Field; /** * The field type of the forward relation, i.e., the type potentially declaring an inverse relation */ readonly toType: RootEntityType; /** * The field of the toType declaring the inverse relation (if any) */ readonly toField: Field | undefined; constructor(params: { fromType: RootEntityType; fromField: Field; toType: RootEntityType; toField?: Field; }); /** * Gets relation from the side of the root entity type that declares the forward relation */ get fromSide(): RelationSide; /** * Gets relation from the side of the root entity type that declares the inverse relation */ get toSide(): RelationSide; /** * Gets a string that uniquely identifies this relation */ get identifier(): string; toString(): string; } /** * A relation from the perspective of one of the two types */ export declare class RelationSide { readonly relation: Relation; private readonly side; /** * The type where the relation originates, when viewed with this side's perspective */ readonly sourceType: RootEntityType; /** * The field declared in the source type * * Might be undefined if this is the "to side" */ readonly sourceField: Field | undefined; /** * The type where the relation points to, when viewed with this side's perspective */ readonly targetType: RootEntityType; /** * The field declared in the source type * * Might be undefined if this is the "from side" */ readonly targetField: Field | undefined; constructor(relation: Relation, side: RelationFieldSide); /** * Whether this is side that follows the relation in the forwards direction */ get isFromSide(): boolean; /** * Whether this is side that follows the relation in the inverse direction */ get isToSide(): boolean; get otherSide(): RelationSide; /** * Is ONE if a source entity can be linked to one target entity, or MANY if it can be linked to many target entities */ get sourceMultiplicity(): Multiplicity; /** * Is ONE if a target entity can be linked to one source entity, or MANY if it can be linked to many source entities */ get targetMultiplicity(): Multiplicity; /** * Specifies the action to take regarding this relation if the source entity is to be removed */ get deleteAction(): RelationDeleteAction; getSourceFieldOrThrow(): Field; toString(): string; } export declare enum Multiplicity { ONE = "ONE", MANY = "MANY" } export {};