UNPKG

@aptos-labs/wallet-adapter-react

Version:
20 lines 1.13 kB
import type { ClassAttributes, JSX as ReactJSX, ReactNode } from "react"; export interface HeadlessComponentProps { /** A class name for styling the element. */ className?: string; /** * Whether to render as the child element instead of the default element provided. * All props will be merged into the child element. */ asChild?: boolean; children?: ReactNode; } /** * Gets an HTML element type from its tag name * @example * HTMLElementFromTag<"img"> // resolved type: HTMLImageElement */ type HTMLElementFromTag<T extends keyof ReactJSX.IntrinsicElements> = ReactJSX.IntrinsicElements[T] extends ClassAttributes<infer Element> ? Element : HTMLElement; export declare function createHeadlessComponent<TElement extends keyof ReactJSX.IntrinsicElements>(displayName: string, elementType: TElement, props?: ReactJSX.IntrinsicElements[TElement] | ((displayName: string) => ReactJSX.IntrinsicElements[TElement])): import("react").ForwardRefExoticComponent<HeadlessComponentProps & import("react").RefAttributes<HTMLElementFromTag<TElement>>>; export {}; //# sourceMappingURL=utils.d.ts.map