import { r as CompositeStoreItem, t as CompositeStore } from "../composite-store-9jZQUYDt.js";
import * as Core from "@ariakit/components/composite/composite-store";
//#region src/composite/utils.d.ts
declare const flipItems: typeof Core.flipItems;
declare const findFirstEnabledItem: typeof Core.findFirstEnabledItem;
declare const groupItemsByRows: typeof Core.groupItemsByRows;
/** Marks the brief window between a focused item's ref cleanup and removal. */
declare function markItemUnmounting(element: Element): void;
/** Clears a transient ref cleanup when React keeps the same node mounted. */
declare function markItemMounted(element: Element): void;
/**
 * Whether DOM focus is currently inside the composite: on the composite element
 * itself, on one of its items, or anywhere in its popup.
 */
declare function ownsFocus(store: CompositeStore): boolean;
interface PresentItemParams {
  store: CompositeStore;
  /**
   * The item to present. Defaults to whichever item is active when the
   * presentation runs, which lets an item that hasn't registered yet resolve
   * later. When given, moving to a different item abandons the presentation,
   * because the user has moved on.
   */
  id?: string | null;
  /** Whether to move DOM focus to the item. */
  focus?: boolean;
  /**
   * Whether to bring the item into view only when it is marked as a
   * presentation target. Focus, when requested, still moves either way.
   */
  markedOnly?: boolean;
  /** Whether to abandon the presentation if the composite loses DOM focus. */
  requireFocus?: boolean;
  /**
   * Determines how the item is scrolled into view when it's presented.
   * @private
   */
  scrollIntoView?: (element: HTMLElement) => void;
}
/**
 * Owns at most one pending presentation for the component's current store.
 * Layout-effect ownership prevents store swaps or unmounts from stranding a
 * request, while newer requests replace older ones.
 * Layout setup runs before child passive effects can request presentation;
 * cleanup clears ownership during unmount before later handlers or microtasks
 * can enqueue work. The initial ref covers the first render before setup.
 *
 * See https://github.com/ariakit/ariakit/pull/7029
 */
declare function usePresentItem(store?: CompositeStore): (params: Omit<PresentItemParams, "store">) => (() => void) | undefined;
/**
 * Returns the store item with the given id (enabled or not), or `null`.
 */
declare function getEnabledItem(store: CompositeStore, id?: string | null): CompositeStoreItem | null;
/**
 * Selects text field contents even if it's a content editable element.
 */
declare function selectTextField(element: HTMLElement, collapseToEnd?: boolean): void;
declare const FOCUS_SILENTLY: unique symbol;
type FocusSilentlyElement = HTMLElement & {
  [FOCUS_SILENTLY]?: boolean;
};
/**
 * Focus an element with a flag. The `silentlyFocused` function needs to be
 * called later to check if the focus was silenced and to reset this state.
 */
declare function focusSilently(element: FocusSilentlyElement): void;
/**
 * Checks whether the element has been focused with the `focusSilently` function
 * and resets the state.
 */
declare function silentlyFocused(element: FocusSilentlyElement): boolean | undefined;
/**
 * Determines whether the element is a composite item.
 */
declare function isItem(store: CompositeStore, element?: Element | null, exclude?: Element): boolean;
//#endregion
export { PresentItemParams, findFirstEnabledItem, flipItems, focusSilently, getEnabledItem, groupItemsByRows, isItem, markItemMounted, markItemUnmounting, ownsFocus, selectTextField, silentlyFocused, usePresentItem };
//# sourceMappingURL=utils.d.ts.map