import { ComponentPropsWithRef, ElementType, HTMLAttributes, ReactElement, ReactNode, RefAttributes } from "react"; import type { AnyObject } from "ariakit-utils/types"; /** * Render prop type. * @template P Props * @example * const children: RenderProp = (props) =>
; */ export declare type RenderProp

= (props: P) => ReactNode; /** * The `as` prop. * @template P Props */ export declare type As

= ElementType

; /** * The `wrapElement` prop. */ export declare type WrapElement = (element: ReactElement) => ReactElement; /** * The `children` prop that supports a function. * @template T Element type. */ export declare type Children = ReactNode | RenderProp & RefAttributes>; /** * Props with the `as` prop. * @template T The `as` prop * @example * type ButtonOptions = Options<"button">; */ export declare type Options = { as?: T; }; /** * Props that automatically includes HTML props based on the `as` prop. * @template O Options * @example * type ButtonHTMLProps = HTMLProps>; */ export declare type HTMLProps = { wrapElement?: WrapElement; children?: Children; [index: `data-${string}`]: unknown; } & Omit>, keyof O | "children">; /** * Options & HTMLProps * @template O Options * @example * type ButtonProps = Props>; */ export declare type Props = O & HTMLProps; /** * A component that supports the `as` prop and the `children` prop as a * function. * @template O Options * @example * type ButtonComponent = Component>; */ export declare type Component = { (props: Omit & Omit>, keyof O> & Required>): JSX.Element | null; (props: Props): JSX.Element | null; displayName?: string; }; /** * A component hook that supports the `as` prop and the `children` prop as a * function. * @template O Options * @example * type ButtonHook = Hook>; */ export declare type Hook = { >(props?: Omit & Omit>, keyof O> & Options): HTMLProps>; displayName?: string; };