import type * as React from 'react'; declare const NODES: readonly ["a", "article", "aside", "footer", "header", "main", "nav", "section", "blockquote", "button", "caption", "code", "div", "dd", "dl", "dt", "em", "fieldset", "figcaption", "figure", "form", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "img", "input", "kbd", "label", "legend", "li", "mark", "ol", "p", "pre", "small", "span", "strong", "svg", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "ul"]; type Primitives = { [E in (typeof NODES)[number]]: PrimitiveComponent; }; /** The tag names an `as` prop accepts: `NODES` minus the void and replaced elements, none of which can carry a part's children. */ export type PolymorphicTag = Exclude<(typeof NODES)[number], 'hr' | 'img' | 'input' | 'svg' | 'textarea'>; /** Props of the intrinsic element `E` plus `asChild`; the base prop type every {@link Primitive} part (and component props extending it) is built from. */ export type PrimitivePropsWithRef = React.ComponentPropsWithRef & { /** * Render this part's behavior onto your own child element instead of the default DOM tag, via {@link Slot}; the child must be a single React element. * @default false */ asChild?: boolean | undefined; }; interface PrimitiveComponent { (props: PrimitivePropsWithRef): React.ReactNode; displayName?: string | undefined; } /** * The base DOM element every primitive part is built on — one component per tag, each accepting {@link PrimitivePropsWithRef.asChild}. * * @example * ```tsx * const MyPart = ({ ref, ...props }: PrimitivePropsWithRef<'div'>) => ( * * ); * ``` * * @internal Not part of the public API; import it inside the package only. */ export declare const Primitive: Primitives; /** * Composes two event handlers so both run without clobbering; `originalEventHandler` runs first, and `ourEventHandler` is skipped if it called `preventDefault()` unless `checkForDefaultPrevented` is `false`. * * @param originalEventHandler - The consumer's handler, passed through `{...props}`, run first. * @param ourEventHandler - The primitive's internal handler, run second. * @param options.checkForDefaultPrevented - Skip `ourEventHandler` if the first handler called `preventDefault()`. @default true * * @example * ```tsx * setOpen(true))} * /> * ``` * * @internal Not part of the public API; import it inside the package only. */ export declare function composeEventHandlers(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: { checkForDefaultPrevented?: boolean | undefined; }): (event: E) => void; /** * Render-phase form of {@link composeEventHandlers}, for handlers that touch a ref. * * The React Compiler cannot see that `composeEventHandlers` only stores its arguments, so a * ref-reading handler passed to it reads as a render-phase ref access; a hook boundary is where * the compiler stops looking. Call it unconditionally, like any hook. * * @param originalEventHandler - The consumer's handler, passed through `{...props}`, run first. * @param ourEventHandler - The primitive's internal handler, run second. * @param options - Forwarded to {@link composeEventHandlers}. * @internal */ export declare function useComposedEventHandlers(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, options?: { checkForDefaultPrevented?: boolean; }): (event: E) => void; export {};