All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kweb.html.events.EventGenerator.kt Maven / Gradle / Ivy

There is a newer version: 1.4.12
Show newest version
package kweb.html.events

import kotlinx.serialization.json.JsonElement
import kweb.WebBrowser
import java.util.*

// TODO: Code for both event listener functions should be generalized
//       and lifted into this class, paying close attention to
//       any differences between the different implementations.

/**
 * Something that event listeners can be attached to, such as an [kweb.Element] or a [kweb.html.Document]
 */

interface EventGenerator {
    val browser: WebBrowser
    fun addImmediateEventCode(eventName: String, jsCode: String)
    fun addEventListener(eventName: String, returnEventFields: Set = Collections.emptySet(), retrieveJs: String?, preventDefault : Boolean, callback: (JsonElement) -> Unit): T
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy