1

I know that this is not best practice but I dont have a choice. The project I am working on has had its own moment typings file for a long time and it is now causing issues. Moment now provides its own typing file which I want to use, but I need to keep it global. How do I do this please?

I have tried just editing our moment.d.ts file inline with suggestions here [TypeScript: How can I make an existing namespace global? which didnt work with an error of 'moment refers to a UMD global, but the current file is a module'.

I have also tried editing the typescript config file to simply 'include' the the node module d.ts file but this gave me a no inputs were found in config file error.

Craig
  • 1,648
  • 1
  • 20
  • 45

1 Answers1

1

Solved this by creating a new global custom typing and a global value cosponsoring which is a separate moment instance. Super hacky and very temporary but works for now...

Craig
  • 1,648
  • 1
  • 20
  • 45
  • I've run into the same issue as you described in your original question that you solved. Would you mind posting a sort snippet of code that you used to create a new global typing and global value in a separate moment instance? – Chason Arthur Feb 19 '19 at 04:01
  • 1
    sorry but I dont remember and dont have access to the code now - i should have posted the snippets. still i hope this helps you in the right direction – Craig Feb 19 '19 at 09:17
  • 1
    I think most likely i created the global custom typing - which you can find docs on - and then created a new singleton instance inferred as that type. – Craig Feb 19 '19 at 09:18