@enact/ui
Version:
A collection of simplified unstyled cross-platform UI components for Enact
23 lines (18 loc) • 669 B
TypeScript
// Type definitions for ui/Slottable
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
export interface SlottableConfig extends Object {
/**
* Array of slot names which will be extracted from `children` and distributed to props.
*/
slots?: string[];
}
export interface SlottableProps {}
export function Slottable<P>(
config: SlottableConfig,
Component: React.ComponentType<P> | string,
): React.ComponentType<P & SlottableProps>;
export function Slottable<P>(
Component: React.ComponentType<P> | string,
): React.ComponentType<P & SlottableProps>;
export default Slottable;