/* * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * The `lightning/cmsDeliveryApi` module provides content available to the community. * @see {@link https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-list-content.html | CMS Delivery Public API Documentation} */ declare module "lightning/cmsDeliveryApi" { /** * Contains the type information for a content node in the CMS. */ export interface ContentNodeValueRepresentation { nodeType: string; } /** * Represents a text node in the CMS content structure. */ export interface ContentTextNodeValueRepresentation extends ContentNodeValueRepresentation { value: string; } /** * Represents a media source node in the CMS content structure with its associated metadata. */ export interface ContentMediaSourceNodeValueRepresentation extends ContentNodeValueRepresentation { url: string; unauthenticatedUrl: string; resourceUrl: string; mediaType: string; mimeType: string; fileName: string; isExternal: boolean; referenceId: string; } /** * Represents a date node in the CMS content structure. */ export interface ContentDateNodeValueRepresentation extends ContentNodeValueRepresentation { value: Date; } /** * Represents a date and time node in the CMS content structure with timezone information. */ export interface ContentDateAndTimeNodeValueRepresentation extends ContentNodeValueRepresentation { dateTimeValue: Date; timeZone: string; } /** * Represents a media node in the CMS content structure with its associated metadata and URLs. */ export interface ContentMediaNodeValueRepresentation extends ContentNodeValueRepresentation { title: string; altText: string; url: string; unauthenticatedUrl: string; resourceUrl: string; altUrl: string; thumbnailUrl: string; mediaType: string; mimeType: string; fileName: string; contentKey: string; } /** * Represents managed content associations. Contains related topics. */ export interface ContentAssociationsRepresentation { topics: string[]; } /** * Contains all metadata of a managed content. */ export type ContentDataRepresentation = { associations?: ContentAssociationsRepresentation; contentNodes: Record< string, | ContentNodeValueRepresentation | ContentTextNodeValueRepresentation | ContentMediaNodeValueRepresentation | ContentMediaSourceNodeValueRepresentation | ContentDateNodeValueRepresentation | ContentDateAndTimeNodeValueRepresentation >; title: string; type: string; typeLabel: string; language: string; contentUrlName: string; publishedDate: string; managedContentId: string; contentKey: string; unauthenticatedUrl: string; }; /** * Represents a collection of content data with pagination information. */ export type ContentsData = { total: number; items: ContentDataRepresentation[]; currentPageUrl: string; nextPageUrl?: string; totalTypes: number; managedContentTypes: Record; }; /** * Represents a managed content type with its associated node types. */ export type ContentTypeRepresentation = { name: string; label: string; nodeTypes: Record; }; /** * Represents a managed content node type with its properties. */ export type ContentNodeTypeRepresentation = { name: string; label: string; nodeType: string; }; /** * Lists content from the CMS Delivery API for a specific community. * @param communityId - The ID of the community to fetch content from * @returns A promise that resolves to the ContentsData. */ export function listContent(communityId: string): Promise; }