Typescript Type Object Is Not Subscriptable