import { n as CollectionItemOptions } from "../collection-item-DRA-Dc3W.js";
import { r as FormStoreItem, s as FormStoreValues, t as FormStore } from "../form-store-C15msSpw.js";
import { StringLike } from "@ariakit/components/form/types";
//#region src/form/form-context.d.ts
type FormItemType = FormStoreItem["type"];
interface FormItemContextOptions {
  store?: FormStore;
  name: StringLike;
  component: string;
}
/**
 * Returns the form store from the nearest form container.
 * @example
 * function FormInput() {
 *   const store = useFormContext();
 *
 *   if (!store) {
 *     throw new Error("FormInput must be wrapped in FormProvider");
 *   }
 *
 *   // Use the store...
 * }
 */
declare const useFormContext: () => FormStore<FormStoreValues> | undefined;
declare function useFormItemContext({ store, name: nameProp, component }: FormItemContextOptions): {
  store: FormStore<FormStoreValues>;
  name: string;
};
interface FormItemOptions extends FormItemContextOptions {
  id?: string;
  type: FormItemType;
  getItem?: CollectionItemOptions["getItem"];
}
declare function useFormItem<T extends HTMLElement>({ id: idProp, type, getItem: getItemProp, ...options }: FormItemOptions): {
  store: FormStore<FormStoreValues>;
  name: string;
  id: string | undefined;
  ref: import("react").RefObject<T | null>;
  getItem: (props: import("@ariakit/components/collection/collection-store").CollectionStoreItem) => import("@ariakit/components/collection/collection-store").CollectionStoreItem;
};
declare const useFormScopedContext: (onlyScoped?: boolean) => FormStore<FormStoreValues> | undefined;
declare const useFormProviderContext: () => FormStore<FormStoreValues> | undefined;
declare const FormContextProvider: (props: import("react").ProviderProps<FormStore<FormStoreValues> | undefined>) => import("react").JSX.Element;
declare const FormScopedContextProvider: (props: import("react").ProviderProps<FormStore<FormStoreValues> | undefined>) => import("react").JSX.Element;
//#endregion
export { FormContextProvider, FormScopedContextProvider, useFormContext, useFormItem, useFormItemContext, useFormProviderContext, useFormScopedContext };
//# sourceMappingURL=form-context.d.ts.map