I pulled in jQuery to use in my project using ts2kt. The basics work fine, however, I can't figure out how to call this function (I just want to pass a single callback to it):
fun done(doneCallback1: JQueryPromiseCallback<T>? = definedExternally /* null */,
vararg doneCallbackN: JQueryPromiseCallback<T>): JQueryPromise<T>
The JQueryPromiseCallback
interface looks like this:
external interface JQueryPromiseCallback<T> {
@nativeInvoke
operator fun invoke(value: T? = definedExternally, vararg args: Any)
}
I tried creating an instance of it to pass in like this:
done(object : JQueryPromiseCallback<Any> {
override fun invoke(value: Any?, vararg args: Any) {
}
})
However, I'm getting an error on the invoke function:
Overriding 'external' function with optional parameters`
The @nativeInvoke
annotation that was generated is also deprecated, and gives me a deprecation message that I can't figure out:
Use inline extension function with body using dynamic
Am I supposed to correct the file that ts2kt generated? If so, how? Do I just not have the syntax for overriding the invoke
method right?