Császár Ákos
11/23/2023, 12:45 PM@JsModule("@packageScope/packageName")
@JsNonModule
external val window: Window
abstract external class Window {
fun func1(variable1: String): Promise<Response>
fun func2(variable2: String): Promise<Response>
}
When I log out window in kotlin, it will be an empty object.
What is the proper way to do it?Artem Kobzar
11/23/2023, 3:00 PMCsászár Ákos
11/24/2023, 7:36 AMCsászár Ákos
11/24/2023, 8:06 AM@file:JsModule("@packageScope/packageName")
and @file:JsNonModule
annotations and define here the functions, but the problem is that I cant verify the function definitions in the npm package but I know that with what name they are added to window.Császár Ákos
11/24/2023, 8:33 AMCsászár Ákos
11/24/2023, 10:18 AMjs("require('packageScope/packageName)")
i think this is what I was looking for.Artem Kobzar
11/24/2023, 2:09 PMrequire
and import
functions, but not with UMD.Császár Ákos
11/24/2023, 2:16 PMrequire
with UMD?Artem Kobzar
11/24/2023, 2:38 PMrequire
is a function that used only with the tooling that supports commonjs modules (such as Node.js and Webpack)Artem Kobzar
11/24/2023, 2:38 PMrequire
also from ES modules)Artem Kobzar
11/24/2023, 2:39 PMCsászár Ákos
11/24/2023, 2:48 PMCsászár Ákos
11/24/2023, 2:50 PM