UNPKG

@are-visual/virtual-table

Version:
17 lines (16 loc) 648 B
import type { SetStateAction } from 'react'; export type Props = Record<string, any>; interface UseControllableValueOptions<T> { valuePropName?: string; defaultValue?: T; trigger?: string; } interface Safe<T> { valuePropName?: string; defaultValue: T; trigger?: string; } type Trigger<T> = (action: SetStateAction<T>, ...args: unknown[]) => unknown; declare function useControllableValue<T = any>(props: Props, options: Safe<T>): [T, Trigger<T>]; declare function useControllableValue<T = any>(props: Props, options: UseControllableValueOptions<T>): [T | undefined, Trigger<T | undefined>]; export { useControllableValue };