Hi, if I mark a file as `@file:JsModule`, how can ...
# javascript
a
Hi, if I mark a file as
@file:JsModule
, how can I declare an non-external interface (an external function return an object without external interface so I created a local interface) ?
t
What is “object without external interface”?
a
In TypeScript I have a library of which I'm creating typings in Kotlin, and in one of the function the return type is
Copy code
{
    program: Shader,
    uniforms: Uniform[]
}
They didn't used an interface, so I want to create one for the function, but when I create it in my file with
@file:JsModule
it says that I can't declare non-external things in an external file
t
Copy code
{
    program: Shader,
    uniforms: Uniform[]
}
it’s TS type or
external interface
in Kotlin/JS
a
Yeah but I mean, how/where do I create the interface ? Do I have to create it in an other file without
@file:JsModule
?
t
external interface
can be created in same file
external interface
not affected by
@JsModule
without magic
@Suppresses
🙂
a
Okay, but it's not an external interface here, the library doesn't use an interface, so I want a non-external interface
t
it’s not an external interface here
Sure?
Non-external = created by Kotlin/JS (class)
a
Oh I see okay