https://kotlinlang.org logo
#javascript
Title
# javascript
a

Alexander Sysoev

06/27/2022, 11:28 AM
Hello everyone! Say where is a class defined in
.js
file like this:
Copy code
OuterClass.InnerClass = function(arg1, arg2) { ... } 

export default p5.Element;
How can i write external declaration for it in kotlin, given that i already have OuterClass exported? Should it be like
Copy code
external class OuterClass {
    class InnerClass(arg1: Int, arg2: Int) {}
}
Can it be done outside
OuterClass
class?
b

Big Chungus

06/27/2022, 11:29 AM
It cannot, since external declarations must represent the final shape, not the way it might be achieved in js
a

Alexander Sysoev

06/27/2022, 2:36 PM
thank you!
4 Views