/* * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * The `experience/cmsDeliveryApi` module provides content available to the community. * @see {@link https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-editor-get-content.html | CMS Delivery Public API Documentation} */ declare module "experience/cmsDeliveryApi" { /** * Represents the metadata of a managed content. */ export type ContentDataRepresentation = { contentKey: string; managedContentId: string; title: string; language: string; publishedDate: string; urlName: string; resourceUrl: string; unauthenticatedUrl: string; isSummary?: boolean; contentType: ContentType; contentBody?: Record; }; /** * Represents the complete content data including channel info and references. */ export type ContentData = { channelSummary: ChannelSummary; references?: Record; referencesList?: Reference[]; contentBody?: Record; contentKey: string; contentType: ContentType; } & ContentDataRepresentation; /** * Represents a collection of managed content with pagination information. */ export type ContentsData = { channelSummary: ChannelSummary; contents: ContentDataRepresentation[]; references?: Record; referencesList?: Reference[]; currentPageUrl: string; nextPageUrl?: string; previousPageUrl?: string; }; /** * Options for requesting multiple contents. */ export interface GetContentsRequestOptions { channelOrSiteId?: string; contentKeys?: string[]; managedContentIds?: string[]; contentTypeFQN?: string; referenceDepth?: number; page?: number; pageSize?: number; includeContentBody?: boolean; } /** * Represents channel information. */ export type ChannelSummary = { domainUrl: string; id: string; type: string; name: string; resourceUrl: string; targetSummary?: TargetSummary; }; /** * Represents target summary information. */ export type TargetSummary = { id: string; }; /** * Represents content type information. */ export type ContentType = { fullyQualifiedName: string; }; /** * Represents a reference to another content. */ export type Reference = { contentKey: string; managedContentId: string; title: string; contentBody?: Record; resourceUrl: string; }; /** * Retrieves content from the Experience CMS Delivery API. * @param channelOrSiteId - The ID of the channel or site to fetch content from. * @param contentKeyOrId - The key or ID of the content to fetch. * @returns A promise that resolves to the ContentData. */ export function getContent( channelOrSiteId: string, contentKeyOrId: string, ): Promise; /** * Retrieves content from the Experience CMS Delivery API. * @param channelOrSiteId - The ID of the channel or site to fetch content from. * @returns A promise that resolves to the ContentsData. */ export function getContents(channelOrSiteId: string): Promise; }