import { OverrideProps } from '@kobalte/utils'; export { OverrideComponentProps, OverrideProps } from '@kobalte/utils'; import { ValidComponent, JSX, ComponentProps } from 'solid-js'; type ElementOf = T extends HTMLElement ? T : T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : any; /** * Polymorphic attribute. */ interface PolymorphicAttributes { as?: T | keyof JSX.HTMLElementTags; } /** * Props used by a polymorphic component. */ type PolymorphicProps = OverrideProps, // Override props from custom/tag component with our own // Override props from custom/tag component with our own Props & // Accept custom props of our own component PolymorphicAttributes>; /** * Helper type to get the exact props in Polymnorphic `as` callback. */ type PolymorphicCallbackProps = Omit & RenderProps; /** * A utility component that render its `as` prop. */ declare function Polymorphic(props: RenderProps & PolymorphicAttributes): JSX.Element; export { ElementOf, Polymorphic, PolymorphicAttributes, PolymorphicCallbackProps, PolymorphicProps };