News for hackers. Stuff that matters.
Re:Announcing TypeScript 2.1 by ng12 on Wednesday December 07, 2016 @02:13PM (#13125268)
Simple example: keyof allows you to safely describe objects which only partially fit an interface.

  interface Values {
    foo: string,
    // etc...
  }

  let keys: keyOf Values

  function initialize(defaults: {[key: keys]: string}) {...}
Now the defaults object can only contain valid keys from Values.

There are no comments on this comment yet.