Skip to content

Inline function types incorrectly formatted when inside an array or union type alias #2892

Closed
@Blackbaud-SteveBrush

Description

@Blackbaud-SteveBrush

Search terms

type alias, function, closure, union, array, formatting

Expected Behavior

Given the following type aliases...

export type FunUnion = (() => boolean) | string;

export type FunArray = (() => boolean)[];

I would expect the types' output to match (() => boolean)[] and (() => boolean) | string.

Actual Behavior

TypeDoc outputs the types as () => boolean[] and () => boolean | string (removes the parenthesis, which results in invalid types).

Steps to reproduce the bug

Clone the following (minimal) repo: https://github.com/Blackbaud-SteveBrush/typedoc-playground

Run npm install && node ./run-typedoc.mjs and observe the output.

TypeDoc: 0.28.0-beta.2
TypeScript: 5.7.3
OS: Mac, Sequoia

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions