Closed
Description
I have an interface that is supposed to have a function signature of:
(param: {prop: boolean}): any
but I forget the parameter name (I'm not sure if this signature is considered valid):
({prop: boolean}): any
When compiling this invalid interface with the --declaration
flag, an invalid .d.ts
file results:
/* foo.ts */
export interface SomeInterface {
({prop: boolean}): any
}
tsc foo.ts --module commonjs --declaration
/* foo.d.ts */
export interface SomeInterface {
({prop: }: {
prop: any;
}): any;
}
If parameter names are optional, this should produce a valid .d.ts
file. If parameter names are required, tsc
should throw an error, or at least warn me that there is an issue.