Cocos Creator 3.0preview1 removed support for Javascript as a scripting language , instead they are now supporting Typescript as the only scripting language used in The Engine editor .
How can i adapt and use the nakama-js client in this version of Cocos , i tried copying the dist folder that contains declaration files so i can use Nakama Typescript types , But i am always getting errors when i run the game (with and without the server running ).
This is the dist folder :
i can do something like
var client : Client = new Client("defaultkey", "127.0.0.1", "7350",false);
Without getting any types errors but when i run the game , i get these error :
Uncaught (in promise) Error: Error loading http://localhost:7456/scripting/assets/nakama/index.js from http://localhost:7456/scripting/assets/scripts/Player.js (SystemJS Error#3 https://git.io/JvFET#3)
at HTMLScriptElement.<anonymous> (script-load.js:69)
You really made this solution better , Thanks to @Okno i was able to replace .d.ts files with the simple .ts files and it works .
You can use only these files without the need of a .js file