1 | import type { SetStateAction } from 'react';
|
2 | export interface Options<T> {
|
3 | defaultValue?: T;
|
4 | defaultValuePropName?: string;
|
5 | valuePropName?: string;
|
6 | trigger?: string;
|
7 | }
|
8 | export type Props = Record<string, any>;
|
9 | export interface StandardProps<T> {
|
10 | value: T;
|
11 | defaultValue?: T;
|
12 | onChange: (val: T) => void;
|
13 | }
|
14 | declare function useControllableValue<T = any>(props: StandardProps<T>): [T, (v: SetStateAction<T>) => void];
|
15 | declare function useControllableValue<T = any>(props?: Props, options?: Options<T>): [T, (v: SetStateAction<T>, ...args: any[]) => void];
|
16 | export default useControllableValue;
|