UNPKG

@sitecore/sc-contenthub-webclient-sdk

Version:

Sitecore Content Hub WebClient SDK.

47 lines (46 loc) 1.87 kB
import { MapNumberTo, MapStringTo, Nullable, Object_Unknown } from "../../.."; import { IContentHubClient } from "../../../clients/content-hub-client"; import { ChildRelationBase, IChildRelation } from "../relation"; import { RelationRole } from "../relation-role"; import { IToManyRelation } from "./to-many-relation"; /** * A relation where the child has many parents. */ export interface IChildToManyParentsRelation extends IChildRelation, IToManyRelation { /** * The list of parent ids. */ readonly parents: Array<number>; /** * When related items are partially loaded, this value will be set * to indicate how many related items there are in total. */ parentTotal?: number; /** * Gets the properties for a parent. * * If no properties are found, an empty list is returned. * @param id - The id of the parent to get properties for */ getParentProperties(id: number): MapStringTo<Object_Unknown>; } export declare class ChildToManyParentsRelation extends ChildRelationBase implements IChildToManyParentsRelation { private _parents; readonly role: RelationRole; readonly parentTotal?: number; readonly isMultiValue: boolean; get isFullyLoaded(): boolean; get isDirty(): boolean; get parents(): Array<number>; constructor(name: string, properties?: Nullable<MapNumberTo<MapStringTo<Object_Unknown>>>, client?: IContentHubClient, parentTotal?: number, inheritsSecurity?: boolean); getIds(): Array<number>; setIds(ids: Array<number>): void; clear(): void; add(id: number): void; addRange(ids: Array<number>): void; addAsync(identifier: string): Promise<void>; addRangeAsync(identifiers: Array<string>): Promise<void>; startTracking(): void; markClean(): void; getParentProperties(id: number): MapStringTo<Object_Unknown>; }