OneSignal-Website-SDK
OneSignal-Website-SDK copied to clipboard
Removed global OneSignal any define, added imports
- Correct all OneSignal typing so IDE hints and compile time checks work on the OneSignal object.
- TODOs
- Fix test runtime errors
- Fix
OneSignalSDKWork.jsbloated size- Attempt to use TS 2.9's import() method to import types only
declare var OneSignal: import('OneSignal');
See branch fix_onesignal_any_typing_take2 as another attempt at this by using the new import type TypeScript feature. Unfortunately it comes with a some cavots too. import type isn't enough alone, you also need to add declare var with the type as well.
Considering using the static OneSignal in internal parts of the SDK mean circular references the direction we should take is removing the references instead of making them typed. I recommend these branches just stay around as reference only and fixing the circular reference as the solution here.
Some of this work is already being done as part of User Model in 16.x.x so closing this PR.