import { Collection as ICollection, Key, Node } from '@react-types/shared'; import { ReactElement, ReactNode } from 'react'; export type Mutable = { -readonly [P in keyof T]: T[P]; }; type FilterFn = (textValue: string, node: Node) => boolean; /** An immutable object representing a Node in a Collection. */ export declare class CollectionNode implements Node { static readonly type: string; readonly type: string; readonly key: Key; readonly value: T | null; readonly level: number; readonly hasChildNodes: boolean; readonly rendered: ReactNode; readonly textValue: string; readonly 'aria-label'?: string; readonly index: number; readonly parentKey: Key | null; readonly prevKey: Key | null; readonly nextKey: Key | null; readonly firstChildKey: Key | null; readonly lastChildKey: Key | null; readonly props: any; readonly render?: (node: Node) => ReactElement; readonly colSpan: number | null; readonly colIndex: number | null; constructor(key: Key); get childNodes(): Iterable>; clone(): this; filter(collection: BaseCollection, newCollection: BaseCollection, filterFn: FilterFn): CollectionNode | null; } export declare class FilterableNode extends CollectionNode { filter(collection: BaseCollection, newCollection: BaseCollection, filterFn: FilterFn): CollectionNode | null; } export declare class HeaderNode extends CollectionNode { static readonly type = "header"; } export declare class LoaderNode extends CollectionNode { static readonly type = "loader"; } export declare class ItemNode extends FilterableNode { static readonly type = "item"; filter(collection: BaseCollection, newCollection: BaseCollection, filterFn: FilterFn): ItemNode | null; } export declare class SectionNode extends FilterableNode { static readonly type = "section"; filter(collection: BaseCollection, newCollection: BaseCollection, filterFn: FilterFn): SectionNode | null; } /** * An immutable Collection implementation. Updates are only allowed * when it is not marked as frozen. This can be subclassed to implement * custom collection behaviors. */ export declare class BaseCollection implements ICollection> { protected keyMap: Map>; protected firstKey: Key | null; protected lastKey: Key | null; protected frozen: boolean; protected itemCount: number; get size(): number; getKeys(): IterableIterator; [Symbol.iterator](): IterableIterator>; getChildren(key: Key): Iterable>; getKeyBefore(key: Key): Key | null; getKeyAfter(key: Key): Key | null; getFirstKey(): Key | null; getLastKey(): Key | null; getItem(key: Key): Node | null; at(): Node; clone(): this; addNode(node: CollectionNode): void; addDescendants(node: CollectionNode, oldCollection: BaseCollection): void; removeNode(key: Key): void; commit(firstKey: Key | null, lastKey: Key | null, isSSR?: boolean): void; filter(filterFn: FilterFn): this; } export {};