Repro
export class Foo {
constructor(
public one?: () => void,
protected two?: () => void,
private three?: () => void,
) {}
}
playground
Expected
export declare class Foo {
one?: (() => void) | undefined;
protected two?: (() => void) | undefined;
private three?;
constructor(one?: (() => void) | undefined, two?: (() => void) | undefined, three?: (() => void) | undefined);
}
TS playground
Actual
export declare class Foo {
one?: () => void | undefined;
protected two?: () => void | undefined;
private three?;
constructor(one?: () => void | undefined, two?: () => void | undefined, three?: () => void | undefined);
}
Note that none of the function types were wrapped with parentheses -- which causes the type to change from (() => void) | undefined to () => (void | undefined).