Working around TS issue in typescript definition