@are-visual/virtual-table
Version:
### VirtualTable
17 lines (16 loc) • 648 B
TypeScript
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 };