JS: External class implementing "Comparable"


I’m using js-joda, which is a port of the java8-time API to JavaScript. Unfortunately I cannot compare ZonedDateTimes from it, because it’s an external class, so I can’t let it implement Comparable<ZonedDateTime> even though it does (it has operator fun compareTo(other: ZonedDateTime): Int).

What can I do in this case?

The only way I can see here is to create a non-external wrapper for ZonedDateTimes, which delegates all calls to corresponding external class and also implements Comparable.