[Wasm] WasmExport implementation

This commit is contained in:
Igor Yakovlev
2023-07-05 12:55:10 +02:00
committed by Space Team
parent 58639951f6
commit b5eafb9eb7
15 changed files with 149 additions and 10 deletions
@@ -11,11 +11,23 @@ package kotlin.wasm
*
* Can only be used on top-level external functions.
*
* In JavaScript environment,
* function will be imported from ES module without type adapters.
* The annotated function will be imported into Wasm module without type adapters.
*/
@Target(AnnotationTarget.FUNCTION)
public annotation class WasmImport(
val module: String,
val name: String = ""
)
/**
* Exports a function with the given optional [name].
* The declaration name will be used if the [name] argument is not provided.
*
* Can only be used on top-level non-external functions.
*
* The annotated function will be exported from Wasm module without type adapters.
*/
@Target(AnnotationTarget.FUNCTION)
public annotation class WasmExport(
val name: String = ""
)