@iazadur/hierarchical-select
Version:
A modern React component for hierarchical/dependent dropdowns with Ant Design and Shadcn UI support
15 lines (14 loc) • 659 B
TypeScript
import { OptionType } from '../types';
/**
* Debounce function to prevent rapid successive calls
*/
export declare const debounce: <F extends (...args: any[]) => any>(func: F, waitFor: number) => ((...args: Parameters<F>) => void);
/**
* Fetch options for a field based on parent value
* Caches responses to avoid redundant API calls
*/
export declare const fetchOptionsWithCache: (fetchFn: (parentValue: any) => Promise<OptionType[]> | OptionType[], parentValue: any, cacheKey: string) => Promise<OptionType[]>;
/**
* Clears the cache for a specific key or all cache if no key provided
*/
export declare const clearCache: (cacheKey?: string) => void;