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

39 lines (38 loc) 1.53 kB
import { IFrameCommunicator } from './IFrameCommunicator'; import { KSLConfiguration } from '../utils/configuration'; export declare class DOMSmartLinkManager { private readonly iframeCommunicator; private readonly configuration; private readonly mutationObserver; private readonly intersectionObserver; private readonly renderer; private enabled; private renderingTimeoutId; private observedElements; private visibleElements; constructor(iframeCommunicator: IFrameCommunicator, configuration: KSLConfiguration); toggle: (force?: boolean) => void; enable: () => void; disable: () => void; destroy: () => void; private augmentVisibleElements; /** * Start an interval rendering (1s) that will re-render highlights for all visible elements using `setInterval`. * It helps to adjust highlights position even in situations that are currently not supported by * the SDK (e.g. element position change w/o animations, some infinite animations and other possible unhandled cases) * for better user experience. */ private startRenderingInterval; private stopRenderingInterval; private listenToGlobalEvents; private unlistenToGlobalEvents; private observeDomMutations; private disconnectObservers; private observeElementVisibility; private unobserveElementVisibility; private onDomMutation; private onElementVisibilityChange; private onEditElement; private onAddInitialClick; private onAddActionClick; }