import { Dispatch, ReactElement, ReactNode, Ref, SetStateAction, ComponentProps } from 'react'; import { InputProps } from '../input/index.js'; import { InputBaseProps } from '../inputBase/index.js'; import { PopperProps, PopperRef } from '../popper/index.js'; import { SelectionContextProps } from '../selectionContext/index.js'; import { MenuOptionType, OptionsBaseSharedProps } from '../optionsBase/index.js'; import { Id, SelectableMultipleProps, SelectableSingleProps } from '../../types.js'; export interface CascadeBaseProps, V extends Id = Id> extends Omit, 'filterPredicate'>, Omit, 'children' | 'defaultValue' | 'value' | 'onChange'> { /** cascade内部由实现 */ inputProps?: ComponentProps<'input'>; defaultOpen?: boolean; open?: boolean; onOpenChange?(open: boolean): void; /** @attention 注意loadOptions返回的必须是从根节点开始的完整树型数据,并非数据片段 */ loadOptions?(searchValue?: string, parent?: O): O[] | Promise; searchable?: boolean; defaultSearchValue?: string; searchValue?: string; onSearchChange?(searchValue: string): void; searchInputProps?: InputProps; childrenKey?: keyof O; popperProps?: PopperProps; popperRef?: Ref; integration?: SelectionContextProps['integration']; } export interface CascadeSingleProps, V extends Id = Id> extends CascadeBaseProps, SelectableSingleProps { renderBackfill?(value: V[]): ReactNode; } export interface CascadeMultipleProps, V extends Id = Id> extends CascadeBaseProps, SelectableMultipleProps { renderBackfill?(value: V[][]): ReactNode; } export type CascadeProps, V extends Id = Id> = CascadeSingleProps | CascadeMultipleProps; type CascadeContext, V extends Id = Id> = { innerLoading: boolean; loadingOption: V | undefined; multiple: boolean; showCheckbox: boolean; /** 默认为"value" */ primaryKey: keyof O; labelKey: keyof O; childrenKey: keyof O; pathifiedValue: undefined | V[] | V[][]; selectionStatus: Map; optionsMap: Map; openedPanels: V[]; onOptionClick(opt: O, index: number): void; onCheckboxClick(opt: O, index: number): void; verticalIndex: number; setVerticalIndex: Dispatch>; horizontalIndex: number; }; declare const CascadeContext: import("react").Context>; export declare function useCascadeContext, V extends Id = Id>(): CascadeContext; export declare const Cascade: , V extends Id = Id>(props: CascadeProps) => ReactElement; export {};