fluidstate
Version:
Library for fine-grained reactivity state management
19 lines (18 loc) • 927 B
TypeScript
import { CloneInertOptions, CloneInertResult } from "./reactive-deep-clone-types";
/**
* Type alias for the `cloneInert` function.
* This can be useful for passing the function as a parameter.
*/
export type CloneInert = typeof cloneInert;
/**
* Creates a deep or shallow clone of a reactive object, array, Set, or Map,
* returning an "inert" (non-reactive) version.
*
* This is useful for obtaining a snapshot of the reactive state at a specific moment
* without any reactive overhead.
*
* @param object The reactive (or non-reactive) data structure to clone.
* @param cloneInertOptions Options to control the cloning behavior (e.g., depth, exclusion of computed properties).
* @returns An inert clone of the input. The exact type depends on the input and options.
*/
export declare const cloneInert: <T, Options extends CloneInertOptions>(object: T, cloneInertOptions?: Options) => CloneInertResult<T, Options>;