@sitecore/sc-contenthub-webclient-sdk
Version:
Sitecore Content Hub WebClient SDK.
24 lines (23 loc) • 710 B
TypeScript
import { Nullable } from "../../../base-types";
import { IRelation } from "../relation";
/**
* Base interface for relation that are associated with only one entity.
*/
export interface IToOneRelation extends IRelation {
/**
* Gets the value of the relation.
* @returns An id or null.
*/
getId(): Nullable<number>;
/**
* Sets the value of the relation.
* @param id - The id to set (or null)
* @throws The id must be strictly positive.
*/
setId(id: Nullable<number>): void;
/**
* Sets the value of the relation.
* @param identifier - The identifier to set (or null)
*/
setIdentifierAsync(identifier: Nullable<string>): Promise<void>;
}