Not sure if this is possible but I'd like to write a function where I take in a string and an object.
The type of the second object should contain a property with a name that is the same as the before mentioned string and have a certain type.
E.g.
// No error
someFuncion("foo", {foo: 42})
// Error
someFuncion("foo", {foo: "a string instead of a number"})
someFuncion("foo", {bar: 42})
Can anyone show me what the type signature for this function would be please?
Thanks