@sitecore/sc-contenthub-webclient-sdk
Version:
Sitecore Content Hub WebClient SDK.
41 lines (40 loc) • 1.22 kB
TypeScript
import { IChildRelation, IParentRelation, IRelation } from "./relation";
import { RelationRole } from "./relation-role";
export declare class RelationContainer {
relationName: string;
private _parentRelation;
get parentRelation(): IParentRelation;
private _childRelation;
get childRelation(): IChildRelation;
/**
* Checks if the relation is self-referencing.
*/
get isSelfRelation(): boolean;
/**
* Checks if this contains any relation.
*/
get isEmpty(): boolean;
constructor(relationName: string);
/**
* Checks if this contains any relation.
*/
any(): boolean;
/**
* Gets the relation. If role is null and the relation is self-referencing, it will throw.
* Returns null if there are no loaded relations.
* @param role - Relation role
*/
getRelation(role?: RelationRole): IRelation;
/**
* Gets an array of all loaded relations.
*/
getRelations(): Array<IRelation>;
/**
* Checks if the relation with specified role is loaded.
*/
relationExists(role: RelationRole): boolean;
/**
* Sets the relation on this container.
*/
setRelation(relation: IRelation): void;
}