typedoc 0.19.1 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -172,7 +172,7 @@ let Application = Application_1 = class Application extends component_1.Childabl
172
172
  ].join(typescript.sys.newLine);
173
173
  }
174
174
  };
175
- Application.VERSION = '0.19.1';
175
+ Application.VERSION = '0.19.2';
176
176
  Application.SUPPORTED_TS_VERSION = '3.9.x || 4.0.x';
177
177
  __decorate([
178
178
  utils_1.BindOption('logger')
@@ -15,13 +15,12 @@ const utils_1 = require("../../utils");
15
15
  let ExportConverter = class ExportConverter extends components_1.ConverterNodeComponent {
16
16
  constructor() {
17
17
  super(...arguments);
18
- this.supports = [
19
- ts.SyntaxKind.ExportAssignment
20
- ];
18
+ this.supports = [ts.SyntaxKind.ExportAssignment];
21
19
  }
22
20
  convert(context, node) {
23
21
  let symbol;
24
- if (node.symbol && (node.symbol.flags & ts.SymbolFlags.Alias) === ts.SymbolFlags.Alias) {
22
+ if (node.symbol &&
23
+ (node.symbol.flags & ts.SymbolFlags.Alias) === ts.SymbolFlags.Alias) {
25
24
  symbol = context.checker.getAliasedSymbol(node.symbol);
26
25
  }
27
26
  else {
@@ -35,7 +34,8 @@ let ExportConverter = class ExportConverter extends components_1.ConverterNodeCo
35
34
  return;
36
35
  }
37
36
  const reflection = project.getReflectionFromFQN(context.checker.getFullyQualifiedName(declaration.symbol));
38
- if (node.isExportEquals && reflection instanceof index_1.DeclarationReflection) {
37
+ if (node.isExportEquals &&
38
+ reflection instanceof index_1.DeclarationReflection) {
39
39
  reflection.setFlag(index_1.ReflectionFlag.ExportAssignment, true);
40
40
  }
41
41
  if (reflection) {
@@ -62,25 +62,31 @@ let ExportDeclarationConverter = class ExportDeclarationConverter extends compon
62
62
  this.supports = [ts.SyntaxKind.ExportDeclaration];
63
63
  }
64
64
  convert(context, node) {
65
- if (this.application.options.getValue('mode') === utils_1.SourceFileMode.File) {
65
+ const withinNamespace = node.parent.kind === ts.SyntaxKind.ModuleBlock;
66
+ if (this.application.options.getValue('mode') === utils_1.SourceFileMode.File &&
67
+ !withinNamespace) {
66
68
  return;
67
69
  }
68
70
  const scope = context.scope;
69
71
  if (!(scope instanceof index_1.ContainerReflection)) {
70
72
  throw new Error('Expected to be within a container');
71
73
  }
72
- if (node.exportClause && node.exportClause.kind === ts.SyntaxKind.NamedExports) {
73
- node.exportClause.elements.forEach(specifier => {
74
+ if (node.exportClause &&
75
+ node.exportClause.kind === ts.SyntaxKind.NamedExports) {
76
+ node.exportClause.elements.forEach((specifier) => {
74
77
  var _a;
75
78
  const source = context.expectSymbolAtLocation(specifier.name);
76
79
  const target = context.resolveAliasedSymbol(context.expectSymbolAtLocation((_a = specifier.propertyName) !== null && _a !== void 0 ? _a : specifier.name));
77
- if (!node.moduleSpecifier && !specifier.propertyName) {
80
+ if (!node.moduleSpecifier &&
81
+ !specifier.propertyName &&
82
+ !withinNamespace) {
78
83
  return;
79
84
  }
80
85
  reference_1.createReferenceReflection(context, source, target);
81
86
  });
82
87
  }
83
- else if (node.exportClause && node.exportClause.kind === ts.SyntaxKind.NamespaceExport) {
88
+ else if (node.exportClause &&
89
+ node.exportClause.kind === ts.SyntaxKind.NamespaceExport) {
84
90
  const source = context.expectSymbolAtLocation(node.exportClause.name);
85
91
  if (!node.moduleSpecifier) {
86
92
  throw new Error('Namespace export is missing a module specifier.');
@@ -1 +1 @@
1
- {"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/lib/converter/nodes/export.ts"],"names":[],"mappings":";;;;;;;;;AAAA,iCAAiC;AAEjC,8CAA4G;AAE5G,8CAAkE;AAClE,sDAAmE;AACnE,uCAA6C;AAG7C,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,mCAA2C;IAAhF;;QAII,aAAQ,GAAoB;YACxB,EAAE,CAAC,UAAU,CAAC,gBAAgB;SACjC,CAAC;IAuCN,CAAC;IArCG,OAAO,CAAC,OAAgB,EAAE,IAAyB;QAC/C,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C;YACvD,CAAC,CAAC,CAAC;SACN;aAAM,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,eAAe,EAAE;YACtF,MAAM,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACtE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACvB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;aACtE;YACD,MAAM,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;YAClG,qCAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;SAEtD;aAAM,IAAI,IAAI,CAAC,eAAe,EAAE;YAC7B,MAAM,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YAC9E,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,EAAE;gBACvE,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE;oBAC3B,SAAS;iBACZ;gBACD,qCAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;aACpF;SACJ;QAED,OAAO,OAAO,CAAC,KAAK,CAAC;IACzB,CAAC;CACJ,CAAA;AA9CY,0BAA0B;IADtC,sBAAS,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC;GAClC,0BAA0B,CA8CtC;AA9CY,gEAA0B","sourcesContent":["import * as ts from 'typescript';\n\nimport { Reflection, ReflectionFlag, DeclarationReflection, ContainerReflection } from '../../models/index';\nimport { Context } from '../context';\nimport { Component, ConverterNodeComponent } from '../components';\nimport { createReferenceReflection } from '../factories/reference';\nimport { SourceFileMode } from '../../utils';\n\n@Component({name: 'node:export'})\nexport class ExportConverter extends ConverterNodeComponent<ts.ExportAssignment> {\n /**\n * List of supported TypeScript syntax kinds.\n */\n supports: ts.SyntaxKind[] = [\n ts.SyntaxKind.ExportAssignment\n ];\n\n convert(context: Context, node: ts.ExportAssignment): Reflection {\n let symbol: ts.Symbol | undefined;\n\n // default export\n if (node.symbol && (node.symbol.flags & ts.SymbolFlags.Alias) === ts.SymbolFlags.Alias) {\n symbol = context.checker.getAliasedSymbol(node.symbol);\n } else {\n let type = context.getTypeAtLocation(node.expression);\n symbol = type ? type.symbol : undefined;\n }\n if (symbol && symbol.declarations) {\n const project = context.project;\n symbol.declarations.forEach((declaration) => {\n if (!declaration.symbol) {\n return;\n }\n\n const reflection = project.getReflectionFromFQN(context.checker.getFullyQualifiedName(declaration.symbol));\n if (node.isExportEquals && reflection instanceof DeclarationReflection) {\n reflection.setFlag(ReflectionFlag.ExportAssignment, true);\n }\n if (reflection) {\n markAsExported(reflection);\n }\n });\n }\n\n function markAsExported(reflection: Reflection) {\n if (reflection instanceof DeclarationReflection) {\n reflection.setFlag(ReflectionFlag.Exported, true);\n }\n\n reflection.traverse(markAsExported);\n }\n\n return context.scope;\n }\n}\n\n@Component({ name: 'node:export-declaration' })\nexport class ExportDeclarationConverter extends ConverterNodeComponent<ts.ExportDeclaration> {\n supports = [ts.SyntaxKind.ExportDeclaration];\n\n convert(context: Context, node: ts.ExportDeclaration): Reflection | undefined {\n // It doesn't make sense to convert export declarations if we are pretending everything is global.\n if (this.application.options.getValue('mode') === SourceFileMode.File) {\n return;\n }\n\n const scope = context.scope;\n if (!(scope instanceof ContainerReflection)) {\n throw new Error('Expected to be within a container');\n }\n\n if (node.exportClause && node.exportClause.kind === ts.SyntaxKind.NamedExports) { // export { a, a as b }\n node.exportClause.elements.forEach(specifier => {\n const source = context.expectSymbolAtLocation(specifier.name);\n const target = context.resolveAliasedSymbol(context.expectSymbolAtLocation(specifier.propertyName ?? specifier.name));\n // If the original declaration is in this file, export {} was used with something\n // defined in this file and we don't need to create a reference unless the name is different.\n if (!node.moduleSpecifier && !specifier.propertyName) {\n return;\n }\n\n createReferenceReflection(context, source, target);\n });\n } else if (node.exportClause && node.exportClause.kind === ts.SyntaxKind.NamespaceExport) { // export * as ns\n const source = context.expectSymbolAtLocation(node.exportClause.name);\n if (!node.moduleSpecifier) {\n throw new Error('Namespace export is missing a module specifier.');\n }\n const target = context.resolveAliasedSymbol(context.expectSymbolAtLocation(node.moduleSpecifier));\n createReferenceReflection(context, source, target);\n\n } else if (node.moduleSpecifier) { // export * from ...\n const sourceFileSymbol = context.expectSymbolAtLocation(node.moduleSpecifier);\n for (const symbol of context.checker.getExportsOfModule(sourceFileSymbol)) {\n if (symbol.name === 'default') { // Default exports are not re-exported with export *\n continue;\n }\n createReferenceReflection(context, symbol, context.resolveAliasedSymbol(symbol));\n }\n }\n\n return context.scope;\n }\n}\n"]}
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/lib/converter/nodes/export.ts"],"names":[],"mappings":";;;;;;;;;AAAA,iCAAiC;AAEjC,8CAK4B;AAE5B,8CAAkE;AAClE,sDAAmE;AACnE,uCAA6C;AAG7C,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,mCAEpC;IAFD;;QAMI,aAAQ,GAAoB,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IA+CjE,CAAC;IA7CG,OAAO,CAAC,OAAgB,EAAE,IAAyB;QAC/C,IAAI,MAA6B,CAAC;QAGlC,IACI,IAAI,CAAC,MAAM;YACX,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,KAAK,EACrE;YACE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC1D;aAAM;YACH,IAAI,IAAI,GAAG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AO,CAAC,sBAAsB,CACzC,IAAI,CAAC,YAAY,CAAC,IAAI,CACzB,CAAC;YACF,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACvB,MAAM,IAAI,KAAK,CACX,iDAAiD,CACpD,CAAC;aACL;YACD,MAAM,MAAM,GAAG,OAAO,CAAC,oBAAoB,CACvC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CACvD,CAAC;YACF,qCAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;SACtD;aAAM,IAAI,IAAI,CAAC,eAAe,EAAE;YAE7B,MAAM,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,CACnD,IAAI,CAAC,eAAe,CACvB,CAAC;YACF,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,kBAAkB,CACnD,gBAAgB,CACnB,EAAE;gBACC,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE;oBAE3B,SAAS;iBACZ;gBACD,qCAAyB,CACrB,OAAO,EACP,MAAM,EACN,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CACvC,CAAC;aACL;SACJ;QAED,OAAO,OAAO,CAAC,KAAK,CAAC;IACzB,CAAC;CACJ,CAAA;AAvFY,0BAA0B;IADtC,sBAAS,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC;GAClC,0BAA0B,CAuFtC;AAvFY,gEAA0B","sourcesContent":["import * as ts from 'typescript';\n\nimport {\n Reflection,\n ReflectionFlag,\n DeclarationReflection,\n ContainerReflection\n} from '../../models/index';\nimport { Context } from '../context';\nimport { Component, ConverterNodeComponent } from '../components';\nimport { createReferenceReflection } from '../factories/reference';\nimport { SourceFileMode } from '../../utils';\n\n@Component({ name: 'node:export' })\nexport class ExportConverter extends ConverterNodeComponent<\n ts.ExportAssignment\n> {\n /**\n * List of supported TypeScript syntax kinds.\n */\n supports: ts.SyntaxKind[] = [ts.SyntaxKind.ExportAssignment];\n\n convert(context: Context, node: ts.ExportAssignment): Reflection {\n let symbol: ts.Symbol | undefined;\n\n // default export\n if (\n node.symbol &&\n (node.symbol.flags & ts.SymbolFlags.Alias) === ts.SymbolFlags.Alias\n ) {\n symbol = context.checker.getAliasedSymbol(node.symbol);\n } else {\n let type = context.getTypeAtLocation(node.expression);\n symbol = type ? type.symbol : undefined;\n }\n if (symbol && symbol.declarations) {\n const project = context.project;\n symbol.declarations.forEach((declaration) => {\n if (!declaration.symbol) {\n return;\n }\n\n const reflection = project.getReflectionFromFQN(\n context.checker.getFullyQualifiedName(declaration.symbol)\n );\n if (\n node.isExportEquals &&\n reflection instanceof DeclarationReflection\n ) {\n reflection.setFlag(ReflectionFlag.ExportAssignment, true);\n }\n if (reflection) {\n markAsExported(reflection);\n }\n });\n }\n\n function markAsExported(reflection: Reflection) {\n if (reflection instanceof DeclarationReflection) {\n reflection.setFlag(ReflectionFlag.Exported, true);\n }\n\n reflection.traverse(markAsExported);\n }\n\n return context.scope;\n }\n}\n\n@Component({ name: 'node:export-declaration' })\nexport class ExportDeclarationConverter extends ConverterNodeComponent<\n ts.ExportDeclaration\n> {\n supports = [ts.SyntaxKind.ExportDeclaration];\n\n convert(\n context: Context,\n node: ts.ExportDeclaration\n ): Reflection | undefined {\n const withinNamespace = node.parent.kind === ts.SyntaxKind.ModuleBlock;\n\n // It doesn't make sense to convert export declarations if we are pretending everything is global.\n if (\n this.application.options.getValue('mode') === SourceFileMode.File &&\n !withinNamespace\n ) {\n return;\n }\n\n const scope = context.scope;\n if (!(scope instanceof ContainerReflection)) {\n throw new Error('Expected to be within a container');\n }\n\n if (\n node.exportClause &&\n node.exportClause.kind === ts.SyntaxKind.NamedExports\n ) {\n // export { a, a as b }\n node.exportClause.elements.forEach((specifier) => {\n const source = context.expectSymbolAtLocation(specifier.name);\n const target = context.resolveAliasedSymbol(\n context.expectSymbolAtLocation(\n specifier.propertyName ?? specifier.name\n )\n );\n // If the original declaration is in this file, export {} was used with something\n // defined in this file and we don't need to create a reference unless the name is different.\n if (\n !node.moduleSpecifier &&\n !specifier.propertyName &&\n !withinNamespace\n ) {\n return;\n }\n\n createReferenceReflection(context, source, target);\n });\n } else if (\n node.exportClause &&\n node.exportClause.kind === ts.SyntaxKind.NamespaceExport\n ) {\n // export * as ns from ...\n const source = context.expectSymbolAtLocation(\n node.exportClause.name\n );\n if (!node.moduleSpecifier) {\n throw new Error(\n 'Namespace export is missing a module specifier.'\n );\n }\n const target = context.resolveAliasedSymbol(\n context.expectSymbolAtLocation(node.moduleSpecifier)\n );\n createReferenceReflection(context, source, target);\n } else if (node.moduleSpecifier) {\n // export * from ...\n const sourceFileSymbol = context.expectSymbolAtLocation(\n node.moduleSpecifier\n );\n for (const symbol of context.checker.getExportsOfModule(\n sourceFileSymbol\n )) {\n if (symbol.name === 'default') {\n // Default exports are not re-exported with export *\n continue;\n }\n createReferenceReflection(\n context,\n symbol,\n context.resolveAliasedSymbol(symbol)\n );\n }\n }\n\n return context.scope;\n }\n}\n"]}
@@ -6,5 +6,5 @@ export declare class ReflectionType extends Type {
6
6
  constructor(declaration: DeclarationReflection);
7
7
  clone(): Type;
8
8
  equals(type: ReflectionType): boolean;
9
- toString(): "function" | "object";
9
+ toString(): "object" | "function";
10
10
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typedoc",
3
3
  "description": "Create api documentation for TypeScript projects.",
4
- "version": "0.19.1",
4
+ "version": "0.19.2",
5
5
  "homepage": "https://typedoc.org",
6
6
  "main": "dist/index.js",
7
7
  "typings": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "fs-extra": "^9.0.1",
24
24
  "handlebars": "^4.7.6",
25
- "highlight.js": "^10.0.0",
25
+ "highlight.js": "^10.2.0",
26
26
  "lodash": "^4.17.20",
27
27
  "lunr": "^2.3.9",
28
28
  "marked": "^1.1.1",
@@ -30,26 +30,26 @@
30
30
  "progress": "^2.0.3",
31
31
  "semver": "^7.3.2",
32
32
  "shelljs": "^0.8.4",
33
- "typedoc-default-themes": "^0.11.1"
33
+ "typedoc-default-themes": "^0.11.4"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "typescript": "3.9.x || 4.0.x"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/fs-extra": "^9.0.1",
40
- "@types/lodash": "^4.14.160",
40
+ "@types/lodash": "^4.14.161",
41
41
  "@types/lunr": "^2.3.3",
42
42
  "@types/marked": "^1.1.0",
43
43
  "@types/minimatch": "3.0.3",
44
44
  "@types/mocha": "^8.0.3",
45
45
  "@types/mockery": "^1.4.29",
46
- "@types/node": "^14.6.1",
46
+ "@types/node": "^14.11.1",
47
47
  "@types/shelljs": "^0.8.8",
48
- "mocha": "^8.1.2",
48
+ "mocha": "^8.1.3",
49
49
  "mockery": "^2.1.0",
50
50
  "nyc": "^15.1.0",
51
51
  "tslint": "^5.20.1",
52
- "typescript": "^4.0.2"
52
+ "typescript": "^4.0.3"
53
53
  },
54
54
  "files": [
55
55
  "bin",