/** * Toast surface used by AthenaTables. * Defaults to package toast helpers (`showToastSuccess`, …); inject your own adapter if needed. */ export type AthenaTableToastVariant = "success" | "danger" | "warning" | "info" | "default"; export type AthenaTableFeedbackText = string | ((value: string) => string); export interface AthenaTableFeedbackMessage { description?: AthenaTableFeedbackText; title: AthenaTableFeedbackText; } /** * Declarative (JSON-serializable) feedback config for table actions / chips. * Use `{{value}}` in title/description templates. */ export interface AthenaTableActionFeedbackConfig { emptyDescription?: string; emptyTitle?: string; emptyVariant?: "danger" | "info" | "warning"; /** Disable toasts for this action (still runs the action). */ enabled?: boolean; errorDescription?: string; errorTitle?: string; successDescription?: string; successTitle?: string; } export interface AthenaTableToastPayload { description?: string; title: string; variant?: AthenaTableToastVariant; } export interface AthenaTableToastAdapter { show: (payload: AthenaTableToastPayload) => void; } /** * Replace `{{value}}` (and aliases) in a feedback template string. */ export declare function applyAthenaTableFeedbackTemplate(template: string | undefined, value: string): string | undefined; export declare function resolveAthenaTableFeedbackMessage(message: AthenaTableFeedbackMessage | undefined, value: string): { description?: string; title: string; } | undefined; /** * Default toast adapter using package toast helpers (title + description). */ export declare const defaultAthenaTableToastAdapter: AthenaTableToastAdapter; /** * Override the toast backend globally (e.g. app-level `showToastSuccess`). * Call once near app bootstrap if you do not want HeroUI toast defaults. */ export declare function setAthenaTableToastAdapter(adapter: AthenaTableToastAdapter | null): void; export declare function getAthenaTableToastAdapter(): AthenaTableToastAdapter; export declare function showAthenaTableToast(payload: AthenaTableToastPayload, adapter?: AthenaTableToastAdapter): void; export declare function showAthenaTableFeedback(message: AthenaTableFeedbackMessage, value: string, variant: AthenaTableToastVariant, adapter?: AthenaTableToastAdapter): void; export interface CopyWithAthenaTableFeedbackOptions { emptyDescription?: AthenaTableFeedbackText; emptyTitle?: AthenaTableFeedbackText; emptyVariant?: "danger" | "info" | "warning"; errorDescription?: AthenaTableFeedbackText; errorTitle?: AthenaTableFeedbackText; /** When false, skip success toast (still copies). Default true. */ showSuccessToast?: boolean; successDescription?: AthenaTableFeedbackText; successTitle?: AthenaTableFeedbackText; toastAdapter?: AthenaTableToastAdapter; } export type AthenaTableCopyFunction = (value: string) => Promise | void; /** * Copy a value with cohesive AthenaTables toast feedback * (success / empty / error) — same ergonomics as app-level copyWithAppFeedback. * * @example * await copyWithAthenaTableFeedback(caseId, { * emptyTitle: "Case ID is not available", * emptyVariant: "danger", * errorTitle: "Unable to copy case ID", * errorDescription: (v) => v, * successTitle: "Case ID copied", * successDescription: (v) => v, * }) */ export declare function copyWithAthenaTableFeedback(value: string | null | undefined, options?: CopyWithAthenaTableFeedbackOptions, copy?: AthenaTableCopyFunction): Promise; /** * Build feedback options from a serializable action config + runtime value. */ export declare function feedbackConfigToCopyOptions(config: AthenaTableActionFeedbackConfig | undefined, value: string): CopyWithAthenaTableFeedbackOptions; export interface RunAthenaTableActionFeedbackOptions { errorDescription?: AthenaTableFeedbackText; errorTitle?: AthenaTableFeedbackText; successDescription?: AthenaTableFeedbackText; successTitle?: AthenaTableFeedbackText; toastAdapter?: AthenaTableToastAdapter; /** Value used for template resolvers (e.g. copied id). */ value?: string; } /** * Run any sync/async table action and toast success or failure. * * @example * await runAthenaTableActionWithFeedback( * () => deleteRow(id), * { * successTitle: "Row deleted", * errorTitle: "Delete failed", * value: id, * } * ) */ export declare function runAthenaTableActionWithFeedback(action: () => Promise | unknown, options?: RunAthenaTableActionFeedbackOptions): Promise<{ ok: true; result: unknown; } | { ok: false; error: unknown; }>; /** * Defaults for common copy-column row actions (case id, email, etc.). */ export declare function createCopyActionFeedback(label?: string): AthenaTableActionFeedbackConfig;