Hi everyone, I'm not very skilled with Kotlin Rea...
# react
l
Hi everyone, I'm not very skilled with Kotlin React for now but I was wondering how does the support for npm packages works right now ? Let's say I want to use a pretty complex module like Mantine (core and/or hooks), how easy it is to use it with Kotlin ? I'd guess merely declaring the package won't help much I'd still need "signatures" for all the functions. Do I need to declare manually every single components/hooks or is there a way to save time ?
t
Mantine have fine definitions (like this) and can be converted manually or automatically.
l
Can I group all the .d.ts files and use dukat to convert them ? Is it that simple ?
t
Manual = dukat + manual actions: • Add package • Fix component declarations manually • Remove unused types • New version = repeat action Automatic = simple gradle plugin with string/replace • New version = rerun plugin
l
String/replace ? You mean it could be possible to convert typescript declaration files to kotlin with a simple search and replace ? Sorry if I'm lost here, but I don't get how the automatic way could work
t
l
Ok thanks, I'll try that approach
t
You can use this project as base and add custom type mappings
In Kotlin:
Copy code
val ArrowBody = RClass<ArrowBodyProps>
String union in TS = Enum in Kotlin
l
This is really useful thanks