import { type ReactNode, type Ref } from "react";
import { type ObjRef, type SortDirection } from "@gooddata/sdk-model";
import { type IAccessibilityConfigBase } from "../../typings/accessibility.js";
import { type IconType } from "../@types/icon.js";
import { type ThemeColor } from "../@types/themeColors.js";
/**
 * Variant for UiAsyncTable component.
 * - "regular": Standard table size for full pages
 * - "small": Compact table size for embedding in modals/dialogs
 *
 * @internal
 */
export type UiAsyncTableVariant = "regular" | "small";
/**
 * @internal
 */
export interface IUiAsyncTableAccessibilityConfig<T> {
    getCheckboxItemAriaLabel?: (item: T) => string;
    checkboxAllAriaLabel?: string;
    searchAriaLabel?: string;
    gridAriaLabel?: string;
}
/**
 * @internal
 */
export interface IUiAsyncTableColumnAccessibilityConfig {
    ariaLabel?: string;
}
/**
 * @internal
 */
export interface IUiAsyncTableProps<T extends {
    id: string;
} | {
    ref: ObjRef;
}> {
    items: T[];
    totalItemsCount?: number;
    columns: Array<IUiAsyncTableColumn<T>>;
    onItemClick?: (item: T) => void;
    scrollToIndex?: number;
    width?: number;
    maxHeight?: number;
    variant?: UiAsyncTableVariant;
    isMobileView?: boolean;
    skeletonItemsCount?: number;
    isLoading?: boolean;
    hasNextPage?: boolean;
    loadNextPage?: () => void;
    filters?: Array<IUiAsyncTableFilter>;
    isFiltersTooLarge?: boolean;
    sortBy?: keyof T;
    sortDirection?: SortDirection;
    onSort?: (key: keyof T) => void;
    allowSearch?: boolean;
    searchPlaceholder?: string;
    onSearch?: (search: string) => void;
    renderToolbarCustomElement?: () => ReactNode;
    bulkActions?: Array<IUiAsyncTableBulkAction>;
    selectedItemIds?: Array<string>;
    setSelectedItemIds?: (items: Array<string>) => void;
    renderItem?: (item: T) => ReactNode;
    renderHeader?: () => ReactNode;
    renderEmptyState?: () => ReactNode;
    locale?: string;
    accessibilityConfig?: IUiAsyncTableAccessibilityConfig<T>;
}
/**
 * @internal
 */
export type UiAsyncTableMenuRenderer<T> = (item: T, closeDropdown: () => void) => ReactNode;
/**
 * @internal
 */
export interface IUiAsyncTableColumn<T> {
    key?: keyof T;
    label?: string;
    width?: number;
    renderMenu?: UiAsyncTableMenuRenderer<T>;
    renderButton?: (item: T) => ReactNode;
    renderRoleIcon?: (item: T) => ReactNode;
    renderPrefixIcon?: (item: T) => ReactNode;
    renderSuffixIcon?: (item: T) => ReactNode;
    renderBadge?: (item: T) => ReactNode;
    getMultiLineTextContent?: (item: T) => Array<string>;
    getTextContent?: (item: T) => string | ReactNode;
    getTextTitle?: (item: T) => string;
    getTextHref?: (item: T) => string | undefined;
    textColor?: ThemeColor;
    bold?: boolean;
    sortable?: boolean;
    align?: "left" | "center" | "right";
    getAccessibilityConfig?: (item: T) => IUiAsyncTableColumnAccessibilityConfig;
}
/**
 * @internal
 */
export interface IUiAsyncTableColumnDefinitionResponsive<T> extends IUiAsyncTableColumn<T> {
    minWidth?: number;
}
/**
 * @internal
 */
export interface IUiAsyncTableFilter {
    label: string;
    options: Array<IUiAsyncTableFilterOption>;
    onItemsSelect: (options: Array<IUiAsyncTableFilterOption>) => void;
    selected?: Array<IUiAsyncTableFilterOption>;
    isMultiSelect?: boolean;
}
/**
 * @internal
 */
export interface IUiAsyncTableFilterOption {
    value: string;
    label?: string;
    secondaryLabel?: string;
}
/**
 * @internal
 */
export interface IUiAsyncTableBulkAction {
    label: string;
    onClick: () => void;
    accessibilityConfig?: IAccessibilityConfigBase;
}
/**
 * @internal
 */
