-
I defined a type like so in a file called "types.d.mts": export interface Thing {
foo: number;
bar: string;
} In a javascript file, I imported it using the relatively new /**
* @import {Thing} from "./types.mjs";
*/
class MyClass {
/**
* A thing.
* @type {Thing}
*/
thing = {foo: 0, bar: ""};
} VSCode picks it up just fine: But typedoc doesn't generate Is this a feature gap, or are there certain steps necessary to follow? compilerOptions: {
"strict": true,
"allowJs": true,
"checkJs": false,
"declaration": true,
"emitDeclarationOnly": true,
"lib": ["DOM", "ES2023"],
"module": "NodeNext",
"moduleResolution": "nodenext",
"target": "ESNext",
"outDir": "./_dts",
"skipLibCheck": true,
"baseUrl": "."
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
TypeDoc documents your exports. While you have imported the interface there, you have not exported it from your entry point, so typedoc won't document it. This is working as intended. TypeScript lacks an
|
Beta Was this translation helpful? Give feedback.
TypeDoc documents your exports. While you have imported the interface there, you have not exported it from your entry point, so typedoc won't document it. This is working as intended.
TypeScript lacks an
@export
tag that you could use to do this easily (microsoft/TypeScript#60831), so TypeDoc supports handling@typedef
tags which "look like" re-exports as re-exports.@typedef {import("./types.mjs").Thing} Thing