-
-
Notifications
You must be signed in to change notification settings - Fork 745
Description
Search terms
type alias link reference declare module
Steps to reproduce the bug
Just tried your fix for #2778, works perfectly. Unrelated to that, though, I did notice another strange behavior regarding links to type aliases:
declare module "bar" {
export interface Bar {}
}
declare module "foo" {
export type Foo = import("bar").Bar;
}
When you generate the docs, the type alias Foo
in module foo
links to the module bar
, instead of directly to the interface Bar
.
(Which also results in a missing reference when using typedoc-plugin-merge-modules
, since, well, the module does not exist anymore as it was merged).
npx typedoc --entryPoints dist/demo.d.ts --out docs-demo
Interestingly, this only happens when using an import type. Importing the symbol first seems to work:
// demo.d.ts
declare module "bar" {
export interface Bar {}
}
declare module "foo" {
import { Bar } from "bar";
export type Foo = Bar;
}
It also seems to happen with declare module "name"
, but not when using separate files bar.ts
and foo.ts
.
Expected Behavior
TypeDoc should link directly to the referenced type.
Actual Behavior
TypeDoc links to the the module containing that type.
Environment
- Typedoc version: 876c690
- TypeScript version: 5.6.3
- Node.js version: v20.18.0
- OS: Linux
6.8.0-35-generic #35-Ubuntu x86_64 x86_64 x86_64 GNU/Linux