import { BaseCollection, CollectionNode } from './BaseCollection'; import { CachedChildrenOptions } from './useCachedChildren'; import { Key, Node } from '@react-types/shared'; import React, { ForwardedRef, JSX, ReactElement, ReactNode } from 'react'; export interface CollectionBuilderProps> { content: ReactNode; children: (collection: C) => ReactNode; createCollection?: () => C; } /** * Builds a `Collection` from the children provided to the `content` prop, and passes it to the child render prop function. */ export declare function CollectionBuilder>(props: CollectionBuilderProps): ReactElement; export type CollectionNodeClass = { new (key: Key): CollectionNode; readonly type: string; }; export declare function createLeafComponent(CollectionNodeClass: CollectionNodeClass | string, render: (props: P, ref: ForwardedRef) => ReactElement | null): (props: P & React.RefAttributes) => ReactElement | null; export declare function createLeafComponent(CollectionNodeClass: CollectionNodeClass | string, render: (props: P, ref: ForwardedRef, node: Node) => ReactElement | null): (props: P & React.RefAttributes) => ReactElement | null; export declare function createBranchComponent(CollectionNodeClass: CollectionNodeClass | string, render: (props: P, ref: ForwardedRef, node: Node) => ReactElement | null, useChildren?: (props: P) => ReactNode): (props: P & React.RefAttributes) => ReactElement | null; export interface CollectionProps extends CachedChildrenOptions { } /** A Collection renders a list of items, automatically managing caching and keys. */ export declare function Collection(props: CollectionProps): JSX.Element;