From 961920d9e1f92315b6a663dcdbcc9f20a563120c Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Wed, 28 Jun 2017 10:25:45 +0800 Subject: [PATCH] fix ts def --- extensions/ccpool/CCNodePool.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/ccpool/CCNodePool.js b/extensions/ccpool/CCNodePool.js index a11c9a9ab7..db61c0b1d6 100644 --- a/extensions/ccpool/CCNodePool.js +++ b/extensions/ccpool/CCNodePool.js @@ -65,6 +65,8 @@ // MyTemplateHandler is a component with 'unuse' and 'reuse' to handle events when node is reused or recycled. * this.myPool = new cc.NodePool('MyTemplateHandler'); * } + * @typescript + * constructor(poolHandlerComp?: {prototype: Component}|string) */ cc.NodePool = function (poolHandlerComp) { /** @@ -83,6 +85,7 @@ cc.NodePool.prototype = { * !#en The current available size in the pool * !#zh 获取当前缓冲池的可用对象数量 * @method size + * @return {Number} */ size: function () { return this._pool.length; @@ -109,6 +112,7 @@ cc.NodePool.prototype = { * 这个函数会自动将目标节点从父节点上移除,但是不会进行 cleanup 操作。 * 这个函数会调用 poolHandlerComp 的 unuse 函数,如果组件和函数都存在的话。 * @method put + * @param {Node} obj * @example * let myNode = cc.instantiate(this.template); * this.myPool.put(myNode); @@ -134,8 +138,8 @@ cc.NodePool.prototype = { * !#zh 获取对象池中的对象,如果对象池没有可用对象,则返回空。 * 这个函数会调用 poolHandlerComp 的 reuse 函数,如果组件和函数都存在的话。 * @method get - * @param {any} params - !#en Params to pass to 'reuse' method in poolHandlerComp !#zh 向 poolHandlerComp 中的 'reuse' 函数传递的参数 - * @return {Object|null} + * @param {any} ...params - !#en Params to pass to 'reuse' method in poolHandlerComp !#zh 向 poolHandlerComp 中的 'reuse' 函数传递的参数 + * @return {Node|null} * @example * let newNode = this.myPool.get(); */