import { type Dispatch, type SetStateAction } from 'react'; /** State and an update action that is ignored after unmount. @public */ export type UseSafeStateResult = readonly [state: S, setState: Dispatch>]; /** * React state whose setter becomes a no-op once the component unmounts. * * Functional updaters are not evaluated after unmount, which makes delayed * callbacks safe to invoke without retaining work or producing React warnings. * * @param initialState - Initial state or a lazy initializer. * @returns The state value and a stable, unmount-aware setter. * @public */ export declare function useSafeState(initialState: S | (() => S)): UseSafeStateResult;