microsoft/TypeScript

Object.keys to use keyof

staeke opened this issue · 3 comments

TypeScript Version: 2.1.1

Code
With the latest keyof feature in TypeScript, I'd expect Object.keys() to return them. In code:

interface ObjectConstructor {
  ...
  keys<T>(o: T): Array<keyof T>;
}

you can make a local copy of lib.d.ts then turn off standard definition --noLib from command line or "noLib" from tsconfig.json and then rewrite the local lib.d.ts anyway you want, including a fix to Object.keys

@jwbay thanks. Anders's comment in the other thread makes perfect sense. I'll close this.