forgeplus-react/node_modules/ahooks/lib/useEventTarget/index.d.ts

15 lines
374 B
TypeScript

interface EventTarget<U> {
target: {
value: U;
};
}
export interface Options<T, U> {
initialValue?: T;
transformer?: (value: U) => T;
}
declare function useEventTarget<T, U = T>(options?: Options<T, U>): readonly [T | undefined, {
readonly onChange: (e: EventTarget<U>) => void;
readonly reset: () => void;
}];
export default useEventTarget;