@sitecore/sc-contenthub-webclient-sdk
Version:
Sitecore Content Hub WebClient SDK.
44 lines (43 loc) • 2.58 kB
TypeScript
import CultureInfo from "../culture-info";
import { PageResource } from "../models/pages/page-resource";
import { IExtendedContentHubClient } from "./extended-client";
import { CancelCallback } from "./internal-client";
export interface IPagesClient {
/**
* Get a page resource by identifier.
* @param identifier - The identifier of the page
* @param culture - A culture to load the page in
* @param entityId - The current entity id (Optional)
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
* @returns A promise resolving to a {@link PageResource}.
* @throws An error when the resource can't be found.
*/
getPageByIdentifierAsync(identifier: string, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
/**
* Get a page resource by name.
* @param name - The name of the page
* @param culture - A culture to load the page in
* @param entityId - The current entity id (Optional)
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
* @returns A promise resolving to a {@link PageResource}.
* @throws An error when the resource can't be found.
*/
getPageByNameAsync(name: string, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
/**
* Get a page resource by id.
* @param id - The id of the page
* @param culture - A culture to load the page in
* @param entityId - The current entity id (Optional)
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
* @returns A promise resolving to a {@link PageResource}.
* @throws An error when the resource can't be found.
*/
getPageByIdAsync(id: number, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
}
export declare class PagesClient implements IPagesClient {
private readonly _client;
constructor(client: IExtendedContentHubClient);
getPageByNameAsync(name: string, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
getPageByIdentifierAsync(identifier: string, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
getPageByIdAsync(id: number, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
}