import { Client } from '../../Client'; import { ContentDeliveryAncestorsOptions, ContentDeliveryByContentTypeOptions, ContentDeliveryByIdOptions, ContentDeliveryByUrlOptions, ContentDeliveryChildrenOptions, ContentDeliveryDescendantsOptions, ContentDeliveryRootOptions, ContentDeliverySearchOptions, ContentDeliveryFilterOptions } from '../../RequestOptions'; import { Content } from '../../Responses'; import { PagedResponse } from '../../Responses/PagedResponse'; import { ContentFilter } from '../../RequestOptions/ContentFilterOptions'; /** * ContentDeliveryClient is used to access the Content part of the Content Delivery API. * @public * * @example * The {@link ContentDeliveryClient} must be accessed through {@link Client}. * * ```typescript * import { Client } from '@umbraco/headless-client' * * const client = new Client({ * projectAlias: '', * apiKey: '', * language: '', * }) * * const contentClient = client.delivery.content * ``` */ export declare class ContentDeliveryClient { private readonly client; /** @internal */ constructor(client: Client); private readonly makeRequest; /** * Fetch all Content at the root. * * @param options - Request options. See {@link ContentDeliveryRootOptions}. * @returns a `Promise` that resolves to an array of {@link Content}. */ root(options?: ContentDeliveryRootOptions): Promise; /** * Fetch a single Content item by its id. * @param id - GUID id of the Content item. * @param options - Request options. See {@link ContentDeliveryByIdOptions}. * @returns a `Promise` that resolves to a {@link Content} if found, otherwise `undefined`. */ byId(id: string, options?: ContentDeliveryByIdOptions): Promise; /** * Feth a single Contint item by its Url. * @param url - Url for the content to retrieve. * @param options - Request options. See {@link ContentDeliveryByUrlOptions}. * @returns a `Promise` that resolves to a {@link Content} if found, otherwise `undefined`. */ byUrl(url: string, options?: ContentDeliveryByUrlOptions): Promise; /** * Fetch children for a Content item. * @param id - GUID id of the Content item. * @param options - Request options. See {@link ContentDeliveryChildrenOptions}. * @returns a `Promise` that resolves to a {@link PagedResponse} of {@link Content} if found, otherwise `undefined`. */ children(id: string, options?: ContentDeliveryChildrenOptions): Promise | undefined>; /** * Fetch ancestors for a content item. * @param id - GUID id of the Content item. * @param options - Request options. See {@link ContentDeliveryAncestorsOptions}. * @returns a `Promise` that resolves to an array of {@link Content} if found, otherwise `undefined`. */ ancestors(id: string, options?: ContentDeliveryAncestorsOptions): Promise; /** * Fetch descendants for a content item. * @param id - GUID id of the Content item. * @param options - Request options. See {@link ContentDeliveryDescendantsOptions}. * @returns a `Promise` that resolves to an array of {@link Content} if found, otherwise `undefined`. */ descendants(id: string, options?: ContentDeliveryDescendantsOptions): Promise | undefined>; /** * Fetch Content of a specific type. * @param contentType - Content Type to filter by. * @param options - Request options. See {@link ContentDeliveryByContentTypeOptions} * @returns a `Promise` that resolves to a {@link PagedResponse} of {@link Content}. */ byContentType(contentType: string, options?: ContentDeliveryByContentTypeOptions): Promise>; /** * Filter for Content containing specific property values * @param contentFilter - Filter object. See {@link ContentFilter} * @param options - Request options. See {@link ContentDeliveryFilterOptions} * @returns a `Promise` that resolves to a {@link PagedResponse} of {@link Content}. */ filter(body: ContentFilter, options?: ContentDeliveryFilterOptions): Promise>; /** * Search for Content containing term, * @param term - Term to search for * @param options - Request options. See {@link ContentDeliverySearchOptions} * @returns a `Promise` that resolves to a {@link PagedResponse} of {@link Content}. */ search(term: string, options?: ContentDeliverySearchOptions): Promise>; }