UNPKG

@kontent-ai/smart-link

Version:

Kontent.ai Smart Link SDK allowing to automatically inject [smart links](https://docs.kontent.ai/tutorials/develop-apps/build-strong-foundation/set-up-editing-from-preview#a-using-smart-links) to Kontent.ai according to manually specified [HTML data attri

16 lines (15 loc) 1.24 kB
import { type IContentItem, type IContentItemElements } from "@kontent-ai/delivery-sdk"; import type { IUpdateMessageData } from "../lib/IFrameCommunicatorTypes"; /** * Applies an update to a content item synchronously. * This function takes a content item and an update message, and returns a new content item with the updates applied. * The update is applied recursively to all linked items within the content item. */ export declare const applyUpdateOnItem: <Elements extends IContentItemElements>(item: IContentItem<Elements>, update: IUpdateMessageData) => IContentItem<Elements>; /** * Applies an update to a content item asynchronously and loads newly added linked items. * This function takes a content item, an update message, and a function to fetch linked items, * and returns a promise that resolves to a new content item with the updates applied. * The update is applied recursively to all linked items within the content item. */ export declare const applyUpdateOnItemAndLoadLinkedItems: <Elements extends IContentItemElements>(item: IContentItem<Elements>, update: IUpdateMessageData, fetchItems: (itemCodenames: ReadonlyArray<string>) => Promise<ReadonlyArray<IContentItem>>) => Promise<IContentItem<Elements>>;