export interface IUiAsyncTableTitleProps {
    title: string;
    renderIcon?: () => ReactNode;
    onSearch?: (search: string) => void;
    actions: Array<IUiAsyncTableTitleAction>;
    scrollToStart: () => void;
}
/**
 * @internal
 */
export interface IUiAsyncTableTitleAction {
    renderAction: () => ReactNode;
}
export interface IUiAsyncTableHeaderProps<T> {
    columns: Array<IUiAsyncTableColumn<T>>;
    handleColumnClick: (key?: keyof T) => void;
    sortBy?: keyof T;
    sortDirection?: SortDirection;
    hasCheckbox?: boolean;
    width?: number;
    small?: boolean;
    largeRow?: boolean;
}
/**
 * @internal
 */
export interface IUiAsyncTableFilterProps extends IUiAsyncTableFilter {
    isFiltersTooLarge?: boolean;
    variant?: UiAsyncTableVariant;
    isMobileView?: boolean;
    width?: number;
    /**
     * When provided, the chip shows a delete button. Clicking it calls this callback
     * (typically used to reset the filter to "All" state).
     */
    onChipReset?: () => void;
}
export interface IUiAsyncTableRowProps<T extends {
    id: string;
} | {
    ref: ObjRef;
}> {
    item?: T;
    itemIndex: number;
    columns: Array<IUiAsyncTableColumn<T>>;
    onSelect?: (item: T) => void;
    onClick?: (item: T) => void;
    hasCheckbox?: boolean;
    isLarge?: boolean;
    isSelected?: boolean;
    isFocused?: boolean;
    focusedColumnIndex?: number;
    focusedElementRef?: Ref<HTMLElement>;
    accessibilityConfig?: IUiAsyncTableAccessibilityConfig<T>;
}
export type UiAsyncTableCheckboxProps = {
    onChange?: () => void;
    checked?: boolean;
    indeterminate?: boolean;
    disabled?: boolean;
    ariaLabel?: string;
    header?: boolean;
    isCellFocused?: boolean;
    cellRef?: Ref<HTMLElement>;
    cellId?: string;
};
export interface IUiAsyncTableToolbarProps<T extends {
    id: string;
} | {
    ref: ObjRef;
}> {
    filters?: Array<IUiAsyncTableFilter>;
    allowSearch?: boolean;
    isFiltersTooLarge?: boolean;
    bulkActions?: Array<IUiAsyncTableBulkAction>;
    selectedItemIds?: Array<string>;
    setSelectedItemIds: (items: Array<string>) => void;
    totalItemsCount: number;
    items: Array<T>;
    variant?: UiAsyncTableVariant;
    isMobileView?: boolean;
    width?: number;
    searchPlaceholder?: string;
    onSearch?: (search: string) => void;
    renderToolbarCustomElement?: () => ReactNode;
    accessibilityConfig?: IUiAsyncTableAccessibilityConfig<T>;
}
export type UiAsyncTableDropdownItemProps = {
    label: string;
    secondaryLabel?: string;
    onClick: () => void;
    isSelected?: boolean;
    isMultiSelect?: boolean;
    isUnderlined?: boolean;
    accessibilityConfig?: IAccessibilityConfigBase;
};
export interface IUiAsyncTableBulkActionsProps {
    bulkActions: Array<IUiAsyncTableBulkAction>;
}
export interface IUiAsyncTableIconRendererProps<T> {
    renderIcon?: (item: T) => ReactNode;
    className: string;
    item: T;
}
export interface IUiAsyncTableBodyProps<T extends {
    id: string;
} | {
    ref: ObjRef;
}> {
    items: T[];
    maxHeight: number;
    itemHeight: number;
    skeletonItemsCount: number;
    hasNextPage?: boolean;
    isLoading?: boolean;
    onItemClick?: (item: T) => void;
    loadNextPage?: () => void;
    columns: Array<IUiAsyncTableColumn<T>>;
    bulkActions?: Array<IUiAsyncTableBulkAction>;
    scrollToIndex?: number;
    isLargeRow?: boolean;
    shouldLoadNextPage?: (lastItemIndex: number, itemsCount: number) => boolean;
    renderItem: (item: T, itemIndex: number, focusedItemRef: Ref<HTMLElement>, isFocused: boolean, focusedColumnIndex?: number) => ReactNode;
}
/**
 * @internal
 */
export interface IUiAsyncTableEmptyStateProps {
    title?: string;
    description?: string;
    icon?: IconType;
}
//# sourceMappingURL=types.d.ts.map