mobx-keystone
Version:
A MobX powered state management solution based on data trees with first class support for TypeScript, snapshots, patches and much more
19 lines (18 loc) • 528 B
TypeScript
/**
* Clone options.
*/
export interface CloneOptions {
/**
* Pass `true` to generate new internal ids for models rather than reusing them. (Default is `true`)
*/
generateNewIds: boolean;
}
/**
* Clones an object by doing a `fromSnapshot(getSnapshot(value), { generateNewIds: true })`.
*
* @template T Object type.
* @param node Object to clone.
* @param [options] Options.
* @returns The cloned object.
*/
export declare function clone<T extends object>(node: T, options?: Partial<CloneOptions>): T;