import { ReactNode } from 'react';
import { Filter } from './internal/types';
/**
 * Render-prop ctx passed to FilterPopoverButton's children. The `custom`
 * adapter (and any consumer using a `custom` filter) uses this to receive the
 * draft (or committed) value and an `onChange` for its rendered body.
 *
 * When commitOnSelect is false (the default), `value` is the in-progress draft
 * and `onChange` updates it; the user must click Apply for it to commit.
 *
 * When commitOnSelect is true, `value` is the filter's currently-committed
 * value and `onChange` commits immediately (and closes the popover).
 */
export type FilterPopoverButtonRenderCtx<V = unknown> = {
    value: V;
    onChange: (value: V) => void;
};
/**
 * Base props shared by both commit modes. `commitOnSelect` is left out so each
 * variant can refine it as a literal; that's what lets `initialValue` be required
 * for the draft branch and absent for the commit-on-select branch.
 */
type FilterPopoverButtonBaseProps<V> = {
    /** The filter being edited. Used for id and dispatching commits. */
    filter: Filter;
    /** Trigger button label. Adapters typically pass adapter.formatLabel(filter). */
    label: ReactNode;
    /** Whether the filter currently has a non-default value (drives selected styling). */
    isSelected: boolean;
    /**
     * The filter's currently-committed value. Used to seed the draft on open and
     * to detect parent-provided changes mid-open. Adapters typically pass
     * adapter.getValue(filter).
     */
    committedValue: V;
    /** Body content as a render-prop. Receives draft (or live) value + onChange. */
    children: (ctx: FilterPopoverButtonRenderCtx<V>) => ReactNode;
};
/**
 * Draft-mode props: requires `initialValue` so each consumer declares what
 * "empty draft" means for its V (e.g. an array-shaped custom filter passes
 * `[]`, a nullable scalar passes `null`). Eliminates the `[] as unknown as V`
 * cast and forces non-nullable V consumers to opt in explicitly.
 */
type DraftModeProps<V> = FilterPopoverButtonBaseProps<V> & {
    commitOnSelect?: false;
    /**
     * Initial draft value used until the popover opens and the draft is seeded
     * from `committedValue`. Each adapter owns the empty-state for its V.
     */
    initialValue: V;
    /**
     * If true, in uncontrolled mode the popover stays open after a body change
     * instead of closing — for multi-selection workflows.
     * @default false
     */
    keepOpenOnUncontrolledChange?: boolean;
};
/**
 * Commit-on-select props: no draft state exists, so `initialValue` and
 * `keepOpenOnUncontrolledChange` don't apply.
 */
type CommitOnSelectProps<V> = FilterPopoverButtonBaseProps<V> & {
    commitOnSelect: true;
};
type FilterPopoverButtonProps<V> = DraftModeProps<V> | CommitOnSelectProps<V>;
/**
 * FilterPopoverButton is the popover-based trigger primitive used by the
 * `custom` filter adapter (and anything else that needs to render an
 * adapter-agnostic popover body with draft / Apply-Cancel semantics).
 *
 * Other filter types (`singleSelect`, `multiSelect`, `asyncSelect`,
 * `asyncMultiSelect`, `date`, `dateRange`, `dateList`) compose menu primitives
 * (`SelectMenu`, `MultiSelectMenu`) or their own popover shells directly and
 * do not go through this component.
 *
 * It owns:
 * - The trigger button (label + icon + selected state)
 * - The OptionsPopover wrapper (open state, outside-press handling)
 * - When commitOnSelect is false: draft state + MenuFooter Apply/Cancel chrome
 *
 * The body is supplied via render-prop children, which receive the
 * appropriate value + onChange for the current commit mode.
 */
export declare const FilterPopoverButton: <V>(props: FilterPopoverButtonProps<V>) => import("react/jsx-runtime").JSX.Element;
export {};
