Typescript is throwing an error with functions shared between DOM & NodeJS - Novu