From 3f2925996743bb3dba8464f863efe124aba85a51 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Wed, 20 May 2020 22:38:08 +0200 Subject: Support for request configuration when using remote interfaces. --- .../src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kvision-tools/kvision-compiler-plugin/src') 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) -- cgit