Files
NapCatQQ/.pnpm-store/v3/files/52/4b55b6e252f49aef8dffb7a053c4537af42ac83de47c24954ca84019771e1d514ba928c97a899836eb1a8d55a67a7b4c62d3515e151ff7a488e3e59458baeb
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

61 lines
2.6 KiB
Plaintext

import { Collection, Key, Node, CollectionStateBase, LayoutDelegate, SingleSelection } from "@react-types/shared";
import { MultipleSelectionStateProps, SelectionManager } from "@react-stately/selection";
export class ListCollection<T> implements Collection<Node<T>> {
constructor(nodes: Iterable<Node<T>>);
[Symbol.iterator](): Generator<Node<T>, void, undefined>;
get size(): number;
getKeys(): IterableIterator<Key>;
getKeyBefore(key: Key): Key | null;
getKeyAfter(key: Key): Key | null;
getFirstKey(): Key | null;
getLastKey(): Key | null;
getItem(key: Key): Node<T> | null;
at(idx: number): Node<T> | null;
getChildren(key: Key): Iterable<Node<T>>;
}
export interface ListProps<T> extends CollectionStateBase<T>, MultipleSelectionStateProps {
/** Filter function to generate a filtered list of nodes. */
filter?: (nodes: Iterable<Node<T>>) => Iterable<Node<T>>;
/** @private */
suppressTextValueWarning?: boolean;
/**
* A delegate object that provides layout information for items in the collection.
* This can be used to override the behavior of shift selection.
*/
layoutDelegate?: LayoutDelegate;
}
export interface ListState<T> {
/** A collection of items in the list. */
collection: Collection<Node<T>>;
/** A set of items that are disabled. */
disabledKeys: Set<Key>;
/** A selection manager to read and update multiple selection state. */
selectionManager: SelectionManager;
}
/**
* Provides state management for list-like components. Handles building a collection
* of items from props, and manages multiple selection state.
*/
export function useListState<T extends object>(props: ListProps<T>): ListState<T>;
export interface SingleSelectListProps<T> extends CollectionStateBase<T>, Omit<SingleSelection, 'disallowEmptySelection'> {
/** Filter function to generate a filtered list of nodes. */
filter?: (nodes: Iterable<Node<T>>) => Iterable<Node<T>>;
/** @private */
suppressTextValueWarning?: boolean;
}
export interface SingleSelectListState<T> extends ListState<T> {
/** The key for the currently selected item. */
readonly selectedKey: Key | null;
/** Sets the selected key. */
setSelectedKey(key: Key | null): void;
/** The value of the currently selected item. */
readonly selectedItem: Node<T> | null;
}
/**
* Provides state management for list-like components with single selection.
* Handles building a collection of items from props, and manages selection state.
*/
export function useSingleSelectListState<T extends object>(props: SingleSelectListProps<T>): SingleSelectListState<T>;
//# sourceMappingURL=types.d.ts.map