title: Getting the enum key with the value string (reverse mapping) in TypeScript
body: <p>I have an enum:</p>
  
  <pre><code>export enum ApiMessages {
      logged_ok = 'Logged OK',
      register_ok = 'Register OK'
  }
  </code></pre>
  
  <p>I have a function with the enum as a parameter:</p>
  
  <pre><code>export function responseOK(message: ApiMessages, result ?: any): ApiResponse {
      return {
          "status": "ok",
          "code": 200,
          "messageId": ApiMessages[message], &lt;-- KO TS7015
          "message": message,
          "result": result
      };
  }
  </code></pre>
  
  <p>I am calling the function like that:</p>
  
  <pre><code>responseOK(ApiMessages.logged_ok, {user: userRes})
  </code></pre>
  
  <p>I am trying to return the enum key and the enum string value to the response but I get the TS error:</p>
  
  <blockquote>
    <p>TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.</p>
  </blockquote>
  
  <p>I have strict TypeScript config. Adding suppressImplicitAnyIndexErrors is not an option.</p>
  
  <p><strong>TypeScript version: 2.9.2</strong></p>