typedoc can't export type by ```export default ...``` reference

This issue has been tracked since 2023-02-03.

Search terms

export default

Describe

case 1: when exist default export ..., the type of fn can't be export. (The result is not expected.)

entryPoints

//index.exportByWrapInDefault.ts
export * from "./utils/index";

import * as utils from "./utils"
export default { ...utils };

typedoc actual result

The type of fn cann't be export.
image

case 2 : when remove default export, the type of fn can be export. ( The result is expected.)

entryPoints

//index.export.ts
export * from "./utils/index";

typedoc actual result

image
image

Demo

  • run case 1 npm run doc-existDefaultExport
  • run case 2 npm run doc-noDefaultExport

Environment

  • Typedoc version: 0.23.24
  • TypeScript version: 4.9.5
  • Node.js version: 14.18.1
  • OS: win 10
Gerrit0 wrote this answer on 2023-02-04

This is an unfortunate interaction, but is working as designed. TypeDoc converts re-exports after exports since it produces better results for the majority of projects... however, because you introduced a default export, that's not a re-export and is converted first. If you export default utils instead of export default { ...utils } the result is better.

It might be worth experimenting with always converting default exports last...

More Details About Repo
Owner Name TypeStrong
Repo Name typedoc
Full Name TypeStrong/typedoc
Language TypeScript
Created Date 2014-05-24
Updated Date 2023-03-19
Star Count 6487
Watcher Count 68
Fork Count 639
Issue Count 48

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date