UNPKG

@sitecore/sc-contenthub-webclient-sdk

Version:

Sitecore Content Hub WebClient SDK.

44 lines (43 loc) 1.88 kB
import CultureInfo from "../culture-info"; import { AggregateResource } from "../models/aggregate-resources/aggregate-resource"; import { IExtendedContentHubClient } from "./extended-client"; import { CancelCallback } from "./internal-client"; export interface AggregateLoadOption { /** * Flag for loading option lists. Defaults to true. */ loadOptionLists?: boolean; /** * Flag for loading settings. Defaults to true. */ loadSettings?: boolean; /** * Flag for loading definitions. Defaults to true. */ loadDefinitions?: boolean; /** * Flag for loading entities. Defaults to true. */ loadEntities?: boolean; /** * Flag for loading permissions. If not defined, will not be added to the query. */ loadPermissions?: boolean; } export interface IAggregateClient { /** * Method for getting the specified aggregate for the specified entity. * @param name - The name of the aggregate * @param id - The entity id to get the aggregate for * @param culture - The user culture * @param loadOptions - Can optionally configure what needs to be loaded from the aggregates (everything will be loaded by default except for permissions) * @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided * @returns An aggregate resource */ getAsync(name: string, id: number, culture?: CultureInfo, loadOptions?: AggregateLoadOption, cancelCallback?: CancelCallback): Promise<AggregateResource>; } export declare class AggregateClient implements IAggregateClient { private readonly _client; constructor(client: IExtendedContentHubClient); getAsync(name: string, id: number, culture?: CultureInfo, loadOptions?: AggregateLoadOption, cancelCallback?: CancelCallback): Promise<AggregateResource>; }