import type { ReactSetState } from "../use-safe-state/index.js"; export type UseClonedStateOptions = { /** * Clone function * * @defaultValue defaultCloneFn (Implemented simply using JSON.parse(JSON.stringify(source))) */ clone?: (source: T) => T; /** * Whether to manually trigger the synchronize (syncSource) function when the input state changes, defaulting to manual. * * @defaultValue true */ manual?: boolean; /** * Whether to perform a deep comparison of the input state and trigger the synchronize (syncSource) function only if the deep comparison result is false. * * deep comparison is enabled by default * * @defaultValue true */ deep?: boolean; }; export type UseClonedStateReturns = readonly [ /** * Cloned state */ cloned: T, /** * Set cloned state */ setCloned: ReactSetState, /** * Synchronize cloned state with source state */ syncSource: () => void ]; export type CloneFn = (x: F) => T; export declare function defaultCloneFn(source: T): T; /** * A React Hook for creating a cloned state that supports modification, synchronous operation, and isolation from each other. * * With support for custom `clone` functions, `JSON.parse(JSON.stringify(source))` by default. */ export declare function useClonedState(source: T, options?: UseClonedStateOptions): UseClonedStateReturns;