@types/clone
TypeScript definitions for clone
Last updated 2 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/clone 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/clone

Summary

This package contains type definitions for clone (https://github.com/pvorb/node-clone).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/clone.

index.d.ts

/**
 * See clone JS source for API docs
 */

/**
 * @param val the value that you want to clone, any type allowed
 * @param circular Call clone with circular set to false if you are certain that obj contains no circular references. This will give better performance if needed. There is no error if undefined or null is passed as obj.
 * @param depth to which the object is to be cloned (optional, defaults to infinity)
 * @param prototype Sets the prototype to be used when cloning an Object (optional, defaults to __proto__)
 * @param includeNonEnumerable Set to true if the non-enumerable properties should be cloned as well (optional, defaults to false)
 */
declare function clone<T>(
    val: T,
    circular?: boolean,
    depth?: number,
    prototype?: any,
    includeNonEnumerable?: boolean,
): T;

/**
 * @param val the value that you want to clone, any type allowed
 * @param opts a single object that specifies circular, depth, prototype and includeNonEnumerable.
 * @param opts.circular Call clone with circular set to false if you are certain that obj contains no circular references. This will give better performance if needed. There is no error if undefined or null is passed as obj.
 * @param opts.depth Sets depth to which the object is to be cloned (optional, defaults to infinity)
 * @param opts.prototype Sets the prototype to be used when cloning an Object (optional, defaults to __proto__)
 * @param opts.includeNonEnumerable Set to true if the non-enumerable properties should be cloned as well (optional, defaults to false)
 */
declare function clone<T>(val: T, opts: CloneOpts): T;

interface CloneOpts {
    circular?: boolean | undefined;
    depth?: number | undefined;
    prototype?: any;
    includeNonEnumerable?: boolean | undefined;
}

declare namespace clone {
    /**
     * @param obj the object that you want to clone
     */
    function clonePrototype<T>(obj: T): T;
}

export = clone;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by Kieran Simpson, and DG-za.

Current Tags

  • 2.1.4                                ...           latest (2 years ago)
  • 0.1.30                                ...           ts2.0 (10 years ago)
  • 0.1.30                                ...           ts2.1 (10 years ago)
  • 0.1.30                                ...           ts2.2 (10 years ago)
  • 0.1.30                                ...           ts2.3 (10 years ago)
  • 0.1.30                                ...           ts2.4 (10 years ago)
  • 0.1.30                                ...           ts2.5 (10 years ago)
  • 0.1.30                                ...           ts2.6 (10 years ago)
  • 0.1.30                                ...           ts2.7 (10 years ago)
  • 0.1.30                                ...           ts2.8 (10 years ago)
  • 0.1.30                                ...           ts2.9 (10 years ago)
  • 2.1.0                                ...           ts3.0 (6 years ago)
  • 2.1.0                                ...           ts3.1 (6 years ago)
  • 2.1.0                                ...           ts3.2 (6 years ago)
  • 2.1.0                                ...           ts3.3 (6 years ago)
  • 2.1.0                                ...           ts3.4 (6 years ago)
  • 2.1.0                                ...           ts3.5 (6 years ago)
  • 2.1.1                                ...           ts3.6 (5 years ago)
  • 2.1.1                                ...           ts3.7 (5 years ago)
  • 2.1.1                                ...           ts3.8 (5 years ago)
  • 2.1.1                                ...           ts3.9 (5 years ago)
  • 2.1.1                                ...           ts4.0 (5 years ago)
  • 2.1.1                                ...           ts4.1 (5 years ago)
  • 2.1.1                                ...           ts4.2 (5 years ago)
  • 2.1.2                                ...           ts4.3 (3 years ago)
  • 2.1.2                                ...           ts4.4 (3 years ago)
  • 2.1.4                                ...           ts4.5 (2 years ago)
  • 2.1.4                                ...           ts4.6 (2 years ago)
  • 2.1.4                                ...           ts4.7 (2 years ago)
  • 2.1.4                                ...           ts4.8 (2 years ago)
  • 2.1.4                                ...           ts4.9 (2 years ago)
  • 2.1.4                                ...           ts5.0 (2 years ago)
  • 2.1.4                                ...           ts5.1 (2 years ago)
  • 2.1.4                                ...           ts5.2 (2 years ago)
  • 2.1.4                                ...           ts5.3 (2 years ago)
  • 2.1.4                                ...           ts5.4 (2 years ago)
  • 2.1.4                                ...           ts5.5 (2 years ago)
  • 2.1.4                                ...           ts5.6 (2 years ago)
  • 2.1.4                                ...           ts5.7 (2 years ago)
  • 2.1.4                                ...           ts5.8 (2 years ago)
  • 2.1.4                                ...           ts5.9 (2 years ago)

16 Versions

  • 2.1.4                                ...           2 years ago
  • 2.1.3                                ...           2 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           5 years ago
  • 2.1.0                                ...           6 years ago
  • 0.1.30                                ...           10 years ago
  • 0.1.29                                ...           10 years ago
  • 0.1.28-alpha                                ...           10 years ago
  • 0.1.27-alpha                                ...           10 years ago
  • 0.1.26-alpha                                ...           10 years ago
  • 0.1.25-alpha                                ...           10 years ago
  • 0.1.24-alpha                                ...           10 years ago
  • 0.1.23-alpha                                ...           10 years ago
  • 0.1.22-alpha                                ...           10 years ago
  • 0.1.17-alpha                                ...           10 years ago
  • 0.1.16-alpha                                ...           10 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 4
Last Day 0
Last Week 4
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |