@Artem Kobzar thanks! Do you think it would be a valid feature request?
Example I've got on hands right now:
public class Properties private constructor(private val data: Map<String, String>) {
public companion object {
@JvmStatic
fun decode(string: String): Properties {
...
}
}
}
Will output the following
d.ts
:
class Properties {
private constructor();
static get Companion(): {
decode(string: string): Properties;
};
}
I can see two problems from a JS/TS consumer point of view:
1. What's a "companion"?
2. Why can't I simply
Properties.decode(...)
To workaround the companion issue I'm now using
@JsName("factory")
public companion object Factory {
So it will look good in all platforms, and a JS/TS consumer can use:
Properties.factory().decode(...)