undefined type is avoided in function param when it is used with an or operator

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

Search terms

undefined type, function parameters

Expected Behavior

when a param in a function interface has this signature:

failed: (
    job: Job | undefined,
    error: Error,
    prev: string,
  ) => void;

job parameter should appear with both possibilities in our docs, (Job | undefined)

Actual Behavior

undefined type is avoided when the documentation is generated. Only Job appears

Steps to reproduce the bug

Add a param in a function with a similar signature as previous example.


  • Typedoc version:0.23.25
  • TypeScript version:4.9.5
  • Node.js version:14.20.1
  • OS:Ubuntu
Gerrit0 wrote this answer on 2023-03-05

You probably have strictNullChecks turned off - in which case Job | undefined is equivalent to Job according to the compiler. I can't reproduce this with strict turned on. https://github.com/TypeStrong/typedoc-repros/actions/runs/4266319079

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


Issue Title Created Date Updated Date