UNPKG

ze-react-component-library

Version:
22 lines (21 loc) 1.31 kB
/// <reference types="react" /> import type { ZETreeFilterProps, ZETreeFilterItemType } from "./ZETreeFilter.types"; export declare const loopTree: (arr: ZETreeFilterItemType[], id: string, formatItem: (item: ZETreeFilterItemType) => ZETreeFilterItemType | null, matchRule?: (item: ZETreeFilterItemType, id: string) => boolean) => any; export declare const useZETreeFilter: ({ value, initialValue, onChange, conditions, maxCount, itemInitialProps, }: Partial<ZETreeFilterProps>) => { data: ZETreeFilterItemType[]; onAdd: (parentId?: string, extraProps?: any, mode?: "drop") => void; onRemove: (id: string) => void; onReset: (id: string) => void; onRootAdd: (extraProps?: any, mode?: "drop") => void; onSwitch: (id: string, newCondition: string) => void; onUpdate: (id: string, changedProps?: ZETreeFilterItemType["props"]) => void; }; export declare const ZETreeFilterContext: import("react").Context<{ data: ZETreeFilterItemType[]; onAdd: (parentId?: string, extraProps?: any, mode?: "drop") => void; onRemove: (id: string) => void; onReset: (id: string) => void; onRootAdd: (extraProps?: any, mode?: "drop") => void; onSwitch: (id: string, newCondition: string) => void; onUpdate: (id: string, changedProps?: ZETreeFilterItemType["props"]) => void; }>;