Hi,
I want to modify a type alias via module augmentation:
// SomeModule/index.d.ts
export type Bar = { baz: 42 }
// my module
import 'Foo'
declare module 'Foo' {
export type Bar = { qux: 42 } // ❌ duplicate identifier "Bar", also declared in SomeModule/index.d.ts
}
this will cause TS to complain about Bar being a duplicate identifier. I found one workaround that refers to a GH issue from 2018 and assumes you can modify the original type definition and work in interfaces instead of type aliases. Is there another approach that does not require me to modify the original module?
Augmenting type aliases, even if it is not allowed, in TypeScript.