Why does Object.keys({ ... }) return a value of type string[] and not Array<keyof T>?

Consider the simple Point interface, and function f that operates on keyof Point (i.e. either "x" or "y") as a parameter.

Now suppose I create a new point NamedPoint which extends the Point interface.

Was this page helpful?