UNPKG

@loke/ui

Version:
30 lines (29 loc) • 1.26 kB
import React from "react"; declare module "react" { interface ReactElement { $$typeof?: symbol | string; } } export type Usable<T> = PromiseLike<T> | React.Context<T>; type SlotProps<Elem extends Element = HTMLElement, Props = React.HTMLAttributes<Elem>> = Props & { children?: React.ReactNode; }; export declare function createSlot<Elem extends Element = HTMLElement, Props = React.HTMLAttributes<Elem>>(ownerName: string): React.ForwardRefExoticComponent<React.PropsWithoutRef<SlotProps<Elem, Props>> & React.RefAttributes<Elem>>; declare const Slot: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & { children?: React.ReactNode; } & React.RefAttributes<HTMLElement>>; type SlottableChildrenProps = { children: React.ReactNode; }; type SlottableRenderFnProps = { child: React.ReactNode; children: (slottable: React.ReactNode) => React.ReactNode; }; type SlottableProps = SlottableRenderFnProps | SlottableChildrenProps; interface SlottableComponent extends React.FC<SlottableProps> { __lokeId: symbol; } export declare function createSlottable(ownerName: string): SlottableComponent; declare const Slottable: SlottableComponent; export type { SlotProps }; export { Slot, Slot as Root, Slottable, };