/** * Data payload for displaying an action sheet. * Can be undefined, a message-style alert, or a list selection. * * @see showActionSheet - SDK/platform utility that accepts this type */ export type ActionSheetData = undefined | ActionSheetMessageData | ActionSheetListData; /** * Configuration for a message-style action sheet. * Displays an alert with an icon indicating the message type. */ export type ActionSheetMessageData = { appearance: 'message'; type: 'info' | 'success' | 'warning' | 'error'; title?: string; description?: string; slotsHtml?: ActionSheetStaticHtmlData[]; }; /** * Array of options or option groups for a list-style action sheet. */ export type ActionSheetListDataOptions = (ActionSheetListOptgroup | ActionSheetListOption)[] | ActionSheetStaticHtmlData[]; /** * A grouped set of options within a list-style action sheet. */ export interface ActionSheetListOptgroup { disabled: boolean; label: string; options: ActionSheetListOption[]; } /** * A single selectable option within a list-style action sheet. */ export interface ActionSheetListOption { disabled: boolean; display: string; hidden: boolean; separator: boolean; multiline: boolean; value: string; innerHTML: string; } /** * Represents a selected option from an action sheet list. */ export interface ActionSheetSelectedOption { value: string; display: string; } /** * Configuration for a list-style action sheet. * Displays a selectable list of options with optional multi-select support. */ export type ActionSheetListData = { appearance: 'list'; title?: string; description?: string; event?: MouseEvent | KeyboardEvent | undefined; listProps: { multiple: boolean; selectedOptions: ActionSheetSelectedOption[]; noSelect: boolean; }; options: ActionSheetListDataOptions; slotsHtml?: ActionSheetStaticHtmlData[]; }; /** * Slotted into action sheet as a static html * Contains non-interactive static html */ export type ActionSheetStaticHtmlData = { slot: string; html: string; }; /** * Data returned when an action sheet is closed. * Contains the selected value(s) and whether the user confirmed or cancelled. */ export interface ActionSheetListCloseData { value?: string; values?: ActionSheetSelectedOption[]; type: 'cancel' | 'confirm'; } /** * Function signature for showing an action sheet. * * @see showActionSheet - Implementation in q2-tecton-common/utility */ export type ShowActionSheetFn = (data: ActionSheetData, selectors?: string[]) => Promise; /** * Extended HTMLElement interface for the q2-action-sheet custom element. * Provides type-safe access to the action sheet's properties and methods. * * @see q2-action-sheet - Component in q2-tecton-elements */ export interface HTMLQ2ActionSheetElement extends HTMLElement { show: () => Promise; data: ActionSheetData; } //# sourceMappingURL=action-sheet.d.ts.map