title: Is it possible to use `keyof` operator on literals instead of interfaces?
body: <p>I have an object literal such as the following (all properties are known at compile time):</p>
  
  <pre><code>const foo = {
    "hello": "hola"
  };
  </code></pre>
  
  <p>If <code>foo</code> were an interface rather than a variable, I could easily do something like </p>
  
  <pre><code>/** THEORETICAL ONLY - Does not compile! */
  function translate(input: keyof foo): string {
    return foo[input];
  }
  </code></pre>
  
  <p>However, doing so with a variable does not work, since the compiler cannot find an interface with the name <code>foo</code>.</p>
  
  <p>Does Typescript support <code>keyof</code> operations on object literals whose values are known at compile time?</p>