I've been going through and trying to convert existing projects (from Node.js) to TypeScript.
For context, I'm using the http-status package (https://www.npmjs.com/package/http-status)
I'm trying to pass variables through into their default export, but it's getting an error:
import status = require("http-status");
status.OK; // this works
status["OK"] // this also works
let str = "OK";
status[str]; // error
Error:
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'HttpStatus'.
No index signature with a parameter of type 'string' was found on type 'HttpStatus'.
How would I convert this usage to TypeScript?