diff --git a/docs/typescript-definition-package/templates/type-definition.template.html b/docs/typescript-definition-package/templates/type-definition.template.html index 020dfe149d..b5860a1edc 100644 --- a/docs/typescript-definition-package/templates/type-definition.template.html +++ b/docs/typescript-definition-package/templates/type-definition.template.html @@ -10,7 +10,7 @@ {%- macro memberInfo(member) -%} {$ commentBlock(member, 5) $} - {$ member.name $}{% if member.optional %}?{% endif -%} + {% if member.isStatic -%}static {% endif -%}{$ member.name $}{% if member.optional %}?{% endif -%} {% if member.typeParameters %}<{% for typeParam in member.typeParameters %}{$ typeParam $}{% if not loop.last %}, {% endif %}{% endfor %}>{% endif -%} {%- if member.parameters -%}({% for param in member.parameters %}{$ param $}{% if not loop.last %}, {% endif %}{% endfor %}){%- endif -%} {%- if member.returnType -%} @@ -58,6 +58,9 @@ declare module {$ module.namespace $} { {%- if export.callMember %} {$ memberInfo(export.callMember) $} {% endif -%} + {%- for static in export.statics %} + {$ memberInfo(static) $} + {%- endfor -%} {%- for member in export.members %} {$ memberInfo(member) $} {%- endfor %} diff --git a/docs/typescript-package/processors/readTypeScriptModules.js b/docs/typescript-package/processors/readTypeScriptModules.js index 58e2e50ee9..e50acd284d 100644 --- a/docs/typescript-package/processors/readTypeScriptModules.js +++ b/docs/typescript-package/processors/readTypeScriptModules.js @@ -64,6 +64,7 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, log.debug('>>>> EXPORT: ' + exportDoc.name + ' (' + exportDoc.docType + ') from ' + moduleDoc.id); exportDoc.members = []; + exportDoc.statics = []; // Generate docs for each of the export's members if (resolvedExport.flags & ts.SymbolFlags.HasMembers) { @@ -102,6 +103,16 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, docs.push(memberDoc); exportDoc.members.push(memberDoc); } + } else if (resolvedExport.flags & ts.SymbolFlags.HasExports) { + for (var exported in resolvedExport.exports) { + if (exported === 'prototype') continue; + if (hidePrivateMembers && exported.charAt(0) === '_') continue; + var memberSymbol = resolvedExport.exports[exported]; + var memberDoc = createMemberDoc(memberSymbol, exportDoc, basePath, parseInfo.typeChecker); + memberDoc.isStatic = true; + docs.push(memberDoc); + exportDoc.statics.push(memberDoc); + } } if (sortClassMembers) { diff --git a/modules/angular2/src/di/key.ts b/modules/angular2/src/di/key.ts index 4e76899259..6d1261d818 100644 --- a/modules/angular2/src/di/key.ts +++ b/modules/angular2/src/di/key.ts @@ -16,9 +16,6 @@ export {TypeLiteral} from './type_literal'; * injector to index in arrays rather than looking up items in maps. */ export class Key { - /** - * @private - */ constructor(public token: Object, public id: number) { if (isBlank(token)) { throw new BaseException('Token must be defined!');