Dear all,
I am trying to export kotlin files to using it as ts.
However, after build and generate all files (package.json, d.ts and js), error occurred when I try to use d.ts file
Example interface is:
@JsExport
interface AdditionalDataAPI {
fun getAdditionalData(dataType: Int): Any?
fun getAdditionalDataList(dataType: Int): List<*>?
fun getAdditionalDataAsync(dataType: Int, callback: AsyncDataReceiver<*>?)
fun getAdditionalDataListAsync(dataType: Int, callback: AsyncDataReceiver<List<*>?>?)
}
after build, these interface became
export namespace api {
interface AdditionalDataAPI {
getAdditionalData(dataType: number): Nullable<any>;
getAdditionalDataList(dataType: number): Nullable<kotlin.collections.List<any /*UnknownType **/>>;
getAdditionalDataAsync(dataType: number, callback: Nullable<listeners.AsyncDataReceiver<any /*UnknownType **/>>): void;
getAdditionalDataListAsync(dataType: number, callback: Nullable<listeners.AsyncDataReceiver<Nullable<kotlin.collections.List<any /*UnknownType **/>>>>): void;
}
}
Why “Unknown type” shows up ? Why kotlin.collections.List is not recognized ?
Setting in gradle.kts is
js(IR) {
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
}
binaries.library()
}
Thanks for help