Hello. ~I'm using @JsExport. I need to export an e...
# javascript
a
Hello. I'm using @JsExport. I need to export an enum, so instead of this enum:
Copy code
enum class QuizSearchType {
    WITH_QUIZ,
    WITH_NO_QUIZ
}
apparently the way to do it so you can add the annotation @JsExport is this:
Copy code
@Suppress("NON_EXPORTABLE_TYPE")
@JsExport
object QuizSearchTypeJs {
    val with_quiz = QuizSearchType.WITH_QUIZ
    val with_no_quiz = QuizSearchType.WITH_NO_QUIZ
}
My question is ... I have a method that i need to @JsExport which receives a list of such enums. I can't use
List<QuizSearchType>
, so I guess I'll need to use
Array<QuizSearchTypeJs>
but ... is that right ?! It's an object class with 2 fields inside it ... they're data type is not
QuizSearchTypeJs
... I'm a bit confused.
How should I mark the method's calling parameters so that it will be a list of such "enum" values ?
👀 2