import * as react_jsx_runtime from 'react/jsx-runtime';
import * as React from 'react';
import { ActiveFilter, SortRule, FilterFieldDef, ConditionalRule } from '../../lib/table-properties-types.js';
import { RowHeight } from '../../lib/row-height.js';
import { DataListViewType } from '../../lib/data-list-view.js';
import { DataListDisplayOptions } from '../../lib/data-list-display-options.js';

/**
 * Structural interface over the fields consumed from `useTableState`.
 * Any `ReturnType<typeof useTableState<T>>` is assignable to this type because:
 *  - All non-row fields have the same shape regardless of `T`.
 *  - `rows: T[]` is assignable to `rows: { length: number }` (arrays expose `.length`).
 */
interface TablePropertiesDrawerButtonState {
    sheetOpen: boolean;
    setSheetOpen: (v: boolean) => void;
    /**
     * Optional deep-link target consumed by `TablePropertiesDrawer`'s `initialPanel`.
     * Required only if the hub deep-links into a specific drawer panel (e.g. the
     * column header's **Add Conditional Rule** sets it to `"conditional-rules"`).
     * Default state is `null`, which makes the drawer open on its index panel.
     */
    sheetInitialPanel?: string | null;
    setSheetInitialPanel?: (v: string | null) => void;
    showGridlines: boolean;
    setShowGridlines: (v: boolean) => void;
    rowHeight: RowHeight;
    setRowHeight: (v: RowHeight) => void;
    activeFilters: ActiveFilter[];
    addFilter: (fieldKey: string, fromDrawer?: boolean) => void;
    updateFilter: (id: string, patch: Partial<ActiveFilter>) => void;
    removeFilter: (id: string) => void;
    getConnector: (leftFilterId: string) => "and" | "or";
    toggleConnector: (leftFilterId: string) => void;
    filterBarVisible: boolean;
    setFilterBarVisible: (v: boolean) => void;
    drawerExpandedFilters: Set<string>;
    setDrawerExpandedFilters: React.Dispatch<React.SetStateAction<Set<string>>>;
    /** Only `.length` is read — compatible with any `T[]`. */
    rows: {
        length: number;
    };
    sortRules: SortRule[];
    setSortRules: (rules: SortRule[]) => void;
    addSortRule: (fieldKey: string) => void;
    removeSortRule: (id: string) => void;
    toggleSortDir: (id: string) => void;
    colOrder: string[];
    setColOrder: (order: string[]) => void;
    hiddenCols: Set<string>;
    toggleColVisibility: (key: string) => void;
    moveCol: (key: string, dir: "up" | "down") => void;
    groupBy: string | null;
    setGroupBy: (key: string | null) => void;
    sortKey?: string;
}
interface TablePropertiesDrawerButtonProps {
    /** Pass any `useTableState<T>` return value. */
    state: TablePropertiesDrawerButtonState;
    totalRows: number;
    filterFields: FilterFieldDef[];
    /**
     * Column definitions for the drawer's Sort / Group / Columns panels.
     * Required — derive from your column defs (`columnsToFieldDefinitions`) so
     * the drawer never falls back to product-specific defaults.
     */
    fieldDefinitions: {
        key: string;
        label: string;
        sortable?: boolean;
    }[];
    resolveColumnLabel?: (key: string) => string;
    displayOptions: DataListDisplayOptions;
    onDisplayOptionsChange: (patch: Partial<DataListDisplayOptions>) => void;
    conditionalRules: ConditionalRule[];
    onAddConditionalRule: (rule: Omit<ConditionalRule, "id">) => void;
    onRemoveConditionalRule: (id: string) => void;
    onUpdateConditionalRule: (id: string, patch: Partial<ConditionalRule>) => void;
    /**
     * Whether pagination is enabled. Defaults to `false`.
     * Placements passes `true` because it supports server-side pagination.
     */
    pagination?: boolean;
    onPaginationChange?: (v: boolean) => void;
    /** View type shown in the drawer header tile grid. */
    currentView?: DataListViewType;
    onViewChange?: (v: DataListViewType) => void;
    /**
     * Subset of view types this hub implements. When provided, the drawer's view-type tile grid is
     * filtered so users cannot select an unsupported view (e.g. List hub never offers Dashboard).
     */
    supportedViewTypes?: readonly DataListViewType[];
    /** Shown below the "Properties" title in the drawer header (e.g. "Team", "Compliance"). */
    lifecycleTabLabel?: string;
    /**
     * Edit-mode rename support — forwarded to `TablePropertiesDrawer`. When set
     * (and not in creation mode), the drawer renders an editable Name input on
     * the main panel bound to this controlled pair. Omit both to keep the
     * existing read-only header.
     */
    viewName?: string;
    onViewNameChange?: (name: string) => void;
    /**
     * When the active view is Board and more than one entry is provided, the drawer renders
     * a selector for which field splits the board into swimlane columns.
     */
    boardGroupByColumnOptions?: {
        key: string;
        label: string;
    }[];
    /** Extra controls rendered before the Properties button (e.g. a dashboard-edit button). */
    extraActions?: React.ReactNode;
    /** Optional custom option renderer for filter values (e.g. status chips). */
    renderFilterOptionValue?: (fieldKey: string, value: string) => React.ReactNode;
    /** Show record counts on each view tab. Surfaced as a toggle in the Display panel. */
    showViewCounts?: boolean;
    onShowViewCountsChange?: (v: boolean) => void;
    /**
     * When `true`, the trigger `<Button>` is not rendered — only the drawer is
     * mounted. The drawer's open state still comes from `state.sheetOpen`, so
     * the parent toggles it via `state.setSheetOpen(true)`. Used by `HubTable`
     * for the 2-step "Add view" creation flow, where the drawer needs to mount
     * with its own ephemeral state buffer but the active view's existing
     * Properties trigger button stays in place.
     */
    hideTrigger?: boolean;
    /**
     * Creation-mode pass-through props for the 2-step "Add view" flow. When
     * `isCreatingNewView` is set, the drawer renders its create-mode header
     * (with the new-view Name input) and footer (Create / Cancel buttons).
     * Wired by `HubTable`'s second `TablePropertiesDrawerButton` instance.
     */
    isCreatingNewView?: boolean;
    newViewName?: string;
    onNewViewNameChange?: (name: string) => void;
    onCreateNewView?: () => void;
    onCancelNewView?: () => void;
    creatingViewTypeLabel?: string;
}
declare function TablePropertiesDrawerButton({ state, totalRows, filterFields, fieldDefinitions, resolveColumnLabel, displayOptions, onDisplayOptionsChange, conditionalRules, onAddConditionalRule, onRemoveConditionalRule, onUpdateConditionalRule, pagination, onPaginationChange, currentView, onViewChange, supportedViewTypes, lifecycleTabLabel, viewName, onViewNameChange, boardGroupByColumnOptions, extraActions, renderFilterOptionValue, showViewCounts, onShowViewCountsChange, hideTrigger, isCreatingNewView, newViewName, onNewViewNameChange, onCreateNewView, onCancelNewView, creatingViewTypeLabel, }: TablePropertiesDrawerButtonProps): react_jsx_runtime.JSX.Element;

export { TablePropertiesDrawerButton, type TablePropertiesDrawerButtonProps, type TablePropertiesDrawerButtonState };
