import { ReactNode } from 'react'; import { AuthTableBodyProps, TableBodyRenderProps } from './auth-table.js'; type EmptyStateRenderFn = NonNullable; /** * Declarative empty-state expressions for AthenaTable. * * Prefer this over nested ternaries: * * ```ts * emptyState={{ * empty: "No rows returned.", * error: listQuery.errorMessage, * loading: "Loading rows...", * }} * // with isLoading={listQuery.isLoading} * ``` * * Or first-class props: `error={listQuery.errorMessage}` + `emptyState="No rows"`. */ export interface AthenaTableEmptyStateConfig { /** * Content when the table is empty and not loading / not in error. * Defaults to the package empty copy when omitted. */ empty?: ReactNode; /** * When truthy (non-empty string or node), shown instead of `empty`. * Table-level `error` / `errorMessage` props override this when provided. */ error?: ReactNode | null; /** * Explicit loading flag for the config object. * AthenaTable also merges its `isLoading` prop into resolution. */ isLoading?: boolean; /** * Content while loading when empty-state resolution is used for loading * (AthenaTable normally short-circuits to skeletons when `isLoading` is true). * Strings starting with "Loading" still map to the skeleton via the normalizer. * @default "Loading rows..." */ loading?: ReactNode; } /** * Accepts the legacy render function, a static ReactNode / string, or a * declarative config object — without breaking existing call sites. */ export type AthenaTableEmptyStateInput = EmptyStateRenderFn | ReactNode | AthenaTableEmptyStateConfig; export interface AthenaTableEmptyStateContext { /** Table-level error (wins over config.error when non-nullish). */ error?: ReactNode | null; /** Table-level loading (merged with config.isLoading). */ isLoading?: boolean; state?: Partial; } /** * Config objects are plain objects with known empty-state keys. * Functions are the legacy render form; strings/numbers/elements are static content. */ export declare function isAthenaTableEmptyStateConfig(value: unknown): value is AthenaTableEmptyStateConfig; /** * Resolves loading → error → empty content for AthenaTable empty states. */ export declare function resolveAthenaTableEmptyStateContent(input: AthenaTableEmptyStateInput | undefined, context?: AthenaTableEmptyStateContext): ReactNode; /** * Builds a HeroUI-compatible `renderEmptyState` function from any accepted input. * Use when you need the legacy function shape (e.g. outside AthenaTable). * * ```ts * emptyState={createAthenaTableEmptyState({ * empty: "No rows", * error: query.errorMessage, * isLoading: query.isLoading, * })} * ``` */ export declare function createAthenaTableEmptyState(input: AthenaTableEmptyStateInput, context?: Omit): EmptyStateRenderFn; export {};