From a34d4c6a5f75fdc766d1e80635215550b1e4a065 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 27 Aug 2015 13:19:24 -0700 Subject: [PATCH] fix(typings): emit spread parameters Closes #3875 --- .../processors/readTypeScriptModules.js | 9 ++++++++- typing_spec/router_spec.ts | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/typescript-package/processors/readTypeScriptModules.js b/docs/typescript-package/processors/readTypeScriptModules.js index e50acd284d..7d314c9f07 100644 --- a/docs/typescript-package/processors/readTypeScriptModules.js +++ b/docs/typescript-package/processors/readTypeScriptModules.js @@ -290,7 +290,11 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, ' at line ' + location.start.line); } return declaration.parameters.map(function(parameter) { - var paramText = getText(sourceFile, parameter.name); + var paramText = ''; + if (parameter.dotDotDotToken) { + paramText += '...'; + } + paramText += getText(sourceFile, parameter.name); if (parameter.questionToken || parameter.initializer) { paramText += '?'; } @@ -298,6 +302,9 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, paramText += ':' + getType(sourceFile, parameter.type); } else { paramText += ': any'; + if (parameter.dotDotDotToken) { + paramText += '[]'; + } } return paramText.trim(); }); diff --git a/typing_spec/router_spec.ts b/typing_spec/router_spec.ts index a33d71dc06..9c1ef75e8d 100644 --- a/typing_spec/router_spec.ts +++ b/typing_spec/router_spec.ts @@ -11,6 +11,7 @@ import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_BINDINGS} from 'angular2/router'; template: '

Hello

', }) class FooCmp { + constructor(a: string, b: number) {} }