How do I define a Kotlin external class/function for a Javascript method that uses rest parameters?
I’m looking at D1PreparedStatement bind with this Javascript signature:
Copy code
bind(...values: unknown[]): D1PreparedStatement;
I’ve tried this in Kotlin:
Copy code
external interface PreparedStatement {
fun bind(vararg params: dynamic): PreparedStatement
}
But that doesn’t seem to be correct, emitting the error “Type ‘object’ not supported for value ‘asdf’“.
t
turansky
02/03/2024, 6:55 PM
In definitions it's class as I see
turansky
02/03/2024, 6:57 PM
'bind` signature looks fine, except
dynamic
usage
c
Carter
02/03/2024, 7:01 PM
What should the type argument be?
t
turansky
02/03/2024, 7:05 PM
Any?
- Kotlin alias for
unknown
c
Carter
02/03/2024, 10:04 PM
Changing the type to Any? got it working 🦜
Thank you!