Hamza
09/23/2018, 2:01 PMnew
type of a variable?
so for instance, if i have this code:
val discord = require("discord.js")
// how can i declare
val bot = js("new discord.Client();")
without losing type safety, as the new
keyword doesn’t exist. is it in the kotlinjs lib?
omitting the word throws an errorjmhmccr
09/23/2018, 6:44 PMdiscord.Client
or see if the discord package has Typescript information (maybe via "Definitely Typed") you can import via ts2kt: https://kotlinlang.org/docs/tutorials/javascript/working-with-javascript.html#using-ts2kt-to-generate-header-files-for-kotlinjmhmccr
09/23/2018, 6:46 PMHamza
09/23/2018, 11:12 PM