import type { Dispatch, SetStateAction } from 'react'; import type { Gettable } from "../utils/basic.cjs"; export type ReactSetState = Dispatch>; export type UseSafeStateOptions = { /** * Deeply compare the new state with the old state before updating. * * If true, only update the state when the new state is different from the old state. * * @defaultValue false */ deep?: boolean; }; /** * A React Hook similar to [React.useState](https://react.dev/reference/react/useState), but suppresses false warning reports in `React <= 17` * * And includes an optional deep comparison feature (`deep`, default is `false`). It is designed as a safe and efficient alternative to `React.useState`. */ export declare function useSafeState(initialState: Gettable, options?: UseSafeStateOptions): readonly [T, ReactSetState]; export declare function useSafeState(): readonly [T | undefined, ReactSetState];