fix: better definition

This commit is contained in:
progre
2014-11-18 20:34:21 +09:00
parent 2c58fe95f6
commit 22290a65aa
2 changed files with 12 additions and 10 deletions
+2 -1
View File
@@ -6,4 +6,5 @@ var original = {
var copy = clone(original);
copy = clone(original, false);
copy = clone(original, true);
copy = clone(original, true, 1);
copy = clone.clonePrototype(original);
+10 -9
View File
@@ -7,18 +7,19 @@
* See clone JS source for API docs
*/
declare module "clone" {
var clone: {
/**
* @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 wich the object is to be cloned (optional, defaults to infinity)
*/
<T>(val: T, circular?: boolean, depth?: number): T;
/**
* @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 wich the object is to be cloned (optional, defaults to infinity)
*/
function clone<T>(val: T, circular?: boolean, depth?: number): T;
module clone {
/**
* @param obj the object that you want to clone
*/
clonePrototype<T>(obj: T): T;
};
function clonePrototype<T>(obj: T): T;
}
export = clone
}