/** * @description Defines the allowed anchor sides for popovers. * @remarks Used to position popovers relative to a target element with a consistent vocabulary. * @enum {string} */ export declare enum PopoverSide { TOP = "top", RIGHT = "right", BOTTOM = "bottom", LEFT = "left" } /** * @description Enumerates built-in AI popover intents. * @remarks Standardizes mapping from UI triggers to AI behaviors. * @enum {string} */ export declare enum ExtensionPopoverType { AI_HIDDEN_PREHEADER = "aiHiddenPreheader", AI_SUBJECT = "aiSubject", AI_TEXT = "aiText" } /** * @description Ordered placement preferences for a popover. * @remarks Enables deterministic fallbacks when space is constrained. * @typedef {Array} PopoverPreferredSides */ export type PopoverPreferredSides = PopoverSide[]; /** * @description Normalized output produced by a popover. * @remarks A single text value returned by any popover flow. * @typedef {string} ExtensionPopoverResult */ export type ExtensionPopoverResult = string; /** * @description Configuration for an AI-assisted popover. * @remarks Encapsulates anchoring, placement, intent, initial value, and completion callback. * @typedef {Object} AIPopoverOptions * @property {HTMLElement} targetElement Element the popover anchors to. * @property {PopoverPreferredSides} preferredSides Preferred sides in priority order. * @property {ExtensionPopoverType} type AI intent to execute. * @property {string} value Initial text context. * @property {(response: string) => void} onResult Callback fired with the AI result. */ export interface AIPopoverOptions { /** * Element the popover anchors to. * @remarks Required to compute placement. */ targetElement: HTMLElement; /** * Preferred sides in priority order. * @remarks Drives fallback positioning. */ preferredSides: PopoverPreferredSides; /** * AI intent to execute. * @remarks One of `ExtensionPopoverType`. */ type: ExtensionPopoverType; /** * Initial text context. * @remarks Seeds AI generation. */ value: string; /** * Callback fired with the AI result. * @param response The generated string. */ onResult: (response: string) => void; } /** * @description Configuration for an emoji picker popover. * @remarks Reuses the same anchoring and result contract for emoji selection. * @typedef {Object} EmojiPopoverOptions * @property {HTMLElement} targetElement Element the popover anchors to. * @property {PopoverPreferredSides} preferredSides Preferred sides in priority order. * @property {(response: string) => void} onResult Callback with the selected emoji. */ export interface EmojiPopoverOptions { /** * Element the popover anchors to. * @remarks Required to compute placement. */ targetElement: HTMLElement; /** * Preferred sides in priority order. * @remarks Drives fallback positioning. */ preferredSides: PopoverPreferredSides; /** * Callback with the selected emoji. * @param response The emoji string. */ onResult: (response: string) => void; }