import type { MouseEvent, Ref, ComponentType, ReactNode } from 'react';
import type { FormControlProps } from '@pega/cosmos-react-core/lib/components/FormControl';
import type { SearchInputProps } from '../SearchInput';
import type { MenuGroupProps, MenuProps } from '../Menu';
import type { Action, BaseProps, DeferInfer, ExcludeStrict, HeadingTag, TestIdProp } from '../../types';
import type { AvatarProps } from '../Avatar';
export interface ViewProps {
    /** Unique, stable identifier of this view. */
    id: string;
    /** Label text of this view. */
    text: string;
    /** Flag indicating whether this view is currently selected. */
    selected: boolean;
    /** A count to assist with number of associated items. */
    count?: number;
    /** A visual to assist identifying an item. */
    visual?: Pick<AvatarProps, 'name' | 'icon' | 'imageSrc' | 'status'>;
}
export interface ViewGroupProps {
    /** Label text of the group. */
    text: MenuGroupProps['label'];
    /** Array of items belonging to the group. */
    items: ViewProps[];
}
export interface ViewSelectorProps {
    /** A list of pre-defined data views. */
    views: (ViewProps | ViewGroupProps)[];
    /** Called when a view is selected. */
    onViewSelect: MenuProps['onItemClick'];
    /** Determines which view is the default. */
    defaultId?: string;
    /** Determines which view is the default in the app. */
    appDefaultId?: string;
}
export interface QueryOption {
    /** A count representing the number of applied conditions within the query option. */
    count?: number;
}
export interface QueryOptionDialogProps<P extends object = any> extends QueryOption {
    /** A component to render the content portion of the query option dialog. */
    renderer: ComponentType<P>;
    /**
     * A props object that will be passed to the content renderer.
     */
    rendererProps?: DeferInfer<P>;
    /**
     * Called when the user explicitly or implicitly cancels(closes) the query dialog.
     * Returning false will block the dialog from closing.
     */
    onCancel: () => boolean | void;
    /**
     * Called when the user explicitly applies the query option conditions.
     * Returning false will block the dialog from closing.
     */
    onSubmit: () => boolean | void;
}
/** Optionally provide query option presets. */
export interface PresetMenuProps extends QueryOption {
    /** Mode defining whether menu selection is single or multi mode. */
    mode?: ExcludeStrict<MenuProps['mode'], 'action'>;
    /** Items of the menu. */
    items: {
        id: string;
        text: string;
        selected: boolean;
        icon?: string;
    }[];
    /** Callback invoked on item selection. Passes the item id as an argument. */
    onItemClick: MenuProps['onItemClick'];
}
export type QueryOptionId = 'filter' | 'sort' | 'group';
export interface ListToolbarProps extends BaseProps, TestIdProp {
    /** Renders a simple text name of table */
    name: string;
    /**
     * Uses specific heading tag for header.
     * @default h3
     */
    headingTag?: HeadingTag;
    /** Renders a simple view heading text or view selection menu. */
    viewSelector?: ViewSelectorProps;
    /** Props related to list used as a form control. */
    formControlProps?: Pick<FormControlProps, 'required' | 'additionalInfo' | 'info' | 'status'>;
    /** Props related to new item creation button. */
    createNew?: {
        /** Label of the new item creation button. */
        label?: string;
        /** Callback that will render a Create new button and is fired when that button is clicked. */
        onClick: (e: MouseEvent) => void;
    };
    /** Props related to the Search Input. */
    search?: SearchInputProps;
    /** Total returned results related for a given search. Optional indication of a selected item count. */
    count?: {
        total?: number;
        /**
         * If true renders + next to total number.
         * @default false
         */
        totalHasMore?: boolean;
        selected?: number;
    };
    /** Additional actions region */
    additionalActions?: ReactNode;
    /** Custom Rendering or available presets for filtering. */
    filter?: QueryOptionDialogProps | PresetMenuProps;
    /** Custom Rendering or available presets for sorting. */
    sort?: QueryOptionDialogProps | PresetMenuProps;
    /** Custom Rendering or available presets for grouping. */
    group?: QueryOptionDialogProps | PresetMenuProps;
    /** Top level dataset actions. */
    actions?: Action[];
    /** Ref for the actions button element. */
    actionsButtonRef?: Ref<HTMLButtonElement>;
    /** Ref for the wrapping element. */
    ref?: Ref<HTMLDivElement>;
}
//# sourceMappingURL=ListToolbar.types.d.ts.map