diff --git a/kmath-ast/src/jsMain/kotlin/Base64/base64.kt b/kmath-ast/src/jsMain/kotlin/base64.kt similarity index 84% rename from kmath-ast/src/jsMain/kotlin/Base64/base64.kt rename to kmath-ast/src/jsMain/kotlin/base64.kt index 540cf9299..6f25dffef 100644 --- a/kmath-ast/src/jsMain/kotlin/Base64/base64.kt +++ b/kmath-ast/src/jsMain/kotlin/base64.kt @@ -1,10 +1,17 @@ @file:Suppress( - "INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", - "CONFLICTING_OVERLOADS", "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation", "ClassName", - "SpellCheckingInspection", "PackageName" + "INTERFACE_WITH_SUPERCLASS", + "OVERRIDING_FINAL_MEMBER", + "RETURN_TYPE_MISMATCH_ON_OVERRIDE", + "CONFLICTING_OVERLOADS", + "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", + "KDocMissingDocumentation", + "ObjectPropertyName", + "ClassName", + "PackageDirectoryMismatch", + "PackageName", ) @file:JsModule("js-base64") -@file:JsNonModule + package Base64 import org.khronos.webgl.Uint8Array @@ -64,4 +71,4 @@ external object gBase64 { var extendString: () -> Unit var extendUint8Array: () -> Unit var extendBuiltins: () -> Unit -} \ No newline at end of file +} diff --git a/kmath-ast/src/jsMain/kotlin/index.binaryen.kt b/kmath-ast/src/jsMain/kotlin/index.binaryen.kt index e75bfdd85..e28289b0f 100644 --- a/kmath-ast/src/jsMain/kotlin/index.binaryen.kt +++ b/kmath-ast/src/jsMain/kotlin/index.binaryen.kt @@ -8,12 +8,11 @@ "KDocMissingDocumentation", "PropertyName", "ClassName", - "SortModifiers", - "SpellCheckingInspection", ) @file:JsModule("binaryen") @file:JsNonModule + package binaryen import org.khronos.webgl.Uint8Array @@ -1649,7 +1648,7 @@ external interface `T$27` { var sourceMap: String? } -external open class Module { +open external class Module { open var ptr: Number open fun block(label: String, children: Array, resultType: Type = definedExternally): ExpressionRef open fun `if`( @@ -2222,7 +2221,7 @@ external fun setOneCallerInlineMaxSize(size: Number) external fun exit(status: Number) -external open class Relooper(module: Module) { +open external class Relooper(module: Module) { open fun addBlock(expression: ExpressionRef): RelooperBlockRef open fun addBranch(from: RelooperBlockRef, to: RelooperBlockRef, condition: ExpressionRef, code: ExpressionRef) open fun addBlockWithSwitch(code: ExpressionRef, condition: ExpressionRef): RelooperBlockRef @@ -2234,4 +2233,4 @@ external open class Relooper(module: Module) { ) open fun renderAndDispose(entry: RelooperBlockRef, labelHelper: Number): ExpressionRef -} \ No newline at end of file +} diff --git a/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt b/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt index ef2ed210b..b5fed4e11 100644 --- a/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt +++ b/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt @@ -4,6 +4,8 @@ import kscience.kmath.expressions.Expression import kscience.kmath.expressions.StringSymbol import kscience.kmath.operations.* +private val spreader = eval("(obj, args) => obj(...args)") + public fun compileMstToWasmF64(mst: MST): Expression { val keys = mutableListOf() @@ -75,7 +77,6 @@ public fun compileMstToWasmF64(mst: MST): Expression { return Expression { args -> val params = keys.map { StringSymbol(it) }.map { args.getValue(it) }.toTypedArray() - val spreader = eval("(obj, args) => obj(...args)") spreader(i.exports.asDynamic().executable, params) as Double } } diff --git a/kmath-ast/src/jsMain/kotlin/lib.dom.WebAssembly.module_dukat.kt b/kmath-ast/src/jsMain/kotlin/lib.dom.WebAssembly.module_dukat.kt index 01b4b9674..e2a1342b8 100644 --- a/kmath-ast/src/jsMain/kotlin/lib.dom.WebAssembly.module_dukat.kt +++ b/kmath-ast/src/jsMain/kotlin/lib.dom.WebAssembly.module_dukat.kt @@ -1,8 +1,16 @@ @file:JsQualifier("WebAssembly") -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", - "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation", "PackageDirectoryMismatch", "PackageName", - "Reformat", "ClassName", "SortModifiers" + +@file:Suppress( + "INTERFACE_WITH_SUPERCLASS", + "OVERRIDING_FINAL_MEMBER", + "RETURN_TYPE_MISMATCH_ON_OVERRIDE", + "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", + "KDocMissingDocumentation", + "PackageDirectoryMismatch", + "PackageName", + "ClassName", ) + package WebAssembly import org.khronos.webgl.ArrayBuffer @@ -132,7 +140,10 @@ external fun compileStreaming(source: Response): Promise external fun compileStreaming(source: Promise): Promise -external fun instantiate(bytes: ArrayBufferView, importObject: Imports = definedExternally): Promise +external fun instantiate( + bytes: ArrayBufferView, + importObject: Imports = definedExternally +): Promise external fun instantiate(bytes: ArrayBufferView): Promise @@ -144,11 +155,17 @@ external fun instantiate(moduleObject: Module, importObject: Imports = definedEx external fun instantiate(moduleObject: Module): Promise -external fun instantiateStreaming(response: Response, importObject: Imports = definedExternally): Promise +external fun instantiateStreaming( + response: Response, + importObject: Imports = definedExternally +): Promise external fun instantiateStreaming(response: Response): Promise -external fun instantiateStreaming(response: PromiseLike, importObject: Imports = definedExternally): Promise +external fun instantiateStreaming( + response: PromiseLike, + importObject: Imports = definedExternally +): Promise external fun instantiateStreaming(response: PromiseLike): Promise @@ -167,7 +184,7 @@ external interface `T$1` { var kind: String } -external open class Module { +open external class Module { constructor(bufferSource: ArrayBuffer) constructor(bufferSource: Uint8Array) @@ -179,18 +196,18 @@ external open class Module { } @JsName("Instance") -external open class Instance(module: Module, importObject: Any = definedExternally) { +open external class Instance(module: Module, importObject: Any = definedExternally) { open var exports: Any } @JsName("Memory") -external open class Memory1(memoryDescriptor: MemoryDescriptor) { +open external class Memory1(memoryDescriptor: MemoryDescriptor) { open var buffer: ArrayBuffer open fun grow(numPages: Number): Number } @JsName("Table") -external open class Table1(tableDescriptor: TableDescriptor) { +open external class Table1(tableDescriptor: TableDescriptor) { open var length: Number open fun get(index: Number): Function<*> open fun grow(numElements: Number): Number diff --git a/kmath-ast/src/jsMain/kotlin/lib.es2015.iterable.kt b/kmath-ast/src/jsMain/kotlin/lib.es2015.iterable.kt index 57fb640dc..761e2e209 100644 --- a/kmath-ast/src/jsMain/kotlin/lib.es2015.iterable.kt +++ b/kmath-ast/src/jsMain/kotlin/lib.es2015.iterable.kt @@ -1,19 +1,9 @@ -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", + "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "PackageDirectoryMismatch", "KDocMissingDocumentation" +) package tsstdlib -import kotlin.js.* -import org.khronos.webgl.* -import org.w3c.dom.* -import org.w3c.dom.events.* -import org.w3c.dom.parsing.* -import org.w3c.dom.svg.* -import org.w3c.dom.url.* -import org.w3c.fetch.* -import org.w3c.files.* -import org.w3c.notifications.* -import org.w3c.performance.* -import org.w3c.workers.* -import org.w3c.xhr.* +import kotlin.js.Promise external interface IteratorYieldResult { var done: Boolean? @@ -51,4 +41,4 @@ external interface PromiseConstructor { fun all(values: Iterable */>): Promise> fun race(values: Iterable): Promise fun race(values: Iterable */>): Promise -} \ No newline at end of file +} diff --git a/kmath-ast/src/jsMain/kotlin/lib.es5.kt b/kmath-ast/src/jsMain/kotlin/lib.es5.kt index 9d0771fa1..9bd4ee9c3 100644 --- a/kmath-ast/src/jsMain/kotlin/lib.es5.kt +++ b/kmath-ast/src/jsMain/kotlin/lib.es5.kt @@ -1,19 +1,13 @@ -@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +@file:Suppress( + "INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", + "PackageDirectoryMismatch", "DEPRECATION", "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation", + "UNUSED_TYPEALIAS_PARAMETER", "PropertyName" +) + package tsstdlib -import kotlin.js.* -import org.khronos.webgl.* -import org.w3c.dom.* -import org.w3c.dom.events.* -import org.w3c.dom.parsing.* -import org.w3c.dom.svg.* -import org.w3c.dom.url.* -import org.w3c.fetch.* -import org.w3c.files.* -import org.w3c.notifications.* -import org.w3c.performance.* -import org.w3c.workers.* -import org.w3c.xhr.* +import org.khronos.webgl.ArrayBuffer +import org.khronos.webgl.Uint8Array external interface FunctionConstructor { @nativeInvoke @@ -28,13 +22,18 @@ external interface ErrorConstructor { } external interface PromiseLike { - fun then(onfulfilled: ((value: T) -> Any?)? = definedExternally, onrejected: ((reason: Any) -> Any?)? = definedExternally): PromiseLike + fun then( + onfulfilled: ((value: T) -> Any?)? = definedExternally, + onrejected: ((reason: Any) -> Any?)? = definedExternally + ): PromiseLike } external interface ArrayLike { var length: Number + @nativeGetter operator fun get(n: Number): T? + @nativeSetter operator fun set(n: Number, value: T) } @@ -51,13 +50,24 @@ external interface ArrayBufferConstructor { } external interface Uint8ArrayConstructor { - fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Uint8Array + fun from( + arrayLike: Iterable, + mapfn: (v: Number, k: Number) -> Number = definedExternally, + thisArg: Any = definedExternally + ): Uint8Array + fun from(arrayLike: Iterable): Uint8Array fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Uint8Array var prototype: Uint8Array var BYTES_PER_ELEMENT: Number fun of(vararg items: Number): Uint8Array fun from(arrayLike: ArrayLike): Uint8Array - fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Uint8Array + + fun from( + arrayLike: ArrayLike, + mapfn: (v: T, k: Number) -> Number, + thisArg: Any = definedExternally + ): Uint8Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Uint8Array -} \ No newline at end of file +} diff --git a/kmath-ast/src/jsMain/kotlin/nonDeclarations.WebAssembly.kt b/kmath-ast/src/jsMain/kotlin/nonDeclarations.WebAssembly.kt index e873001f1..4b8766922 100644 --- a/kmath-ast/src/jsMain/kotlin/nonDeclarations.WebAssembly.kt +++ b/kmath-ast/src/jsMain/kotlin/nonDeclarations.WebAssembly.kt @@ -29,4 +29,4 @@ typealias CompileError1 = Error typealias LinkError1 = Error -typealias RuntimeError1 = Error \ No newline at end of file +typealias RuntimeError1 = Error