/************************************************************************* * Copyright 2025 Adobe * All Rights Reserved. * * NOTICE: Adobe permits you to use, modify, and distribute this file in * accordance with the terms of the Adobe license agreement accompanying * it. If you have received this file from a source other than Adobe, * then your use, modification, or distribution of it requires the prior * written permission of Adobe. **************************************************************************/ /** * Internal APIs, meant to be used by Unified Shell to manipulate the iframe DOM. * @packageDocumentation * @module dom */ export interface DomHighlightStyle { border?: string; borderColor?: string; borderWidth?: string; borderRadius?: string; backgroundColor?: string; boxShadow?: string; } export interface DomStyleConfig { /** * Style applied directly to the element overlay component */ highlightStyle: DomHighlightStyle; /** * Custom style injected into page when spotlight is enabled. */ injectedStyle: { /** * The classname applied when spotlight is enabled. */ className: string; /** * The HTML to inject into the style element. Contains the CSS for the injected style class. */ html: string; }; } export interface DataCaptureConfig { /** * Whether to include the attributes of the element. */ includeAttributes?: boolean; /** * Whether to include the HTML of the element. */ includeHTML?: boolean; /** * Whether to include a screenshot of the element. */ includeScreenshot?: boolean; /** * Whether to include the text of the element. */ includeText?: boolean; } export interface DomElement { minSize?: number; maxSize?: number; tagName: string; } export interface DomInteractionConfig { /** * Configuration for data capture. */ dataCapture?: DataCaptureConfig; /** * Configuration for element detection. */ elementDetection?: { /** * Used to delay the actual highlight until the user has stopped moving * the mouse for a set amount of time. A higher debounce will mean a less * responsive highlight. Not enabled by default. */ debounceDelay?: number; /** * The types of elements to be detected e.g. 'a', 'div', 'button', etc. */ elements?: DomElement[]; /** * Used in onMouseOver to prevent the highlight logic from running more than once every so often * (30ms by default), even if the mouse moves more frequently. */ throttleDelay?: number; }; /** * Styles to be applied to the page and overlay element. */ style?: DomStyleConfig; } export declare enum DomMessageType { ELEMENT_CLICK = "ELEMENT_CLICK", ELEMENT_HOVER = "ELEMENT_HOVER", SPOTLIGHT_ENABLE = "SPOTLIGHT_ENABLE", SPOTLIGHT_DISABLE = "SPOTLIGHT_DISABLE" } export interface DomMessagePayload { /** * The payload data of the custom event. */ data?: any; /** * The type of message. */ type: DomMessageType; } export interface ElementData { attributes?: Record; className?: string; dataset?: Record; id?: string; innerHTML?: string; outerHTML?: string; rect: { bottom: number; height: number; left: number; right: number; toJSON: () => object; top: number; width: number; x: number; y: number; }; screenshot?: string; tagName?: string; textContent?: string; }