diff --git a/src/lib/converter/converter.ts b/src/lib/converter/converter.ts index 8df586879..a05585a6f 100644 --- a/src/lib/converter/converter.ts +++ b/src/lib/converter/converter.ts @@ -1,4 +1,5 @@ import ts from "typescript"; +import { ok } from "assert"; import type { Application } from "../application.js"; import { @@ -23,7 +24,7 @@ import { convertType } from "./types.js"; import { ConverterEvents } from "./converter-events.js"; import { convertSymbol } from "./symbols.js"; import { MinimatchSet, nicePath } from "../utils/paths.js"; -import { type GlobString, hasAllFlags, hasAnyFlag, unique } from "#utils"; +import { type GlobString, hasAllFlags, hasAnyFlag, partition, unique } from "#utils"; import type { DocumentationEntryPoint } from "../utils/entry-point.js"; import type { CommentParserConfig } from "./comments/index.js"; import type { CommentStyle, ValidationOptions } from "../utils/options/declaration.js"; @@ -132,6 +133,12 @@ export class Converter extends AbstractComponent { private _config?: CommentParserConfig; private _externalSymbolResolvers: Array = []; + // We try to document symbols which are exported from multiple locations + // in modules/namespaces which declare them, rather than those which re-export them. + // To do this, when converting a symbol, that might be re-exported, we first defer it + // to the second conversion pass. + private _deferPermitted = false; + private _defer: Array<() => void> = []; get config(): CommentParserConfig { return this._config || this._buildCommentParserConfig(); @@ -434,6 +441,14 @@ export class Converter extends AbstractComponent { } } + /** + * Defer a conversion step until later. This may only be called during conversion. + */ + deferConversion(cb: () => void): void { + ok(this._deferPermitted, "Attempted to defer conversion when not permitted"); + this._defer.push(cb); + } + /** * Compile the files within the given context and convert the compiler symbols to reflections. * @@ -444,14 +459,10 @@ export class Converter extends AbstractComponent { entryPoints: readonly DocumentationEntryPoint[], context: Context, ) { - const entries = entryPoints.map((e) => { - return { - entryPoint: e, - context: undefined as Context | undefined, - }; - }); - - let createModuleReflections = entries.length > 1; + ok(!this._deferPermitted); + this._deferPermitted = true; + + let createModuleReflections = entryPoints.length > 1; if (!createModuleReflections) { const opts = this.application.options; createModuleReflections = opts.isSet("alwaysCreateEntryPointModule") @@ -467,22 +478,18 @@ export class Converter extends AbstractComponent { ); } - entries.forEach((e) => { - context.setActiveProgram(e.entryPoint.program); - e.context = this.convertExports( - context, - e.entryPoint, - createModuleReflections, - ); - }); - for (const { entryPoint, context } of entries) { - // active program is already set on context - // if we don't have a context, then this entry point is being ignored - if (context) { - this.convertReExports(context, entryPoint.sourceFile); - } + for (const entry of entryPoints) { + // Clone context in case deferred conversion uses different programs + const entryContext = context.withScope(context.scope); + entryContext.setActiveProgram(entry.program); + this.convertExports(entryContext, entry, createModuleReflections); } - context.setActiveProgram(undefined); + + while (this._defer.length) { + const first = this._defer.shift()!; + first(); + } + this._deferPermitted = false; } private convertExports( @@ -530,24 +537,20 @@ export class Converter extends AbstractComponent { } const allExports = getExports(context, node, symbol); - for (const exp of allExports.filter((exp) => isDirectExport(context.resolveAliasedSymbol(exp), node))) { + const [directExport, indirectExports] = partition( + allExports, + exp => isDirectExport(context.resolveAliasedSymbol(exp), node), + ); + for (const exp of directExport) { this.convertSymbol(moduleContext, exp); } - return moduleContext; - } - - private convertReExports(moduleContext: Context, node: ts.SourceFile) { - for ( - const exp of getExports( - moduleContext, - node, - moduleContext.project.getSymbolFromReflection(moduleContext.scope), - ).filter( - (exp) => !isDirectExport(moduleContext.resolveAliasedSymbol(exp), node), - ) - ) { - this.convertSymbol(moduleContext, exp); + if (indirectExports.length) { + this.deferConversion(() => { + for (const exp of indirectExports) { + this.convertSymbol(moduleContext, exp); + } + }); } } diff --git a/src/lib/converter/symbols.ts b/src/lib/converter/symbols.ts index 14b98293b..fb22156eb 100644 --- a/src/lib/converter/symbols.ts +++ b/src/lib/converter/symbols.ts @@ -99,11 +99,7 @@ assert( "conversionOrder contains a symbol flag that converters do not.", ); -export function convertSymbol( - context: Context, - symbol: ts.Symbol, - exportSymbol?: ts.Symbol, -): void { +function _convertSymbolNow(context: Context, symbol: ts.Symbol, exportSymbol: ts.Symbol | undefined) { if (context.shouldIgnore(symbol)) { return; } @@ -183,6 +179,23 @@ export function convertSymbol( } } +export function convertSymbol( + context: Context, + symbol: ts.Symbol, + exportSymbol?: ts.Symbol, +): void { + // #1795, defer conversion of symbols named `default` so that if a function + // is default exported and also exported with a name, the name takes precedence + if ((exportSymbol?.name ?? symbol.name) === "default") { + context.converter.deferConversion(() => { + _convertSymbolNow(context, symbol, exportSymbol); + }); + return; + } + + _convertSymbolNow(context, symbol, exportSymbol); +} + function convertSymbols(context: Context, symbols: readonly ts.Symbol[]) { for (const symbol of symbols) { convertSymbol(context, symbol); @@ -890,25 +903,30 @@ function convertAlias( symbol: ts.Symbol, exportSymbol?: ts.Symbol, ): undefined { - const reflection = context.project.getReflectionFromSymbol( - context.resolveAliasedSymbol(symbol), - ); - if ( - !reflection || - (reflection && - !reflection.parent?.kindOf( - ReflectionKind.Project | ReflectionKind.SomeModule, - )) - ) { - // We don't have this, convert it. - convertSymbol( - context, + // Defer conversion of aliases so that if the original module/namespace + // containing them is included in the docs, we will point to that namespace + // rather than pointing that namespace to the first namespace encountered, #2856. + context.converter.deferConversion(() => { + const reflection = context.project.getReflectionFromSymbol( context.resolveAliasedSymbol(symbol), - exportSymbol ?? symbol, ); - } else { - createAlias(reflection, context, symbol, exportSymbol); - } + if ( + !reflection || + (reflection && + !reflection.parent?.kindOf( + ReflectionKind.Project | ReflectionKind.SomeModule, + )) + ) { + // We don't have this, convert it. + convertSymbol( + context, + context.resolveAliasedSymbol(symbol), + exportSymbol ?? symbol, + ); + } else { + createAlias(reflection, context, symbol, exportSymbol); + } + }); } function createAlias( diff --git a/src/test/converter/exports/specs.json b/src/test/converter/exports/specs.json index 8b6a3b375..2a376d330 100644 --- a/src/test/converter/exports/specs.json +++ b/src/test/converter/exports/specs.json @@ -6,21 +6,21 @@ "flags": {}, "children": [ { - "id": 14, + "id": 9, "name": "export", "variant": "declaration", "kind": 2, "flags": {}, "children": [ { - "id": 20, + "id": 11, "name": "GH1453", "variant": "declaration", "kind": 4, "flags": {}, "children": [ { - "id": 25, + "id": 16, "name": "Foo", "variant": "declaration", "kind": 2097152, @@ -35,13 +35,13 @@ ], "type": { "type": "reference", - "target": 35, + "target": 20, "name": "GH1453Helper", "package": "typedoc" } }, { - "id": 23, + "id": 14, "name": "Member", "variant": "declaration", "kind": 32, @@ -63,7 +63,7 @@ "defaultValue": "Mod.a" }, { - "id": 21, + "id": 12, "name": "Module", "variant": "declaration", "kind": 32, @@ -80,14 +80,14 @@ ], "type": { "type": "reference", - "target": 29, + "target": 17, "name": "__module", "package": "typedoc" }, "defaultValue": "Mod" }, { - "id": 24, + "id": 15, "name": "TypedMember", "variant": "declaration", "kind": 32, @@ -104,14 +104,14 @@ ], "type": { "type": "reference", - "target": 30, + "target": 18, "name": "a", "package": "typedoc" }, "defaultValue": "Mod.a" }, { - "id": 22, + "id": 13, "name": "TypedModule", "variant": "declaration", "kind": 32, @@ -128,7 +128,7 @@ ], "type": { "type": "reference", - "target": 29, + "target": 17, "name": "__module", "package": "typedoc" }, @@ -139,16 +139,16 @@ { "title": "Type Aliases", "children": [ - 25 + 16 ] }, { "title": "Variables", "children": [ - 23, - 21, - 24, - 22 + 14, + 12, + 15, + 13 ] } ], @@ -162,7 +162,7 @@ ] }, { - "id": 15, + "id": 27, "name": "add", "variant": "declaration", "kind": 64, @@ -177,7 +177,7 @@ ], "signatures": [ { - "id": 16, + "id": 28, "name": "add", "variant": "signature", "kind": 4096, @@ -192,7 +192,7 @@ ], "parameters": [ { - "id": 17, + "id": 29, "name": "x", "variant": "param", "kind": 32768, @@ -203,7 +203,7 @@ } }, { - "id": 18, + "id": 30, "name": "y", "variant": "param", "kind": 32768, @@ -222,7 +222,7 @@ ] }, { - "id": 26, + "id": 31, "name": "default", "variant": "declaration", "kind": 64, @@ -237,7 +237,7 @@ ], "signatures": [ { - "id": 27, + "id": 32, "name": "default", "variant": "signature", "kind": 4096, @@ -252,7 +252,7 @@ ], "parameters": [ { - "id": 28, + "id": 33, "name": "a", "variant": "param", "kind": 32768, @@ -271,7 +271,7 @@ ] }, { - "id": 44, + "id": 34, "name": "a", "variant": "reference", "kind": 4194304, @@ -284,10 +284,10 @@ "url": "typedoc://mod.ts#L8" } ], - "target": 30 + "target": 18 }, { - "id": 45, + "id": 46, "name": "b", "variant": "reference", "kind": 4194304, @@ -308,10 +308,10 @@ "url": "typedoc://mod.ts#L13" } ], - "target": 30 + "target": 18 }, { - "id": 40, + "id": 42, "name": "c", "variant": "reference", "kind": 4194304, @@ -324,10 +324,10 @@ "url": "typedoc://export.ts#L5" } ], - "target": 30 + "target": 18 }, { - "id": 48, + "id": 36, "name": "GH1453Helper", "variant": "reference", "kind": 4194304, @@ -340,10 +340,10 @@ "url": "typedoc://mod.ts#L42" } ], - "target": 35 + "target": 20 }, { - "id": 41, + "id": 43, "name": "Mod", "variant": "reference", "kind": 4194304, @@ -356,10 +356,10 @@ "url": "typedoc://export.ts#L5" } ], - "target": 29 + "target": 17 }, { - "id": 43, + "id": 45, "name": "Mod2", "variant": "reference", "kind": 4194304, @@ -380,10 +380,10 @@ "url": "typedoc://export.ts#L14" } ], - "target": 29 + "target": 17 }, { - "id": 42, + "id": 44, "name": "ModDefault", "variant": "reference", "kind": 4194304, @@ -396,7 +396,7 @@ "url": "typedoc://export.ts#L5" } ], - "target": 36 + "target": 40 }, { "id": 47, @@ -412,33 +412,33 @@ "url": "typedoc://mod.ts#L40" } ], - "target": 29 + "target": 17 } ], "groups": [ { "title": "Namespaces", "children": [ - 20 + 11 ] }, { "title": "Functions", "children": [ - 15, - 26 + 27, + 31 ] }, { "title": "References", "children": [ - 44, - 45, - 40, - 48, - 41, - 43, + 34, + 46, 42, + 36, + 43, + 45, + 44, 47 ] } @@ -460,7 +460,7 @@ "flags": {}, "children": [ { - "id": 2, + "id": 23, "name": "export=", "variant": "declaration", "kind": 64, @@ -475,7 +475,7 @@ ], "signatures": [ { - "id": 3, + "id": 24, "name": "export=", "variant": "signature", "kind": 4096, @@ -490,7 +490,7 @@ ], "parameters": [ { - "id": 4, + "id": 25, "name": "x", "variant": "param", "kind": 32768, @@ -501,7 +501,7 @@ } }, { - "id": 5, + "id": 26, "name": "y", "variant": "param", "kind": 32768, @@ -524,7 +524,7 @@ { "title": "Functions", "children": [ - 2 + 23 ] } ], @@ -538,14 +538,14 @@ ] }, { - "id": 6, + "id": 2, "name": "export-default", "variant": "declaration", "kind": 2, "flags": {}, "children": [ { - "id": 7, + "id": 48, "name": "default", "variant": "declaration", "kind": 32, @@ -571,7 +571,7 @@ { "title": "Variables", "children": [ - 7 + 48 ] } ], @@ -585,14 +585,14 @@ ] }, { - "id": 8, + "id": 3, "name": "export-with-local", "variant": "declaration", "kind": 2, "flags": {}, "children": [ { - "id": 13, + "id": 8, "name": "x", "variant": "declaration", "kind": 32, @@ -614,7 +614,7 @@ "defaultValue": "5" }, { - "id": 9, + "id": 4, "name": "add", "variant": "declaration", "kind": 64, @@ -629,7 +629,7 @@ ], "signatures": [ { - "id": 10, + "id": 5, "name": "add", "variant": "signature", "kind": 4096, @@ -644,7 +644,7 @@ ], "parameters": [ { - "id": 11, + "id": 6, "name": "x", "variant": "param", "kind": 32768, @@ -655,7 +655,7 @@ } }, { - "id": 12, + "id": 7, "name": "y", "variant": "param", "kind": 32768, @@ -678,13 +678,13 @@ { "title": "Variables", "children": [ - 13 + 8 ] }, { "title": "Functions", "children": [ - 9 + 4 ] } ], @@ -698,14 +698,14 @@ ] }, { - "id": 29, + "id": 17, "name": "mod", "variant": "declaration", "kind": 2, "flags": {}, "children": [ { - "id": 35, + "id": 20, "name": "GH1453Helper", "variant": "declaration", "kind": 2097152, @@ -724,7 +724,7 @@ } }, { - "id": 30, + "id": 18, "name": "a", "variant": "declaration", "kind": 32, @@ -754,7 +754,7 @@ "defaultValue": "1" }, { - "id": 36, + "id": 40, "name": "default", "variant": "declaration", "kind": 64, @@ -769,7 +769,7 @@ ], "signatures": [ { - "id": 37, + "id": 41, "name": "default", "variant": "signature", "kind": 4096, @@ -798,7 +798,7 @@ ] }, { - "id": 31, + "id": 37, "name": "b", "variant": "reference", "kind": 4194304, @@ -819,10 +819,10 @@ "url": "typedoc://mod.ts#L13" } ], - "target": 30 + "target": 18 }, { - "id": 32, + "id": 38, "name": "c", "variant": "reference", "kind": 4194304, @@ -843,10 +843,10 @@ "url": "typedoc://mod.ts#L18" } ], - "target": 30 + "target": 18 }, { - "id": 34, + "id": 39, "name": "ThisModule", "variant": "reference", "kind": 4194304, @@ -859,34 +859,34 @@ "url": "typedoc://mod.ts#L40" } ], - "target": 29 + "target": 17 } ], "groups": [ { "title": "Type Aliases", "children": [ - 35 + 20 ] }, { "title": "Variables", "children": [ - 30 + 18 ] }, { "title": "Functions", "children": [ - 36 + 40 ] }, { "title": "References", "children": [ - 31, - 32, - 34 + 37, + 38, + 39 ] } ], @@ -900,7 +900,7 @@ ] }, { - "id": 38, + "id": 21, "name": "no-doc-members", "variant": "declaration", "kind": 2, @@ -926,7 +926,7 @@ }, "children": [ { - "id": 39, + "id": 22, "name": "abc", "variant": "declaration", "kind": 32, @@ -952,7 +952,7 @@ { "title": "Variables", "children": [ - 39 + 22 ] } ], @@ -970,12 +970,12 @@ { "title": "Modules", "children": [ - 14, + 9, 1, - 6, - 8, - 29, - 38 + 2, + 3, + 17, + 21 ] } ], @@ -986,170 +986,170 @@ "qualifiedName": "" }, "2": { - "sourceFileName": "src/test/converter/exports/export-assignment.ts", - "qualifiedName": "add" + "sourceFileName": "src/test/converter/exports/export-default.ts", + "qualifiedName": "" }, "3": { - "sourceFileName": "src/test/converter/exports/export-assignment.ts", - "qualifiedName": "add" + "sourceFileName": "src/test/converter/exports/export-with-local.ts", + "qualifiedName": "" }, "4": { - "sourceFileName": "src/test/converter/exports/export-assignment.ts", - "qualifiedName": "x" + "sourceFileName": "src/test/converter/exports/export-with-local.ts", + "qualifiedName": "add" }, "5": { - "sourceFileName": "src/test/converter/exports/export-assignment.ts", - "qualifiedName": "y" + "sourceFileName": "src/test/converter/exports/export-with-local.ts", + "qualifiedName": "add" }, "6": { - "sourceFileName": "src/test/converter/exports/export-default.ts", - "qualifiedName": "" + "sourceFileName": "src/test/converter/exports/export-with-local.ts", + "qualifiedName": "x" }, "7": { - "sourceFileName": "src/test/converter/exports/export-default.ts", - "qualifiedName": "x" + "sourceFileName": "src/test/converter/exports/export-with-local.ts", + "qualifiedName": "y" }, "8": { "sourceFileName": "src/test/converter/exports/export-with-local.ts", - "qualifiedName": "" + "qualifiedName": "x" }, "9": { - "sourceFileName": "src/test/converter/exports/export-with-local.ts", - "qualifiedName": "add" - }, - "10": { - "sourceFileName": "src/test/converter/exports/export-with-local.ts", - "qualifiedName": "add" + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "" }, "11": { - "sourceFileName": "src/test/converter/exports/export-with-local.ts", - "qualifiedName": "x" + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "GH1453" }, "12": { - "sourceFileName": "src/test/converter/exports/export-with-local.ts", - "qualifiedName": "y" + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "GH1453.Module" }, "13": { - "sourceFileName": "src/test/converter/exports/export-with-local.ts", - "qualifiedName": "x" + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "GH1453.TypedModule" }, "14": { "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "" + "qualifiedName": "GH1453.Member" }, "15": { "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "add" + "qualifiedName": "GH1453.TypedMember" }, "16": { "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "add" + "qualifiedName": "GH1453.Foo" }, "17": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "x" + "sourceFileName": "src/test/converter/exports/mod.ts", + "qualifiedName": "" }, "18": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "y" + "sourceFileName": "src/test/converter/exports/mod.ts", + "qualifiedName": "a" }, "20": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "GH1453" + "sourceFileName": "src/test/converter/exports/mod.ts", + "qualifiedName": "GH1453Helper" }, "21": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "GH1453.Module" + "sourceFileName": "src/test/converter/exports/no-doc-members.ts", + "qualifiedName": "" }, "22": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "GH1453.TypedModule" + "sourceFileName": "src/test/converter/exports/no-doc-members.ts", + "qualifiedName": "abc" }, "23": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "GH1453.Member" + "sourceFileName": "src/test/converter/exports/export-assignment.ts", + "qualifiedName": "add" }, "24": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "GH1453.TypedMember" + "sourceFileName": "src/test/converter/exports/export-assignment.ts", + "qualifiedName": "add" }, "25": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "GH1453.Foo" + "sourceFileName": "src/test/converter/exports/export-assignment.ts", + "qualifiedName": "x" }, "26": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "default" + "sourceFileName": "src/test/converter/exports/export-assignment.ts", + "qualifiedName": "y" }, "27": { "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "default" + "qualifiedName": "add" }, "28": { "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "a" + "qualifiedName": "add" }, "29": { - "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "" + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "x" }, "30": { - "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "a" + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "y" }, "31": { - "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "b" + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "default" }, "32": { - "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "c" + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "default" }, - "34": { - "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "ThisModule" + "33": { + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "a" }, - "35": { + "34": { "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "GH1453Helper" + "qualifiedName": "a" }, "36": { "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "default" + "qualifiedName": "GH1453Helper" }, "37": { "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "default" + "qualifiedName": "b" }, "38": { - "sourceFileName": "src/test/converter/exports/no-doc-members.ts", - "qualifiedName": "" + "sourceFileName": "src/test/converter/exports/mod.ts", + "qualifiedName": "c" }, "39": { - "sourceFileName": "src/test/converter/exports/no-doc-members.ts", - "qualifiedName": "abc" + "sourceFileName": "src/test/converter/exports/mod.ts", + "qualifiedName": "ThisModule" }, "40": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "c" + "sourceFileName": "src/test/converter/exports/mod.ts", + "qualifiedName": "default" }, "41": { - "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "Mod" + "sourceFileName": "src/test/converter/exports/mod.ts", + "qualifiedName": "default" }, "42": { "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "ModDefault" + "qualifiedName": "c" }, "43": { "sourceFileName": "src/test/converter/exports/export.ts", - "qualifiedName": "Mod2" + "qualifiedName": "Mod" }, "44": { - "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "a" + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "ModDefault" }, "45": { + "sourceFileName": "src/test/converter/exports/export.ts", + "qualifiedName": "Mod2" + }, + "46": { "sourceFileName": "src/test/converter/exports/mod.ts", "qualifiedName": "b" }, @@ -1158,8 +1158,8 @@ "qualifiedName": "ThisModule" }, "48": { - "sourceFileName": "src/test/converter/exports/mod.ts", - "qualifiedName": "GH1453Helper" + "sourceFileName": "src/test/converter/exports/export-default.ts", + "qualifiedName": "x" } }, "files": { @@ -1173,11 +1173,11 @@ }, "reflections": { "1": 1, - "2": 6, - "3": 8, - "4": 14, - "5": 29, - "6": 38 + "2": 2, + "3": 3, + "4": 9, + "5": 17, + "6": 21 } } } diff --git a/src/test/converter/exports/specs.nodoc.json b/src/test/converter/exports/specs.nodoc.json index 52470b47b..f9cac2d8d 100644 --- a/src/test/converter/exports/specs.nodoc.json +++ b/src/test/converter/exports/specs.nodoc.json @@ -6,14 +6,14 @@ "flags": {}, "children": [ { - "id": 14, + "id": 9, "name": "export", "variant": "declaration", "kind": 2, "flags": {}, "children": [ { - "id": 45, + "id": 46, "name": "b", "variant": "reference", "kind": 4194304, @@ -34,10 +34,10 @@ "url": "typedoc://mod.ts#L13" } ], - "target": 30 + "target": 18 }, { - "id": 43, + "id": 45, "name": "Mod2", "variant": "reference", "kind": 4194304, @@ -58,15 +58,15 @@ "url": "typedoc://export.ts#L14" } ], - "target": 29 + "target": 17 } ], "groups": [ { "title": "References", "children": [ - 45, - 43 + 46, + 45 ] } ], @@ -80,14 +80,14 @@ ] }, { - "id": 29, + "id": 17, "name": "mod", "variant": "declaration", "kind": 2, "flags": {}, "children": [ { - "id": 30, + "id": 18, "name": "a", "variant": "declaration", "kind": 32, @@ -117,7 +117,7 @@ "defaultValue": "1" }, { - "id": 36, + "id": 40, "name": "default", "variant": "declaration", "kind": 64, @@ -132,7 +132,7 @@ ], "signatures": [ { - "id": 37, + "id": 41, "name": "default", "variant": "signature", "kind": 4096, @@ -161,7 +161,7 @@ ] }, { - "id": 31, + "id": 37, "name": "b", "variant": "reference", "kind": 4194304, @@ -182,10 +182,10 @@ "url": "typedoc://mod.ts#L13" } ], - "target": 30 + "target": 18 }, { - "id": 32, + "id": 38, "name": "c", "variant": "reference", "kind": 4194304, @@ -206,27 +206,27 @@ "url": "typedoc://mod.ts#L18" } ], - "target": 30 + "target": 18 } ], "groups": [ { "title": "Variables", "children": [ - 30 + 18 ] }, { "title": "Functions", "children": [ - 36 + 40 ] }, { "title": "References", "children": [ - 31, - 32 + 37, + 38 ] } ], @@ -240,7 +240,7 @@ ] }, { - "id": 38, + "id": 21, "name": "no-doc-members", "variant": "declaration", "kind": 2, @@ -278,51 +278,51 @@ { "title": "Modules", "children": [ - 14, - 29, - 38 + 9, + 17, + 21 ] } ], "packageName": "typedoc", "symbolIdMap": { - "14": { + "9": { "sourceFileName": "src/test/converter/exports/export.ts", "qualifiedName": "" }, - "29": { + "17": { "sourceFileName": "src/test/converter/exports/mod.ts", "qualifiedName": "" }, - "30": { + "18": { "sourceFileName": "src/test/converter/exports/mod.ts", "qualifiedName": "a" }, - "31": { + "21": { + "sourceFileName": "src/test/converter/exports/no-doc-members.ts", + "qualifiedName": "" + }, + "37": { "sourceFileName": "src/test/converter/exports/mod.ts", "qualifiedName": "b" }, - "32": { + "38": { "sourceFileName": "src/test/converter/exports/mod.ts", "qualifiedName": "c" }, - "36": { + "40": { "sourceFileName": "src/test/converter/exports/mod.ts", "qualifiedName": "default" }, - "37": { + "41": { "sourceFileName": "src/test/converter/exports/mod.ts", "qualifiedName": "default" }, - "38": { - "sourceFileName": "src/test/converter/exports/no-doc-members.ts", - "qualifiedName": "" - }, - "43": { + "45": { "sourceFileName": "src/test/converter/exports/export.ts", "qualifiedName": "Mod2" }, - "45": { + "46": { "sourceFileName": "src/test/converter/exports/mod.ts", "qualifiedName": "b" } @@ -337,9 +337,9 @@ "6": "src/test/converter/exports/no-doc-members.ts" }, "reflections": { - "4": 14, - "5": 29, - "6": 38 + "4": 9, + "5": 17, + "6": 21 } } } diff --git a/src/test/converter/js/specs.json b/src/test/converter/js/specs.json index e34d5eb13..01c70d9ac 100644 --- a/src/test/converter/js/specs.json +++ b/src/test/converter/js/specs.json @@ -13,7 +13,7 @@ "flags": {}, "children": [ { - "id": 5, + "id": 2, "name": "Foo", "variant": "declaration", "kind": 2097152, @@ -32,7 +32,7 @@ } }, { - "id": 2, + "id": 43, "name": "export=", "variant": "declaration", "kind": 64, @@ -47,7 +47,7 @@ ], "signatures": [ { - "id": 3, + "id": 44, "name": "export=", "variant": "signature", "kind": 4096, @@ -62,7 +62,7 @@ ], "parameters": [ { - "id": 4, + "id": 45, "name": "x", "variant": "param", "kind": 32768, @@ -93,13 +93,13 @@ { "title": "Type Aliases", "children": [ - 5 + 2 ] }, { "title": "Functions", "children": [ - 2 + 43 ] } ], @@ -113,14 +113,14 @@ ] }, { - "id": 6, + "id": 3, "name": "index", "variant": "declaration", "kind": 2, "flags": {}, "children": [ { - "id": 10, + "id": 7, "name": "ColumnType", "variant": "declaration", "kind": 8, @@ -135,7 +135,7 @@ }, "children": [ { - "id": 12, + "id": 9, "name": "NUMBER", "variant": "declaration", "kind": 16, @@ -154,7 +154,7 @@ } }, { - "id": 11, + "id": 8, "name": "STRING", "variant": "declaration", "kind": 16, @@ -177,8 +177,8 @@ { "title": "Enumeration Members", "children": [ - 12, - 11 + 9, + 8 ] } ], @@ -198,7 +198,7 @@ ] }, { - "id": 15, + "id": 12, "name": "AlsoInterfaceIsh", "variant": "declaration", "kind": 256, @@ -213,7 +213,7 @@ }, "children": [ { - "id": 17, + "id": 14, "name": "bar", "variant": "declaration", "kind": 1024, @@ -240,7 +240,7 @@ } }, { - "id": 16, + "id": 13, "name": "foo", "variant": "declaration", "kind": 1024, @@ -271,8 +271,8 @@ { "title": "Properties", "children": [ - 17, - 16 + 14, + 13 ] } ], @@ -286,14 +286,14 @@ ] }, { - "id": 13, + "id": 10, "name": "InterfaceIsh", "variant": "declaration", "kind": 256, "flags": {}, "children": [ { - "id": 14, + "id": 11, "name": "foo", "variant": "declaration", "kind": 1024, @@ -324,7 +324,7 @@ { "title": "Properties", "children": [ - 14 + 11 ] } ], @@ -338,7 +338,7 @@ ] }, { - "id": 42, + "id": 39, "name": "Foo", "variant": "declaration", "kind": 2097152, @@ -354,7 +354,7 @@ "type": { "type": "reflection", "declaration": { - "id": 43, + "id": 40, "name": "__type", "variant": "declaration", "kind": 65536, @@ -369,14 +369,14 @@ ], "signatures": [ { - "id": 44, + "id": 41, "name": "__type", "variant": "signature", "kind": 4096, "flags": {}, "parameters": [ { - "id": 45, + "id": 42, "name": "args", "variant": "param", "kind": 32768, @@ -410,7 +410,7 @@ } }, { - "id": 28, + "id": 25, "name": "HasReturnTag", "variant": "declaration", "kind": 2097152, @@ -426,7 +426,7 @@ "type": { "type": "reflection", "declaration": { - "id": 29, + "id": 26, "name": "__type", "variant": "declaration", "kind": 65536, @@ -441,7 +441,7 @@ ], "signatures": [ { - "id": 30, + "id": 27, "name": "__type", "variant": "signature", "kind": 4096, @@ -456,7 +456,7 @@ } }, { - "id": 40, + "id": 37, "name": "Identity", "variant": "declaration", "kind": 2097152, @@ -479,7 +479,7 @@ ], "typeParameters": [ { - "id": 41, + "id": 38, "name": "T", "variant": "typeParam", "kind": 131072, @@ -496,14 +496,14 @@ ], "type": { "type": "reference", - "target": 41, + "target": 38, "name": "T", "package": "typedoc", "refersToTypeParameter": true } }, { - "id": 31, + "id": 28, "name": "IdentityFn", "variant": "declaration", "kind": 2097152, @@ -518,7 +518,7 @@ ], "typeParameters": [ { - "id": 35, + "id": 32, "name": "T", "variant": "typeParam", "kind": 131072, @@ -528,7 +528,7 @@ "type": { "type": "reflection", "declaration": { - "id": 32, + "id": 29, "name": "__type", "variant": "declaration", "kind": 65536, @@ -543,21 +543,21 @@ ], "signatures": [ { - "id": 33, + "id": 30, "name": "__type", "variant": "signature", "kind": 4096, "flags": {}, "parameters": [ { - "id": 34, + "id": 31, "name": "data", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "reference", - "target": 35, + "target": 32, "name": "T", "package": "typedoc", "refersToTypeParameter": true @@ -566,7 +566,7 @@ ], "type": { "type": "reference", - "target": 35, + "target": 32, "name": "T", "package": "typedoc", "refersToTypeParameter": true @@ -577,7 +577,7 @@ } }, { - "id": 20, + "id": 17, "name": "IntersectionType", "variant": "declaration", "kind": 2097152, @@ -604,14 +604,14 @@ { "type": "reflection", "declaration": { - "id": 21, + "id": 18, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 22, + "id": 19, "name": "x", "variant": "declaration", "kind": 1024, @@ -634,7 +634,7 @@ { "title": "Properties", "children": [ - 22 + 19 ] } ], @@ -651,14 +651,14 @@ { "type": "reflection", "declaration": { - "id": 23, + "id": 20, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 24, + "id": 21, "name": "y", "variant": "declaration", "kind": 1024, @@ -681,7 +681,7 @@ { "title": "Properties", "children": [ - 24 + 21 ] } ], @@ -699,7 +699,7 @@ } }, { - "id": 25, + "id": 22, "name": "NoReturnTag", "variant": "declaration", "kind": 2097152, @@ -723,7 +723,7 @@ "type": { "type": "reflection", "declaration": { - "id": 26, + "id": 23, "name": "__type", "variant": "declaration", "kind": 65536, @@ -738,7 +738,7 @@ ], "signatures": [ { - "id": 27, + "id": 24, "name": "__type", "variant": "signature", "kind": 4096, @@ -753,7 +753,7 @@ } }, { - "id": 18, + "id": 15, "name": "ObjectAlias", "variant": "declaration", "kind": 2097152, @@ -785,7 +785,7 @@ } }, { - "id": 36, + "id": 33, "name": "OptionalArg", "variant": "declaration", "kind": 2097152, @@ -801,7 +801,7 @@ "type": { "type": "reflection", "declaration": { - "id": 37, + "id": 34, "name": "__type", "variant": "declaration", "kind": 65536, @@ -816,14 +816,14 @@ ], "signatures": [ { - "id": 38, + "id": 35, "name": "__type", "variant": "signature", "kind": 4096, "flags": {}, "parameters": [ { - "id": 39, + "id": 36, "name": "data", "variant": "param", "kind": 32768, @@ -854,7 +854,7 @@ } }, { - "id": 19, + "id": 16, "name": "UnionType", "variant": "declaration", "kind": 2097152, @@ -890,7 +890,7 @@ } }, { - "id": 7, + "id": 4, "name": "usedFoo", "variant": "declaration", "kind": 64, @@ -905,7 +905,7 @@ ], "signatures": [ { - "id": 8, + "id": 5, "name": "usedFoo", "variant": "signature", "kind": 4096, @@ -934,7 +934,7 @@ ], "parameters": [ { - "id": 9, + "id": 6, "name": "args", "variant": "param", "kind": 32768, @@ -970,34 +970,34 @@ { "title": "Enumerations", "children": [ - 10 + 7 ] }, { "title": "Interfaces", "children": [ - 15, - 13 + 12, + 10 ] }, { "title": "Type Aliases", "children": [ - 42, - 28, - 40, - 31, - 20, + 39, 25, - 18, - 36, - 19 + 37, + 28, + 17, + 22, + 15, + 33, + 16 ] }, { "title": "Functions", "children": [ - 7 + 4 ] } ], @@ -1016,7 +1016,7 @@ "title": "Modules", "children": [ 1, - 6 + 3 ] } ], @@ -1028,87 +1028,87 @@ }, "2": { "sourceFileName": "src/test/converter/js/export-eq-type.js", - "qualifiedName": "foo" + "qualifiedName": "Foo" }, "3": { - "sourceFileName": "src/test/converter/js/export-eq-type.js", - "qualifiedName": "foo" + "sourceFileName": "src/test/converter/js/index.js", + "qualifiedName": "" }, "4": { - "sourceFileName": "src/test/converter/js/export-eq-type.js", - "qualifiedName": "x" + "sourceFileName": "src/test/converter/js/index.js", + "qualifiedName": "usedFoo" }, "5": { - "sourceFileName": "src/test/converter/js/export-eq-type.js", - "qualifiedName": "Foo" + "sourceFileName": "src/test/converter/js/index.js", + "qualifiedName": "usedFoo" }, "6": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "" + "qualifiedName": "args" }, "7": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "usedFoo" + "qualifiedName": "ColumnType" }, "8": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "usedFoo" + "qualifiedName": "__object.STRING" }, "9": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "args" + "qualifiedName": "__object.NUMBER" }, "10": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "ColumnType" + "qualifiedName": "InterfaceIsh" }, "11": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__object.STRING" + "qualifiedName": "__type.foo" }, "12": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__object.NUMBER" + "qualifiedName": "AlsoInterfaceIsh" }, "13": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "InterfaceIsh" + "qualifiedName": "__type.foo" }, "14": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type.foo" + "qualifiedName": "__type.bar" }, "15": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "AlsoInterfaceIsh" + "qualifiedName": "ObjectAlias" }, "16": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type.foo" + "qualifiedName": "UnionType" }, "17": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type.bar" + "qualifiedName": "IntersectionType" }, "18": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "ObjectAlias" + "qualifiedName": "__type" }, "19": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "UnionType" + "qualifiedName": "__type.x" }, "20": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "IntersectionType" + "qualifiedName": "__type" }, "21": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type" + "qualifiedName": "__type.y" }, "22": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type.x" + "qualifiedName": "NoReturnTag" }, "23": { "sourceFileName": "src/test/converter/js/index.js", @@ -1116,11 +1116,11 @@ }, "24": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type.y" + "qualifiedName": "__type" }, "25": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "NoReturnTag" + "qualifiedName": "HasReturnTag" }, "26": { "sourceFileName": "src/test/converter/js/index.js", @@ -1132,7 +1132,7 @@ }, "28": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "HasReturnTag" + "qualifiedName": "IdentityFn" }, "29": { "sourceFileName": "src/test/converter/js/index.js", @@ -1144,63 +1144,63 @@ }, "31": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "IdentityFn" + "qualifiedName": "data" }, "32": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type" + "qualifiedName": "T" }, "33": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type" + "qualifiedName": "OptionalArg" }, "34": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "data" + "qualifiedName": "__type" }, "35": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "T" + "qualifiedName": "__type" }, "36": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "OptionalArg" + "qualifiedName": "data" }, "37": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type" + "qualifiedName": "Identity" }, "38": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type" + "qualifiedName": "T" }, "39": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "data" + "qualifiedName": "Foo" }, "40": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "Identity" + "qualifiedName": "__type" }, "41": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "T" + "qualifiedName": "__type" }, "42": { "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "Foo" + "qualifiedName": "args" }, "43": { - "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type" + "sourceFileName": "src/test/converter/js/export-eq-type.js", + "qualifiedName": "foo" }, "44": { - "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "__type" + "sourceFileName": "src/test/converter/js/export-eq-type.js", + "qualifiedName": "foo" }, "45": { - "sourceFileName": "src/test/converter/js/index.js", - "qualifiedName": "args" + "sourceFileName": "src/test/converter/js/export-eq-type.js", + "qualifiedName": "x" } }, "files": { @@ -1210,7 +1210,7 @@ }, "reflections": { "1": 1, - "2": 6 + "2": 3 } } } diff --git a/src/test/converter/variables/specs.json b/src/test/converter/variables/specs.json index b6e39c651..2fead343b 100644 --- a/src/test/converter/variables/specs.json +++ b/src/test/converter/variables/specs.json @@ -1143,7 +1143,7 @@ "defaultValue": "..." }, { - "id": 74, + "id": 85, "name": "objectLiteral", "variant": "declaration", "kind": 32, @@ -1169,14 +1169,14 @@ "type": { "type": "reflection", "declaration": { - "id": 75, + "id": 86, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 93, + "id": 104, "name": "[toStringTag]", "variant": "declaration", "kind": 1024, @@ -1196,7 +1196,7 @@ "defaultValue": "\"computed\"" }, { - "id": 94, + "id": 105, "name": "literal", "variant": "declaration", "kind": 1024, @@ -1216,7 +1216,7 @@ "defaultValue": "true" }, { - "id": 95, + "id": 106, "name": "literal2", "variant": "declaration", "kind": 1024, @@ -1236,7 +1236,7 @@ "defaultValue": "true" }, { - "id": 91, + "id": 102, "name": "valueA", "variant": "declaration", "kind": 1024, @@ -1256,7 +1256,7 @@ "defaultValue": "100" }, { - "id": 92, + "id": 103, "name": "valueB", "variant": "declaration", "kind": 1024, @@ -1276,7 +1276,7 @@ "defaultValue": "true" }, { - "id": 80, + "id": 91, "name": "valueX", "variant": "declaration", "kind": 1024, @@ -1292,14 +1292,14 @@ "type": { "type": "reflection", "declaration": { - "id": 81, + "id": 92, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 90, + "id": 101, "name": "valueA", "variant": "declaration", "kind": 1024, @@ -1322,7 +1322,7 @@ "defaultValue": "..." }, { - "id": 83, + "id": 94, "name": "valueY", "variant": "declaration", "kind": 1024, @@ -1338,7 +1338,7 @@ "type": { "type": "reflection", "declaration": { - "id": 84, + "id": 95, "name": "__type", "variant": "declaration", "kind": 65536, @@ -1353,7 +1353,7 @@ ], "signatures": [ { - "id": 85, + "id": 96, "name": "__type", "variant": "signature", "kind": 4096, @@ -1368,7 +1368,7 @@ ], "parameters": [ { - "id": 86, + "id": 97, "name": "z", "variant": "param", "kind": 32768, @@ -1382,14 +1382,14 @@ "type": { "type": "reflection", "declaration": { - "id": 87, + "id": 98, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 88, + "id": 99, "name": "a", "variant": "declaration", "kind": 1024, @@ -1409,7 +1409,7 @@ "defaultValue": "\"test\"" }, { - "id": 89, + "id": 100, "name": "b", "variant": "declaration", "kind": 1024, @@ -1433,8 +1433,8 @@ { "title": "Properties", "children": [ - 88, - 89 + 99, + 100 ] } ], @@ -1455,7 +1455,7 @@ "defaultValue": "..." }, { - "id": 82, + "id": 93, "name": "valueZ", "variant": "declaration", "kind": 1024, @@ -1479,9 +1479,9 @@ { "title": "Properties", "children": [ - 90, - 83, - 82 + 101, + 94, + 93 ] } ], @@ -1498,7 +1498,7 @@ "defaultValue": "..." }, { - "id": 77, + "id": 88, "name": "valueY", "variant": "declaration", "kind": 1024, @@ -1514,7 +1514,7 @@ "type": { "type": "reflection", "declaration": { - "id": 78, + "id": 89, "name": "__type", "variant": "declaration", "kind": 65536, @@ -1529,7 +1529,7 @@ ], "signatures": [ { - "id": 79, + "id": 90, "name": "__type", "variant": "signature", "kind": 4096, @@ -1553,7 +1553,7 @@ "defaultValue": "..." }, { - "id": 76, + "id": 87, "name": "valueZ", "variant": "declaration", "kind": 1024, @@ -1577,14 +1577,14 @@ { "title": "Properties", "children": [ - 93, - 94, - 95, + 104, + 105, + 106, + 102, + 103, 91, - 92, - 80, - 77, - 76 + 88, + 87 ] } ], @@ -1992,7 +1992,7 @@ "title": "Variables", "children": [ 54, - 74, + 85, 35 ] } @@ -2007,14 +2007,14 @@ ] }, { - "id": 96, + "id": 74, "name": "variable", "variant": "declaration", "kind": 2, "flags": {}, "children": [ { - "id": 97, + "id": 75, "name": "myConst", "variant": "declaration", "kind": 32, @@ -2036,7 +2036,7 @@ "defaultValue": "15" }, { - "id": 98, + "id": 76, "name": "myLet", "variant": "declaration", "kind": 32, @@ -2056,7 +2056,7 @@ "defaultValue": "15" }, { - "id": 99, + "id": 77, "name": "myVar", "variant": "declaration", "kind": 32, @@ -2076,7 +2076,7 @@ "defaultValue": "15" }, { - "id": 103, + "id": 81, "name": "satisfies", "variant": "declaration", "kind": 32, @@ -2094,14 +2094,14 @@ "type": { "type": "reflection", "declaration": { - "id": 104, + "id": 82, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 105, + "id": 83, "name": "a", "variant": "declaration", "kind": 1024, @@ -2121,7 +2121,7 @@ "defaultValue": "1" }, { - "id": 106, + "id": 84, "name": "b", "variant": "declaration", "kind": 1024, @@ -2145,8 +2145,8 @@ { "title": "Properties", "children": [ - 105, - 106 + 83, + 84 ] } ], @@ -2163,7 +2163,7 @@ "defaultValue": "..." }, { - "id": 100, + "id": 78, "name": "x", "variant": "declaration", "kind": 32, @@ -2182,7 +2182,7 @@ } }, { - "id": 101, + "id": 79, "name": "y", "variant": "declaration", "kind": 32, @@ -2212,7 +2212,7 @@ } }, { - "id": 102, + "id": 80, "name": "z", "variant": "declaration", "kind": 32, @@ -2246,13 +2246,13 @@ { "title": "Variables", "children": [ - 97, - 98, - 99, - 103, - 100, - 101, - 102 + 75, + 76, + 77, + 81, + 78, + 79, + 80 ] } ], @@ -2273,7 +2273,7 @@ 1, 15, 34, - 96 + 74 ] } ], @@ -2544,136 +2544,136 @@ "qualifiedName": "__type" }, "74": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "objectLiteral" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "" }, "75": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "myConst" }, "76": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.valueZ" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "myLet" }, "77": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.valueY" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "myVar" }, "78": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__function" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "x" }, "79": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__function" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "y" }, "80": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.valueX" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "z" }, "81": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "satisfies" }, "82": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.valueZ" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "__object" }, "83": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.valueY" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "__object.a" }, "84": { - "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__function" + "sourceFileName": "src/test/converter/variables/variable.ts", + "qualifiedName": "__object.b" }, "85": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__function" + "qualifiedName": "objectLiteral" }, "86": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "z" + "qualifiedName": "__object" }, "87": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object" + "qualifiedName": "__object.valueZ" }, "88": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.a" + "qualifiedName": "__object.valueY" }, "89": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.b" + "qualifiedName": "__function" }, "90": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.valueA" + "qualifiedName": "__function" }, "91": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.valueA" + "qualifiedName": "__object.valueX" }, "92": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.valueB" + "qualifiedName": "__object" }, "93": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.[toStringTag]" + "qualifiedName": "__object.valueZ" }, "94": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.literal" + "qualifiedName": "__object.valueY" }, "95": { "sourceFileName": "src/test/converter/variables/literal.ts", - "qualifiedName": "__object.literal2" + "qualifiedName": "__function" }, "96": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__function" }, "97": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "myConst" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "z" }, "98": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "myLet" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__object" }, "99": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "myVar" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__object.a" }, "100": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "x" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__object.b" }, "101": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "y" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__object.valueA" }, "102": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "z" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__object.valueA" }, "103": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "satisfies" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__object.valueB" }, "104": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "__object" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__object.[toStringTag]" }, "105": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "__object.a" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__object.literal" }, "106": { - "sourceFileName": "src/test/converter/variables/variable.ts", - "qualifiedName": "__object.b" + "sourceFileName": "src/test/converter/variables/literal.ts", + "qualifiedName": "__object.literal2" } }, "files": { @@ -2687,7 +2687,7 @@ "1": 1, "2": 15, "3": 34, - "4": 96 + "4": 74 } } } diff --git a/src/test/converter/variables/specs.nodoc.json b/src/test/converter/variables/specs.nodoc.json index 6c0cc6c64..0210753ef 100644 --- a/src/test/converter/variables/specs.nodoc.json +++ b/src/test/converter/variables/specs.nodoc.json @@ -408,7 +408,7 @@ "flags": {}, "children": [ { - "id": 74, + "id": 85, "name": "objectLiteral", "variant": "declaration", "kind": 32, @@ -434,14 +434,14 @@ "type": { "type": "reflection", "declaration": { - "id": 75, + "id": 86, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 93, + "id": 104, "name": "[toStringTag]", "variant": "declaration", "kind": 1024, @@ -461,7 +461,7 @@ "defaultValue": "\"computed\"" }, { - "id": 94, + "id": 105, "name": "literal", "variant": "declaration", "kind": 1024, @@ -481,7 +481,7 @@ "defaultValue": "true" }, { - "id": 95, + "id": 106, "name": "literal2", "variant": "declaration", "kind": 1024, @@ -501,7 +501,7 @@ "defaultValue": "true" }, { - "id": 91, + "id": 102, "name": "valueA", "variant": "declaration", "kind": 1024, @@ -521,7 +521,7 @@ "defaultValue": "100" }, { - "id": 92, + "id": 103, "name": "valueB", "variant": "declaration", "kind": 1024, @@ -541,7 +541,7 @@ "defaultValue": "true" }, { - "id": 80, + "id": 91, "name": "valueX", "variant": "declaration", "kind": 1024, @@ -557,14 +557,14 @@ "type": { "type": "reflection", "declaration": { - "id": 81, + "id": 92, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 90, + "id": 101, "name": "valueA", "variant": "declaration", "kind": 1024, @@ -587,7 +587,7 @@ "defaultValue": "..." }, { - "id": 83, + "id": 94, "name": "valueY", "variant": "declaration", "kind": 1024, @@ -603,7 +603,7 @@ "type": { "type": "reflection", "declaration": { - "id": 84, + "id": 95, "name": "__type", "variant": "declaration", "kind": 65536, @@ -618,7 +618,7 @@ ], "signatures": [ { - "id": 85, + "id": 96, "name": "__type", "variant": "signature", "kind": 4096, @@ -633,7 +633,7 @@ ], "parameters": [ { - "id": 86, + "id": 97, "name": "z", "variant": "param", "kind": 32768, @@ -647,14 +647,14 @@ "type": { "type": "reflection", "declaration": { - "id": 87, + "id": 98, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 88, + "id": 99, "name": "a", "variant": "declaration", "kind": 1024, @@ -674,7 +674,7 @@ "defaultValue": "\"test\"" }, { - "id": 89, + "id": 100, "name": "b", "variant": "declaration", "kind": 1024, @@ -698,8 +698,8 @@ { "title": "Properties", "children": [ - 88, - 89 + 99, + 100 ] } ], @@ -720,7 +720,7 @@ "defaultValue": "..." }, { - "id": 82, + "id": 93, "name": "valueZ", "variant": "declaration", "kind": 1024, @@ -744,9 +744,9 @@ { "title": "Properties", "children": [ - 90, - 83, - 82 + 101, + 94, + 93 ] } ], @@ -763,7 +763,7 @@ "defaultValue": "..." }, { - "id": 77, + "id": 88, "name": "valueY", "variant": "declaration", "kind": 1024, @@ -779,7 +779,7 @@ "type": { "type": "reflection", "declaration": { - "id": 78, + "id": 89, "name": "__type", "variant": "declaration", "kind": 65536, @@ -794,7 +794,7 @@ ], "signatures": [ { - "id": 79, + "id": 90, "name": "__type", "variant": "signature", "kind": 4096, @@ -818,7 +818,7 @@ "defaultValue": "..." }, { - "id": 76, + "id": 87, "name": "valueZ", "variant": "declaration", "kind": 1024, @@ -842,14 +842,14 @@ { "title": "Properties", "children": [ - 93, - 94, - 95, + 104, + 105, + 106, + 102, + 103, 91, - 92, - 80, - 77, - 76 + 88, + 87 ] } ], @@ -1256,7 +1256,7 @@ { "title": "Variables", "children": [ - 74, + 85, 35 ] } @@ -1419,91 +1419,91 @@ "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__type.valueB" }, - "74": { + "85": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "objectLiteral" }, - "75": { + "86": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object" }, - "76": { + "87": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.valueZ" }, - "77": { + "88": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.valueY" }, - "78": { + "89": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__function" }, - "79": { + "90": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__function" }, - "80": { + "91": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.valueX" }, - "81": { + "92": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object" }, - "82": { + "93": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.valueZ" }, - "83": { + "94": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.valueY" }, - "84": { + "95": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__function" }, - "85": { + "96": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__function" }, - "86": { + "97": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "z" }, - "87": { + "98": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object" }, - "88": { + "99": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.a" }, - "89": { + "100": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.b" }, - "90": { + "101": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.valueA" }, - "91": { + "102": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.valueA" }, - "92": { + "103": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.valueB" }, - "93": { + "104": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.[toStringTag]" }, - "94": { + "105": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.literal" }, - "95": { + "106": { "sourceFileName": "src/test/converter/variables/literal.ts", "qualifiedName": "__object.literal2" } diff --git a/src/test/converter2/issues/gh2856.ts b/src/test/converter2/issues/gh2856.ts new file mode 100644 index 000000000..541b51bde --- /dev/null +++ b/src/test/converter2/issues/gh2856.ts @@ -0,0 +1,9 @@ +export namespace A { + export const definedInA = true; + export import definedInB = B.definedInB; // Alias +} + +export namespace B { + export import definedInA = A.definedInA; // Alias + export const definedInB = true; +} diff --git a/src/test/issues.c2.test.ts b/src/test/issues.c2.test.ts index f50c49538..96f0ea6cb 100644 --- a/src/test/issues.c2.test.ts +++ b/src/test/issues.c2.test.ts @@ -1979,4 +1979,14 @@ describe("Issue Tests", () => { ["customMethod"], ); }); + + it("#2856 supports deferring export conversion", () => { + const project = convert(); + + ok(!query(project, "A.definedInA").isReference()); + ok(query(project, "A.definedInB").isReference()); + + ok(query(project, "B.definedInA").isReference()); + ok(!query(project, "B.definedInB").isReference()); + }); });