@transkripid/flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork
11 lines (10 loc) • 631 B
TypeScript
import type React from 'react';
export type AsProp<C extends React.ElementType> = {
as?: C | null;
};
export type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
export type PolymorphicComponentProp<C extends React.ElementType, Props = {}> = React.PropsWithChildren<Props & AsProp<C>> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
export type PolymorphicComponentPropWithRef<C extends React.ElementType, Props = {}> = PolymorphicComponentProp<C, Props> & {
ref?: PolymorphicRef<C>;
};
export type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref'];