org.jetbrains.kotlinx.jupyter.api.AnnotationsHandling.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-jupyter-api Show documentation
Show all versions of kotlin-jupyter-api Show documentation
API for libraries supporting Kotlin Jupyter notebooks
package org.jetbrains.kotlinx.jupyter.api
import kotlin.reflect.KClass
/**
* Callback to handle new class or interface declarations in executed snippets
*/
typealias ClassDeclarationsCallback = KotlinKernelHost.(List>) -> Unit
/**
* Annotation handler used to hook class declarations with specific annotations
*/
class ClassAnnotationHandler(val annotation: KClass, val callback: ClassDeclarationsCallback)
typealias ExecutionCallback = KotlinKernelHost.() -> T
typealias AfterCellExecutionCallback = KotlinKernelHost.(snippetInstance: Any, result: FieldValue) -> Unit
typealias InterruptionCallback = KotlinKernelHost.() -> Unit
typealias FileAnnotationCallback = KotlinKernelHost.(List) -> Unit
class FileAnnotationHandler(val annotation: KClass, val callback: FileAnnotationCallback)