aboutsummaryrefslogtreecommitdiff
path: root/kvision-tools/kvision-compiler-plugin
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2020-05-20 22:38:08 +0200
committerRobert Jaros <rjaros@finn.pl>2020-05-20 22:38:08 +0200
commit3f2925996743bb3dba8464f863efe124aba85a51 (patch)
tree368af569a8f6d58e0ca13f75b4bbfa090a1a65ee /kvision-tools/kvision-compiler-plugin
parent18af38d4ac7bbc33a43115c99ed47a586acf6020 (diff)
downloadkvision-3f2925996743bb3dba8464f863efe124aba85a51.tar.gz
kvision-3f2925996743bb3dba8464f863efe124aba85a51.tar.bz2
kvision-3f2925996743bb3dba8464f863efe124aba85a51.zip
Support for request configuration when using remote interfaces.
Diffstat (limited to 'kvision-tools/kvision-compiler-plugin')
-rw-r--r--kvision-tools/kvision-compiler-plugin/src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/kvision-tools/kvision-compiler-plugin/src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt b/kvision-tools/kvision-compiler-plugin/src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt
index 5d5cc514..6a0a0130 100644
--- a/kvision-tools/kvision-compiler-plugin/src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt
+++ b/kvision-tools/kvision-compiler-plugin/src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt
@@ -158,12 +158,14 @@ class KVProcessor : AbstractProcessor() {
appendln("//")
appendln("package $packageName")
appendln()
+ appendln("import pl.treksoft.jquery.JQueryAjaxSettings")
+ appendln("import pl.treksoft.jquery.JQueryXHR")
appendln("import pl.treksoft.kvision.remote.KVRemoteAgent")
getTypes(cl.methods()).sorted().forEach {
appendln("import $it")
}
appendln()
- appendln("actual class $baseName : $iName, KVRemoteAgent<$baseName>(${baseName}Manager) {")
+ appendln("actual class $baseName(beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null) : $iName, KVRemoteAgent<$baseName>(${baseName}Manager, beforeSend) {")
cl.methods().forEach {
val name = it.name
val params = it.allParameters.drop(1)