UNPKG

@loke/ui

Version:
23 lines (22 loc) • 945 B
import { type Scope } from "@loke/ui/context"; import { type Slot } from "@loke/ui/slot"; import React from "react"; type SlotProps = React.ComponentPropsWithoutRef<typeof Slot>; interface CollectionProps extends SlotProps { scope: Scope; } declare function createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string): readonly [{ readonly ItemSlot: React.ForwardRefExoticComponent<React.PropsWithoutRef<ItemData & { children: React.ReactNode; scope: Scope; }> & React.RefAttributes<ItemElement>>; readonly Provider: React.FC<{ children?: React.ReactNode; scope: Scope; }>; readonly Slot: React.ForwardRefExoticComponent<CollectionProps & React.RefAttributes<HTMLElement>>; }, (scope: Scope) => () => ({ ref: React.RefObject<ItemElement | null>; } & ItemData)[], import("@loke/ui/context").CreateScope]; export type { CollectionProps }; export { createCollection };