khalid64927
12/25/2023, 10:42 AM@JsExport
data class RequestConfig<T>(
val urlPath: String,
val resource: Any? = null,
val postBodyJson: T? = null,
val headerMap: Map<String, String> = emptyMap(),
val postBody: Map<String, String> = emptyMap(),
)
Its complaining about Map not being exportable, although when I generate TS definition files it is as below.
Its simply assigning HeaderMap and postBody type as Any
. Is there any library I can convert that to Map in TS ?
type Nullable<T> = T | null | undefined
export declare namespace com.demo.payments.data.config {
class RequestConfig<T> {
constructor(urlPath: string, resource?: Nullable<any>, postBodyJson?: Nullable<T>, headerMap?: any/* kotlin.collections.Map<string, string> */, postBody?: any/* kotlin.collections.Map<string, string> */);
get urlPath(): string;
get resource(): Nullable<any>;
get postBodyJson(): Nullable<T>;
get headerMap(): any/* kotlin.collections.Map<string, string> */;
get postBody(): any/* kotlin.collections.Map<string, string> */;
copy(urlPath?: string, resource?: Nullable<any>, postBodyJson?: Nullable<T>, headerMap?: any/* kotlin.collections.Map<string, string> */, postBody?: any/* kotlin.collections.Map<string, string> */): com.demo.payments.data.config.RequestConfig<T>;
toString(): string;
hashCode(): number;
equals(other: Nullable<any>): boolean;
}
}
When I look as Kotlin-Wrapper repo it has collection package (https://github.com/JetBrains/kotlin-wrappers/blob/master/kotlin-js/src/jsMain/kotlin/js/collections/JsMap.kt)
Then I wonder why JS platform export dont support this.Adam S
12/25/2023, 12:08 PMArtem Kobzar
12/27/2023, 9:28 AMkhalid64927
12/27/2023, 11:43 AM