Let's say I've got this method obj.getProperty(key) where the type for each property depends on the specific key.
How can I define the type (specifically in a .d.ts file) so that known keys return defined types, but the rest return unknown?
So basically
interface Obj {
getProperty('foo'): Foo;
getProperty('bar'): Bar;
getProperty(key: string): unknown;
}