From 1f50f326ad74da21d095ebb940ff44d04af24f3a Mon Sep 17 00:00:00 2001 From: xieziang Date: Wed, 9 Jul 2025 00:12:50 +0800 Subject: [PATCH] update from mirror Signed-off-by: xieziang Change-Id: I18ef57b210bb32375695bc60aed3dbe70e4b445e --- .../common/dist/bridges/ohos/chai/index.d.ts | 56 - .../common/dist/bridges/ohos/chai/index.js | 2 +- .../common/dist/bridges/ohos/index.d.ts | 19 - .../koalaui/common/dist/bridges/ohos/index.js | 2 +- .../common/dist/bridges/ohos/mocha/index.d.ts | 17 - .../common/dist/bridges/ohos/mocha/index.js | 2 +- .../koalaui/common/dist/lib/src/Errors.d.ts | 15 - .../common/dist/lib/src/Errors.d.ts.map | 1 + .../koalaui/common/dist/lib/src/Errors.js | 2 +- .../koalaui/common/dist/lib/src/Errors.js.map | 1 + .../common/dist/lib/src/Finalization.d.ts | 15 - .../common/dist/lib/src/Finalization.d.ts.map | 1 + .../common/dist/lib/src/Finalization.js | 2 +- .../common/dist/lib/src/Finalization.js.map | 1 + .../common/dist/lib/src/KoalaProfiler.d.ts | 15 - .../dist/lib/src/KoalaProfiler.d.ts.map | 1 + .../common/dist/lib/src/KoalaProfiler.js | 2 +- .../common/dist/lib/src/KoalaProfiler.js.map | 1 + .../common/dist/lib/src/LifecycleEvent.d.ts | 15 - .../dist/lib/src/LifecycleEvent.d.ts.map | 1 + .../common/dist/lib/src/LifecycleEvent.js | 2 +- .../common/dist/lib/src/LifecycleEvent.js.map | 1 + .../common/dist/lib/src/MarkableQueue.d.ts | 16 +- .../dist/lib/src/MarkableQueue.d.ts.map | 1 + .../common/dist/lib/src/MarkableQueue.js | 2 +- .../common/dist/lib/src/MarkableQueue.js.map | 1 + .../koalaui/common/dist/lib/src/Matrix33.d.ts | 15 - .../common/dist/lib/src/Matrix33.d.ts.map | 1 + .../koalaui/common/dist/lib/src/Matrix33.js | 4 +- .../common/dist/lib/src/Matrix33.js.map | 1 + .../koalaui/common/dist/lib/src/Matrix44.d.ts | 15 - .../common/dist/lib/src/Matrix44.d.ts.map | 1 + .../koalaui/common/dist/lib/src/Matrix44.js | 2 +- .../common/dist/lib/src/Matrix44.js.map | 1 + .../common/dist/lib/src/PerfProbe.d.ts | 30 +- .../common/dist/lib/src/PerfProbe.d.ts.map | 1 + .../koalaui/common/dist/lib/src/PerfProbe.js | 18 +- .../common/dist/lib/src/PerfProbe.js.map | 1 + .../koalaui/common/dist/lib/src/Point.d.ts | 15 - .../common/dist/lib/src/Point.d.ts.map | 1 + .../koalaui/common/dist/lib/src/Point.js | 2 +- .../koalaui/common/dist/lib/src/Point.js.map | 1 + .../koalaui/common/dist/lib/src/Point3.d.ts | 15 - .../common/dist/lib/src/Point3.d.ts.map | 1 + .../koalaui/common/dist/lib/src/Point3.js | 2 +- .../koalaui/common/dist/lib/src/Point3.js.map | 1 + .../koalaui/common/dist/lib/src/Unique.d.ts | 77 + .../common/dist/lib/src/Unique.d.ts.map | 1 + .../koalaui/common/dist/lib/src/Unique.js | 309 ++ .../koalaui/common/dist/lib/src/Unique.js.map | 1 + .../koalaui/common/dist/lib/src/index.d.ts | 17 +- .../common/dist/lib/src/index.d.ts.map | 1 + .../koalaui/common/dist/lib/src/index.js | 9 +- .../koalaui/common/dist/lib/src/index.js.map | 1 + .../koalaui/common/dist/lib/src/koalaKey.d.ts | 16 - .../common/dist/lib/src/koalaKey.d.ts.map | 1 + .../koalaui/common/dist/lib/src/koalaKey.js | 2 +- .../common/dist/lib/src/koalaKey.js.map | 1 + .../koalaui/common/dist/lib/src/math.d.ts | 15 - .../koalaui/common/dist/lib/src/math.d.ts.map | 1 + .../koalaui/common/dist/lib/src/math.js | 2 +- .../koalaui/common/dist/lib/src/math.js.map | 1 + .../koalaui/common/dist/lib/src/sha1.d.ts | 15 - .../koalaui/common/dist/lib/src/sha1.d.ts.map | 1 + .../koalaui/common/dist/lib/src/sha1.js | 5 +- .../koalaui/common/dist/lib/src/sha1.js.map | 1 + .../common/dist/lib/src/stringUtils.d.ts | 15 - .../common/dist/lib/src/stringUtils.d.ts.map | 1 + .../common/dist/lib/src/stringUtils.js | 2 +- .../common/dist/lib/src/stringUtils.js.map | 1 + .../koalaui/common/dist/lib/src/uniqueId.d.ts | 15 - .../common/dist/lib/src/uniqueId.d.ts.map | 1 + .../koalaui/common/dist/lib/src/uniqueId.js | 2 +- .../common/dist/lib/src/uniqueId.js.map | 1 + .../common/dist/lib/tsconfig.tsbuildinfo | 1 + koala-wrapper/koalaui/common/oh-package.json5 | 50 - koala-wrapper/koalaui/common/src/Errors.ts | 31 - .../koalaui/common/src/Finalization.ts | 40 - .../koalaui/common/src/KoalaProfiler.ts | 190 -- .../koalaui/common/src/MarkableQueue.ts | 112 - koala-wrapper/koalaui/common/src/Matrix33.ts | 86 - koala-wrapper/koalaui/common/src/Matrix44.ts | 381 --- koala-wrapper/koalaui/common/src/PerfProbe.ts | 431 --- koala-wrapper/koalaui/common/src/Point.ts | 76 - koala-wrapper/koalaui/common/src/Point3.ts | 53 - koala-wrapper/koalaui/common/src/index.ts | 56 - koala-wrapper/koalaui/common/src/koalaKey.ts | 30 - koala-wrapper/koalaui/common/src/math.ts | 97 - koala-wrapper/koalaui/common/src/sha1.ts | 353 -- .../koalaui/common/src/stringUtils.ts | 29 - koala-wrapper/koalaui/common/src/uniqueId.ts | 62 - koala-wrapper/koalaui/compat/README.md | 4 - .../koalaui/compat/dist/src/index.d.ts | 16 +- .../koalaui/compat/dist/src/index.d.ts.map | 1 + .../koalaui/compat/dist/src/index.js | 11 +- .../koalaui/compat/dist/src/index.js.map | 1 + .../compat/dist/src/typescript/array.d.ts | 15 - .../compat/dist/src/typescript/array.d.ts.map | 1 + .../compat/dist/src/typescript/array.js | 2 +- .../compat/dist/src/typescript/array.js.map | 1 + .../compat/dist/src/typescript/atomic.d.ts | 16 +- .../dist/src/typescript/atomic.d.ts.map | 1 + .../compat/dist/src/typescript/atomic.js | 2 +- .../compat/dist/src/typescript/atomic.js.map | 1 + .../compat/dist/src/typescript/double.d.ts | 21 - .../dist/src/typescript/finalization.d.ts | 15 - .../dist/src/typescript/finalization.d.ts.map | 1 + .../dist/src/typescript/finalization.js | 2 +- .../dist/src/typescript/finalization.js.map | 1 + .../compat/dist/src/typescript/index.d.ts | 17 +- .../compat/dist/src/typescript/index.d.ts.map | 1 + .../compat/dist/src/typescript/index.js | 4 +- .../compat/dist/src/typescript/index.js.map | 1 + .../dist/src/typescript/observable.d.ts | 15 - .../dist/src/typescript/observable.d.ts.map | 1 + .../compat/dist/src/typescript/observable.js | 120 +- .../dist/src/typescript/observable.js.map | 1 + .../dist/src/typescript/performance.d.ts | 15 - .../dist/src/typescript/performance.d.ts.map | 1 + .../compat/dist/src/typescript/performance.js | 2 +- .../dist/src/typescript/performance.js.map | 1 + .../compat/dist/src/typescript/primitive.d.ts | 11 + .../dist/src/typescript/primitive.d.ts.map | 1 + .../typescript/{double.js => primitive.js} | 27 +- .../dist/src/typescript/primitive.js.map | 1 + .../dist/src/typescript/prop-deep-copy.d.ts | 15 - .../src/typescript/prop-deep-copy.d.ts.map | 1 + .../dist/src/typescript/prop-deep-copy.js | 2 +- .../dist/src/typescript/prop-deep-copy.js.map | 1 + .../dist/src/typescript/reflection.d.ts | 15 - .../dist/src/typescript/reflection.d.ts.map | 1 + .../compat/dist/src/typescript/reflection.js | 7 +- .../dist/src/typescript/reflection.js.map | 1 + .../compat/dist/src/typescript/strings.d.ts | 15 - .../dist/src/typescript/strings.d.ts.map | 1 + .../compat/dist/src/typescript/strings.js | 2 +- .../compat/dist/src/typescript/strings.js.map | 1 + .../dist/src/typescript/ts-reflection.d.ts | 15 - .../src/typescript/ts-reflection.d.ts.map | 1 + .../dist/src/typescript/ts-reflection.js | 2 +- .../dist/src/typescript/ts-reflection.js.map | 1 + .../compat/dist/src/typescript/types.d.ts | 15 - .../compat/dist/src/typescript/types.d.ts.map | 1 + .../compat/dist/src/typescript/types.js | 2 +- .../compat/dist/src/typescript/types.js.map | 1 + .../compat/dist/src/typescript/utils.d.ts | 19 +- .../compat/dist/src/typescript/utils.d.ts.map | 1 + .../compat/dist/src/typescript/utils.js | 22 +- .../compat/dist/src/typescript/utils.js.map | 1 + .../koalaui/compat/src/arkts/array.ts | 58 - .../koalaui/compat/src/arkts/atomic.ts | 41 - .../koalaui/compat/src/arkts/double.ts | 33 - .../koalaui/compat/src/arkts/finalization.ts | 31 - .../koalaui/compat/src/arkts/index.ts | 27 - .../koalaui/compat/src/arkts/observable.ts | 311 -- .../koalaui/compat/src/arkts/performance.ts | 30 - .../koalaui/compat/src/arkts/reflection.ts | 22 - .../koalaui/compat/src/arkts/strings.ts | 214 -- .../koalaui/compat/src/arkts/ts-reflection.ts | 38 - .../koalaui/compat/src/arkts/types.ts | 25 - koala-wrapper/koalaui/compat/src/index.ts | 56 - .../koalaui/compat/src/ohos/index.ts | 59 - .../koalaui/compat/src/ohos/performance.ts | 30 - .../koalaui/compat/src/typescript/Types.d.ts | 19 - .../koalaui/compat/src/typescript/array.ts | 36 - .../koalaui/compat/src/typescript/atomic.ts | 40 - .../koalaui/compat/src/typescript/double.ts | 32 - .../compat/src/typescript/finalization.ts | 43 - .../koalaui/compat/src/typescript/index.ts | 27 - .../compat/src/typescript/observable.ts | 404 --- .../compat/src/typescript/performance.ts | 30 - .../compat/src/typescript/prop-deep-copy.ts | 95 - .../compat/src/typescript/reflection.ts | 20 - .../koalaui/compat/src/typescript/strings.ts | 205 -- .../compat/src/typescript/ts-reflection.ts | 35 - .../koalaui/compat/src/typescript/types.ts | 25 - .../koalaui/compat/src/typescript/utils.ts | 18 - .../dist/lib/src/arkts/ResourceManager.d.ts | 24 +- .../lib/src/arkts/ResourceManager.d.ts.map | 1 + .../dist/lib/src/arkts/ResourceManager.js | 31 +- .../dist/lib/src/arkts/ResourceManager.js.map | 1 + .../lib/src/interop/DeserializerBase.d.ts | 28 +- .../lib/src/interop/DeserializerBase.d.ts.map | 1 + .../dist/lib/src/interop/DeserializerBase.js | 34 +- .../lib/src/interop/DeserializerBase.js.map | 1 + .../dist/lib/src/interop/Finalizable.d.ts | 15 - .../dist/lib/src/interop/Finalizable.d.ts.map | 1 + .../dist/lib/src/interop/Finalizable.js | 6 +- .../dist/lib/src/interop/Finalizable.js.map | 1 + .../lib/src/interop/InteropNativeModule.d.ts | 37 +- .../src/interop/InteropNativeModule.d.ts.map | 1 + .../lib/src/interop/InteropNativeModule.js | 11 +- .../src/interop/InteropNativeModule.js.map | 1 + .../dist/lib/src/interop/InteropOps.d.ts | 15 - .../dist/lib/src/interop/InteropOps.d.ts.map | 1 + .../dist/lib/src/interop/InteropOps.js | 2 +- .../dist/lib/src/interop/InteropOps.js.map | 1 + .../dist/lib/src/interop/InteropTypes.d.ts | 16 +- .../lib/src/interop/InteropTypes.d.ts.map | 1 + .../dist/lib/src/interop/InteropTypes.js | 15 - .../dist/lib/src/interop/InteropTypes.js.map | 1 + .../lib/src/interop/MaterializedBase.d.ts | 15 - .../lib/src/interop/MaterializedBase.d.ts.map | 1 + .../dist/lib/src/interop/MaterializedBase.js | 2 +- .../lib/src/interop/MaterializedBase.js.map | 1 + .../dist/lib/src/interop/NativeBuffer.d.ts | 19 +- .../lib/src/interop/NativeBuffer.d.ts.map | 1 + .../dist/lib/src/interop/NativeBuffer.js | 13 +- .../dist/lib/src/interop/NativeBuffer.js.map | 1 + .../dist/lib/src/interop/NativeString.d.ts | 15 - .../lib/src/interop/NativeString.d.ts.map | 1 + .../dist/lib/src/interop/NativeString.js | 2 +- .../dist/lib/src/interop/NativeString.js.map | 1 + .../dist/lib/src/interop/Platform.d.ts | 15 - .../dist/lib/src/interop/Platform.d.ts.map | 1 + .../interop/dist/lib/src/interop/Platform.js | 2 +- .../dist/lib/src/interop/Platform.js.map | 1 + .../dist/lib/src/interop/SerializerBase.d.ts | 28 +- .../lib/src/interop/SerializerBase.d.ts.map | 1 + .../dist/lib/src/interop/SerializerBase.js | 71 +- .../lib/src/interop/SerializerBase.js.map | 1 + .../interop/dist/lib/src/interop/Wrapper.d.ts | 15 - .../dist/lib/src/interop/Wrapper.d.ts.map | 1 + .../interop/dist/lib/src/interop/Wrapper.js | 2 +- .../dist/lib/src/interop/Wrapper.js.map | 1 + .../interop/dist/lib/src/interop/arrays.d.ts | 15 - .../dist/lib/src/interop/arrays.d.ts.map | 1 + .../interop/dist/lib/src/interop/arrays.js | 2 +- .../dist/lib/src/interop/arrays.js.map | 1 + .../interop/dist/lib/src/interop/buffer.d.ts | 24 +- .../dist/lib/src/interop/buffer.d.ts.map | 1 + .../interop/dist/lib/src/interop/buffer.js | 5 +- .../dist/lib/src/interop/buffer.js.map | 1 + .../interop/dist/lib/src/interop/index.d.ts | 17 +- .../dist/lib/src/interop/index.d.ts.map | 1 + .../interop/dist/lib/src/interop/index.js | 6 +- .../interop/dist/lib/src/interop/index.js.map | 1 + .../dist/lib/src/interop/loadLibraries.d.ts | 15 - .../lib/src/interop/loadLibraries.d.ts.map | 1 + .../dist/lib/src/interop/loadLibraries.js.map | 1 + .../dist/lib/src/interop/nullable.d.ts | 15 - .../dist/lib/src/interop/nullable.d.ts.map | 1 + .../interop/dist/lib/src/interop/nullable.js | 2 +- .../dist/lib/src/interop/nullable.js.map | 1 + .../dist/lib/src/napi/wrappers/Callback.d.ts | 15 - .../lib/src/napi/wrappers/Callback.d.ts.map | 1 + .../dist/lib/src/napi/wrappers/Callback.js | 2 +- .../lib/src/napi/wrappers/Callback.js.map | 1 + .../dist/lib/src/napi/wrappers/Wrapper.d.ts | 15 - .../lib/src/napi/wrappers/Wrapper.d.ts.map | 1 + .../dist/lib/src/napi/wrappers/Wrapper.js | 2 +- .../dist/lib/src/napi/wrappers/Wrapper.js.map | 1 + .../dist/lib/src/napi/wrappers/arrays.d.ts | 15 - .../lib/src/napi/wrappers/arrays.d.ts.map | 1 + .../dist/lib/src/napi/wrappers/arrays.js | 2 +- .../dist/lib/src/napi/wrappers/arrays.js.map | 1 + .../dist/lib/src/wasm/wrappers/Callback.d.ts | 15 - .../lib/src/wasm/wrappers/Callback.d.ts.map | 1 + .../dist/lib/src/wasm/wrappers/Callback.js | 2 +- .../lib/src/wasm/wrappers/Callback.js.map | 1 + .../dist/lib/src/wasm/wrappers/Wrapper.d.ts | 15 - .../lib/src/wasm/wrappers/Wrapper.d.ts.map | 1 + .../dist/lib/src/wasm/wrappers/Wrapper.js | 2 +- .../dist/lib/src/wasm/wrappers/Wrapper.js.map | 1 + .../dist/lib/src/wasm/wrappers/arrays.d.ts | 15 - .../lib/src/wasm/wrappers/arrays.d.ts.map | 1 + .../dist/lib/src/wasm/wrappers/arrays.js | 2 +- .../dist/lib/src/wasm/wrappers/arrays.js.map | 1 + .../interop/dist/lib/tsconfig.tsbuildinfo | 1 + .../koalaui/interop/oh-package.json5 | 62 - ...serializerBase.sts => DeserializerBase.ts} | 254 +- .../arkts/{Finalizable.sts => Finalizable.ts} | 15 +- ...ativeModule.sts => InteropNativeModule.ts} | 44 +- .../{InteropTypes.sts => InteropTypes.ts} | 13 +- ...terializedBase.sts => MaterializedBase.ts} | 2 +- .../{NativeBuffer.sts => NativeBuffer.ts} | 57 +- .../interop/src/arkts/ResourceManager.ts | 41 +- .../{SerializerBase.sts => SerializerBase.ts} | 393 ++- .../src/arkts/{callback.sts => callback.ts} | 16 +- .../interop/src/arkts/{index.sts => index.ts} | 3 +- .../{loadLibraries.sts => loadLibraries.ts} | 7 +- .../interop/src/cangjie/DeserializerBase.cj | 86 +- .../src/cangjie/InteropNativeModule.cj | 111 +- .../interop/src/cangjie/InteropTypes.cj | 18 +- .../{Finalizable.cj => MaterializedBase.cj} | 18 +- .../interop/src/cangjie/ResourceManager.cj | 2 +- .../interop/src/cangjie/SerializerBase.cj | 235 +- .../koalaui/interop/src/cangjie/Tag.cj | 2 +- .../koalaui/interop/src/cangjie/cjpm.toml | 13 + .../interop/src/cpp/DeserializerBase.h | 103 +- .../koalaui/interop/src/cpp/SerializerBase.h | 64 +- .../koalaui/interop/src/cpp/ani/ani.h | 2999 +++++------------ .../interop/src/cpp/ani/convertors-ani.cc | 102 +- .../interop/src/cpp/ani/convertors-ani.h | 719 +++- .../interop/src/cpp/callback-resource.cc | 29 +- .../interop/src/cpp/callback-resource.h | 15 +- .../interop/src/cpp/cangjie/convertors-cj.cc | 28 +- .../interop/src/cpp/cangjie/convertors-cj.h | 78 +- .../koalaui/interop/src/cpp/common-interop.cc | 360 +- .../koalaui/interop/src/cpp/common-interop.h | 20 +- .../koalaui/interop/src/cpp/crashdump.h | 2 +- .../koalaui/interop/src/cpp/dynamic-loader.h | 8 +- .../interop/src/cpp/ets/convertors-ets.cc | 22 +- .../interop/src/cpp/ets/convertors-ets.h | 532 ++- .../koalaui/interop/src/cpp/ets/etsapi.h | 2 +- .../interop/src/cpp/interop-logging.cc | 29 +- .../koalaui/interop/src/cpp/interop-logging.h | 19 +- .../koalaui/interop/src/cpp/interop-types.h | 36 +- .../interop/src/cpp/jni/convertors-jni.cc | 2 +- .../interop/src/cpp/jni/convertors-jni.h | 107 +- .../interop/src/cpp/jsc/convertors-jsc.cc | 31 +- .../interop/src/cpp/jsc/convertors-jsc.h | 95 +- .../interop/src/cpp/napi/convertors-napi.cc | 43 +- .../interop/src/cpp/napi/convertors-napi.h | 161 +- .../interop/src/cpp/napi/win-dynamic-node.cc | 94 +- .../koalaui/interop/src/cpp/ohos/oh_sk_log.cc | 19 +- .../koalaui/interop/src/cpp/ohos/oh_sk_log.h | 7 +- .../koalaui/interop/src/cpp/profiler.h | 8 +- .../koalaui/interop/src/cpp/tracer.h | 4 +- .../interop/src/cpp/types/koala-types.h | 142 +- .../interop/src/cpp/types/signatures.cc | 38 +- .../interop/src/cpp/types/signatures.h | 2 +- .../koalaui/interop/src/cpp/vmloader.cc | 650 +++- .../interop/src/cpp/wasm/convertors-wasm.h | 63 +- .../interop/src/interop/DeserializerBase.ts | 34 +- .../interop/src/interop/Finalizable.ts | 10 +- .../src/interop/InteropNativeModule.ts | 28 +- .../koalaui/interop/src/interop/InteropOps.ts | 4 +- .../interop/src/interop/InteropTypes.ts | 7 +- .../interop/src/interop/MaterializedBase.ts | 2 +- .../interop/src/interop/NativeBuffer.ts | 28 +- .../interop/src/interop/NativeString.ts | 2 +- .../koalaui/interop/src/interop/Platform.ts | 4 +- .../interop/src/interop/SerializerBase.ts | 60 +- .../koalaui/interop/src/interop/Wrapper.ts | 4 +- .../koalaui/interop/src/interop/arrays.ts | 4 +- .../koalaui/interop/src/interop/buffer.ts | 15 +- .../koalaui/interop/src/interop/index.ts | 4 +- .../src/interop/java/CallbackRecord.java | 2 +- .../src/interop/java/CallbackRegistry.java | 14 +- .../src/interop/java/CallbackTests.java | 2 +- .../src/interop/java/CallbackType.java | 2 +- .../interop/src/interop/loadLibraries.ts | 2 +- .../koalaui/interop/src/interop/nullable.ts | 2 +- .../interop/src/kotlin/DeserializerBase.kt | 169 + .../InteropNativeModule.kt} | 47 +- .../src/kotlin/InteropTypes.kt} | 21 +- .../src/kotlin/MaterializedBase.kt} | 40 +- .../interop/src/kotlin/ResourceManager.kt | 71 + .../interop/src/kotlin/SerializerBase.kt | 206 ++ .../utils.ts => interop/src/kotlin/Tag.kt} | 13 +- .../interop/src/napi/wrappers/Callback.ts | 2 +- .../interop/src/napi/wrappers/Wrapper.ts | 4 +- .../interop/src/napi/wrappers/arrays.ts | 4 +- .../interop/src/wasm/wrappers/Callback.ts | 2 +- .../interop/src/wasm/wrappers/Wrapper.ts | 4 +- .../interop/src/wasm/wrappers/arrays.ts | 4 +- 357 files changed, 6272 insertions(+), 8646 deletions(-) delete mode 100644 koala-wrapper/koalaui/common/dist/bridges/ohos/chai/index.d.ts delete mode 100644 koala-wrapper/koalaui/common/dist/bridges/ohos/index.d.ts delete mode 100644 koala-wrapper/koalaui/common/dist/bridges/ohos/mocha/index.d.ts create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Errors.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Errors.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Finalization.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Finalization.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Matrix33.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Matrix33.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Matrix44.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Matrix44.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Point.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Point.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Point3.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Point3.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Unique.d.ts create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Unique.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Unique.js create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/Unique.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/index.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/index.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/koalaKey.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/koalaKey.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/math.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/math.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/sha1.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/sha1.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/stringUtils.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/stringUtils.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/uniqueId.d.ts.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/src/uniqueId.js.map create mode 100644 koala-wrapper/koalaui/common/dist/lib/tsconfig.tsbuildinfo delete mode 100644 koala-wrapper/koalaui/common/oh-package.json5 delete mode 100644 koala-wrapper/koalaui/common/src/Errors.ts delete mode 100644 koala-wrapper/koalaui/common/src/Finalization.ts delete mode 100644 koala-wrapper/koalaui/common/src/KoalaProfiler.ts delete mode 100644 koala-wrapper/koalaui/common/src/MarkableQueue.ts delete mode 100644 koala-wrapper/koalaui/common/src/Matrix33.ts delete mode 100644 koala-wrapper/koalaui/common/src/Matrix44.ts delete mode 100644 koala-wrapper/koalaui/common/src/PerfProbe.ts delete mode 100644 koala-wrapper/koalaui/common/src/Point.ts delete mode 100644 koala-wrapper/koalaui/common/src/Point3.ts delete mode 100644 koala-wrapper/koalaui/common/src/index.ts delete mode 100644 koala-wrapper/koalaui/common/src/koalaKey.ts delete mode 100644 koala-wrapper/koalaui/common/src/math.ts delete mode 100644 koala-wrapper/koalaui/common/src/sha1.ts delete mode 100644 koala-wrapper/koalaui/common/src/stringUtils.ts delete mode 100644 koala-wrapper/koalaui/common/src/uniqueId.ts delete mode 100644 koala-wrapper/koalaui/compat/README.md create mode 100644 koala-wrapper/koalaui/compat/dist/src/index.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/index.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/array.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/array.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/atomic.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/atomic.js.map delete mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/double.d.ts create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/finalization.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/finalization.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/index.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/index.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/observable.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/observable.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/performance.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/performance.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/primitive.d.ts create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/primitive.d.ts.map rename koala-wrapper/koalaui/compat/dist/src/typescript/{double.js => primitive.js} (58%) create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/primitive.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/reflection.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/reflection.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/strings.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/strings.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/types.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/types.js.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/utils.d.ts.map create mode 100644 koala-wrapper/koalaui/compat/dist/src/typescript/utils.js.map delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/array.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/atomic.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/double.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/finalization.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/index.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/observable.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/performance.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/reflection.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/strings.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/ts-reflection.ts delete mode 100644 koala-wrapper/koalaui/compat/src/arkts/types.ts delete mode 100644 koala-wrapper/koalaui/compat/src/index.ts delete mode 100644 koala-wrapper/koalaui/compat/src/ohos/index.ts delete mode 100644 koala-wrapper/koalaui/compat/src/ohos/performance.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/Types.d.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/array.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/atomic.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/double.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/finalization.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/index.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/observable.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/performance.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/prop-deep-copy.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/reflection.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/strings.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/ts-reflection.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/types.ts delete mode 100644 koala-wrapper/koalaui/compat/src/typescript/utils.ts create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/index.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/index.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.d.ts.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.js.map create mode 100644 koala-wrapper/koalaui/interop/dist/lib/tsconfig.tsbuildinfo delete mode 100644 koala-wrapper/koalaui/interop/oh-package.json5 rename koala-wrapper/koalaui/interop/src/arkts/{DeserializerBase.sts => DeserializerBase.ts} (39%) rename koala-wrapper/koalaui/interop/src/arkts/{Finalizable.sts => Finalizable.ts} (90%) rename koala-wrapper/koalaui/interop/src/arkts/{InteropNativeModule.sts => InteropNativeModule.ts} (60%) rename koala-wrapper/koalaui/interop/src/arkts/{InteropTypes.sts => InteropTypes.ts} (73%) rename koala-wrapper/koalaui/interop/src/arkts/{MaterializedBase.sts => MaterializedBase.ts} (93%) rename koala-wrapper/koalaui/interop/src/arkts/{NativeBuffer.sts => NativeBuffer.ts} (42%) rename koala-wrapper/koalaui/interop/src/arkts/{SerializerBase.sts => SerializerBase.ts} (36%) rename koala-wrapper/koalaui/interop/src/arkts/{callback.sts => callback.ts} (84%) rename koala-wrapper/koalaui/interop/src/arkts/{index.sts => index.ts} (92%) rename koala-wrapper/koalaui/interop/src/arkts/{loadLibraries.sts => loadLibraries.ts} (76%) rename koala-wrapper/koalaui/interop/src/cangjie/{Finalizable.cj => MaterializedBase.cj} (61%) create mode 100644 koala-wrapper/koalaui/interop/src/kotlin/DeserializerBase.kt rename koala-wrapper/koalaui/interop/src/{arkts/buffer.sts => kotlin/InteropNativeModule.kt} (44%) rename koala-wrapper/koalaui/{compat/src/arkts/prop-deep-copy.ts => interop/src/kotlin/InteropTypes.kt} (59%) rename koala-wrapper/koalaui/{common/src/LifecycleEvent.ts => interop/src/kotlin/MaterializedBase.kt} (45%) create mode 100644 koala-wrapper/koalaui/interop/src/kotlin/ResourceManager.kt create mode 100644 koala-wrapper/koalaui/interop/src/kotlin/SerializerBase.kt rename koala-wrapper/koalaui/{compat/src/arkts/utils.ts => interop/src/kotlin/Tag.kt} (71%) diff --git a/koala-wrapper/koalaui/common/dist/bridges/ohos/chai/index.d.ts b/koala-wrapper/koalaui/common/dist/bridges/ohos/chai/index.d.ts deleted file mode 100644 index 05dac46d7..000000000 --- a/koala-wrapper/koalaui/common/dist/bridges/ohos/chai/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export interface Assert { - (expression: any, message?: string): asserts expression; - /** - * Asserts non-strict equality (==) of actual and expected. - */ - equal(actual: T, expected: T, message?: string): void; - /** - * Asserts non-strict inequality (!=) of actual and expected. - */ - notEqual(actual: T, expected: T, message?: string): void; - /** - * Asserts strict equality (===) of actual and expected. - */ - strictEqual(actual: T, expected: T, message?: string): void; - /** - * Asserts strict inequality (!==) of actual and expected. - */ - notStrictEqual(actual: T, expected: T, message?: string): void; - deepEqual(actual: any, expected: any, message?: string): void; - notDeepEqual(actual: any, expected: any, message?: string): void; - isTrue(value: any, message?: string): void; - isFalse(value: any, message?: string): void; - closeTo(actual: number, expected: number, delta: number, message?: string): void; - fail(message?: string): void; - isNull(value: any, message?: string): void; - isNotNull(value: any, message?: string): void; - instanceOf(value: any, constructor: Function, message?: string): void; - isAtLeast(valueToCheck: number, valueToBeAtLeast: number, message?: string): void; - exists(value: any, message?: string): void; - throw(fn: () => void, message?: string): void; - throws(fn: () => void, message?: string): void; - isAbove(valueToCheck: number, valueToBeAbove: number, message?: string): void; - isBelow(valueToCheck: number, valueToBeBelow: number, message?: string): void; - match(value: string, regexp: RegExp, message?: string): void; - isDefined(value: any, message?: string): void; - isUndefined(value: any, message?: string): void; - isEmpty(object: any, message?: string): void; - isNotEmpty(object: any, message?: string): void; -} -export declare var assert: Assert; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/bridges/ohos/chai/index.js b/koala-wrapper/koalaui/common/dist/bridges/ohos/chai/index.js index d1716b7f8..8459ce279 100644 --- a/koala-wrapper/koalaui/common/dist/bridges/ohos/chai/index.js +++ b/koala-wrapper/koalaui/common/dist/bridges/ohos/chai/index.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/bridges/ohos/index.d.ts b/koala-wrapper/koalaui/common/dist/bridges/ohos/index.d.ts deleted file mode 100644 index 46a1ecc14..000000000 --- a/koala-wrapper/koalaui/common/dist/bridges/ohos/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { startTests } from "./mocha"; -export * from "./chai"; -import "./mocha"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/bridges/ohos/index.js b/koala-wrapper/koalaui/common/dist/bridges/ohos/index.js index 2fcb7de3e..a6b5113ae 100644 --- a/koala-wrapper/koalaui/common/dist/bridges/ohos/index.js +++ b/koala-wrapper/koalaui/common/dist/bridges/ohos/index.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/bridges/ohos/mocha/index.d.ts b/koala-wrapper/koalaui/common/dist/bridges/ohos/mocha/index.d.ts deleted file mode 100644 index 99c5ebee5..000000000 --- a/koala-wrapper/koalaui/common/dist/bridges/ohos/mocha/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export declare function startTests(generateGolden?: boolean): void; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/bridges/ohos/mocha/index.js b/koala-wrapper/koalaui/common/dist/bridges/ohos/mocha/index.js index b95b9f3ee..408a2fb4e 100644 --- a/koala-wrapper/koalaui/common/dist/bridges/ohos/mocha/index.js +++ b/koala-wrapper/koalaui/common/dist/bridges/ohos/mocha/index.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Errors.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/Errors.d.ts index e367bc336..803b07a2e 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Errors.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/Errors.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export declare function assertion(condition: boolean, message: string): void; export declare function ensure(value: T | undefined, message: string): T; //# sourceMappingURL=Errors.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Errors.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/Errors.d.ts.map new file mode 100644 index 000000000..3e5ebd678 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../src/Errors.ts"],"names":[],"mappings":"AAiBA,wBAAgB,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAE5D;AAQD,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAC,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAGhE"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Errors.js b/koala-wrapper/koalaui/common/dist/lib/src/Errors.js index 4f05c8cef..ef78008d2 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Errors.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/Errors.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Errors.js.map b/koala-wrapper/koalaui/common/dist/lib/src/Errors.js.map new file mode 100644 index 000000000..28a6f3201 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../../src/Errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAGH,8CAA8C;AAC9C,SAAgB,SAAS,CAAC,SAAkB,EAAE,OAAe;IACzD,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;AAC5C,CAAC;AAFD,8BAEC;AAED,gEAAgE;AAChE,6BAA6B;AAC7B,4BAA4B;AAC5B,KAAK;AACL,6BAA6B;AAC7B,8BAA8B;AAC9B,SAAgB,MAAM,CAAI,KAAkB,EAAE,OAAe;IACzD,IAAI,KAAK,IAAI,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAChD,OAAO,KAAU,CAAA;AACrB,CAAC;AAHD,wBAGC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Finalization.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/Finalization.d.ts index 5fc9fef68..dc4ab4a5f 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Finalization.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/Finalization.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { Thunk } from "#koalaui/compat"; export { Thunk } from "#koalaui/compat"; export declare function finalizerRegister(target: object, thunk: Thunk): void; diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Finalization.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/Finalization.d.ts.map new file mode 100644 index 000000000..8634bcfcb --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Finalization.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Finalization.d.ts","sourceRoot":"","sources":["../../../src/Finalization.ts"],"names":[],"mappings":"AAeA,OAAO,EAAkG,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvI,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,QAE7D;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,QAE/E;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,QAEjD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Finalization.js b/koala-wrapper/koalaui/common/dist/lib/src/Finalization.js index 8b8f9e9b1..32c206689 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Finalization.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/Finalization.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Finalization.js.map b/koala-wrapper/koalaui/common/dist/lib/src/Finalization.js.map new file mode 100644 index 000000000..b0888940f --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Finalization.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Finalization.js","sourceRoot":"","sources":["../../../src/Finalization.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,4CAAuI;AAIvI,SAAgB,iBAAiB,CAAC,MAAc,EAAE,KAAY;IAC1D,IAAA,0BAAuB,EAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAC1C,CAAC;AAFD,8CAEC;AAED,SAAgB,4BAA4B,CAAC,MAAc,EAAE,OAAmB;IAC5E,IAAA,0BAAuB,EAAC,MAAM,EAAE,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC,CAAA;AAC9D,CAAC;AAFD,oEAEC;AAED,SAAgB,mBAAmB,CAAC,MAAc;IAC9C,IAAA,4BAAyB,EAAC,MAAM,CAAC,CAAA;AACrC,CAAC;AAFD,kDAEC;AAED,MAAM,YAAY;IAEd,YAAY,OAAmB;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IAC1B,CAAC;IACD,KAAK;QACD,IAAI,CAAC,OAAO,EAAE,CAAA;IAClB,CAAC;CACJ"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.d.ts index a78eaad53..022089618 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/compat"; export declare class KoalaProfiler { private static readonly map; diff --git a/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.d.ts.map new file mode 100644 index 000000000..3645daf74 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/K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gB,CAAI;IAE5B,MAAM,CAAC,MAAM;IAIb,MAAM,CAAC,OAAO;IAId,MAAM,CAAC,OAAO,IAAI,OAAO;IAIzB,KAAK;IAgBL,MAAM;IAIN,SAAS,IAAI,MAAM;IAiCnB,YAAY;IACZ,OAAO;IACP,KAAK;IACL,IAAI;IACJ,QAAQ;IACR,UAAU;IACV,MAAM;IACN,OAAO;IACP,KAAK,CAAC,EAAE,EAAE,MAAM;IAShB,cAAc;IAGd,aAAa;IAGb,WAAW;IAGX,UAAU;IAGV,SAAS;IAGT,QAAQ;IAGR,mBAAmB;IAGnB,kBAAkB;IAGlB,cAAc,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,KAAK;CAS9C"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.js b/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.js index 664840fdd..bf2512c23 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.js.map b/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.js.map new file mode 100644 index 000000000..cb0b7d340 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/KoalaProfiler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KoalaProfiler.js","sourceRoot":"","sources":["../../../src/KoalaProfiler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAIH;;;GAGG;AACH,MAAM,qBAAqB,GAAG,KAAK,CAAA;AAEnC,MAAa,aAAa;IAA1B;QAwBY,kBAAa,GAAG,CA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K2B,iBAAG,GAAyC,qBAAqB;IACrF,CAAC,CAAC,IAAI,GAAG,EAAsB;IAC/B,CAAC,CAAC,SAAS,CAAA;AAmBD,sBAAQ,GAA8B,SAAS,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.d.ts index e72ef9fae..be276917f 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export declare enum LifecycleEventKind { SHOW_FRAME = 0, HIDE_FRAME = 1, diff --git a/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.d.ts.map new file mode 100644 index 000000000..085fb3768 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LifecycleEvent.d.ts","sourceRoot":"","sources":["../../../src/LifecycleEvent.ts"],"names":[],"mappings":"AAeA,oBAAY,kBAAkB;IAC1B,UAAU,IAAA;IACV,UAAU,IAAA;IACV,WAAW,IAAA;IACX,SAAS,IAAA;IACT,YAAY,IAAA;IACZ,cAAc,IAAA;IACd,cAAc,IAAA;IACd,IAAI,IAAA;IACJ,WAAW,IAAA;IACX,aAAa,IAAA;CAChB;AAED,qBAAa,cAAc;IACvB,IAAI,EAAE,kBAAkB,CAAA;gBACZ,IAAI,EAAE,kBAAkB;CAGvC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.js b/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.js index 2b1f275d8..c3b848452 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.js.map b/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.js.map new file mode 100644 index 000000000..492f4cbfb --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/LifecycleEvent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LifecycleEvent.js","sourceRoot":"","sources":["../../../src/LifecycleEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC1B,uEAAU,CAAA;IACV,uEAAU,CAAA;IACV,yEAAW,CAAA;IACX,qEAAS,CAAA;IACT,2EAAY,CAAA;IACZ,+EAAc,CAAA;IACd,+EAAc,CAAA;IACd,2DAAI,CAAA;IACJ,yEAAW,CAAA;IACX,6EAAa,CAAA;AACjB,CAAC,EAXW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAW7B;AAED,MAAa,cAAc;IAEvB,YAAY,IAAwB;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;CACJ;AALD,wCAKC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.d.ts index 075ed627f..729309cc9 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.d.ts @@ -1,18 +1,6 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/** + * A markable queue that allows to accumulate callbacks and to call them to the latest set marker. */ - export interface MarkableQueue { /** Sets the new marker to the queue. */ setMarker(): void; diff --git a/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.d.ts.map new file mode 100644 index 000000000..610a0af2f --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MarkableQueue.d.ts","sourceRoot":"","sources":["../../../src/MarkableQueue.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,wCAAwC;IACxC,SAAS,IAAI,IAAI,CAAA;IACjB,4CAA4C;IAC5C,WAAW,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;IACvC,gEAAgE;IAChE,aAAa,IAAI,IAAI,CAAA;IACrB,wBAAwB;IACxB,KAAK,IAAI,IAAI,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,GAAE,OAAe,GAAG,aAAa,CAEtE"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.js b/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.js index a956f4620..a1d88d833 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.js.map b/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.js.map new file mode 100644 index 000000000..e525c6080 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/MarkableQueue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MarkableQueue.js","sourceRoot":"","sources":["../../../src/MarkableQueue.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,4CAA2C;AAgB3C;;;GAGG;AACH,SAAgB,aAAa,CAAC,WAAoB,KAAK;IACnD,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,YAAY,EAAE,CAAA;AAC9D,CAAC;AAFD,sCAEC;AAED,MAAM,YAAY;IAAlB;QACqB,SAAI,GAAG,IAAI,kBAAS,CAAQ,IAAI,KAAK,EAAE,CAAC,CAAA;QACxC,UAAK,GAAG,IAAI,kBAAS,CAAQ,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC7C,WAAM,GAAG,IAAI,kBAAS,CAAoB,SAAS,CAAC,CAAA;IA4BzE,CAAC;IA1BG,SAAS;QACL,MAAM,MAAM,GAAG,IAAI,KAAK,EAAE,CAAA;QAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAA;QAC/C,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAA;IAC9B,CAAC;IAED,WAAW,CAAC,QAAoB;QAC5B,MAA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;IACjD,CAAC;IAED,aAAa;;QACT,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;QAC/C,IAAI,MAAM,EAAE;YACR,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;YAC5C,OAAO,KAAK,EAAE;gBACV,MAAA,MAAA,KAAM,EAAC,QAAQ,kDAAI,CAAA;gBACnB,KAAK,GAAG,KAAM,CAAC,IAAI,CAAC,KAAK,CAAA;aAC5B;SACJ;IACL,CAAC;IAED,KAAK;QACD,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,SAAS,CAAA;IACjC,CAAC;CACJ;AAED,MAAM,KAAK;IAIP,YAAY,QAAqB;QAHxB,SAAI,GAAG,IAAI,kBAAS,CAAoB,SAAS,CAAC,CAAA;QAIvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC5B,CAAC;CACJ"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.d.ts index 8fff5dd79..8ece5f11b 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { float32 } from "#koalaui/compat"; export declare function mat33(array?: Float32Array): Matrix33; export declare class Matrix33 { diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.d.ts.map new file mode 100644 index 000000000..644e6d91b --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Matrix33.d.ts","sourceRoot":"","sources":["../../../src/Matrix33.ts"],"names":[],"mappings":"AAeA,OAAO,EAAqB,OAAO,EAAwB,MAAM,iBAAiB,CAAA;AAElF,wBAAgB,KAAK,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,QAAQ,CAEpD;AAID,qBAAa,QAAQ;IACjB,SAAgB,KAAK,EAAE,YAAY,CAAA;gBACtB,KAAK,GAAE,YAIjB;IAIH,MAAM,CAAC,IAAI,IAAI,QAAQ;IAIvB,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,QAAQ;IAIxD,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,GAAE,OAAY,GAAG,QAAQ;IAIzD,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ;IAejF,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,QAAQ;IAInD,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ;IAcnC,aAAa,IAAI,QAAQ;CAO5B"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.js b/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.js index 0c68024b3..5e7a0452a 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,7 +20,7 @@ function mat33(array) { return (array == undefined) ? new Matrix33() : new Matrix33(array); } exports.mat33 = mat33; -const tolerance = (1.0 / (1 << 12)); +const tolerance = (0, compat_1.float64To32)(1.0 / (1 << 12)); class Matrix33 { constructor(array = new Float32Array((0, compat_1.Array_from_number)([ 1.0, 0.0, 0.0, diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.js.map b/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.js.map new file mode 100644 index 000000000..22e3a43cb --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Matrix33.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Matrix33.js","sourceRoot":"","sources":["../../../src/Matrix33.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,4CAAkF;AAElF,SAAgB,KAAK,CAAC,KAAoB;IACtC,OAAO,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAA;AACvE,CAAC;AAFD,sBAEC;AAED,MAAM,SAAS,GAAY,IAAA,oBAAW,EAAC,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;AAEvD,MAAa,QAAQ;IAEjB,YAAa,QAAsB,IAAI,YAAY,CAAC,IAAA,0BAAiB,EAAC;QAClE,GAAG,EAAE,GAAG,EAAE,GAAG;QACb,GAAG,EAAE,GAAG,EAAE,GAAG;QACb,GAAG,EAAE,GAAG,EAAE,GAAG;KAChB,CAAC,CAAC;QACC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;IAC9B,CAAC;IAED,MAAM,CAAC,IAAI;QACP,OAAO,IAAI,QAAQ,CAAC,I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AAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAC9C,CAAC,CAAC,CAAC,CAAA;IACR,CAAC;CACJ;AA9DD,4BA8DC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.d.ts index 0524b6b5a..3a7e05f74 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { float32 } from "#koalaui/compat"; import { Matrix33 } from "./Matrix33"; import { Point3 } from "./Point3"; diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.d.ts.map new file mode 100644 index 000000000..f7609546f --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Matrix44.d.ts","sourceRoot":"","sources":["../../../src/Matrix44.ts"],"names":[],"mappings":"AAeA,OAAO,EAAqB,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,MAAM,WAAW,aAAa;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,CAAC,CAAC,EAAE,O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G,QAAQ;IAsB3B,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,QAAQ;IAetC,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,QAAQ;IA+CxC,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,QAAQ;IAO9C,MAAM,IAAI,QAAQ;IAiFlB,SAAS,IAAI,QAAQ;IA2BrB,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,GAAG,QAAQ;CAKlD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.js b/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.js index 4f727e450..0a8a046d7 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.js.map b/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.js.map new file mode 100644 index 000000000..5d4ab5f3f --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Matrix44.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Matrix44.js","sourceRoot":"","sources":["../../../src/Matrix44.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,4CAA4D;AAC5D,yCAAqC;AACrC,qCAAiC;AA4BjC,uEAAuE;AACvE,MAAM,oBAAoB;IAKtB,IAAI,CAAC,KAA0B,OAAO,IAAI,CAAC,EAAE,CAAA,CAAC,CAAC;IAC/C,IAAI,CAAC,KAA0B,OAAO,IAAI,CAAC,EAAE,CAAA,CAAC,CAAC;IAC/C,IAAI,CAAC,KAA0B,OAAO,IAAI,CAAC,EAAE,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be.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.d.ts index 7d860cc4c..44cb58ceb 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.d.ts @@ -1,18 +1,22 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/** + * A probe to measure performance. + * + * A probe can measure performance of any activity which has an entry and an exit points. + * Such activity can be a method call, or a sequence of actions, possibly asynchronous. + * + * A probe which has been entered and exited is considered a performed probe (see {@link MainPerfProbe.probePerformed}). + * A probe can be entered recursively. When all the recursive calls exits the probe becomes a performed probe. * - * http://www.apache.org/licenses/LICENSE-2.0 + * All performing probes form a hierarchy which is rooted at the main probe (see {@link enterMainPerfProbe}). + * A last started probe (see {@link MainPerfProbe.enterProbe}) which has not yet performed becomes a parent + * for the next started probe. It's the responsibility of the API caller to keep this parent-child relationship valid, + * that is: a child probe should exit before its parent probe exits. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Statistics gathered by a probe: + * - call count + * - recursive call count + * - total time and percentage relative to the main (root) probe */ - export interface PerfProbe { /** * The name of the probe. @@ -34,7 +38,7 @@ export interface PerfProbe { /** * Cancels measuring the probe and its children probes. */ - cancel(): void; + cancel(b?: Boolean): void; /** * User-defined data associated with the probe. */ diff --git a/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.d.ts.map new file mode 100644 index 000000000..fcfb10f76 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PerfProbe.d.ts","sourceRoot":"","sources":["../../../src/PerfProbe.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,SAAS;IACtB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAErB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IAEvB;;;;;OAKG;IACH,IAAI,CAAC,GAAG,EAAE,OAAO,GAAC,SAAS,GAAG,IAAI,CAAA;IAElC;;OAEG;IACH,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAEzB;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAE5B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC5C;;;;;;;;OAQG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IAEnC;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IAElC;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IAEjC;;;;;;OAMG;IACH,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA;IAE/C;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CACxC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAG5D"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.js b/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.js index 06e957f97..bb7732a75 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -42,7 +42,7 @@ class DummyPerfProbe { get name() { return "dummy"; } get dummy() { return true; } exit(log) { } - cancel() { } + cancel(b) { } get canceled() { return false; } enterProbe(name) { return PerfProbeImpl.DUMMY; } exitProbe(name) { return PerfProbeImpl.DUMMY; } @@ -105,15 +105,17 @@ class PerfProbeImpl { if (log) this.log(); } - cancel(cancelChildren = true) { + cancelWithChildren() { + this.cancel(); + this.maybeCancelChildren(); + } + cancel(b) { this._canceled = true; - if (cancelChildren) - this.maybeCancelChildren(); } maybeCancelChildren() { MainPerfProbeImpl.visit(this, false, (probe, depth) => { if (probe.performing) - probe.cancel(false); + probe.cancel(); }); } get canceled() { @@ -161,7 +163,7 @@ class MainPerfProbeImpl extends PerfProbeImpl { } push(probe) { probe.parent = this.currentProbe; - probe.index = probe.parent ? probe.parent.children.length : 0; + probe.index = probe.parent ? (0, compat_1.float64ToInt)(probe.parent.children.length) : 0; if (probe.parent) probe.parent.children.push(probe); this.currentProbe = probe; @@ -216,7 +218,7 @@ class MainPerfProbeImpl extends PerfProbeImpl { this.log(); this.cancel(); } - cancel() { + cancel(b) { MainPerfProbeImpl.mainProbes.delete(this.name); } static visit(root, logging, apply) { diff --git a/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.js.map b/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.js.map new file mode 100644 index 000000000..abe658fe6 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/PerfProbe.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PerfProbe.js","sourceRoot":"","sources":["../../../src/PerfProbe.ts"],"names":[],"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AI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE;gBAAE,MAAM,IAAI,IAAI,CAAA;YAC9C,IAAI,KAAK,CAAC,SAAS,EAAE;gBACjB,MAAM,UAAU,GAAG,KAAK,CAAC,MAAO,CAAC,SAAS,CAAA;gBAC1C,IAAI,YAAY,GAAG,CAAC,CAAA;gBACpB,KAAK,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAgB,EAAO,EAAE,GAAG,YAAY,IAAI,CAAC,CAAC,SAAS,CAAA,CAAC,CAAC,CAAC,CAAA;gBAC1F,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,YAAY,CAAU,CAAA;gBACjE,MAAM,UAAU,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACxF,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,MAAM,IAAI,KAAK,CAAC,IAAI,WAAW,IAAA,sBAAa,EAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,UAAU,GAAG,CAAC,CAAA;aAC/G;iBAAM;gBACH,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;aACvD;QACL,CAAC,CAAC,CAAA;IACN,CAAC;;AAtIe,4BAAU,GAAmC,IAAI,GAAG,EAA6B,CAAA;AAwIjF,uBAAK,GAAkB,IAAI,cAAc,EAAE,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Point.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/Point.d.ts index f35d2561b..f0cb976b2 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Point.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/Point.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { float32 } from "#koalaui/compat"; export declare class Point { coordinates: Float32Array; diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Point.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/Point.d.ts.map new file mode 100644 index 000000000..48c34c5de --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Point.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../src/Point.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC,qBAAa,KAAK;IACd,WAAW,EAAE,YAAY,CAAA;gBAEZ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO;IAMnC,IAAI,CAAC,IAAI,OAAO,CAEf;IAED,IAAI,CAAC,IAAI,OAAO,CAEf;IAED,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,KAAK;IAIzC,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,KAAK;IAIzB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK;IAI5B,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,KAAK;IAIxC,MAAM,CAAC,IAAI,QAA4C;IAEvD,OAAO,IAAI,YAAY;IAIvB,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,YAAY;IASvD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;CAUvD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Point.js b/koala-wrapper/koalaui/common/dist/lib/src/Point.js index 1b5080bfa..377a89a2a 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Point.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/Point.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Point.js.map b/koala-wrapper/koalaui/common/dist/lib/src/Point.js.map new file mode 100644 index 000000000..7be4ff130 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Point.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Point.js","sourceRoot":"","sources":["../../../src/Point.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAIH,MAAa,KAAK;IAGd,YAAa,CAAU,EAAE,CAAU;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;QACtC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QACvB,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;IAED,IAAI,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAY,CAAA;IACzC,CAAC;IAED,IAAI,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAY,CAAA;IACzC,CAAC;IAED,QAAQ,CAAC,EAAW,EAAE,EAAW;QAC7B,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CA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G,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YACxC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAY,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAY,CAAC,CAAA;SAC/E;QACD,OAAO,KAAK,CAAA;IAChB,CAAC;;AAzDL,sBA0DC;AAzBU,UAAI,GAAG,IAAI,KAAK,CAAC,GAAc,EAAE,GAAc,CAAC,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Point3.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/Point3.d.ts index d6121d56d..230c4c33a 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Point3.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/Point3.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { float32 } from "#koalaui/compat"; export declare class Point3 { x: float32; diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Point3.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/Point3.d.ts.map new file mode 100644 index 000000000..0116985e1 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Point3.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Point3.d.ts","sourceRoot":"","sources":["../../../src/Point3.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC,qBAAa,MAAM;IACf,CAAC,EAAE,OAAO,CAAA;IACV,CAAC,EAAE,OAAO,CAAA;IACV,CAAC,EAAE,OAAO,CAAA;gBACE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO;IAM9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAQ/B,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAQ5B,SAAS,IAAI,MAAM;CAStB"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Point3.js b/koala-wrapper/koalaui/common/dist/lib/src/Point3.js index de748e8e1..8eff88ce6 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/Point3.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/Point3.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Point3.js.map b/koala-wrapper/koalaui/common/dist/lib/src/Point3.js.map new file mode 100644 index 000000000..7d764042e --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Point3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Point3.js","sourceRoot":"","sources":["../../../src/Point3.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAIH,MAAa,MAAM;IAIf,YAAY,CAAU,EAAE,CAAU,EAAE,CAAU;QAC1C,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;IACd,CAAC;IAED,QAAQ,CAAC,KAAa;QAClB,OAAO,IAAI,MAAM,CACb,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAChB,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAChB,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CACnB,CAAA;IACL,CAAC;IAED,KAAK,CAAC,KAAa;QACf,OAAO,IAAI,MAAM,CACb,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EACnC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EACnC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CACtC,CAAA;IACL,CAAC;IAED,SAAS;QACL,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAY,CAAA;QACrF,MAAM,SAAS,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;QACnC,IAAI,GAAG,GAAG,SAAS,EAAE;YACjB,iEAAiE;YACjE,OAAO,IAAI,CAAC;SACf;QACD,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC,GAAI,GAAG,CAAC,CAAA;IAChE,CAAC;CACJ;AAnCD,wBAmCC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Unique.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/Unique.d.ts new file mode 100644 index 000000000..cb83c8df7 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Unique.d.ts @@ -0,0 +1,77 @@ +import { int32 } from "#koalaui/compat"; +export type UID = int32; +export interface Unique { + readonly uid: UID; +} +export declare class UniqueSet { + private array; + private latest; + get empty(): boolean; + /** + * @returns the number of unique elements + */ + get size(): number; + /** + * @returns a boolean indicating whether the given element exists or not + */ + has(element: U): boolean; + /** + * Adds the given element if it is not already present. + */ + add(element: U): void; + /** + * Removes the given element if it is present. + */ + delete(element: U): void; + /** + * Removes all elements for which the given predicate returns true. + */ + deleteIf(predicate: (element: U) => boolean): void; + /** + * Performs the given action for each element. + */ + forEach(action: (element: U) => void): void; + /** + * Removes all of the elements. + */ + clear(): void; +} +export declare class UniqueMap { + private array; + private latest; + get empty(): boolean; + /** + * @returns the number of unique keys + */ + get size(): number; + /** + * @returns a boolean indicating whether a mapping for the given key exists or not + */ + has(key: U): boolean; + /** + * @returns the value to which the given key is mapped, or `undefined` if a mapping does not exist. + */ + get(key: U): V | undefined; + /** + * Associates the specified value with the given key. + * If a mapping for the given key exists, the old value is replaced by the specified value. + */ + set(key: U, value: V): void; + /** + * Removes a mapping for the given key if it is present. + */ + delete(key: U): void; + /** + * Removes all mappings for which the given predicate returns true. + */ + deleteIf(predicate: (key: U, value: V) => boolean): void; + /** + * Performs the given action for each mapping. + */ + forEach(action: (key: U, value: V) => void): void; + /** + * Removes all of the mappings. + */ + clear(): void; +} +//# sourceMappingURL=Unique.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Unique.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/Unique.d.ts.map new file mode 100644 index 000000000..3cec263ed --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Unique.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Unique.d.ts","sourceRoot":"","sources":["../../../src/Unique.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,MAAM,GAAG,GAAG,KAAK,CAAA;AAEvB,MAAM,WAAW,MAAM;IACnB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;CACpB;AAED,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AIR"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Unique.js b/koala-wrapper/koalaui/common/dist/lib/src/Unique.js new file mode 100644 index 000000000..a62bdc9c9 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Unique.js @@ -0,0 +1,309 @@ +"use strict"; +/* + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueMap = exports.UniqueSet = void 0; +class UniqueSet { + constructor() { + this.array = undefined; + this.latest = undefined; + } + get empty() { + return this.size <= 0; + } + /** + * @returns the number of unique elements + */ + get size() { + const array = this.array; + return array ? array.length : this.latest ? 1 : 0; + } + /** + * @returns a boolean indicating whether the given element exists or not + */ + has(element) { + const latest = this.latest; + if (latest && latest.uid == element.uid) + return true; + const array = this.array; + if (array) { + const index = find(array, element.uid); + if (found(array, element.uid, index)) + return true; + } + return false; + } + /** + * Adds the given element if it is not already present. + */ + add(element) { + const latest = this.latest; + if (latest && latest.uid == element.uid) + return; + let array = this.array; + if (array) { + const index = find(array, element.uid); + if (!found(array, element.uid, index)) { + array.splice(index, 0, element); + } + } + else if (latest) { + array = new Array(); + array.push(latest); + array.splice(find(array, element.uid), 0, element); + this.array = array; + } + this.latest = element; + } + /** + * Removes the given element if it is present. + */ + delete(element) { + const array = this.array; + if (array) { + const index = find(array, element.uid); + if (found(array, element.uid, index)) { + array.splice(index, 1); + } + } + const latest = this.latest; + if (latest && latest.uid == element.uid) { + this.latest = undefined; + } + } + /** + * Removes all elements for which the given predicate returns true. + */ + deleteIf(predicate) { + const latest = this.latest; + const array = this.array; + if (array) { + let index = array.length; + while (0 < index--) { + const element = array[index]; + if (predicate(element)) { + array.splice(index, 1); + if (element === latest) { + this.latest = undefined; + } + } + } + } + else if (latest && predicate(latest)) { + this.latest = undefined; + } + } + /** + * Performs the given action for each element. + */ + forEach(action) { + const array = this.array; + if (array) { + let index = array.length; + while (0 < index--) { + action((array[index])); + } + } + else { + const latest = this.latest; + if (latest) + action(latest); + } + } + /** + * Removes all of the elements. + */ + clear() { + this.array = undefined; + this.latest = undefined; + } +} +exports.UniqueSet = UniqueSet; +class UniqueMap { + constructor() { + this.array = undefined; + this.latest = undefined; + } + get empty() { + return this.size <= 0; + } + /** + * @returns the number of unique keys + */ + get size() { + const array = this.array; + return array ? array.length : this.latest ? 1 : 0; + } + /** + * @returns a boolean indicating whether a mapping for the given key exists or not + */ + has(key) { + const latest = this.latest; + if (latest && latest.uid == key.uid) + return true; + const array = this.array; + if (array) { + const index = find(array, key.uid); + if (found(array, key.uid, index)) + return true; + } + return false; + } + /** + * @returns the value to which the given key is mapped, or `undefined` if a mapping does not exist. + */ + get(key) { + const latest = this.latest; + if (latest && latest.uid == key.uid) + return latest.value; + const array = this.array; + if (array) { + const index = find(array, key.uid); + const entry = found(array, key.uid, index); + if (entry) + return entry.value; + } + return undefined; + } + /** + * Associates the specified value with the given key. + * If a mapping for the given key exists, the old value is replaced by the specified value. + */ + set(key, value) { + const latest = this.latest; + if (latest && latest.uid == key.uid) { + latest.value = value; + } + else { + let array = this.array; + if (array) { + const index = find(array, key.uid); + let entry = found(array, key.uid, index); + if (entry) { + entry.value = value; + } + else { + entry = new Entry(key, value); + array.splice(index, 0, entry); + } + this.latest = entry; + } + else { + const entry = new Entry(key, value); + if (latest) { + array = new Array(); + array.push(latest); + array.splice(find(array, key.uid), 0, entry); + this.array = array; + } + this.latest = entry; + } + } + } + /** + * Removes a mapping for the given key if it is present. + */ + delete(key) { + const array = this.array; + if (array) { + const index = find(array, key.uid); + if (found(array, key.uid, index)) { + array.splice(index, 1); + } + } + const latest = this.latest; + if (latest && latest.uid == key.uid) { + this.latest = undefined; + } + } + /** + * Removes all mappings for which the given predicate returns true. + */ + deleteIf(predicate) { + const latest = this.latest; + const array = this.array; + if (array) { + let index = array.length; + while (0 < index--) { + const entry = array[index]; + if (predicate(entry.key, entry.value)) { + array.splice(index, 1); + if (entry === latest) { + this.latest = undefined; + } + } + } + } + else if (latest && predicate(latest.key, latest.value)) { + this.latest = undefined; + } + } + /** + * Performs the given action for each mapping. + */ + forEach(action) { + const array = this.array; + if (array) { + let index = array.length; + while (0 < index--) { + const entry = array[index]; + action(entry.key, entry.value); + } + } + else { + const latest = this.latest; + if (latest) + action(latest.key, latest.value); + } + } + /** + * Removes all of the mappings. + */ + clear() { + this.array = undefined; + this.latest = undefined; + } +} +exports.UniqueMap = UniqueMap; +class Entry { + constructor(key, value) { + this.key = key; + this.value = value; + } + get uid() { + return this.key.uid; + } +} +function found(array, uid, index) { + if (index < array.length) { + const element = array[index]; + if (element.uid == uid) + return element; + } + return undefined; +} +function find(array, uid) { + let left = 0; + let right = array.length; + while (left < right) { + const center = ((left + right) >>> 1); + if (array[center].uid < uid) + left = center + 1; + else + right = center; + } + return left; +} +//# sourceMappingURL=Unique.js.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/Unique.js.map b/koala-wrapper/koalaui/common/dist/lib/src/Unique.js.map new file mode 100644 index 000000000..a0452db19 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/Unique.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Unique.js","sourceRoot":"","sources":["../../../src/Unique.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAUH,MAAa,SAAS;IAAtB;QACY,UAAK,GAAyB,SAAS,CAAA;QACvC,WAAM,GAAkB,SAAS,CAAA;IAiH7C,CAAC;IA/GG,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,IAAI,IAAI,CAAC,CAAA;IACzB,CAAC;IAED;;OAE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E,MAAM,CAAC,MAAO,CAAC,GAAG,EAAE,MAAO,CAAC,KAAK,CAAC,CAAA;SACjD;IACL,CAAC;IAED;;OAEG;IACH,KAAK;QACD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAA;IAC3B,CAAC;CACJ;AA/ID,8BA+IC;AAED,MAAM,KAAK;IAGP,YAAY,GAAM,EAAE,KAAQ;QACxB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACtB,CAAC;IACD,IAAI,GAAG;QACH,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAA;IACvB,CAAC;CACJ;AAED,SAAS,KAAK,CAAmB,KAAe,EAAE,GAAQ,EAAE,KAAa;IACrE,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE;QACtB,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;QAC5B,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG;YAAE,OAAO,OAAO,CAAA;KACzC;IACD,OAAO,SAAS,CAAA;AACpB,CAAC;AAED,SAAS,IAAI,CAAmB,KAAe,EAAE,GAAQ;IACrD,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAA;IACxB,OAAO,IAAI,GAAG,KAAK,EAAE;QACjB,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAU,CAAA;QAC9C,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,GAAG;YAAE,IAAI,GAAG,MAAM,GAAG,CAAC,CAAA;;YACzC,KAAK,GAAG,MAAM,CAAA;KACtB;IACD,OAAO,IAAI,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/index.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/index.d.ts index 8b816b3c4..49e53edfe 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/index.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/index.d.ts @@ -1,19 +1,4 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { int8, uint8, int32, uint32, int64, uint64, float32, float64, asArray, asFloat64, float32FromBits, int32BitsFromFloat, Array_from_set, AtomicRef, CustomTextDecoder, CustomTextEncoder, className, lcClassName, functionOverValue, Observed, Observable, ObservableHandler, observableProxy, observableProxyArray, isFunction, propDeepCopy, refEqual, int8Array, unsafeCast } from "#koalaui/compat"; +export { int8, uint8, int32, uint32, int64, uint64, float32, float64, asArray, asFloat64, charToInt, float32FromBits, float64ToInt, float64ToLong, int32BitsFromFloat, Array_from_set, AtomicRef, CustomTextDecoder, CustomTextEncoder, className, lcClassName, functionOverValue, Observed, Observable, ObservableHandler, observableProxy, observableProxyArray, isFunction, propDeepCopy, refEqual, int8Array, errorAsString, unsafeCast, scheduleCoroutine, memoryStats, launchJob } from "#koalaui/compat"; export { clamp, lerp, modulo, parseNumber, isFiniteNumber, getDistancePx } from "./math"; export { hashCodeFromString } from "./stringUtils"; export { KoalaProfiler } from "./KoalaProfiler"; diff --git a/koala-wrapper/koalaui/common/dist/lib/src/index.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/index.d.ts.map new file mode 100644 index 000000000..ab2a4d589 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACH,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,EACP,SAAS,EACT,SAAS,EACT,eAAe,EACf,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EAAE,WAAW,EACtB,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,SAAS,EACZ,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,cAAc,YAAY,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/index.js b/koala-wrapper/koalaui/common/dist/lib/src/index.js index e50e6f07a..c14056a7e 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/index.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/index.js @@ -28,11 +28,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.UniqueId = exports.createSha1 = exports.SHA1Hash = exports.KoalaProfiler = exports.hashCodeFromString = exports.getDistancePx = exports.isFiniteNumber = exports.parseNumber = exports.modulo = exports.lerp = exports.clamp = exports.unsafeCast = exports.int8Array = exports.refEqual = exports.propDeepCopy = exports.isFunction = exports.observableProxyArray = exports.observableProxy = exports.ObservableHandler = exports.Observed = exports.functionOverValue = exports.lcClassName = exports.className = exports.CustomTextEncoder = exports.CustomTextDecoder = exports.AtomicRef = exports.Array_from_set = exports.int32BitsFromFloat = exports.float32FromBits = exports.asFloat64 = exports.asArray = void 0; +exports.UniqueId = exports.createSha1 = exports.SHA1Hash = exports.KoalaProfiler = exports.hashCodeFromString = exports.getDistancePx = exports.isFiniteNumber = exports.parseNumber = exports.modulo = exports.lerp = exports.clamp = exports.launchJob = exports.memoryStats = exports.scheduleCoroutine = exports.unsafeCast = exports.errorAsString = exports.int8Array = exports.refEqual = exports.propDeepCopy = exports.isFunction = exports.observableProxyArray = exports.observableProxy = exports.ObservableHandler = exports.Observed = exports.functionOverValue = exports.lcClassName = exports.className = exports.CustomTextEncoder = exports.CustomTextDecoder = exports.AtomicRef = exports.Array_from_set = exports.int32BitsFromFloat = exports.float64ToLong = exports.float64ToInt = exports.float32FromBits = exports.charToInt = exports.asFloat64 = exports.asArray = void 0; var compat_1 = require("#koalaui/compat"); Object.defineProperty(exports, "asArray", { enumerable: true, get: function () { return compat_1.asArray; } }); Object.defineProperty(exports, "asFloat64", { enumerable: true, get: function () { return compat_1.asFloat64; } }); +Object.defineProperty(exports, "charToInt", { enumerable: true, get: function () { return compat_1.charToInt; } }); Object.defineProperty(exports, "float32FromBits", { enumerable: true, get: function () { return compat_1.float32FromBits; } }); +Object.defineProperty(exports, "float64ToInt", { enumerable: true, get: function () { return compat_1.float64ToInt; } }); +Object.defineProperty(exports, "float64ToLong", { enumerable: true, get: function () { return compat_1.float64ToLong; } }); Object.defineProperty(exports, "int32BitsFromFloat", { enumerable: true, get: function () { return compat_1.int32BitsFromFloat; } }); Object.defineProperty(exports, "Array_from_set", { enumerable: true, get: function () { return compat_1.Array_from_set; } }); Object.defineProperty(exports, "AtomicRef", { enumerable: true, get: function () { return compat_1.AtomicRef; } }); @@ -49,7 +52,11 @@ Object.defineProperty(exports, "isFunction", { enumerable: true, get: function ( Object.defineProperty(exports, "propDeepCopy", { enumerable: true, get: function () { return compat_1.propDeepCopy; } }); Object.defineProperty(exports, "refEqual", { enumerable: true, get: function () { return compat_1.refEqual; } }); Object.defineProperty(exports, "int8Array", { enumerable: true, get: function () { return compat_1.int8Array; } }); +Object.defineProperty(exports, "errorAsString", { enumerable: true, get: function () { return compat_1.errorAsString; } }); Object.defineProperty(exports, "unsafeCast", { enumerable: true, get: function () { return compat_1.unsafeCast; } }); +Object.defineProperty(exports, "scheduleCoroutine", { enumerable: true, get: function () { return compat_1.scheduleCoroutine; } }); +Object.defineProperty(exports, "memoryStats", { enumerable: true, get: function () { return compat_1.memoryStats; } }); +Object.defineProperty(exports, "launchJob", { enumerable: true, get: function () { return compat_1.launchJob; } }); var math_1 = require("./math"); Object.defineProperty(exports, "clamp", { enumerable: true, get: function () { return math_1.clamp; } }); Object.defineProperty(exports, "lerp", { enumerable: true, get: function () { return math_1.lerp; } }); diff --git a/koala-wrapper/koalaui/common/dist/lib/src/index.js.map b/koala-wrapper/koalaui/common/dist/lib/src/index.js.map new file mode 100644 index 000000000..23eecf751 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;AAEH,0CAgCwB;AA3BpB,iGAAA,OAAO,OAAA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/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.d.ts index 1b2e1e4ed..2c4c0751a 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.d.ts @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - import { int32 } from "#koalaui/compat"; export type KoalaCallsiteKey = int32; export declare class KoalaCallsiteKeys { diff --git a/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.d.ts.map new file mode 100644 index 000000000..f21f57b49 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"koalaKey.d.ts","sourceRoot":"","sources":["../../../src/koalaKey.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAA;AAEpC,qBAAa,iBAAiB;IAC1B,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAa;IAEpD,MAAM,CAAC,OAAO,CAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,GAAG,gBAAgB;IAIjF,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM;CAGjD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.js b/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.js index 458a2c260..e1daaa0c7 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.js.map b/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.js.map new file mode 100644 index 000000000..ff922a34a --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/koalaKey.js.map @@ -0,0 +1 @@ +{"version":3,"file":"koalaKey.js","sourceRoot":"","sources":["../../../src/koalaKey.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAMH,MAAa,iBAAiB;IAG1B,MAAM,CAAC,OAAO,CAAE,IAAsB,EAAE,IAAsB;QAC1D,OAAO,IAAI,GAAG,IAAI,CAAA;IACtB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACjC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IACvC,CAAC;;AATL,8CAUC;AATmB,uBAAK,GAAqB,CAAU,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/math.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/math.d.ts index f114cb459..3ff1abad4 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/math.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/math.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { float64 } from "#koalaui/compat"; /** * Computes the linear interpolation between `source` and `target` based on `weight`. diff --git a/koala-wrapper/koalaui/common/dist/lib/src/math.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/math.d.ts.map new file mode 100644 index 000000000..9c970a4ec --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/math.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../src/math.ts"],"names":[],"mappings":"AAeA,OAAO,EAAuB,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9D;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAE/E;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAEzE;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI9C;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,MAAiB,EAAE,MAAM,GAAE,OAAe,GAAG,OAAO,CAelG;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAMvD;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAIrG"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/math.js b/koala-wrapper/koalaui/common/dist/lib/src/math.js index 474003ae9..fd5d078bc 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/math.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/math.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/math.js.map b/koala-wrapper/koalaui/common/dist/lib/src/math.js.map new file mode 100644 index 000000000..ad65235f4 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/math.js.map @@ -0,0 +1 @@ +{"version":3,"file":"math.js","sourceRoot":"","sources":["../../../src/math.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,4CAA8D;AAE9D;;;;;;;GAOG;AACH,SAAgB,IAAI,CAAC,MAAe,EAAE,MAAe,EAAE,MAAe;IAClE,OAAO,MAAM,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,MAAM,GAAG,MAAM,CAAA;AACpD,CAAC;AAFD,oBAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,KAAK,CAAC,KAAc,EAAE,GAAY,EAAE,GAAY;IAC5D,OAAO,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAA;AAC1D,CAAC;AAFD,sBAEC;AAED;;;;;;;GAOG;AACH,SAAgB,MAAM,CAAC,KAAc;IACjC,iEAAiE;IACjE,MAAM,MAAM,GAAY,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACjD,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAA;AACxC,CAAC;AAJD,wBAIC;AAED;;;;;;GAMG;AACH,SAA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d.ts index 7efad4ed5..dfd3d12c2 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/sha1.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/sha1.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/compat"; export declare function createSha1(): SHA1Hash; export declare class SHA1Hash { diff --git a/koala-wrapper/koalaui/common/dist/lib/src/sha1.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/sha1.d.ts.map new file mode 100644 index 000000000..89b095099 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/sha1.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha1.d.ts","sourceRoot":"","sources":["../../../src/sha1.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAkBvC,wBAAgB,UAAU,IAAI,QAAQ,CAErC;AAED,qBAAa,QAAQ;IACjB,OAAO,CAAC,CAAC,CAA4B;IACrC,OAAO,CAAC,CAAC,CAA4B;IACrC,OAAO,CAAC,CAAC,CAA4B;IACrC,OAAO,CAAC,CAAC,CAA4B;IACrC,OAAO,CAAC,CAAC,CAA4B;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAY;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAY;IAClC,OAAO,CAAC,KAAK,CAAI;IACjB,OAAO,CAAC,GAAG,CAAI;;IAaf,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ;IAGvD,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ;IAMlC,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ;IAwD5E,OAAO,CAAC,MAAM;IAwBd,OAAO,CAAC,KAAK;IAiDb,OAAO,CAAC,MAAM;IAoCd,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM;IAqC9C,OAAO,CAAC,IAAI;IAUZ,OAAO,CAAC,IAAI;CAiBf"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/sha1.js b/koala-wrapper/koalaui/common/dist/lib/src/sha1.js index 597c33707..f101a735b 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/sha1.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/sha1.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -68,6 +68,7 @@ class SHA1Hash { let buffer = undefined; // TODO: an attempt to wrie this in a generic form causes // es2panda to segfault. + let BYTES_PER_ELEMENT = 4; if (data instanceof Int32Array) { byteOffset = data.byteOffset; length = data.byteLength; @@ -87,6 +88,7 @@ class SHA1Hash { byteOffset = data.byteOffset; length = data.byteLength; buffer = data.buffer; + BYTES_PER_ELEMENT = 1; } let blocks = ((length / inputBytes) | 0); let offset = 0; @@ -100,7 +102,6 @@ class SHA1Hash { this._size += offset; } // data: TypedArray | DataView - const BYTES_PER_ELEMENT = data.BYTES_PER_ELEMENT; if ((BYTES_PER_ELEMENT != 1) && buffer != undefined) { const rest = new Uint8Array(buffer, byteOffset + offset, length - offset); return this._uint8(rest); diff --git a/koala-wrapper/koalaui/common/dist/lib/src/sha1.js.map b/koala-wrapper/koalaui/common/dist/lib/src/sha1.js.map new file mode 100644 index 000000000..b6fbc8e83 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/sha1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha1.js","sourceRoot":"","sources":["../../../src/sha1.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,4CAAmD;AAGnD,MAAM,CAAC,GAAG;IACN,CAAC,UAAU,GAAG,CAAC,CAAU;IACzB,CAAC,UAAU,GAAG,CAAC,CAAU;IACzB,CAAC,UAAU,GAAG,CAAC,CAAU;IACzB,CAAC,UAAU,GAAG,CAAC,CAAU;CAC5B,CAAA;AAED,MAAM,UAAU,GAAG,EAAE,CAAA;AACrB,MAAM,UAAU,GAAG,UAAU,GAAG,CAAC,CAAA;AACjC,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,CAAA;AAChC,MAAM,QAAQ,GAAG,UAAU,GAAG,CAAC,CAAA;AAC/B,MAAM,SAAS,GAAG,EAAE,CAAA;AACpB,MAAM,UAAU,GAAG,EAAE,CAAA;AACrB,MAAM,UAAU,GAAG,UAAU,GAAG,CAAC,CAAA;AACjC,MAAM,UAAU,GAAG,UAAU,GAAG,GAAG,CAAA;AAEnC,SAAgB,UAAU;IACvB,OAAO,IAAI,QAAQ,EAAE,CAAA;AACxB,CAAC;AAFD,gCAEC;AAED,MAAa,QAAQ;IAWjB;QAVQ,MAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAU,CAAA;QAC7B,MAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAU,CAAA;QAC7B,MAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAU,CAAA;QAC7B,MAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAU,CAAA;QAC7B,MAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAU,CAAA;QAG7B,UAAK,GAAG,CAAC,CAAA;QACT,QAAG,GAAG,CAAC,CAAA,CAAC,iBAAiB;QAG7B,IAAI,CAAC,YAAY,IAAI,YAAY,IAAI,UAAU,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EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAC3D,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAC3D,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAC3D,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAC3D,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAC3D,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,KAAK,IAAI,CAAC,CAAE,GAAG,GAAG,CAAC,CAAA;IAC3D,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,KAAK,IAAI,CAAC,CAAE,GAAG,GAAG,CAAC,CAAA;IAC3D,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,KAAK,IAAI,CAAC,CAAE,GAAG,GAAG,CAAC,CAAA;AAC/D,CAAC;AAED,SAAS,eAAe,CAAC,MAAa;IAClC,OAAO,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,CAAA;AACjD,CAAC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.d.ts index d8101efbf..c5659a69a 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/compat"; /** * Computes a hash code from the string {@link value}. diff --git a/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.d.ts.map new file mode 100644 index 000000000..fcbd592ed --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stringUtils.d.ts","sourceRoot":"","sources":["../../../src/stringUtils.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAGvC;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAOvD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.js b/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.js index 06850d000..efe590f98 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.js.map b/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.js.map new file mode 100644 index 000000000..0fc14566f --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/stringUtils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stringUtils.js","sourceRoot":"","sources":["../../../src/stringUtils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAKH;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAa;IAC5C,IAAI,IAAI,GAAG,IAAI,CAAA;IACf,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAClC,IAAI,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QACxC,IAAI,IAAI,CAAC,CAAA;KACZ;IACD,OAAO,IAAI,CAAA;AACf,CAAC;AAPD,gDAOC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.d.ts b/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.d.ts index 0d00f1dd1..ef9ffe83c 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.d.ts +++ b/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/compat"; export declare class UniqueId { private sha; diff --git a/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.d.ts.map b/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.d.ts.map new file mode 100644 index 000000000..df8909405 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"uniqueId.d.ts","sourceRoot":"","sources":["../../../src/uniqueId.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAGvC,qBAAa,QAAQ;IACjB,OAAO,CAAC,GAAG,CAAe;IAEnB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAKjC,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ;IAK7B,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ;IAKzC,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,QAAQ;IAKvC,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,QAAQ;IAKxC,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,QAAQ;IAKtC,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;IAO5C,OAAO,IAAI,MAAM;CAG3B"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.js b/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.js index 6269d042c..4a3cd07f3 100644 --- a/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.js +++ b/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.js.map b/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.js.map new file mode 100644 index 000000000..91e78af94 --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/src/uniqueId.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uniqueId.js","sourceRoot":"","sources":["../../../src/uniqueId.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG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new file mode 100644 index 000000000..7272e9f0d --- /dev/null +++ b/koala-wrapper/koalaui/common/dist/lib/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es5.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2016.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2017.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2018.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2019.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2020.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2021.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2022.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.esnext.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.core.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.collection.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.generator.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.iterable.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.promise.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.proxy.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.reflect.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.symbol.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2015.symbol.wellknown.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2016.array.include.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2017.object.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2017.sharedmemory.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2017.string.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2017.intl.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2017.typedarrays.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2018.asyncgenerator.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2018.asynciterable.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2018.intl.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2018.promise.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2018.regexp.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2019.array.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2019.object.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2019.string.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2019.symbol.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2019.intl.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2020.bigint.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2020.date.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2020.promise.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2020.sharedmemory.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2020.string.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2020.symbol.wellknown.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2020.intl.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2020.number.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2021.promise.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2021.string.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2021.weakref.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2021.intl.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2022.array.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2022.error.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2022.intl.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2022.object.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2022.sharedmemory.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.es2022.string.d.ts","../../../../interop/node_modules/@koalaui/ets-tsc/lib/lib.esnext.intl.d.ts","../../src/Errors.ts","../../../compat/build/src/typescript/types.d.ts","../../../compat/build/src/typescript/array.d.ts","../../../compat/build/src/typescript/atomic.d.ts","../../../compat/build/src/typescript/primitive.d.ts","../../../compat/build/src/typescript/finalization.d.ts","../../../compat/build/src/typescript/observable.d.ts","../../../compat/build/src/typescript/performance.d.ts","../../../compat/build/src/typescript/prop-deep-copy.d.ts","../../../compat/build/src/typescript/reflection.d.ts","../../../compat/build/src/typescript/strings.d.ts","../../../compat/build/src/typescript/ts-reflection.d.ts","../../../compat/build/src/typescript/utils.d.ts","../../../compat/build/src/typescript/index.d.ts","../../../compat/build/src/index.d.ts","../../src/Finalization.ts","../../src/KoalaProfiler.ts","../../src/LifecycleEvent.ts","../../src/MarkableQueue.ts","../../src/Matrix33.ts","../../src/Point3.ts","../../src/Matrix44.ts","../../src/PerfProbe.ts","../../src/Point.ts","../../src/math.ts","../../src/stringUtils.ts","../../src/sha1.ts","../../src/uniqueId.ts","../../src/koalaKey.ts","../../src/index.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/eslint/use-at-your-own-risk.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/eslint-scope/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/node/ts5.1/compatibility/disposable.d.ts","../../../node_modules/@types/node/ts5.6/compatibility/float16array.d.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../../node_modules/undici-types/utility.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/h2c-client.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-call-history.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cache-interceptor.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/ts5.1/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts"],"fileInfos":[{"version":"14dd5dc695734e52d7c38a0c3e227e5ea9043b66410bbcacb8772093f6134d92","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","d11a03592451da2d1065e09e61f4e2a9bf68f780f4f6623c18b57816a9679d17","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"34c839eaaa6d78c8674ae2c37af2236dee6831b13db7b4ef4df3ec889a04d4f2","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"ab7d58e6161a550ff92e5aff755dc37fe896245348332cd5f1e1203479fe0ed1","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"a4da0551fd39b90ca7ce5f68fb55d4dc0c1396d589b612e1902f68ee090aaada","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},{"version":"6e60bf279d69528403bd95f5a31b170930a1d779458a18c70ec64954cfb55af0","signature":"6e770adfd4d6b3523c8bdcf023573e1b4ec3191537879cc53c973e6563fbfcc0"},"168660b1574e99365c968af11d848be4ef38c92aa1817320c5c8155295394e8f","73253d11ee7aabbccde30ab9a8c493ded6ffc57247f58fc270e4ad94d406f25f","107fe39b503f4aa5eb209928c6570e64970be58409a140c180421aa2e2e777ae","ed68521db67e07fd133b619e59b04db8d60bd0e92a82493d3b66eff2ea6eb7ed","40d59757c37369349c81eaa28b6368f8d7d7db473662cb9d08c7440d3c8cbd77","fc3ccf197082101c44fadfbf831c4e0a5ae3cbbdcbccc4c43f168aa45dab6981","9e3a3c75130c30cfd692bb750495f855e5e56353890f4195080ec44e74783181","9c4dfde250536e69425bfd810e17a4a2e95437902f1519e3228147ecb68777b2","52131cc3d1e3e0de3cc07ee36798ae3c06e083a67ddb22c6c3679d08ce03bc3e","85ea0c635e0e91e4305350c41e59d6318ec6a235d8909007d2f1b9fafc3707fe","279b03a1207f07b9a190b6681a1d4e6ddd783faaf76d00880d3ded20daa79b1e","6a1509bef473f8a5522a419138bad8b1de52803c00c70741d8bd02377214e2b6","9b2279d1835fedcbaf4f13484767d5a1f1e258b217e6bfb6df5c28c4e1264b84","ae7293760b8e64f57bafa709c263e75ec19422deeb42ab3922fe49aa20db07d9",{"version":"3f14adba5b6cad5a8372884c1cefa778725a6ff62da1d54feec3ca980bfc50b2","signature":"e142833f9b3c9d1044307d760b032f191dc0e513ccc74d5562f73e6668f95ce7"},{"version":"347bfe6c20cad554656b6a69cba1eb4e59e41dab5c3621a3398d2acc0a436997","signature":"220998029c0afc4e8c0a3698bb7baac664a3767c3b0a8b99d7a0fe4779f23fa0"},{"version":"0932f2fa33e31a413398893ec85c6c63df6de2841cc02651706e57b2022b3ca1","signature":"766a45759e9afb9ff487e4f327b9bba3a92c8db7d1cad09776b464d39d7697b5"},{"version":"b70b8d96dc3a3b5843be08d069be944e0c14b0943a939c704474f1287115c65c","signature":"ddf98e1d50ee1b3d0c8bd495810c4aac728fb4ad90f9840240ddce1156a86b8f"},{"version":"06f0f09bccc256d65efc64c270f52df0b03af3fc4af88a45e98492091a97c5bb","signature":"ac0cccc4d745ce790cb8392d3f01455bd8ef9878322b011532e460ddc5a301ff"},{"version":"fecd4e13869fef2c04562abd097610c15ea0cd53bea1caaffb3bc9f96b90f1bc","signature":"8b4ff0f0f0fcf7646b2007fcb00ceef7835cd324eded8f58a5c45e925e7f60ba"},{"version":"cf108c938b83bb6c2676733e378d188fb04d26a36ee621914296ae4bbbfcfb9c","signature":"098c958a047b9099ad01911d64f6bc71cc253cf6125ead7f542e49bcc17cae18"},{"version":"78ea2c866e06d4f3456849142dbdeae6600a7f69acae68a9d2b7018d95b022d0","signature":"db55d3604ef8d6497a54957989c664f707c9652254d4496c2b3a494919f989ad"},{"version":"48bdae11416e3a1dae9536faa7b97621596600f2c0face75518f750aa4f331a4","signature":"c328775993ac047e6e16cdf667f0063d1bc54017ccc8a9c1ff1105290cbcc3d6"},{"version":"811e394ae2a05f1543db5629da229883af2bfb7d494e727fadac3f6b996a0fd5","signature":"dbef411b39684fecd20717c0781c6a150ec8abd572f4e58e443bff6cda499c66"},{"version":"bca1e57249f215f05164ee6377c8b9603b421ecb366b2a2bba77b8fe6e05d7e5","signature":"ab266ffb980044c3c4cf0f556c24f33fb819fd84bb467bf23a951688ce17b5d3"},{"version":"6c2bc3a4d835fb19d48463ee4bccd7ce8123546edb8d573ec999bdba36e12298","signature":"7ba4ee4882eb1b240b3ba44055b8d7b3146b7ee8aa092aad90adfa35399438d2"},{"version":"192d4cf77f19e6adb46fc1927c9eca0e6d3bc94f094f5f42e46a852cdc42be2d","signature":"084b56c97cd681c0d34a935d4a060483a45ca0b0e503a9c33091482a84147ad6"},{"version":"1e3b01ce626f3d7db9a9e879295ca1cc8faf07f75f1b4af4f4dbf81be6226c2d","signature":"f1bc7b808272fe2f9c1994e632d8332d86a5153b642fef48aaa9df5cc76c38ae"},{"version":"f185e2a9c5a0ae7c76981a033351cd3d88b858dae138d8e970ab909b90e48650","signature":"8e482115d2c59addcd080789fd9b73a56df18327c4d68898a1cbbfc34ef1a67e"},{"version":"eef204f061321360559bd19235ea32a9d55b3ec22a362cc78d14ef50d4db4490","affectsGlobalScope":true},"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","a4a39b5714adfcadd3bbea6698ca2e942606d833bde62ad5fb6ec55f5e438ff8","bbc1d029093135d7d9bfa4b38cbf8761db505026cc458b5e9c8b74f4000e5e75","1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe",{"version":"3f6d6465811321abc30a1e5f667feed63e5b3917b3d6c8d6645daf96c75f97ba","affectsGlobalScope":true},{"version":"6876211ece0832abdfe13c43c65a555549bb4ca8c6bb4078d68cf923aeb6009e","affectsGlobalScope":true},{"version":"394fda71d5d6bd00a372437dff510feab37b92f345861e592f956d6995e9c1ce","affectsGlobalScope":true},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true},{"version":"c564fc7c6f57b43ebe0b69bc6719d38ff753f6afe55dadf2dba36fb3558f39b6","affectsGlobalScope":true},{"version":"109b9c280e8848c08bf4a78fff1fed0750a6ca1735671b5cf08b71bae5448c03","affectsGlobalScope":true},"cdcf9ea426ad970f96ac930cd176d5c69c6c24eebd9fc580e1572d6c6a88f62c","23cd712e2ce083d68afe69224587438e5914b457b8acf87073c22494d706a3d0","487b694c3de27ddf4ad107d4007ad304d29effccf9800c8ae23c2093638d906a","e525f9e67f5ddba7b5548430211cae2479070b70ef1fd93550c96c10529457bd","ccf4552357ce3c159ef75f0f0114e80401702228f1898bdc9402214c9499e8c0","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","17fe9131bec653b07b0a1a8b99a830216e3e43fe0ea2605be318dc31777c8bbf","3c8e93af4d6ce21eb4c8d005ad6dc02e7b5e6781f429d52a35290210f495a674","2c9875466123715464539bfd69bcaccb8ff6f3e217809428e0d7bd6323416d01","ea6bc8de8b59f90a7a3960005fd01988f98fd0784e14bc6922dde2e93305ec7d","36107995674b29284a115e21a0618c4c2751b32a8766dd4cb3ba740308b16d59","914a0ae30d96d71915fc519ccb4efbf2b62c0ddfb3a3fc6129151076bc01dc60","2472ef4c28971272a897fdb85d4155df022e1f5d9a474a526b8fc2ef598af94e","6c8e442ba33b07892169a14f7757321e49ab0f1032d676d321a1fdab8a67d40c","b41767d372275c154c7ea6c9d5449d9a741b8ce080f640155cc88ba1763e35b3","1cd673d367293fc5cb31cd7bf03d598eb368e4f31f39cf2b908abbaf120ab85a","19851a6596401ca52d42117108d35e87230fc21593df5c4d3da7108526b6111c","3825bf209f1662dfd039010a27747b73d0ef379f79970b1d05601ec8e8a4249f","0b6e25234b4eec6ed96ab138d96eb70b135690d7dd01f3dd8a8ab291c35a683a","40bfc70953be2617dc71979c14e9e99c5e65c940a4f1c9759ddb90b0f8ff6b1a","da52342062e70c77213e45107921100ba9f9b3a30dd019444cf349e5fb3470c4","e9ace91946385d29192766bf783b8460c7dbcbfc63284aa3c9cae6de5155c8bc","40b463c6766ca1b689bfcc46d26b5e295954f32ad43e37ee6953c0a677e4ae2b","561c60d8bfe0fec2c08827d09ff039eca0c1f9b50ef231025e5a549655ed0298","1e30c045732e7db8f7a82cf90b516ebe693d2f499ce2250a977ec0d12e44a529","84b736594d8760f43400202859cda55607663090a43445a078963031d47e25e7","499e5b055a5aba1e1998f7311a6c441a369831c70905cc565ceac93c28083d53","54c3e2371e3d016469ad959697fd257e5621e16296fa67082c2575d0bf8eced0","beb8233b2c220cfa0feea31fbe9218d89fa02faa81ef744be8dce5acb89bb1fd","78b29846349d4dfdd88bd6650cc5d2baaa67f2e89dc8a80c8e26ef7995386583","5d0375ca7310efb77e3ef18d068d53784faf62705e0ad04569597ae0e755c401","59af37caec41ecf7b2e76059c9672a49e682c1a2aa6f9d7dc78878f53aa284d6","addf417b9eb3f938fddf8d81e96393a165e4be0d4a8b6402292f9c634b1cb00d","e38d4fdf79e1eadd92ed7844c331dbaa40f29f21541cfee4e1acff4db09cda33","8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","7c10a32ae6f3962672e6869ee2c794e8055d8225ef35c91c0228e354b4e5d2d3","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","99f569b42ea7e7c5fe404b2848c0893f3e1a56e0547c1cd0f74d5dbb9a9de27e",{"version":"f4b4faedc57701ae727d78ba4a83e466a6e3bdcbe40efbf913b17e860642897c","affectsGlobalScope":true},"bbcfd9cd76d92c3ee70475270156755346c9086391e1b9cb643d072e0cf576b8","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","72c1f5e0a28e473026074817561d1bc9647909cf253c8d56c41d1df8d95b85f7",{"version":"4a48915fb0c07aa96d315dcb98231aa135151fb961cd3c6093cf29d64304c5d0","affectsGlobalScope":true},"938f94db8400d0b479626b9006245a833d50ce8337f391085fad4af540279567","c4e8e8031808b158cfb5ac5c4b38d4a26659aec4b57b6a7e2ba0a141439c208c",{"version":"2c91d8366ff2506296191c26fd97cc1990bab3ee22576275d28b654a21261a44","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a",{"version":"12fb9c13f24845000d7bd9660d11587e27ef967cbd64bd9df19ae3e6aa9b52d4","affectsGlobalScope":true},"289e9894a4668c61b5ffed09e196c1f0c2f87ca81efcaebdf6357cfb198dac14","25a1105595236f09f5bce42398be9f9ededc8d538c258579ab662d509aa3b98e","4ea4cb9f755b97e72fd2f42e2d9786baf9184a8625085a24dc7ea96734d5986b","bd1b3b48920e1bd6d52133f95153a5d94aa1b3555e5f30b2154336e52abd29bd","ad1cc0ed328f3f708771272021be61ab146b32ecf2b78f3224959ff1e2cd2a5c",{"version":"71450bbc2d82821d24ca05699a533e72758964e9852062c53b30f31c36978ab8","affectsGlobalScope":true},{"version":"62f572306e0b173cc5dfc4c583471151f16ef3779cf27ab96922c92ec82a3bc8","affectsGlobalScope":true},"2f32444438ecb1fa4519f6ec3977d69ce0e3acfa18b803e5cd725c204501f350","0ab3c844f1eb5a1d94c90edc346a25eb9d3943af7a7812f061bf2d627d8afac0","e8c431ccd0dd211303eeeaef6329d70d1ba8d4f6fa23b9c1a625cebd29226c1e","161f09445a8b4ba07f62ae54b27054e4234e7957062e34c6362300726dabd315","77fced47f495f4ff29bb49c52c605c5e73cd9b47d50080133783032769a9d8a6","e6057f9e7b0c64d4527afeeada89f313f96a53291705f069a9193c18880578cb",{"version":"34ecb9596317c44dab586118fb62c1565d3dad98d201cd77f3e6b0dde453339c","affectsGlobalScope":true},"0f5cda0282e1d18198e2887387eb2f026372ebc4e11c4e4516fef8a19ee4d514","e99b0e71f07128fc32583e88ccd509a1aaa9524c290efb2f48c22f9bf8ba83b1","76957a6d92b94b9e2852cf527fea32ad2dc0ef50f67fe2b14bd027c9ceef2d86",{"version":"237581f5ec4620a17e791d3bb79bad3af01e27a274dbee875ac9b0721a4fe97d","affectsGlobalScope":true},{"version":"a8a99a5e6ed33c4a951b67cc1fd5b64fd6ad719f5747845c165ca12f6c21ba16","affectsGlobalScope":true},"a58a15da4c5ba3df60c910a043281256fa52d36a0fcdef9b9100c646282e88dd","b36beffbf8acdc3ebc58c8bb4b75574b31a2169869c70fc03f82895b93950a12","de263f0089aefbfd73c89562fb7254a7468b1f33b61839aafc3f035d60766cb4","70b57b5529051497e9f6482b76d91c0dcbb103d9ead8a0549f5bab8f65e5d031","e6d81b1f7ab11dc1b1ad7ad29fcfad6904419b36baf55ed5e80df48d56ac3aff","1013eb2e2547ad8c100aca52ef9df8c3f209edee32bb387121bb3227f7c00088","b6b8e3736383a1d27e2592c484a940eeb37ec4808ba9e74dd57679b2453b5865","d6f36b683c59ac0d68a1d5ee906e578e2f5e9a285bca80ff95ce61cdc9ddcdeb","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"12aad38de6f0594dc21efa78a2c1f67bf6a7ef5a389e05417fe9945284450908","affectsGlobalScope":true},"ea713aa14a670b1ea0fbaaca4fd204e645f71ca7653a834a8ec07ee889c45de6","b338a6e6c1d456e65a6ea78da283e3077fe8edf7202ae10490abbba5b952b05e",{"version":"2918b7c516051c30186a1055ebcdb3580522be7190f8a2fff4100ea714c7c366","affectsGlobalScope":true},"ae86f30d5d10e4f75ce8dcb6e1bd3a12ecec3d071a21e8f462c5c85c678efb41","982efeb2573605d4e6d5df4dc7e40846bda8b9e678e058fc99522ab6165c479e","e03460fe72b259f6d25ad029f085e4bedc3f90477da4401d8fbc1efa9793230e","4286a3a6619514fca656089aee160bb6f2e77f4dd53dc5a96b26a0b4fc778055",{"version":"d67fc92a91171632fc74f413ce42ff1aa7fbcc5a85b127101f7ec446d2039a1f","affectsGlobalScope":true},{"version":"d40e4631100dbc067268bce96b07d7aff7f28a541b1bfb7ef791c64a696b3d33","affectsGlobalScope":true},"784490137935e1e38c49b9289110e74a1622baf8a8907888dcbe9e476d7c5e44","42180b657831d1b8fead051698618b31da623fb71ff37f002cb9d932cfa775f1","4f98d6fb4fe7cbeaa04635c6eaa119d966285d4d39f0eb55b2654187b0b27446",{"version":"e4c653466d0497d87fa9ffd00e59a95f33bc1c1722c3f5c84dab2e950c18da70","affectsGlobalScope":true},"e6dcc3b933e864e91d4bea94274ad69854d5d2a1311a4b0e20408a57af19e95d","2119ab23f794e7b563cc1a005b964e2f59b8ebcb3dfe2ce61d0c782bfd5e02a2","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","844ab83672160ca57a2a2ea46da4c64200d8c18d4ebb2087819649cad099ff0e"],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":1,"noEmitOnError":true,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"target":4},"fileIdsList":[[96,140],[69,96,140],[69,74,75,96,140],[55,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,96,140],[69,81,96,140],[68,96,140],[56,96,140],[56,57,58,59,60,61,62,63,64,65,66,67,96,140],[86,89,96,140],[86,87,88,96,140],[89,96,140],[96,137,140],[96,139,140],[96,140,145,175],[96,140,141,146,152,153,160,172,183],[96,140,141,142,152,160],[96,140,143,184],[96,140,144,145,153,161],[96,140,145,172,180],[96,140,146,148,152,160],[96,139,140,147],[96,140,148,149],[96,140,150,152],[96,139,140,152],[96,140,152,153,154,172,183],[96,140,152,153,154,167,172,175],[96,135,140],[96,135,140,148,152,155,160,172,183],[96,140,152,153,155,156,160,172,180,183],[96,140,155,157,172,180,183],[96,140,152,158],[96,140,159,183],[96,140,148,152,160,172],[96,140,161],[96,140,162],[96,139,140,163],[96,137,138,139,140,141,142,143,144,145,146,147,148,149,150,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189],[96,140,165],[96,140,166],[96,140,152,167,168],[96,140,167,169,184,186],[96,140,152,172,173,175],[96,140,174,175],[96,140,172,173],[96,140,175],[96,140,176],[96,137,140,172,177],[96,140,152,178,179],[96,140,178,179],[96,140,145,160,172,180],[96,140,181],[92,93,94,95,96,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189],[140],[96,140,160,182],[96,140,155,166,183],[96,140,145,184],[96,140,172,185],[96,140,159,186],[96,140,187],[96,140,152,154,163,172,175,183,185,186,188],[96,140,172,189],[96,140,191,230],[96,140,191,215,230],[96,140,230],[96,140,191],[96,140,191,216,230],[96,140,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229],[96,140,216,230],[96,105,109,140,183],[96,105,140,172,183],[96,140,172],[96,100,140],[96,102,105,140,183],[96,140,160,180],[96,140,190],[96,100,140,190],[96,102,105,140,160,183],[96,97,98,99,101,104,140,152,172,183],[96,105,113,140],[96,98,103,140],[96,105,129,130,140],[96,98,101,105,140,175,183,190],[96,105,140],[96,97,140],[96,100,101,102,103,104,105,106,107,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,130,131,132,133,134,140],[96,105,122,125,140,148],[96,105,113,114,115,140],[96,103,105,114,116,140],[96,104,140],[96,98,100,105,140],[96,105,109,114,116,140],[96,109,140],[96,103,105,108,140,183],[96,98,102,105,113,140],[96,105,122,140],[96,100,105,129,140,175,188,190],[69],[69,74,75],[55,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83]],"referencedMap":[[55,1],[70,2],[71,2],[72,1],[73,2],[74,2],[76,3],[77,2],[78,2],[75,2],[84,4],[83,2],[79,2],[81,2],[80,2],[82,5],[69,6],[57,7],[58,1],[60,1],[68,8],[61,1],[62,1],[59,7],[63,1],[64,1],[65,7],[66,1],[56,1],[67,1],[85,1],[90,9],[89,10],[88,11],[86,1],[87,1],[91,1],[137,12],[138,12],[139,13],[140,14],[141,15],[142,16],[94,1],[143,17],[144,18],[145,19],[146,20],[147,21],[148,22],[149,22],[151,1],[150,23],[152,24],[153,25],[154,26],[136,27],[155,28],[156,29],[157,30],[158,31],[159,32],[160,33],[161,34],[162,35],[163,36],[164,37],[165,38],[166,39],[167,40],[168,40],[169,41],[170,1],[171,1],[172,42],[174,43],[173,44],[175,45],[176,46],[177,47],[178,48],[179,49],[180,50],[181,51],[92,1],[190,52],[96,53],[93,1],[95,1],[182,54],[183,55],[184,56],[185,57],[186,58],[187,59],[188,60],[189,61],[215,62],[216,63],[191,64],[194,64],[213,62],[214,62],[204,62],[203,65],[201,62],[196,62],[209,62],[207,62],[211,62],[195,62],[208,62],[212,62],[197,62],[198,62],[210,62],[192,62],[199,62],[200,62],[202,62],[206,62],[217,66],[205,62],[193,62],[230,67],[229,1],[224,66],[226,68],[225,66],[218,66],[219,66],[221,66],[223,66],[227,68],[228,68],[220,68],[222,68],[113,69],[124,70],[111,69],[125,71],[134,72],[103,73],[102,74],[133,75],[128,76],[132,77],[105,78],[121,79],[104,80],[131,81],[100,82],[101,76],[106,83],[107,1],[112,73],[110,83],[98,84],[135,85],[126,86],[116,87],[115,83],[117,88],[119,89],[114,90],[118,91],[129,75],[108,92],[109,93],[120,94],[99,71],[123,95],[122,83],[127,1],[97,1],[130,96],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[35,1],[32,1],[33,1],[34,1],[36,1],[7,1],[37,1],[42,1],[43,1],[38,1],[39,1],[40,1],[41,1],[8,1],[47,1],[44,1],[45,1],[46,1],[48,1],[9,1],[49,1],[50,1],[51,1],[52,1],[53,1],[1,1],[10,1],[54,1]],"exportedModulesMap":[[70,97],[71,97],[74,97],[76,98],[78,97],[75,97],[84,99],[83,97],[79,97],[81,97],[80,97],[82,97],[69,6],[57,7],[58,1],[60,1],[68,8],[61,1],[62,1],[59,7],[63,1],[64,1],[65,7],[66,1],[56,1],[67,1],[85,1],[90,9],[89,10],[88,11],[86,1],[87,1],[91,1],[137,12],[138,12],[139,13],[140,14],[141,15],[142,16],[94,1],[143,17],[144,18],[145,19],[146,20],[147,21],[148,22],[149,22],[151,1],[150,23],[152,24],[153,25],[154,26],[136,27],[155,28],[156,29],[157,30],[158,31],[159,32],[160,33],[161,34],[162,35],[163,36],[164,37],[165,38],[166,39],[167,40],[168,40],[169,41],[170,1],[171,1],[172,42],[174,43],[173,44],[175,45],[176,46],[177,47],[178,48],[179,49],[180,50],[181,51],[92,1],[190,52],[96,53],[93,1],[95,1],[182,54],[183,55],[184,56],[185,57],[186,58],[187,59],[188,60],[189,61],[215,62],[216,63],[191,64],[194,64],[213,62],[214,62],[204,62],[203,65],[201,62],[196,62],[209,62],[207,62],[211,62],[195,62],[208,62],[212,62],[197,62],[198,62],[210,62],[192,62],[199,62],[200,62],[202,62],[206,62],[217,66],[205,62],[193,62],[230,67],[229,1],[224,66],[226,68],[225,66],[218,66],[219,66],[221,66],[223,66],[227,68],[228,68],[220,68],[222,68],[113,69],[124,70],[111,69],[125,71],[134,72],[103,73],[102,74],[133,75],[128,76],[132,77],[105,78],[121,79],[104,80],[131,81],[100,82],[101,76],[106,83],[107,1],[112,73],[110,83],[98,84],[135,85],[126,86],[116,87],[115,83],[117,88],[119,89],[114,90],[118,91],[129,75],[108,92],[109,93],[120,94],[99,71],[123,95],[122,83],[127,1],[97,1],[130,96],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[35,1],[32,1],[33,1],[34,1],[36,1],[7,1],[37,1],[42,1],[43,1],[38,1],[39,1],[40,1],[41,1],[8,1],[47,1],[44,1],[45,1],[46,1],[48,1],[9,1],[49,1],[50,1],[51,1],[52,1],[53,1],[1,1],[10,1],[54,1]],"semanticDiagnosticsPerFile":[55,70,71,72,73,74,76,77,78,75,84,83,79,81,80,82,69,57,58,60,68,61,62,59,63,64,65,66,56,67,85,90,89,88,86,87,91,137,138,139,140,141,142,94,143,144,145,146,147,148,149,151,150,152,153,154,136,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,174,173,175,176,177,178,179,180,181,92,190,96,93,95,182,183,184,185,186,187,188,189,215,216,191,194,213,214,204,203,201,196,209,207,211,195,208,212,197,198,210,192,199,200,202,206,217,205,193,230,229,224,226,225,218,219,221,223,227,228,220,222,113,124,111,125,134,103,102,133,128,132,105,121,104,131,100,101,106,107,112,110,98,135,126,116,115,117,119,114,118,129,108,109,120,99,123,122,127,97,130,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,35,32,33,34,36,7,37,42,43,38,39,40,41,8,47,44,45,46,48,9,49,50,51,52,53,1,10,54],"latestChangedDtsFile":"./src/koalaKey.d.ts"},"version":"4.9.5"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/oh-package.json5 b/koala-wrapper/koalaui/common/oh-package.json5 deleted file mode 100644 index a1d31c737..000000000 --- a/koala-wrapper/koalaui/common/oh-package.json5 +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@koalaui/common", - "version": "1.4.1+devel", - "description": "", - "main": "build/lib/src/index.js", - "types": "./index.d.ts", - "files": [ - "build/lib/**/*.js", - "build/lib/**/*.d.ts", - "build/bridges/ohos/**/*.js", - "build/bridges/ohos/**/*.d.ts" - ], - "exports": { - ".": "./build/lib/src/index.js", - "./golden": "./test/golden.js", - "./bridges": { - "ark": "./build/bridges/ohos/index.js", - "default": null - } - }, - "typesVersions": { - "*": { - "bridges": ["build/bridges/ohos/index.d.ts"], - "*": ["build/lib/src/*", "build/lib/typescript/*"] - } - }, - "scripts": { - "compile": "tsc -b .", - "clean": "rimraf build dist", - "test": "mocha", - "test:coverage": "nyc mocha", - "compile:arkts": "bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig.json --ets-module" - }, - "keywords": [], - "dependencies": { - "@koalaui/compat": "../compat" - }, - "devDependencies": { - "@ohos/hypium": "^1.0.5", - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", - "@typescript-eslint/eslint-plugin": "^5.20.0", - "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", - "eslint": "^8.13.0", - "eslint-plugin-unused-imports": "^2.0.0", - "mocha": "^9.2.2", - "source-map-support": "^0.5.21" - } -} diff --git a/koala-wrapper/koalaui/common/src/Errors.ts b/koala-wrapper/koalaui/common/src/Errors.ts deleted file mode 100644 index d57ea750a..000000000 --- a/koala-wrapper/koalaui/common/src/Errors.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// "assert" is a reserved keyword in ArkTS :-( -export function assertion(condition: boolean, message: string) { - if (!condition) throw new Error(message) -} - -// The unknonwn type support in ArkTS compiler is not ready yet. -// When it is ready move from -// ensure(value, message) -// to -// value ?? error(message) -// which is much more readable -export function ensure(value: T|undefined, message: string): T { - if (value == undefined) throw new Error(message) - return value as T -} diff --git a/koala-wrapper/koalaui/common/src/Finalization.ts b/koala-wrapper/koalaui/common/src/Finalization.ts deleted file mode 100644 index 30be27994..000000000 --- a/koala-wrapper/koalaui/common/src/Finalization.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { finalizerRegister as finalizerRegisterCompat, finalizerUnregister as finalizerUnregisterCompat, Thunk } from "@koalaui/compat" - -export { Thunk } from "@koalaui/compat" - -export function finalizerRegister(target: object, thunk: Thunk) { - finalizerRegisterCompat(target, thunk) -} - -export function finalizerRegisterWithCleaner(target: object, cleaner: () => void) { - finalizerRegisterCompat(target, new CleanerThunk(cleaner)) -} - -export function finalizerUnregister(target: object) { - finalizerUnregisterCompat(target) -} - -class CleanerThunk implements Thunk { - private cleaner: () => void - constructor(cleaner: () => void) { - this.cleaner = cleaner - } - clean() { - this.cleaner() - } -} diff --git a/koala-wrapper/koalaui/common/src/KoalaProfiler.ts b/koala-wrapper/koalaui/common/src/KoalaProfiler.ts deleted file mode 100644 index 0e8f704f0..000000000 --- a/koala-wrapper/koalaui/common/src/KoalaProfiler.ts +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { int32 } from "@koalaui/compat" - -/** - * Adds statistics for constructing/disposing of the TreeNode instances. - * It is disabled by default because collecting such data affects performance. - */ -const DEBUG_WITH_NODE_STATS = false - -export class KoalaProfiler { - private static readonly map = DEBUG_WITH_NODE_STATS - ? new Map>() - : undefined - - static nodeCreated(nodeType: int32, node: Object) { - if (KoalaProfiler.map === undefined) return - let set = KoalaProfiler.map!.get(nodeType) - if (set === undefined) { - set = new Set() - KoalaProfiler.map!.set(nodeType, set) - } - set.add(node) - } - - static nodeDisposed(nodeType: int32, node: Object) { - if (KoalaProfiler.map === undefined) return - let set = KoalaProfiler.map!.get(nodeType) - if (set === undefined) throw new Error("node never existed") - if (!set.delete(node)) console.log("node is already disposed") - } - - public static counters: KoalaProfiler | undefined = undefined - - private invalidations = 0 - private computes = 0 - private builds = 0 - private nodes = 0 - private realDraws = 0 - private cachedDraws = 0 - private measures = 0 - private layouts = 0 - private frames = 0 - private lastTime = 0.0 - private lastFPS = 0 - private updateEnterTime = 0.0 - private updateExitTime = 0.0 - private updateTime = 0.0 - private buildEnterTime = 0.0 - private buildExitTime = 0.0 - private buildTime = 0.0 - private layoutEnterTime = 0.0 - private layoutExitTime = 0.0 - private layoutTime = 0.0 - private drawEnterTime = 0.0 - private drawExitTime = 0.0 - private drawTime = 0.0 - private updatableStates = 0 - private mutableStates = 0 - private computableValues = 0 - - static enable() { - KoalaProfiler.counters = new KoalaProfiler() - } - - static disable() { - KoalaProfiler.counters = undefined - } - - static enabled(): boolean { - return KoalaProfiler.counters != undefined - } - - reset() { - this.invalidations = 0 - this.computes = 0 - this.builds = 0 - this.nodes = 0 - this.realDraws = 0 - this.cachedDraws = 0 - this.layouts = 0 - this.measures = 0 - this.updateEnterTime = 0 - this.updateExitTime = 0 - this.updatableStates = 0 - this.mutableStates = 0 - this.computableValues = 0 - } - - report() { - console.log(this.getReport()) - } - - getReport(): string { - const updateTime = Math.round(1000 * (this.updateExitTime - this.updateEnterTime)) - const buildTime = Math.round(1000 * (this.buildExitTime - this.buildEnterTime)) - const layoutTime = Math.round(1000 * (this.layoutExitTime - this.layoutEnterTime)) - const drawTime = Math.round(1000 * (this.drawExitTime - this.drawEnterTime)) - if (this.updateTime < updateTime) this.updateTime = updateTime - if (this.buildTime < buildTime) this.buildTime = buildTime - if (this.layoutTime < layoutTime) this.layoutTime = layoutTime - if (this.drawTime < drawTime) this.drawTime = drawTime - - // TODO: OHOS does not properly handle \n in template literals - const array = Array.of( - `invalidations: ${this.invalidations}`, - `modified states: ${this.mutableStates}/${this.updatableStates} + ${this.computableValues}`, - `update states (mks): ${this.updateTime} / ${updateTime}`, - `build root node (mks): ${this.buildTime} / ${buildTime}`, - `layout view (mks): ${this.layoutTime} / ${layoutTime}`, - `draw view (mks): ${this.drawTime} / ${drawTime}`, - `computes: ${this.computes}`, - `builds: ${this.builds}`, - `nodes: ${this.nodes}`, - `realDraws: ${this.realDraws}`, - `cachedDraws: ${this.cachedDraws}`, - `measures: ${this.measures}`, - `layouts: ${this.layouts}`, - `FPS: ${this.lastFPS}`, - ) - KoalaProfiler.map?.forEach((set:Set, kind:int32) => { - if (set.size > 0) array.push(kind + ":" + set.size) - }) - return array.join("\n") - } - - invalidation() { this.invalidations++ } - compute() { this.computes++ } - build() { this.builds++ } - node() { this.nodes++ } - realDraw() { this.realDraws++ } - cachedDraw() { this.cachedDraws++ } - layout() { this.layouts++ } - measure() { this.measures++ } - frame(ms: number) { - if (ms - this.lastTime <= 1000) { - this.frames++ - } else { - this.lastFPS = Math.round(this.frames * 1000 / (ms - this.lastTime)) as int32 - this.frames = 1 - this.lastTime = ms - } - } - buildRootEnter() { - this.buildEnterTime = Date.now() - } - buildRootExit() { - this.buildExitTime = Date.now() - } - layoutEnter() { - this.layoutEnterTime = Date.now() - } - layoutExit() { - this.layoutExitTime = Date.now() - } - drawEnter() { - this.drawEnterTime = Date.now() - } - drawExit() { - this.drawExitTime = Date.now() - } - updateSnapshotEnter() { - this.updateEnterTime = Date.now() - } - updateSnapshotExit() { - this.updateExitTime = Date.now() - } - updateSnapshot(modified: int32, all?: int32) { - if (all === undefined) { - this.computableValues = modified - this.mutableStates - - } else { - this.mutableStates = modified - this.updatableStates = all - } - } -} diff --git a/koala-wrapper/koalaui/common/src/MarkableQueue.ts b/koala-wrapper/koalaui/common/src/MarkableQueue.ts deleted file mode 100644 index 6d6efa518..000000000 --- a/koala-wrapper/koalaui/common/src/MarkableQueue.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AtomicRef } from "@koalaui/compat" - -/** - * A markable queue that allows to accumulate callbacks and to call them to the latest set marker. - */ -export interface MarkableQueue { - /** Sets the new marker to the queue. */ - setMarker(): void - /** Adds the given callback to the queue. */ - addCallback(callback: () => void): void - /** Calls all accumulated callbacks to the latest set marker. */ - callCallbacks(): void - /** Clears the queue. */ - clear(): void -} - -/** - * Creates a new markable queue to safely process callbacks across several threads or tasks. - * @param reversed - `true` changes the order of calling callbacks - */ -export function markableQueue(reversed: boolean = false): MarkableQueue { - return reversed ? new ReversedQueue() : new DefaultQueue() -} - -class DefaultQueue implements MarkableQueue { - private readonly last = new AtomicRef(new Block()) - private readonly first = new AtomicRef(this.last.value) - private readonly marker = new AtomicRef(undefined) - - setMarker(): void { - const marker = new Block() - this.last.getAndSet(marker).next.value = marker - this.marker.value = marker - } - - addCallback(callback: () => void): void { - const block = new Block(callback) - this.last.getAndSet(block).next.value = block - } - - callCallbacks(): void { - const marker = this.marker.getAndSet(undefined) - if (marker) { - let block = this.first.getAndSet(marker) - while (block !== marker) { - block.callback?.() - block = block.next.value! - } - } - } - - clear(): void { - this.last.value = this.first.value - this.marker.value = undefined - } -} - -class ReversedQueue implements MarkableQueue { - private readonly last = new AtomicRef(undefined) - private readonly marker = new AtomicRef(undefined) - - setMarker(): void { - const marker = new Block() - marker.next.value = this.last.getAndSet(marker) - this.marker.value = marker - } - - addCallback(callback: () => void): void { - const block = new Block(callback) - block.next.value = this.last.getAndSet(block) - } - - callCallbacks(): void { - const marker = this.marker.getAndSet(undefined) - if (marker) { - let block = marker.next.getAndSet(undefined) - while (block) { - block!.callback?.() - block = block!.next.value - } - } - } - - clear(): void { - this.last.value = undefined - this.marker.value = undefined - } -} - -class Block { - readonly next = new AtomicRef(undefined) - readonly callback: (() => void) | undefined - - constructor(callback?: () => void) { - this.callback = callback - } -} diff --git a/koala-wrapper/koalaui/common/src/Matrix33.ts b/koala-wrapper/koalaui/common/src/Matrix33.ts deleted file mode 100644 index 978e3a907..000000000 --- a/koala-wrapper/koalaui/common/src/Matrix33.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Array_from_number, float32, float64 } from "@koalaui/compat" - -export function mat33(array?: Float32Array): Matrix33 { - return (array == undefined) ? new Matrix33 () : new Matrix33(array) -} - -const tolerance: float32 = (1.0 / (1 << 12)) - -export class Matrix33 { - public readonly array: Float32Array - constructor (array: Float32Array = new Float32Array(Array_from_number([ - 1.0, 0.0, 0.0, - 0.0, 1.0, 0.0, - 0.0, 0.0, 1.0 - ]))) { - this.array = array.slice() - } - - static zero(): Matrix33 { - return new Matrix33(new Float32Array(Array_from_number([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]))) - } - - static makeTranslate(dx: float32, dy: float32): Matrix33 { - return new Matrix33(new Float32Array(Array_from_number([1.0, 0.0, dx as float64, 0.0, 1.0, dy as float64, 0.0, 0.0, 1.0]))) - } - - static makeScale(dx: float32, dy: float32 = dx): Matrix33 { - return new Matrix33(new Float32Array(Array_from_number([dx as float64, 0.0, 0.0, 0.0, dy as float64, 0.0, 0.0, 0.0, 1.0]))) - } - - static makeRotate(degrees: float32, pivotX?: float32, pivotY?: float32): Matrix33 { - let rads = degrees * Math.PI / 180 - let cos = Math.cos(rads) - let sin = Math.sin(rads) - if (Math.abs(sin) <= tolerance) sin = 0.0 - if (Math.abs(cos) <= tolerance) cos = 0.0 - if (pivotX !== undefined && pivotY != undefined) { - let dx = pivotX - pivotX * cos + pivotY * sin - let dy = pivotY - pivotY * cos - pivotX * sin - return new Matrix33(new Float32Array(Array_from_number([cos, -sin, dx, sin, cos, dy, 0.0, 0.0, 1.0]))) - } else { - return new Matrix33(new Float32Array(Array_from_number([cos, -sin, 0.0, sin, cos, 0.0, 0.0, 0.0, 1.0]))) - } - } - - static makeSkew(sx: float32, sy: float32): Matrix33 { - return new Matrix33(new Float32Array(Array_from_number([1.0, sx, 0.0, sy, 1.0, 0.0, 0.0, 0.0, 1.0]))) - } - - makeConcat(rhs: Matrix33): Matrix33 { - return new Matrix33(new Float32Array(Array_from_number([ - this.array[0] * rhs.array[0] + this.array[1] * rhs.array[3] + this.array[2] * rhs.array[6], - this.array[0] * rhs.array[1] + this.array[1] * rhs.array[4] + this.array[2] * rhs.array[7], - this.array[0] * rhs.array[2] + this.array[1] * rhs.array[5] + this.array[2] * rhs.array[8], - this.array[3] * rhs.array[0] + this.array[4] * rhs.array[3] + this.array[5] * rhs.array[6], - this.array[3] * rhs.array[1] + this.array[4] * rhs.array[4] + this.array[5] * rhs.array[7], - this.array[3] * rhs.array[2] + this.array[4] * rhs.array[5] + this.array[5] * rhs.array[8], - this.array[6] * rhs.array[0] + this.array[7] * rhs.array[3] + this.array[8] * rhs.array[6], - this.array[6] * rhs.array[1] + this.array[7] * rhs.array[4] + this.array[8] * rhs.array[7], - this.array[6] * rhs.array[2] + this.array[7] * rhs.array[5] + this.array[8] * rhs.array[8], - ]))) - } - - makeTranspose(): Matrix33{ - return new Matrix33(new Float32Array(Array_from_number([ - this.array[0], this.array[3], this.array[6], - this.array[1], this.array[4], this.array[7], - this.array[2], this.array[5], this.array[8] - ]))) - } -} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/src/Matrix44.ts b/koala-wrapper/koalaui/common/src/Matrix44.ts deleted file mode 100644 index 163b53949..000000000 --- a/koala-wrapper/koalaui/common/src/Matrix44.ts +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Array_from_number, float32 } from "@koalaui/compat" -import { Matrix33 } from "./Matrix33" -import { Point3 } from "./Point3" - - -export interface RotateOptions { - angle?: float32 - x?: float32 - y?: float32 - z?: float32 - pivotX?: float32 - pivotY?: float32 - pivotZ?: float32 -} - -export interface ScaleOptions { - x?: float32 - y?: float32 - z?: float32 - pivotX?: float32 - pivotY?: float32 - pivotZ?: float32 -} - -export interface TranslateOptions { - x?: float32 - y?: float32 - z?: float32 -} - -// TODO: this is because ArkTS doesn allow interface literal instances. -class TranslateOptionsImpl implements TranslateOptions { - _x: float32 | undefined - _y: float32 | undefined - _z: float32 | undefined - - get x(): float32 | undefined { return this._x } - get y(): float32 | undefined { return this._y } - get z(): float32 | undefined { return this._z } - - set x(x: float32 | undefined) { this._x = x } - set y(y: float32 | undefined) { this._y = y } - set z(z: float32 | undefined) { this._z = z } - - constructor( - x: float32 | undefined, - y: float32 | undefined, - z: float32 | undefined - ) { - this._x = x - this._y = y - this._z = z - } -} - -export function mat44(array?: Float32Array): Matrix44 { - return (array == undefined)? new Matrix44() : new Matrix44(array) -} -/** - * 4x4 matrix with right-handed coordinate system: - * +x goes to the right - * +y goes down - * +z goes into the screen (away from the viewer) - */ -export class Matrix44 { - public readonly array: Float32Array - constructor (array: Float32Array = new Float32Array(Array_from_number([ - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - ]))) { - this.array = array.slice() - } - - public static identity(): Matrix44 { - return mat44() - } - - static zero(): Matrix44 { - return mat44(new Float32Array(Array_from_number([ - 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, - ]))) - } - - public static lookAt(eye: Point3, center: Point3, up: Point3): Matrix44 { - const f = center.subtract(eye).normalize() - const u = up.normalize() - const s = f.cross(u).normalize() - const sf = s.cross(f) - return new Matrix44(new Float32Array(Array_from_number([ - s.x, sf.x, -f.x, eye.x, - s.y, sf.y, -f.y, eye.y, - s.z, sf.z, -f.z, eye.z, - 0, 0, 0, 1, - ]))).invert() - } - - public static perspective(depth: float32): Matrix44 { - return new Matrix44(new Float32Array(Array_from_number([ - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, -1.0 / depth, 1.0, - ]))) - } - - public static perspectiveFov(fov: float32, near: float32, far: float32): Matrix44 { - const denomInv = (far - near) - const halfAngle = fov * 0.5; - const cot = Math.cos(halfAngle) / Math.sin(halfAngle) - return new Matrix44(new Float32Array(Array_from_number([ - cot, 0.0, 0.0, 0.0, - 0.0, cot, 0.0, 0.0, - 0.0, 0.0, (far + near) * denomInv, 2 * far * near * denomInv, - 0.0, 0.0, -1.0, 0.0, - ]))) - } - - /** - * Returns new matrix, made from Matrix33. - * - * @param matrix - 3x3 matrix - * @returns the new instance of Matrix44 - * - */ - public static makeFromMatrix33(matrix: Matrix33): Matrix44{ - return new Matrix44(new Float32Array(Array_from_number([ - matrix.array[0], matrix.array[1], 0.0, matrix.array[2], - matrix.array[3], matrix.array[4], 0.0, matrix.array[5], - 0.0, 0.0, 1.0, 0.0, - matrix.array[6], matrix.array[7], 0.0, matrix.array[8] - ]))) - } - - /** - * Returns new 3x3 matrix, made from this matrix by dropping the third row and the third column. - * - * @returns the new instance of Matrix33 - * - */ - public asMatrix33(): Matrix33{ - return new Matrix33(new Float32Array(Array_from_number([ - this.array[0], this.array[1], this.array[3], - this.array[4], this.array[5], this.array[7], - this.array[12], this.array[13], this.array[15] - ]))) - } - - public copy(): Matrix44 { - return new Matrix44(new Float32Array(Array_from_number([ - this.array[0], this.array[1], this.array[2], this.array[3], - this.array[4], this.array[5], this.array[6], this.array[7], - this.array[8], this.array[9], this.array[10], this.array[11], - this.array[12], this.array[13], this.array[14], this.array[15] - ]))) - } - - concat(matrix: Matrix44): Matrix44 { - const result: Float32Array = new Float32Array(Array_from_number([ - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0, - ])) - for (let row = 0; row < 4; row++) { - for (let col = 0; col < 4; col++) { - let num: float32 = 0 - for (let k = 0; k < 4; k++) { - num += this.array[row * 4 + k] * matrix.array[col + 4 * k] - } - result[row * 4 + col] = num - } - } - for (let i = 0; i < this.array.length; i++) { - this.array[i] = result[i] - } - return this - } - - public scale(options: ScaleOptions): Matrix44 { - const scaled = new Matrix44() - scaled.array[0] = options.x ?? 1.0 as float32 - scaled.array[5] = options.y ?? 1.0 as float32 - scaled.array[10] = options.z ?? 1.0 as float32 - - this.translate(new TranslateOptionsImpl( - -(options.pivotX ?? 0.0 as float32) * (options.x ?? 1.0 as float32) + (options.pivotX ?? 0.0 as float32), - -(options.pivotY ?? 0.0 as float32) * (options.y ?? 1.0 as float32) + (options.pivotY ?? 0.0 as float32), - undefined - )).concat(scaled) - - return this - } - - public rotate(options: RotateOptions): Matrix44 { - const translationToPivot = mat44().translate(new TranslateOptionsImpl( - (options.pivotX ?? 0.0 as float32), - (options.pivotY ?? 0.0 as float32), - (options.pivotZ ?? 0.0 as float32), - )) - const translationToBack = mat44().translate(new TranslateOptionsImpl( - -(options.pivotX ?? 0.0 as float32), - -(options.pivotY ?? 0.0 as float32), - -(options.pivotZ ?? 0.0 as float32), - )) - - const vec = new Point3(options.x ?? 0.0 as float32, options.y ?? 0.0 as float32, options.z ?? 0.0 as float32).normalize() - const rads = (options.angle ?? 0.0 as float32) * Math.PI / 180 - let c = Math.cos(rads) - let s = Math.sin(rads) - const tolerance = (1.0 / (1 << 12)) - if (Math.abs(s) <= tolerance) s = 0.0 - if (Math.abs(c) <= tolerance) c = 0.0 - let t = 1 - c - const x = vec.x - const y = vec.y - const z = vec.z - - const rotation = mat44() - rotation.array[0] = t * x * x + c - rotation.array[1] = t * x * y - s * z - rotation.array[2] = t * x * z + s * y - rotation.array[3] = 0 - rotation.array[4] = t * x * y + s * z - rotation.array[5] = t * y * y + c - rotation.array[6] = t * y * z - s * x - rotation.array[7] = 0 - rotation.array[8] = t * x * z - s * y - rotation.array[9] = t * y * z + s * x - rotation.array[10] = t * z * z + c - rotation.array[11] = 0 - rotation.array[12] = 0 - rotation.array[13] = 0 - rotation.array[14] = 0 - rotation.array[15] = 1 - - this.concat(translationToPivot).concat(rotation).concat(translationToBack) - - return this - } - - public translate(options: TranslateOptions): Matrix44 { - this.array[3] = options.x ?? 0.0 as float32 - this.array[7] = options.y ?? 0.0 as float32 - this.array[11] = options.z ?? 0.0 as float32 - return this - } - - public invert(): Matrix44 { - const result: Float32Array = new Float32Array(16) - - let a00 = this.array[0] - let a01 = this.array[1] - let a02 = this.array[2] - let a03 = this.array[3] - let a10 = this.array[4] - let a11 = this.array[5] - let a12 = this.array[6] - let a13 = this.array[7] - let a20 = this.array[8] - let a21 = this.array[9] - let a22 = this.array[10] - let a23 = this.array[11] - let a30 = this.array[12] - let a31 = this.array[13] - let a32 = this.array[14] - let a33 = this.array[15] - - let b00 = a00 * a11 - a01 * a10 - let b01 = a00 * a12 - a02 * a10 - let b02 = a00 * a13 - a03 * a10 - let b03 = a01 * a12 - a02 * a11 - let b04 = a01 * a13 - a03 * a11 - let b05 = a02 * a13 - a03 * a12 - let b06 = a20 * a31 - a21 * a30 - let b07 = a20 * a32 - a22 * a30 - let b08 = a20 * a33 - a23 * a30 - let b09 = a21 * a32 - a22 * a31 - let b10 = a21 * a33 - a23 * a31 - let b11 = a22 * a33 - a23 * a32 - - let determinant = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06 - let invdet = 1.0 / determinant - b00 *= invdet - b01 *= invdet - b02 *= invdet - b03 *= invdet - b04 *= invdet - b05 *= invdet - b06 *= invdet - b07 *= invdet - b08 *= invdet - b09 *= invdet - b10 *= invdet - b11 *= invdet - - result[0] = a11 * b11 - a12 * b10 + a13 * b09 - result[1] = a02 * b10 - a01 * b11 - a03 * b09 - result[2] = a31 * b05 - a32 * b04 + a33 * b03 - result[3] = a22 * b04 - a21 * b05 - a23 * b03 - result[4] = a12 * b08 - a10 * b11 - a13 * b07 - result[5] = a00 * b11 - a02 * b08 + a03 * b07 - result[6] = a32 * b02 - a30 * b05 - a33 * b01 - result[7] = a20 * b05 - a22 * b02 + a23 * b01 - result[8] = a10 * b10 - a11 * b08 + a13 * b06 - result[9] = a01 * b08 - a00 * b10 - a03 * b06 - result[10] = a30 * b04 - a31 * b02 + a33 * b00 - result[11] = a21 * b02 - a20 * b04 - a23 * b00 - result[12] = a11 * b07 - a10 * b09 - a12 * b06 - result[13] = a00 * b09 - a01 * b07 + a02 * b06 - result[14] = a31 * b01 - a30 * b03 - a32 * b00 - result[15] = a20 * b03 - a21 * b01 + a22 * b00 - - // If 1/det overflows to infinity (i.e. det is denormalized) or any of the inverted matrix - // values is non-finite, return zero to indicate a non-invertible matrix. - let prod = 0 - for (let i = 0; i < result.length; ++i) { - prod *= result[i] - } - // At this point, prod will either be NaN or 0 - // if prod is NaN, this check will return false - if (prod == 0) { - for (let i = 0; i < this.array.length; i++) { - this.array[i] = result[i] - } - } - return this - } - - public transpose(): Matrix44 { - const result: Float32Array = new Float32Array(16) - - result[0] = this.array[0] - result[1] = this.array[4] - result[2] = this.array[8] - result[3] = this.array[12] - result[4] = this.array[1] - result[5] = this.array[5] - result[6] = this.array[9] - result[7] = this.array[13] - result[8] = this.array[2] - result[9] = this.array[6] - result[10] = this.array[10] - result[11] = this.array[14] - result[12] = this.array[3] - result[13] = this.array[7] - result[14] = this.array[11] - result[15] = this.array[15] - - for (let i = 0; i < this.array.length; i++) { - this.array[i] = result[i] - } - - return this - } - - public skew(x?: float32, y?: float32): Matrix44 { - this.array[1] += x ?? 0.0 as float32 - this.array[4] += y ?? 0.0 as float32 - return this - } -} diff --git a/koala-wrapper/koalaui/common/src/PerfProbe.ts b/koala-wrapper/koalaui/common/src/PerfProbe.ts deleted file mode 100644 index 063d4d590..000000000 --- a/koala-wrapper/koalaui/common/src/PerfProbe.ts +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { float64, int32, timeNow, numberToFixed } from "@koalaui/compat" - -/** - * A probe to measure performance. - * - * A probe can measure performance of any activity which has an entry and an exit points. - * Such activity can be a method call, or a sequence of actions, possibly asynchronous. - * - * A probe which has been entered and exited is considered a performed probe (see {@link MainPerfProbe.probePerformed}). - * A probe can be entered recursively. When all the recursive calls exits the probe becomes a performed probe. - * - * All performing probes form a hierarchy which is rooted at the main probe (see {@link enterMainPerfProbe}). - * A last started probe (see {@link MainPerfProbe.enterProbe}) which has not yet performed becomes a parent - * for the next started probe. It's the responsibility of the API caller to keep this parent-child relationship valid, - * that is: a child probe should exit before its parent probe exits. - * - * Statistics gathered by a probe: - * - call count - * - recursive call count - * - total time and percentage relative to the main (root) probe - */ -export interface PerfProbe { - /** - * The name of the probe. - */ - readonly name: string - - /** - * Whether this is a dummy probe which does not measure (a noop). - * - * @see MainPerfProbe.getProbe - */ - readonly dummy: boolean - - /** - * Exists the probe. - * - * @param log log the gathered statistics. - * @see MainPerfProbe.enterProbe - */ - exit(log: boolean|undefined): void - - /** - * Cancels measuring the probe and its children probes. - */ - cancel(): void - - /** - * User-defined data associated with the probe. - */ - userData: string | undefined - - /** - * Whether the probe was canceled. - */ - readonly canceled: boolean -} - -/** - * The main (root) {@link PerfProbe}. - * - * This probe is used to enter the main activity. - * - * Calling {@link PerfProbe.cancel} removes the main probe and disposes all its resources. - * - * Calling {@link PerfProbe.exit} exits the main probe, cancels it and when the log option is provided - * logs the gathered statistics. - * - * @see enterMainPerfProbe - * @see getMainPerfProbe - */ -export interface MainPerfProbe extends PerfProbe { - /** - * Enters a child probe referenced by the {@link name} and measures it. - * If the probe does not exist, returns a dummy instance. - * - * If the probe already performs a recursive call is counted. - * - * @see PerfProbe.exit - * @see exitProbe - */ - enterProbe(name: string): PerfProbe - - /** - * Exits a child probe referenced by the {@link name}. - * If the probe does not exist, returns a dummy instance. - * - * This is an equivalent of calling {@link getProbe} and then {@link PerfProbe.exit}. - */ - exitProbe(name: string): PerfProbe - - /** - * Returns the child probe referenced by the {@link name} if it exists, - * otherwise a dummy instance. - * - * @see PerfProbe.dummy - */ - getProbe(name: string): PerfProbe - - /** - * Performs the {@link func} of a child probe referenced by the {@link name} and measures it. - * - * This is an equivalent of calling {@link enterProbe} and then {@link exitProbe}. - * - * If the probe already performs a recursive call is counted. - */ - performProbe(name: string, func: () => T): T - - /** - * Returns true if the probe referenced by the {@link name} has been performed - * (entered and exited all the recursive calls). - */ - probePerformed(name: string): boolean -} - -/** - * Creates a {@link MainPerfProbe} instance with the {@link name} and enters its main probe. - * - * If a {@link MainPerfProbe} with this {@link name} already exists then it is canceled and the new one is created. - * - * Exit it with {@link MainPerfProbe.exit}. - */ -export function enterMainPerfProbe(name: string): MainPerfProbe { - return new MainPerfProbeImpl(name) -} - -/** - * Returns {@link MainPerfProbe} instance with the {@link name} if it exists, - * otherwise a dummy instance. - * - * @see MainPerfProbe.dummy - */ -export function getMainPerfProbe(name: string): MainPerfProbe { - const instance = MainPerfProbeImpl.mainProbes.get(name) - return instance ? instance : MainPerfProbeImpl.DUMMY -} - -class DummyPerfProbe implements MainPerfProbe { - get name(): string { return "dummy" } - get dummy(): boolean { return true } - exit(log: boolean|undefined): void {} - cancel () {} - get canceled(): boolean { return false } - enterProbe(name: string): PerfProbe { return PerfProbeImpl.DUMMY } - exitProbe (name: string): PerfProbe { return PerfProbeImpl.DUMMY } - getProbe(name: string): PerfProbe { return PerfProbeImpl.DUMMY } - //performProbe: (_: string, func: () => T) => func(), - performProbe(name: string, func: () => T): T { return func() } - probePerformed(_: string): boolean { return false } - - get userData(): string | undefined { - return undefined - } - set userData(_: string | undefined) {} -} - -class PerfProbeImpl implements PerfProbe { - constructor( - name: string, - main?: MainPerfProbeImpl, - parent?: PerfProbeImpl, - remainder: boolean = false - ) { - this._name = name - this._main = main - this.parent = parent - this.remainder = remainder - } - - private readonly _name: string - private readonly _main: MainPerfProbeImpl|undefined - public parent: PerfProbeImpl|undefined - public readonly remainder: boolean - - children: Array = new Array() - childrenSorted: boolean = false - index: int32 = 0 - startTime: float64 = 0.0 - totalTime: float64 = 0.0 - callCount: int32 = 0 - currentRecursionDepth: int32 = 0 - recursiveCallCount: int32 = 0 - _canceled: boolean = false - private _userData?: string - - get name(): string { - return this._name - } - - get dummy(): boolean { - return false - } - - get main(): MainPerfProbeImpl { - return this._main! - } - - get performing(): boolean { - return this.startTime > 0 - } - - get userData(): string | undefined { - return this._userData - } - - set userData(value: string | undefined) { - this._userData = value - } - - exit(log?: boolean): void { - if (this.canceled) return - - if (this.currentRecursionDepth == 0) { - this.totalTime += timeNow() - this.startTime - this.startTime = 0 - } else { - this.currentRecursionDepth-- - } - if (!this.performing) { - this.main.pop(this) - } - if (log) this.log() - } - - cancel(cancelChildren: boolean = true) { - this._canceled = true - if (cancelChildren) this.maybeCancelChildren() - } - - private maybeCancelChildren() { - MainPerfProbeImpl.visit(this, false, (probe: PerfProbeImpl, depth: int32) => { - if (probe.performing) probe.cancel(false) - }) - } - - get canceled(): boolean { - return this._canceled - } - - toString(): string { - if (this.canceled) { - return `[${this.name}] canceled` - } - if (this.performing) { - return `[${this.name}] still performing...` - } - const mainProbe = this.main.probes.get(this.main.name)! - const percentage = mainProbe.totalTime > 0 ? Math.round((100 / mainProbe.totalTime) * this.totalTime) : 0 - - let result = `[${this.name}] call count: ${this.callCount}` - + ` | recursive call count: ${this.recursiveCallCount}` - + ` | time: ${this.totalTime}ms ${percentage}%` - - if (this.userData) { - result += ` | user data: ${this.userData}` - } - - return result - } - - protected log(prefix?: string) { - console.log(prefix ? `${prefix}${this.toString()}` : this.toString()) - } - - static readonly DUMMY: PerfProbe = new DummyPerfProbe() -} - -class MainPerfProbeImpl extends PerfProbeImpl implements MainPerfProbe { - constructor( - name: string - ) { - super(name) - const prev = MainPerfProbeImpl.mainProbes.get(name) - if (prev) prev.cancel() - MainPerfProbeImpl.mainProbes.set(name, this) - this.currentProbe = this.enterProbe(name) - } - - static readonly mainProbes: Map = new Map() - - currentProbe: PerfProbeImpl - probes: Map = new Map() - - private createProbe(name: string): PerfProbeImpl { - const probes = name == this.name ? this : new PerfProbeImpl(name, this) - this.push(probes) - return probes - } - - get main(): MainPerfProbeImpl { - return this - } - - push(probe: PerfProbeImpl) { - probe.parent = this.currentProbe - probe.index = probe.parent ? probe.parent!.children.length as int32 : 0 - if (probe.parent) probe.parent!.children.push(probe) - this.currentProbe = probe - } - - pop(probe: PerfProbeImpl) { - if (probe.parent) { - this.currentProbe = probe.parent! - } - } - - performProbe(name: string, func: () => T): T { - const probe = this.enterProbe(name) - try { - return func() - } finally { - probe.exit() - } - } - - enterProbe(name: string): PerfProbeImpl { - let probe = this.probes.get(name) - if (!probe) { - probe = this.createProbe(name) - this.probes.set(name, probe) - } - probe._canceled = false - - if (probe.performing) { - probe.recursiveCallCount++ - probe.currentRecursionDepth++ - } else { - probe.startTime = timeNow() - probe.callCount++ - } - return probe - } - - exitProbe(name: string): PerfProbe { - const probe = this.getProbe(name) - probe.exit(undefined) - return probe - } - - getProbe(name: string): PerfProbe { - const probe = this.probes.get(name) - return probe !== undefined ? probe : PerfProbeImpl.DUMMY - } - - probePerformed(name: string): boolean { - const probe = this.probes.get(name) - return probe != undefined && !probe!.performing && !probe!.canceled - } - - exit(log?: boolean) { - super.exit() - if (log) this.log() - this.cancel() - } - - cancel() { - MainPerfProbeImpl.mainProbes.delete(this.name) - } - - static visit(root: PerfProbeImpl, logging: boolean, apply: (probe: PerfProbeImpl, depth: int32) => void) { - let current: PerfProbeImpl = root - let index = 0 - let depth = 0 - let visiting = true - while (true) { - if (visiting) { - current.index = 0 - apply(current, depth) - } - if (index >= current.children.length) { - if (!current.parent) { - break - } - current = current.parent! - index = ++current.index - depth-- - visiting = false - continue - } - visiting = true - if (logging && !current.childrenSorted) { - current.childrenSorted = true - current.children = current.children.sort((p1: PerfProbeImpl, p2: PerfProbeImpl):number => p2.totalTime - p1.totalTime) - if (depth == 0) { - // a special probe to log the time remained - current.children.push(new PerfProbeImpl("", root.main, current, true)) - } - } - current = current.children[index] - index = 0 - depth++ - } - } - - protected log(prefix?: string) { - prefix = prefix !== undefined ? `${prefix}: ` : "" - console.log(`${prefix}perf probes:`) - - MainPerfProbeImpl.visit(this.main, true, (probe, depth):void => { - let indent = "\t" - for (let i = 0; i < depth; i++) indent += "\t" - if (probe.remainder) { - const parentTime = probe.parent!.totalTime - let childrenTime = 0 - probe.parent!.children.forEach((a: PerfProbeImpl):void => { childrenTime += a.totalTime }) - probe.totalTime = Math.max(0, parentTime - childrenTime) as int32 - const percentage = parentTime > 0 ? Math.round((100 / parentTime) * probe.totalTime) : 0 - console.log(`${prefix}${indent}[${probe.name}] time: ${numberToFixed(probe.totalTime, 2)}ms ${percentage}%`) - } else { - console.log(`${prefix}${indent}${probe.toString()}`) - } - }) - } - - static readonly DUMMY: MainPerfProbe = new DummyPerfProbe() -} diff --git a/koala-wrapper/koalaui/common/src/Point.ts b/koala-wrapper/koalaui/common/src/Point.ts deleted file mode 100644 index 1a89eadcd..000000000 --- a/koala-wrapper/koalaui/common/src/Point.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { float32 } from "@koalaui/compat" - -export class Point { - coordinates: Float32Array - - constructor (x: float32, y: float32) { - this.coordinates = new Float32Array(2) - this.coordinates[0] = x - this.coordinates[1] = y - } - - get x(): float32 { - return this.coordinates[0] as float32 - } - - get y(): float32 { - return this.coordinates[1] as float32 - } - - offsetXY(dx: float32, dy: float32): Point { - return new Point(this.x + dx, this.y + dy) - } - - offset(vec: Point): Point { - return this.offsetXY(vec.x, vec.y) - } - - scale(scale: float32): Point { - return this.scaleXY(scale, scale) - } - - scaleXY(sx: float32, sy: float32): Point { - return new Point(this.x * sx, this.y * sy) - } - - static ZERO = new Point(0.0 as float32, 0.0 as float32) - - toArray(): Float32Array { - return this.coordinates - } - - static flattenArray(points: Array): Float32Array { - let array = new Float32Array(points.length * 2) - for (let i = 0; i < points.length; i++) { - array[i * 2] = points[i].x - array[i * 2 + 1] = points[i].y - } - return array - } - - static fromArray(points: Float32Array): Array { - if (points.length % 2 != 0) - throw new Error("Expected " + points.length + " % 2 == 0") - - let array = new Array(points.length / 2) - for (let i = 0; i < points.length / 2; i++) { - array[i] = new Point(points[i * 2] as float32, points[i * 2 + 1] as float32) - } - return array - } -} diff --git a/koala-wrapper/koalaui/common/src/Point3.ts b/koala-wrapper/koalaui/common/src/Point3.ts deleted file mode 100644 index 04e86ee2a..000000000 --- a/koala-wrapper/koalaui/common/src/Point3.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { float32 } from "@koalaui/compat" - -export class Point3 { - x: float32 - y: float32 - z: float32 - constructor(x: float32, y: float32, z: float32) { - this.x = x - this.y = y - this.z = z - } - - subtract(value: Point3): Point3 { - return new Point3( - this.x - value.x, - this.y - value.y, - this.z - value.z - ) - } - - cross(value: Point3): Point3 { - return new Point3( - this.y * value.z - this.z * value.y, - this.z * value.x - this.x * value.z, - this.x * value.y - this.y * value.x - ) - } - - normalize(): Point3 { - const mag = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z) as float32 - const tolerance = (1.0 / (1 << 12)) - if (mag < tolerance) { - // This semicolon after return this is a workaround for ArkTS bug - return this; - } - return new Point3(this.x / mag, this.y / mag, this.z / mag) - } -} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/src/index.ts b/koala-wrapper/koalaui/common/src/index.ts deleted file mode 100644 index 471b714b3..000000000 --- a/koala-wrapper/koalaui/common/src/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { - int8, uint8, - int32, uint32, - int64, uint64, - float32, float64, - asArray, - asFloat64, - float32FromBits, - int32BitsFromFloat, - Array_from_set, - AtomicRef, - CustomTextDecoder, - CustomTextEncoder, - className, lcClassName, - functionOverValue, - Observed, - Observable, - ObservableHandler, - observableProxy, - observableProxyArray, - isFunction, - propDeepCopy, - refEqual, - int8Array, - unsafeCast -} from "@koalaui/compat" -export { clamp, lerp, modulo, parseNumber, isFiniteNumber, getDistancePx } from "./math" -export { hashCodeFromString } from "./stringUtils" -export { KoalaProfiler } from "./KoalaProfiler" -export * from "./PerfProbe" -export * from "./Errors" -export * from "./LifecycleEvent" -export * from "./Finalization" -export * from "./MarkableQueue" -export * from "./Matrix33" -export * from "./Matrix44" -export * from "./Point3" -export * from "./Point" -export { SHA1Hash, createSha1 } from "./sha1" -export { UniqueId } from "./uniqueId" -export * from "./koalaKey" diff --git a/koala-wrapper/koalaui/common/src/koalaKey.ts b/koala-wrapper/koalaui/common/src/koalaKey.ts deleted file mode 100644 index 94c00f336..000000000 --- a/koala-wrapper/koalaui/common/src/koalaKey.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { int32 } from "@koalaui/compat" - -export type KoalaCallsiteKey = int32 - -export class KoalaCallsiteKeys { - static readonly empty: KoalaCallsiteKey = 0 as int32 - - static combine (key1: KoalaCallsiteKey, key2: KoalaCallsiteKey): KoalaCallsiteKey { - return key1 + key2 - } - - static asString(key: KoalaCallsiteKey): string { - return new Number(key).toString(16) - } -} diff --git a/koala-wrapper/koalaui/common/src/math.ts b/koala-wrapper/koalaui/common/src/math.ts deleted file mode 100644 index 9b8b15d87..000000000 --- a/koala-wrapper/koalaui/common/src/math.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { asFloat64, asString, float64 } from "@koalaui/compat" - -/** - * Computes the linear interpolation between `source` and `target` based on `weight`. - * - * @param weight - interpolation factor in the range [0..1] - * @param source - a value corresponding to weight 0 - * @param target - a value corresponding to weight 1 - * @returns interpolated value - */ -export function lerp(weight: float64, source: float64, target: float64): float64 { - return source * (1.0 - weight) + target * weight -} - -/** - * Clamps a {@link value} within the specified range. - * - * @param value - a value to clamp - * @param min - the lower boundary of the range - * @param max - the upper boundary of the range - * @returns `min` if `value` is less than `min`, - * `max` if `value` is greater than `max`, - * `value` otherwise - */ -export function clamp(value: float64, min: float64, max: float64): float64 { - return value <= min ? min : value >= max ? max : value -} - -/** - * Calculates the difference between the argument and - * the largest (closest to positive infinity) integer value - * that is less than or equal to the argument. - * - * @param value a floating-point value to process - * @returns a floor modulus of the given value in the range [0..1) - */ -export function modulo(value: float64): float64 { - // The casts below are needed since floor returns double in ArkTS - const modulo: float64 = value - Math.floor(value) - return (modulo < 1.0) ? modulo : 0.0 -} - -/** - * @param str a string to parse - * @param name a name for error message - * @param verify whether to verify parsing validity - * @returns a floating-point number - * @throws Error if `str` cannot be parsed - */ -export function parseNumber(str: string, name: string = "number", verify: boolean = false): float64 { - if (str != "") { // do not parse empty string to 0 - // ArkTS does not support NaN, isNaN, parseFloat - const value = asFloat64(str) - if (verify) { - const reverseStr = asString(value) - if (reverseStr !== undefined && reverseStr?.length == str.length && reverseStr == str) { - return value - } - } - else { - return value - } - } - throw new Error(`cannot parse ${name}: "${str}"`) -} - -/** - * An ArkTS-compliant replacement for {@link isFinite}. - */ -export function isFiniteNumber(number: float64): boolean { - // With Node.js: - // isFiniteNumber(Number.NEGATIVE_INFINITY) == false - // isFiniteNumber(Number.POSITIVE_INFINITY) == false - // isFiniteNumber(NaN) == false - return number >= Number.MIN_SAFE_INTEGER && number <= Number.MAX_SAFE_INTEGER -} - -export function getDistancePx(startX: float64, startY: float64, endX: float64, endY: float64): float64 { - const cathetA = Math.abs(endX - startX) - const cathetB = Math.abs(endY - startY) - return Math.sqrt(cathetA * cathetA + cathetB * cathetB) as float64 -} \ No newline at end of file diff --git a/koala-wrapper/koalaui/common/src/sha1.ts b/koala-wrapper/koalaui/common/src/sha1.ts deleted file mode 100644 index 11af4b187..000000000 --- a/koala-wrapper/koalaui/common/src/sha1.ts +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { CustomTextDecoder } from "@koalaui/compat" -import { int32 } from "@koalaui/compat" - -const K = [ - (0x5a827999 | 0) as int32, - (0x6ed9eba1 | 0) as int32, - (0x8f1bbcdc | 0) as int32, - (0xca62c1d6 | 0) as int32, -] - -const inputBytes = 64 -const inputWords = inputBytes / 4 -const highIndex = inputWords - 2 -const lowIndex = inputWords - 1 -const workWords = 80 -const allocBytes = 80 -const allocWords = allocBytes / 4 -const allocTotal = allocBytes * 100 - -export function createSha1(): SHA1Hash { - return new SHA1Hash() -} - -export class SHA1Hash { - private A = (0x67452301 | 0) as int32 - private B = (0xefcdab89 | 0) as int32 - private C = (0x98badcfe | 0) as int32 - private D = (0x10325476 | 0) as int32 - private E = (0xc3d2e1f0 | 0) as int32 - private readonly _byte: Uint8Array - private readonly _word: Int32Array - private _size = 0 - private _sp = 0 // surrogate pair - - constructor() { - if (!sharedBuffer || sharedOffset >= allocTotal) { - sharedBuffer = new ArrayBuffer(allocTotal) - sharedOffset = 0 - } - - this._byte = new Uint8Array(sharedBuffer, sharedOffset, allocBytes) - this._word = new Int32Array(sharedBuffer, sharedOffset, allocWords) - sharedOffset += allocBytes - } - - updateString(data: string, encoding?: string): SHA1Hash { - return this._utf8(data) - } - updateInt32(data: int32): SHA1Hash { - const buffer = new Int32Array(1) - buffer[0] = data - return this.update(buffer) - } - - update(data: Int32Array | Float32Array | Uint32Array | Uint8Array): SHA1Hash { - if (data == null) { - throw new TypeError("SHA1Hash expected non-null data: ") - } - - let byteOffset: int32 = 0 - let length: int32 = 0 - let buffer: ArrayBufferLike | undefined = undefined - - // TODO: an attempt to wrie this in a generic form causes - // es2panda to segfault. - if (data instanceof Int32Array) { - byteOffset = data.byteOffset as int32 - length = data.byteLength as int32 - buffer = data.buffer - } else if (data instanceof Uint32Array) { - byteOffset = data.byteOffset as int32 - length = data.byteLength as int32 - buffer = data.buffer - } else if (data instanceof Float32Array) { - byteOffset = data.byteOffset as int32 - length = data.byteLength as int32 - buffer = data.buffer - } else if (data instanceof Uint8Array) { - byteOffset = data.byteOffset as int32 - length = data.byteLength as int32 - buffer = data.buffer - } - - let blocks: int32 = ((length / inputBytes) | 0) as int32 - let offset: int32 = 0 - - // longer than 1 block - if ((blocks != 0) && !(byteOffset & 3) && !(this._size % inputBytes)) { - const block = new Int32Array(buffer!, byteOffset, blocks * inputWords) - while (blocks--) { - this._int32(block, offset >> 2) - offset += inputBytes - } - this._size += offset - } - - // data: TypedArray | DataView - const BYTES_PER_ELEMENT = (data as Uint8Array).BYTES_PER_ELEMENT as int32 - if ((BYTES_PER_ELEMENT != 1) && buffer != undefined) { - const rest = new Uint8Array(buffer, byteOffset + offset, length - offset) - return this._uint8(rest) - } - - // no more bytes - if (offset == length) return this - - return this._uint8(new Uint8Array(buffer!), offset) - } - - private _uint8(data: Uint8Array, offset?: int32): SHA1Hash { - const _byte = this._byte - const _word = this._word - const length = data.length - offset = ((offset ?? 0) | 0) as int32 - - while (offset < length) { - const start = this._size % inputBytes - let index = start - - while (offset < length && index < inputBytes) { - _byte[index++] = data[offset++] - } - - if (index >= inputBytes) { - this._int32(_word) - } - - this._size += index - start - } - - return this - } - - private _utf8(text: string): SHA1Hash { - const _byte = this._byte - const _word = this._word - const length = text.length - let surrogate = this._sp - - for (let offset = 0; offset < length; ) { - const start = this._size % inputBytes - let index = start - - while (offset < length && index < inputBytes) { - let code = text.charCodeAt(offset++) | 0 - if (code < 0x80) { - // ASCII characters - _byte[index++] = code - } else if (code < 0x800) { - // 2 bytes - _byte[index++] = 0xC0 | (code >>> 6) - _byte[index++] = 0x80 | (code & 0x3F) - } else if (code < 0xD800 || code > 0xDFFF) { - // 3 bytes - _byte[index++] = 0xE0 | (code >>> 12) - _byte[index++] = 0x80 | ((code >>> 6) & 0x3F) - _byte[index++] = 0x80 | (code & 0x3F) - } else if (surrogate) { - // 4 bytes - surrogate pair - code = ((surrogate & 0x3FF) << 10) + (code & 0x3FF) + 0x10000 - _byte[index++] = 0xF0 | (code >>> 18) - _byte[index++] = 0x80 | ((code >>> 12) & 0x3F) - _byte[index++] = 0x80 | ((code >>> 6) & 0x3F) - _byte[index++] = 0x80 | (code & 0x3F) - surrogate = 0 - } else { - surrogate = code - } - } - - if (index >= inputBytes) { - this._int32(_word) - _word[0] = _word[inputWords] - } - - this._size += index - start - } - - this._sp = surrogate - return this - } - - private _int32(data: Int32Array, offset?: int32): void { - let A = this.A - let B = this.B - let C = this.C - let D = this.D - let E = this.E - let i = 0 - offset = ((offset ?? 0) | 0) as int32 - - while (i < inputWords) { - W[i++] = swap32(data[offset++] as int32) - } - - for (i = inputWords; i < workWords; i++) { - W[i] = rotate1((W[i - 3] as int32) ^ (W[i - 8] as int32) ^ (W[i - 14] as int32) ^ (W[i - 16] as int32)) - } - - for (i = 0; i < workWords; i++) { - const S = (i / 20) | 0 - const T = ((rotate5(A) + ft(S, B, C, D) + E + W[i] + K[S]) as int32) | 0 - E = D - D = C - C = rotate30(B) - B = A - A = T - } - - this.A = (A + this.A) | 0 - this.B = (B + this.B) | 0 - this.C = (C + this.C) | 0 - this.D = (D + this.D) | 0 - this.E = (E + this.E) | 0 - } - - // digest(): Uint8Array - // digest(encoding: string): string - digest(encoding?: string): Uint8Array | string { - const _byte = this._byte - const _word = this._word - let i = (this._size % inputBytes) | 0 - _byte[i++] = 0x80 - - // pad 0 for current word - while (i & 3) { - _byte[i++] = 0 - } - i >>= 2 - - if (i > highIndex) { - while (i < inputWords) { - _word[i++] = 0 - } - i = 0 - this._int32(_word) - } - - // pad 0 for rest words - while (i < inputWords) { - _word[i++] = 0 - } - - // input size - const bits64: int32 = this._size * 8 - const low32: int32 = ((bits64 & 0xffffffff) as int32 >>> 0) as int32 - const high32: int32 = ((bits64 - low32) as int32 / 0x100000000) as int32 - if (high32) _word[highIndex] = swap32(high32) as int32 - if (low32) _word[lowIndex] = swap32(low32) as int32 - - this._int32(_word) - - return (encoding === "hex") ? this._hex() : this._bin() - } - - private _hex(): string { - let A = this.A - let B = this.B - let C = this.C - let D = this.D - let E = this.E - - return hex32Str(A, B, C, D, E) - } - - private _bin(): Uint8Array { - let A = this.A - let B = this.B - let C = this.C - let D = this.D - let E = this.E - const _byte = this._byte - const _word = this._word - - _word[0] = swap32(A) - _word[1] = swap32(B) - _word[2] = swap32(C) - _word[3] = swap32(D) - _word[4] = swap32(E) - - return _byte.slice(0, 20) - } -} - -type NS = (num: int32) => string -type NN = (num: int32) => int32 - -const W = new Int32Array(workWords) - -let sharedBuffer: ArrayBuffer -let sharedOffset: int32 = 0 - -const swapLE: NN = ((c:int32):int32 => (((c << 24) & 0xff000000) | ((c << 8) & 0xff0000) | ((c >> 8) & 0xff00) | ((c >> 24) & 0xff))) -const swapBE: NN = ((c:int32):int32 => c) -const swap32: NN = isBE() ? swapBE : swapLE -const rotate1: NN = (num: int32): int32 => (num << 1) | (num >>> 31) -const rotate5: NN = (num: int32): int32 => (num << 5) | (num >>> 27) -const rotate30: NN = (num: int32): int32 => (num << 30) | (num >>> 2) - -function isBE(): boolean { - let a16 = new Uint16Array(1) - a16[0] = 0xFEFF - let a8 = new Uint8Array(a16.buffer) - return a8[0] == 0xFE // BOM -} - - -function ft(s: int32, b: int32, c: int32, d: int32) { - if (s == 0) return (b & c) | ((~b) & d) - if (s == 2) return (b & c) | (b & d) | (c & d) - return b ^ c ^ d -} - -const hex32Decoder = new CustomTextDecoder() -const hex32DecodeBuffer = new Uint8Array(40) -function hex32Str(A: int32, B: int32, C: int32, D: int32, E: int32): string { - writeIntAsHexUTF8(A, hex32DecodeBuffer, 0) - writeIntAsHexUTF8(B, hex32DecodeBuffer, 8) - writeIntAsHexUTF8(C, hex32DecodeBuffer, 16) - writeIntAsHexUTF8(D, hex32DecodeBuffer, 24) - writeIntAsHexUTF8(E, hex32DecodeBuffer, 32) - return hex32Decoder.decode(hex32DecodeBuffer) -} - -function writeIntAsHexUTF8(value: int32, buffer: Uint8Array, byteOffset: int32) { - buffer[byteOffset++] = nibbleToHexCode((value >> 28) & 0xF) - buffer[byteOffset++] = nibbleToHexCode((value >> 24) & 0xF) - buffer[byteOffset++] = nibbleToHexCode((value >> 20) & 0xF) - buffer[byteOffset++] = nibbleToHexCode((value >> 16) & 0xF) - buffer[byteOffset++] = nibbleToHexCode((value >> 12) & 0xF) - buffer[byteOffset++] = nibbleToHexCode((value >> 8 ) & 0xF) - buffer[byteOffset++] = nibbleToHexCode((value >> 4 ) & 0xF) - buffer[byteOffset++] = nibbleToHexCode((value >> 0 ) & 0xF) -} - -function nibbleToHexCode(nibble: int32) { - return nibble > 9 ? nibble + 87 : nibble + 48 -} diff --git a/koala-wrapper/koalaui/common/src/stringUtils.ts b/koala-wrapper/koalaui/common/src/stringUtils.ts deleted file mode 100644 index e9ec1a790..000000000 --- a/koala-wrapper/koalaui/common/src/stringUtils.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { int32 } from "@koalaui/compat" - - -/** - * Computes a hash code from the string {@link value}. - */ -export function hashCodeFromString(value: string): int32 { - let hash = 5381 - for(let i = 0; i < value.length; i++) { - hash = (hash * 33) ^ value.charCodeAt(i) - hash |= 0 - } - return hash -} diff --git a/koala-wrapper/koalaui/common/src/uniqueId.ts b/koala-wrapper/koalaui/common/src/uniqueId.ts deleted file mode 100644 index b32441905..000000000 --- a/koala-wrapper/koalaui/common/src/uniqueId.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { int32 } from "@koalaui/compat" -import { createSha1 } from "./sha1"; - -export class UniqueId { - private sha = createSha1() - - public addString(data: string): UniqueId { - this.sha.updateString(data) - return this - } - - public addI32(data: int32): UniqueId { - this.sha.updateInt32(data) - return this - } - - public addF32Array(data: Float32Array): UniqueId { - this.sha.update(data) - return this - } - - public addI32Array(data: Int32Array): UniqueId { - this.sha.update(data) - return this - } - - public addU32Array(data: Uint32Array): UniqueId { - this.sha.update(data) - return this - } - - public addU8Array(data: Uint8Array): UniqueId { - this.sha.update(data) - return this - } - - public addPtr(data: Uint32Array | number): UniqueId { - if (data instanceof Uint32Array) { - return this.addU32Array(data) - } - return this.addI32(data as int32) - } - - public compute(): string { - return this.sha.digest("hex") as string - } -} diff --git a/koala-wrapper/koalaui/compat/README.md b/koala-wrapper/koalaui/compat/README.md deleted file mode 100644 index 5bd0a1951..000000000 --- a/koala-wrapper/koalaui/compat/README.md +++ /dev/null @@ -1,4 +0,0 @@ -This is a typescript and ArkTS compatibility library. - -It abstracts out such things as reflection which are quite different in typescript and ArkTS. - diff --git a/koala-wrapper/koalaui/compat/dist/src/index.d.ts b/koala-wrapper/koalaui/compat/dist/src/index.d.ts index 6a50786d6..f9870681a 100644 --- a/koala-wrapper/koalaui/compat/dist/src/index.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/index.d.ts @@ -1,16 +1,2 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export { asArray, Array_from_set, Array_from_int32, Array_from_number, AtomicRef, asFloat64, asString, float32FromBits, int32BitsFromFloat, Thunk, finalizerRegister, finalizerUnregister, timeNow, numberToFixed, Observed, Observable, ObservableHandler, observableProxy, observableProxyArray, propDeepCopy, lcClassName, CustomTextEncoder, CustomTextDecoder, className, isFunction, functionOverValue, refEqual, isNotPrimitive, uint8, int8, int16, int32, uint32, int64, uint64, float32, float64, int8Array, unsafeCast, } from "#platform"; +export { asArray, Array_from_set, Array_from_int32, Array_from_number, AtomicRef, asFloat64, asString, float64To32, float64ToInt, float64ToLong, float32To64, float32FromBits, int32BitsFromFloat, charToInt, Thunk, finalizerRegister, finalizerUnregister, timeNow, numberToFixed, Observed, Observable, ObservableHandler, observableProxy, observableProxyArray, propDeepCopy, lcClassName, CustomTextEncoder, CustomTextDecoder, className, isFunction, functionOverValue, refEqual, isNotPrimitive, uint8, int8, int16, int32, uint32, int64, uint64, float32, float64, int8Array, errorAsString, unsafeCast, scheduleCoroutine, memoryStats, launchJob } from "#platform"; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/index.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/index.d.ts.map new file mode 100644 index 000000000..f0062e269 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACH,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,mBAAmB,EACnB,OAAO,EACP,aAAa,EACb,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,SAAS,EACZ,MAAM,WAAW,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/index.js b/koala-wrapper/koalaui/compat/dist/src/index.js index cfaa72b41..059c0f2e7 100644 --- a/koala-wrapper/koalaui/compat/dist/src/index.js +++ b/koala-wrapper/koalaui/compat/dist/src/index.js @@ -14,7 +14,7 @@ * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.unsafeCast = exports.int8Array = exports.isNotPrimitive = exports.refEqual = exports.functionOverValue = exports.isFunction = exports.className = exports.CustomTextDecoder = exports.CustomTextEncoder = exports.lcClassName = exports.propDeepCopy = exports.observableProxyArray = exports.observableProxy = exports.ObservableHandler = exports.Observed = exports.numberToFixed = exports.timeNow = exports.finalizerUnregister = exports.finalizerRegister = exports.int32BitsFromFloat = exports.float32FromBits = exports.asString = exports.asFloat64 = exports.AtomicRef = exports.Array_from_number = exports.Array_from_int32 = exports.Array_from_set = exports.asArray = void 0; +exports.launchJob = exports.memoryStats = exports.scheduleCoroutine = exports.unsafeCast = exports.errorAsString = exports.int8Array = exports.isNotPrimitive = exports.refEqual = exports.functionOverValue = exports.isFunction = exports.className = exports.CustomTextDecoder = exports.CustomTextEncoder = exports.lcClassName = exports.propDeepCopy = exports.observableProxyArray = exports.observableProxy = exports.ObservableHandler = exports.Observed = exports.numberToFixed = exports.timeNow = exports.finalizerUnregister = exports.finalizerRegister = exports.charToInt = exports.int32BitsFromFloat = exports.float32FromBits = exports.float32To64 = exports.float64ToLong = exports.float64ToInt = exports.float64To32 = exports.asString = exports.asFloat64 = exports.AtomicRef = exports.Array_from_number = exports.Array_from_int32 = exports.Array_from_set = exports.asArray = void 0; var _platform_1 = require("#platform"); Object.defineProperty(exports, "asArray", { enumerable: true, get: function () { return _platform_1.asArray; } }); Object.defineProperty(exports, "Array_from_set", { enumerable: true, get: function () { return _platform_1.Array_from_set; } }); @@ -23,8 +23,13 @@ Object.defineProperty(exports, "Array_from_number", { enumerable: true, get: fun Object.defineProperty(exports, "AtomicRef", { enumerable: true, get: function () { return _platform_1.AtomicRef; } }); Object.defineProperty(exports, "asFloat64", { enumerable: true, get: function () { return _platform_1.asFloat64; } }); Object.defineProperty(exports, "asString", { enumerable: true, get: function () { return _platform_1.asString; } }); +Object.defineProperty(exports, "float64To32", { enumerable: true, get: function () { return _platform_1.float64To32; } }); +Object.defineProperty(exports, "float64ToInt", { enumerable: true, get: function () { return _platform_1.float64ToInt; } }); +Object.defineProperty(exports, "float64ToLong", { enumerable: true, get: function () { return _platform_1.float64ToLong; } }); +Object.defineProperty(exports, "float32To64", { enumerable: true, get: function () { return _platform_1.float32To64; } }); Object.defineProperty(exports, "float32FromBits", { enumerable: true, get: function () { return _platform_1.float32FromBits; } }); Object.defineProperty(exports, "int32BitsFromFloat", { enumerable: true, get: function () { return _platform_1.int32BitsFromFloat; } }); +Object.defineProperty(exports, "charToInt", { enumerable: true, get: function () { return _platform_1.charToInt; } }); Object.defineProperty(exports, "finalizerRegister", { enumerable: true, get: function () { return _platform_1.finalizerRegister; } }); Object.defineProperty(exports, "finalizerUnregister", { enumerable: true, get: function () { return _platform_1.finalizerUnregister; } }); Object.defineProperty(exports, "timeNow", { enumerable: true, get: function () { return _platform_1.timeNow; } }); @@ -43,5 +48,9 @@ Object.defineProperty(exports, "functionOverValue", { enumerable: true, get: fun Object.defineProperty(exports, "refEqual", { enumerable: true, get: function () { return _platform_1.refEqual; } }); Object.defineProperty(exports, "isNotPrimitive", { enumerable: true, get: function () { return _platform_1.isNotPrimitive; } }); Object.defineProperty(exports, "int8Array", { enumerable: true, get: function () { return _platform_1.int8Array; } }); +Object.defineProperty(exports, "errorAsString", { enumerable: true, get: function () { return _platform_1.errorAsString; } }); Object.defineProperty(exports, "unsafeCast", { enumerable: true, get: function () { return _platform_1.unsafeCast; } }); +Object.defineProperty(exports, "scheduleCoroutine", { enumerable: true, get: function () { return _platform_1.scheduleCoroutine; } }); +Object.defineProperty(exports, "memoryStats", { enumerable: true, get: function () { return _platform_1.memoryStats; } }); +Object.defineProperty(exports, "launchJob", { enumerable: true, get: function () { return _platform_1.launchJob; } }); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/index.js.map b/koala-wrapper/koalaui/compat/dist/src/index.js.map new file mode 100644 index 000000000..b477efefe --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,uCAiDkB;AAhDd,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,6GAAA,gBAAgB,OAAA;AAChB,8GAAA,iBAAiB,OAAA;AACjB,sGAAA,SAAS,OAAA;AACT,sGAAA,SAAS,OAAA;AACT,qGAAA,QAAQ,OAAA;AACR,wGAAA,WAAW,OAAA;AACX,yGAAA,YAAY,OAAA;AACZ,0GAAA,aAAa,OAAA;AACb,wGAAA,WAAW,OAAA;AACX,4GAAA,eAAe,OAAA;AACf,+GAAA,kBAAkB,OAAA;AAClB,sGAAA,SAAS,OAAA;AAET,8GAAA,iBAAiB,OAAA;AACjB,gHAAA,mBAAmB,OAAA;AACnB,oGAAA,OAAO,OAAA;AACP,0GAAA,aAAa,OAAA;AACb,qGAAA,QAAQ,OAAA;AAER,8GAAA,iBAAiB,OAAA;AACjB,4GAAA,eAAe,OAAA;AACf,iHAAA,oBAAoB,OAAA;AACpB,yGAAA,YAAY,OAAA;AACZ,wGAAA,WAAW,OAAA;AACX,8GAAA,iBAAiB,OAAA;AACjB,8GAAA,iBAAiB,OAAA;AACjB,sGAAA,SAAS,OAAA;AACT,uGAAA,UAAU,OAAA;AACV,8GAAA,iBAAiB,OAAA;AACjB,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AAUd,sGAAA,SAAS,OAAA;AACT,0GAAA,aAAa,OAAA;AACb,uGAAA,UAAU,OAAA;AACV,8GAAA,iBAAiB,OAAA;AACjB,wGAAA,WAAW,OAAA;AACX,sGAAA,SAAS,OAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/array.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/array.d.ts index df8d52c6b..cedc1f4c1 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/array.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/array.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { float64, int32, int8 } from "./types"; export declare function asArray(value: T[]): Array; export declare function Array_from_set(set: Set): Array; diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/array.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/array.d.ts.map new file mode 100644 index 000000000..241363de9 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/typescript/array.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9C,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAE/C;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAEvD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,KAAK,EAAE,CAE1D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAEjE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,CAE7C"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/array.js b/koala-wrapper/koalaui/compat/dist/src/typescript/array.js index c391e6c4f..675515db0 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/array.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/array.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/array.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/array.js.map new file mode 100644 index 000000000..35cbcd381 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/array.js.map @@ -0,0 +1 @@ +{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src/typescript/array.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAIH,SAAgB,OAAO,CAAI,KAAU;IACjC,OAAO,KAAK,CAAA;AAChB,CAAC;AAFD,0BAEC;AAED,SAAgB,cAAc,CAAI,GAAW;IACzC,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AAFD,wCAEC;AAED,SAAgB,gBAAgB,CAAC,IAAgB;IAC7C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC;AAFD,4CAEC;AAED,SAAgB,iBAAiB,CAAC,IAAe;IAC7C,OAAO,IAAI,CAAA;AACf,CAAC;AAFD,8CAEC;AAED,SAAgB,SAAS,CAAC,IAAW;IACjC,OAAO,EAAE,CAAA;AACb,CAAC;AAFD,8BAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.d.ts index d799b95b0..2ed0dd872 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.d.ts @@ -1,18 +1,6 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/** + * A reference that may be updated atomically. */ - export declare class AtomicRef { value: Value; /** diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.d.ts.map new file mode 100644 index 000000000..017bafd3a --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"atomic.d.ts","sourceRoot":"","sources":["../../../src/typescript/atomic.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,qBAAa,SAAS,CAAC,KAAK;IACxB,KAAK,EAAE,KAAK,CAAA;IAEZ;;;OAGG;gBACS,KAAK,EAAE,KAAK;IAIxB;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;CAKjC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.js b/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.js index 2aa1b1ad4..ec29e5211 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.js.map new file mode 100644 index 000000000..4a5eeb974 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/atomic.js.map @@ -0,0 +1 @@ +{"version":3,"file":"atomic.js","sourceRoot":"","sources":["../../../src/typescript/atomic.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH;;GAEG;AACH,MAAa,SAAS;IAGlB;;;OAGG;IACH,YAAY,KAAY;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACtB,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,KAAY;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,OAAO,MAAM,CAAA;IACjB,CAAC;CACJ;AArBD,8BAqBC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/double.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/double.d.ts deleted file mode 100644 index 71c40c89b..000000000 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/double.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { float64, int32, float32 } from "./types"; -export declare function asFloat64(value: string): float64; -export declare function asString(value: float64 | undefined): string | undefined; -export declare function float32FromBits(value: int32): float32; -export declare function int32BitsFromFloat(value: float32): int32; -//# sourceMappingURL=double.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.d.ts index 8047a3aec..f9d40b708 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export interface Thunk { clean(): void; } diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.d.ts.map new file mode 100644 index 000000000..1d06a6668 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"finalization.d.ts","sourceRoot":"","sources":["../../../src/typescript/finalization.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,KAAK;IAClB,KAAK,IAAI,IAAI,CAAA;CAChB;AAkBD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAE9D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,QAEjD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.js b/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.js index 4d605cb72..3d7ef6679 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.js.map new file mode 100644 index 000000000..ad13255a8 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/finalization.js.map @@ -0,0 +1 @@ +{"version":3,"file":"finalization.js","sourceRoot":"","sources":["../../../src/typescript/finalization.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAkBH,MAAM,QAAQ,GAAG,IAAI,oBAAoB,CAAC,CAAC,KAAY,EAAE,EAAE;IACvD,KAAK,CAAC,KAAK,EAAE,CAAA;AACjB,CAAC,CAAC,CAAA;AAEF,SAAgB,iBAAiB,CAAC,MAAc,EAAE,KAAa;IAC3D,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACpC,CAAC;AAFD,8CAEC;AAED,SAAgB,mBAAmB,CAAC,MAAc;IAC9C,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;AAC/B,CAAC;AAFD,kDAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/index.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/index.d.ts index 11311543c..6c5403837 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/index.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/index.d.ts @@ -1,21 +1,6 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export * from "./array"; export * from "./atomic"; -export * from "./double"; +export * from "./primitive"; export * from "./finalization"; export * from "./observable"; export * from "./performance"; diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/index.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/index.d.ts.map new file mode 100644 index 000000000..295bc02dc --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/typescript/index.ts"],"names":[],"mappings":"AAeA,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/index.js b/koala-wrapper/koalaui/compat/dist/src/typescript/index.js index 17c1bf11d..2b89796fd 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/index.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/index.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -30,7 +30,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./array"), exports); __exportStar(require("./atomic"), exports); -__exportStar(require("./double"), exports); +__exportStar(require("./primitive"), exports); __exportStar(require("./finalization"), exports); __exportStar(require("./observable"), exports); __exportStar(require("./performance"), exports); diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/index.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/index.js.map new file mode 100644 index 000000000..7ef9f4225 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/typescript/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;AAEH,0CAAuB;AACvB,2CAAwB;AACxB,8CAA2B;AAC3B,iDAA8B;AAC9B,+CAA4B;AAC5B,gDAA6B;AAC7B,mDAAgC;AAChC,+CAA4B;AAC5B,4CAAyB;AACzB,kDAA+B;AAC/B,0CAAuB;AACvB,0CAAuB"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/observable.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/observable.d.ts index 28df03087..98a3fd1de 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/observable.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/observable.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export declare function getObservableTarget(proxy: Object): Object; /** * Data class decorator that makes all child fields trackable. diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/observable.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/observable.d.ts.map new file mode 100644 index 000000000..b58570d6f --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/observable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"observable.d.ts","sourceRoot":"","sources":["../../../src/typescript/observable.ts"],"names":[],"mappings":"AAiBA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAMD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,QAErD;AAOD,gBAAgB;AACh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QAAQ,CAAC,UAAU,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC;CAUjF;AAED,gBAAgB;AAChB,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAE3E;AAED,gBAAgB;AAChB,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,iBAAiB,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,MAAM,UAAO,GAAG,KAAK,CA0EzH"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/observable.js b/koala-wrapper/koalaui/compat/dist/src/typescript/observable.js index 5de62790f..972012d2a 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/observable.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/observable.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -238,7 +238,22 @@ function observableProxy(value, parent, observed, strict = true) { }); return proxyObject(value, handler); } - // TODO: support set/map + if (value instanceof Map) { + const handler = new ObservableHandler(parent); + const data = proxyMapValues(value, handler, observed); + setObservable(data); + deleteObservable(data); + clearObservable(data); + return proxyMapOrSet(data, handler); + } + if (value instanceof Set) { + const handler = new ObservableHandler(parent); + const data = proxySetValues(value, handler, observed); + addObservable(data); + deleteObservable(data); + clearObservable(data); + return proxyMapOrSet(data, handler); + } const handler = new ObservableHandler(parent, isObserved(value)); if (handler.observed || observed) proxyFields(value, true, handler); @@ -403,4 +418,105 @@ function unshiftObservable(array) { }; } } +function proxyMapValues(data, parent, observed) { + if (observed === undefined) + observed = ObservableHandler.contains(parent); + const result = new Map(); + for (const [key, value] of data.entries()) { + result.set(key, observableProxy(value, parent, observed)); + } + return result; +} +function proxySetValues(data, parent, observed) { + // TODO: check if necessary to replace items of the set with observed objects as + // for complex objects add() function won't find original object inside the set of proxies + /* + if (observed === undefined) observed = ObservableHandler.contains(parent) + const result = new Set() + for (const value of data.values()) { + result.add(observableProxy(value, parent, observed)) + } + return result + */ + return data; +} +function proxyMapOrSet(value, observable) { + ObservableHandler.installOn(value, observable); + return new Proxy(value, { + get(target, property, receiver) { + var _a, _b; + if (property == OBSERVABLE_TARGET) + return target; + if (property == 'size') { + (_a = ObservableHandler.find(target)) === null || _a === void 0 ? void 0 : _a.onAccess(); + return target.size; + } + const value = Reflect.get(target, property, receiver); + (_b = ObservableHandler.find(target)) === null || _b === void 0 ? void 0 : _b.onAccess(); + return typeof value == "function" + ? value.bind(target) + : value; + }, + }); +} +function addObservable(data) { + if (data.addOriginal === undefined) { + data.addOriginal = data.add; + data.add = function (value) { + const observable = ObservableHandler.find(this); + if (observable && !this.has(value)) { + observable.onModify(); + // TODO: check if necessary to replace items of the set with observed objects as + // for complex objects add() function won't find original object inside the set of proxies + // value = observableProxy(value, observable) + } + return this.addOriginal(value); + }; + } +} +function setObservable(data) { + if (data.setOriginal === undefined) { + data.setOriginal = data.set; + data.set = function (key, value) { + const observable = ObservableHandler.find(this); + if (observable) { + observable.onModify(); + observable.removeChild(this.get(key)); + value = observableProxy(value, observable); + } + return this.setOriginal(key, value); + }; + } +} +function deleteObservable(data) { + if (data.deleteOriginal === undefined) { + data.deleteOriginal = data.delete; + data.delete = function (key) { + const observable = ObservableHandler.find(this); + if (observable) { + observable.onModify(); + if (this instanceof Map) { + observable.removeChild(this.get(key)); + } + else if (this instanceof Set) { + observable.removeChild(key); + } + } + return this.deleteOriginal(key); + }; + } +} +function clearObservable(data) { + if (data.clearOriginal === undefined) { + data.clearOriginal = data.clear; + data.clear = function () { + const observable = ObservableHandler.find(this); + if (observable) { + observable.onModify(); + Array.from(this.values()).forEach(it => observable.removeChild(it)); + } + return this.clearOriginal(); + }; + } +} //# sourceMappingURL=observable.js.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/observable.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/observable.js.map new file mode 100644 index 000000000..2f07bc544 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/observable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"observable.js","sourceRoot":"","sources":["../../../src/typescript/observable.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,MAAM,iBAAiB,GAAG,6BAA6B,CAAA;AAEvD,SAAgB,mBAAmB,CAAC,KAAa;;IAC7C,OAAO,MAAA,gBAAgB,CAAC,iBAAiB,EAAE,KAAK,CAAC,mCAAI,KAAK,CAAA;AAC9D,CAAC;AAFD,kDAEC;AAED,SAAS,gBAAgB,CAAC,IAAY,EAAE,MAAW;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,mBAA6B;IAClD,mBAAmB,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAA;AAClD,CAAC;AAFD,4BAEC;AAED,MAAM,QAAQ,GAAG,qBAAqB,CAAA;AACtC,SAAS,UAAU,CAAC,KAAU;IAC1B,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;AACnC,CAAC;AAUD,gBAAgB;AAChB,MAAa,iBAAiB;IAU1B,YAAY,MAA0B,EAAE,WAAoB,KAAK;QAPzD,YAAO,GAAG,IAAI,GAAG,EAAqB,CAAA;QACtC,aAAQ,GAAG,IAAI,GAAG,EAA6B,CAAA;QAEtC,gBAAW,GAAG,IAAI,GAAG,EAAc,CAAA;QAC5C,cAAS,GAAG,KAAK,CAAA;QAIrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,MAAM;YAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IACtC,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AAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAA;aACtE;YACD,OAAO,IAAI,CAAC,aAAa,EAAE,CAAA;QAC/B,CAAC,CAAA;KACJ;AACL,CAAC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/performance.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/performance.d.ts index ffff2ebb8..8b94eeca4 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/performance.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/performance.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /** * @returns the number of milliseconds elapsed since midnight, * January 1, 1970 Universal Coordinated Time (UTC). diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/performance.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/performance.d.ts.map new file mode 100644 index 000000000..dc69e567d --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/performance.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../src/typescript/performance.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAE3E"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/performance.js b/koala-wrapper/koalaui/compat/dist/src/typescript/performance.js index faf020971..437694449 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/performance.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/performance.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/performance.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/performance.js.map new file mode 100644 index 000000000..87c45e229 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/performance.js.map @@ -0,0 +1 @@ +{"version":3,"file":"performance.js","sourceRoot":"","sources":["../../../src/typescript/performance.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH;;;GAGG;AACH,SAAgB,OAAO;IACnB,OAAO,WAAW,CAAC,GAAG,EAAE,CAAA;AAC5B,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,KAAa,EAAE,cAAsB;IAC/D,OAAO,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;AACxC,CAAC;AAFD,sCAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.d.ts new file mode 100644 index 000000000..1bf4c1d52 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.d.ts @@ -0,0 +1,11 @@ +import { float64, int32, float32, int64 } from "./types"; +export declare function float32To64(value: float32): float64; +export declare function float64To32(value: float64): float32; +export declare function asFloat64(value: string): float64; +export declare function asString(value: float64 | undefined): string | undefined; +export declare function float32FromBits(value: int32): float32; +export declare function int32BitsFromFloat(value: float32): int32; +export declare function float64ToInt(value: float64): int32; +export declare function float64ToLong(value: float64): int64; +export declare function charToInt(value: string): int32; +//# sourceMappingURL=primitive.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.d.ts.map new file mode 100644 index 000000000..b17bba8ec --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"primitive.d.ts","sourceRoot":"","sources":["../../../src/typescript/primitive.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAExD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEnD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEnD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEvE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAErD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAExD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAElD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAEnD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAE9C"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/double.js b/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.js similarity index 58% rename from koala-wrapper/koalaui/compat/dist/src/typescript/double.js rename to koala-wrapper/koalaui/compat/dist/src/typescript/primitive.js index ea84b6e5d..f60591eca 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/double.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,9 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - Object.defineProperty(exports, "__esModule", { value: true }); -exports.int32BitsFromFloat = exports.float32FromBits = exports.asString = exports.asFloat64 = void 0; +exports.charToInt = exports.float64ToLong = exports.float64ToInt = exports.int32BitsFromFloat = exports.float32FromBits = exports.asString = exports.asFloat64 = exports.float64To32 = exports.float32To64 = void 0; +function float32To64(value) { + return value; +} +exports.float32To64 = float32To64; +function float64To32(value) { + return value; +} +exports.float64To32 = float64To32; function asFloat64(value) { return Number(value); } @@ -32,4 +39,16 @@ function int32BitsFromFloat(value) { return value; } exports.int32BitsFromFloat = int32BitsFromFloat; -//# sourceMappingURL=double.js.map \ No newline at end of file +function float64ToInt(value) { + return value; +} +exports.float64ToInt = float64ToInt; +function float64ToLong(value) { + return value; +} +exports.float64ToLong = float64ToLong; +function charToInt(value) { + return parseInt(value); +} +exports.charToInt = charToInt; +//# sourceMappingURL=primitive.js.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.js.map new file mode 100644 index 000000000..697b34298 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/primitive.js.map @@ -0,0 +1 @@ +{"version":3,"file":"primitive.js","sourceRoot":"","sources":["../../../src/typescript/primitive.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAIH,SAAgB,WAAW,CAAC,KAAc;IACtC,OAAO,KAAK,CAAA;AAChB,CAAC;AAFD,kCAEC;AAED,SAAgB,WAAW,CAAC,KAAc;IACtC,OAAO,KAAK,CAAA;AAChB,CAAC;AAFD,kCAEC;AAED,SAAgB,SAAS,CAAC,KAAa;IACnC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;AACxB,CAAC;AAFD,8BAEC;AAED,SAAgB,QAAQ,CAAC,KAA0B;IAC/C,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE,CAAA;AAC5B,CAAC;AAFD,4BAEC;AAED,SAAgB,eAAe,CAAC,KAAY;IACxC,OAAO,KAAK,CAAA;AAChB,CAAC;AAFD,0CAEC;AAED,SAAgB,kBAAkB,CAAC,KAAc;IAC7C,OAAO,KAAK,CAAA;AAChB,CAAC;AAFD,gDAEC;AAED,SAAgB,YAAY,CAAC,KAAc;IACvC,OAAO,KAAK,CAAA;AAChB,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa,CAAC,KAAc;IACxC,OAAO,KAAK,CAAA;AAChB,CAAC;AAFD,sCAEC;AAED,SAAgB,SAAS,CAAC,KAAa;IACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC;AAFD,8BAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.d.ts index 5248eba2d..d8c3461cd 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.d.ts @@ -1,17 +1,2 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export declare function propDeepCopy(sourceObject: T): T; //# sourceMappingURL=prop-deep-copy.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.d.ts.map new file mode 100644 index 000000000..c15c4bfaa --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prop-deep-copy.d.ts","sourceRoot":"","sources":["../../../src/typescript/prop-deep-copy.ts"],"names":[],"mappings":"AAuBA,wBAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,CAuElD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.js b/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.js index 157cb42df..c6dfc1df1 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.js.map new file mode 100644 index 000000000..302483524 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/prop-deep-copy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prop-deep-copy.js","sourceRoot":"","sources":["../../../src/typescript/prop-deep-copy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,6CAAkD;AAElD;;;;GAIG;AAEH,SAAgB,YAAY,CAAI,YAAe;IAC3C,IAAI,CAAC,YAAY,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;QACnD,OAAO,YAAY,CAAA;KACtB;IAED,MAAM,aAAa,GAAG,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Y,EAAE,IAAI,CAAC,CAAA;YACrC,OAAO,IAAS,CAAA;SACnB;QAED,OAAO,YAAY,CAAA;IACvB,CAAC;AACL,CAAC;AAvED,oCAuEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.d.ts index 231d7b525..2408a17a4 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.d.ts @@ -1,17 +1,2 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export declare function lcClassName(object: Object): string; //# sourceMappingURL=reflection.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.d.ts.map new file mode 100644 index 000000000..372283c68 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"reflection.d.ts","sourceRoot":"","sources":["../../../src/typescript/reflection.ts"],"names":[],"mappings":"AAiBA,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,UAEzC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.js b/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.js index 73b3ff9e7..2c3f43c3b 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.js @@ -1,6 +1,8 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lcClassName = void 0; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,9 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.lcClassName = void 0; const ts_reflection_1 = require("./ts-reflection"); function lcClassName(object) { return (0, ts_reflection_1.className)(object).toLowerCase(); diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.js.map new file mode 100644 index 000000000..236a22cd9 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/reflection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reflection.js","sourceRoot":"","sources":["../../../src/typescript/reflection.ts"],"names":[],"mappings":";;;AACA;;;;;;;;;;;;;GAaG;AACH,mDAA2C;AAE3C,SAAgB,WAAW,CAAC,MAAc;IACtC,OAAO,IAAA,yBAAS,EAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAA;AAC1C,CAAC;AAFD,kCAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/strings.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/strings.d.ts index 3af44f725..d3a2a3a9f 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/strings.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/strings.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "./types"; interface SystemTextEncoder { encode(input?: string): Uint8Array; diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/strings.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/strings.d.ts.map new file mode 100644 index 000000000..19087246f --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/strings.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../src/typescript/strings.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,UAAU,iBAAiB;IACvB,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACnC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CACnD;AAED,UAAU,gBAAgB;IACtB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC;AAED,UAAU,iBAAiB;IACvB,MAAM,CACF,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,EAC1B,OAAO,CAAC,EAAE,gBAAgB,GAC3B,MAAM,CAAC;CACb;AAED,qBAAa,iBAAiB;IAC1B,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAA+B;gBAEnD,OAAO,GAAE,iBAAiB,GAAC,SAAiF;IAIxH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;WAEvC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK;IAYhD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK;IAkBnC,OAAO,CAAC,SAAS;IAOjB,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,GAAE,KAAS,GAAG,KAAK;IAMnE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,GAAE,OAAc,GAAG,UAAU;IAmBxE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,UAAU;IAqB/C,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,GAAG,UAAU;CA4B7E;AAED,qBAAa,iBAAiB;IAC1B,MAAM,CAAC,cAAc,SAAM;gBACf,OAAO,GAAE,iBAAiB,GAAC,SAAiF;IAIxH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAyCpC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/strings.js b/koala-wrapper/koalaui/compat/dist/src/typescript/strings.js index a2419d0a2..782bf7d18 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/strings.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/strings.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/strings.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/strings.js.map new file mode 100644 index 000000000..e385db5ae --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/strings.js.map @@ -0,0 +1 @@ +{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../../src/typescript/strings.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAoBH,MAAa,iBAAiB;IAG1B,YAAY,UAAuC,CAAC,CAAC,OAAO,WAAW,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACpH,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IAC1B,CAAC;IAIM,MAAM,CAAC,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AAA;gBACjE,KAAK,GAAG,CAAC,CAAA;aACZ;YACD,UAAU,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAA;YAC7B,IAAI,OAAO,IAAI,MAAM,EAAE;gBACnB,OAAO,GAAG,CAAC,CAAA;gBACX,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC,CAAA;aAChD;YACD,KAAK,IAAI,KAAK,CAAA;SACjB;QACD,IAAI,OAAO,GAAG,CAAC,EAAE;YACb,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAA;SAClE;QACD,OAAO,MAAM,CAAA;IACjB,CAAC;;AAhDL,8CAiDC;AAhDU,gCAAc,GAAG,GAAG,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.d.ts index 3d013c4d5..c25995bc5 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export declare function className(object?: Object): string; export declare function isFunction(object?: Object): boolean; export declare function functionOverValue(value: Value | (() => Value)): boolean; diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.d.ts.map new file mode 100644 index 000000000..f6165b22d --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-reflection.d.ts","sourceRoot":"","sources":["../../../src/typescript/ts-reflection.ts"],"names":[],"mappings":"AAeA,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAEnD;AAGD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAC,CAAC,MAAI,KAAK,CAAC,GAAG,OAAO,CAE1E;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO,CAE3D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.js b/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.js index c2ba31757..41f489fa9 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.js.map new file mode 100644 index 000000000..786091865 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/ts-reflection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-reflection.js","sourceRoot":"","sources":["../../../src/typescript/ts-reflection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,SAAgB,SAAS,CAAC,MAAe;;IACrC,OAAO,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC,IAAI,mCAAI,QAAQ,CAAA;AAC/C,CAAC;AAFD,8BAEC;AAED,SAAgB,UAAU,CAAC,MAAe;IACtC,OAAO,OAAO,MAAM,KAAK,UAAU,CAAA;AACvC,CAAC;AAFD,gCAEC;AAED,2CAA2C;AAC3C,SAAgB,iBAAiB,CAAQ,KAAwB;IAC7D,OAAO,OAAO,KAAK,KAAK,UAAU,CAAA;AACtC,CAAC;AAFD,8CAEC;AAED,SAAgB,QAAQ,CAAQ,CAAQ,EAAE,CAAQ;IAC9C,OAAO,CAAC,KAAK,CAAC,CAAA;AAClB,CAAC;AAFD,4BAEC;AAED,SAAgB,cAAc,CAAC,KAAa;IACxC,OAAO,IAAI,CAAA;AACf,CAAC;AAFD,wCAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/types.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/types.d.ts index 3a8beb40c..ff3c49fa7 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/types.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/types.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /// export type uint8 = int; export type int8 = int; diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/types.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/types.d.ts.map new file mode 100644 index 000000000..34b315991 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/typescript/types.ts"],"names":[],"mappings":";AAgBA,MAAM,MAAM,KAAK,GAAG,GAAG,CAAA;AACvB,MAAM,MAAM,IAAI,GAAG,GAAG,CAAA;AACtB,MAAM,MAAM,KAAK,GAAG,GAAG,CAAA;AACvB,MAAM,MAAM,KAAK,GAAG,GAAG,CAAA;AACvB,MAAM,MAAM,MAAM,GAAG,GAAG,CAAA;AACxB,MAAM,MAAM,KAAK,GAAG,IAAI,CAAA;AACxB,MAAM,MAAM,MAAM,GAAG,IAAI,CAAA;AACzB,MAAM,MAAM,OAAO,GAAG,KAAK,CAAA;AAC3B,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/types.js b/koala-wrapper/koalaui/compat/dist/src/typescript/types.js index af49665f4..7239fddb8 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/types.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/types.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/types.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/types.js.map new file mode 100644 index 000000000..16e211d99 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/typescript/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAEH,iDAAiD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/utils.d.ts b/koala-wrapper/koalaui/compat/dist/src/typescript/utils.d.ts index f359d5f17..7c61ae75c 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/utils.d.ts +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/utils.d.ts @@ -1,17 +1,6 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +export declare function errorAsString(error: Error): string; export declare function unsafeCast(value: unknown): T; +export declare function scheduleCoroutine(): void; +export declare function memoryStats(): string; +export declare function launchJob(job: () => void): Promise; //# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/utils.d.ts.map b/koala-wrapper/koalaui/compat/dist/src/typescript/utils.d.ts.map new file mode 100644 index 000000000..eee6251ff --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/typescript/utils.ts"],"names":[],"mappings":"AAeA,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAElD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAE/C;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAAG;AAE5C,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAMxD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/utils.js b/koala-wrapper/koalaui/compat/dist/src/typescript/utils.js index ec1727664..52c9e3824 100644 --- a/koala-wrapper/koalaui/compat/dist/src/typescript/utils.js +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/utils.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,9 +14,27 @@ * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.unsafeCast = void 0; +exports.launchJob = exports.memoryStats = exports.scheduleCoroutine = exports.unsafeCast = exports.errorAsString = void 0; +function errorAsString(error) { + var _a; + return (_a = error.stack) !== null && _a !== void 0 ? _a : error.toString(); +} +exports.errorAsString = errorAsString; function unsafeCast(value) { return value; } exports.unsafeCast = unsafeCast; +function scheduleCoroutine() { } +exports.scheduleCoroutine = scheduleCoroutine; +function memoryStats() { + return `none`; +} +exports.memoryStats = memoryStats; +function launchJob(job) { + return new Promise(resolve => setTimeout(() => { + resolve(); + job(); + }, 0)); +} +exports.launchJob = launchJob; //# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/dist/src/typescript/utils.js.map b/koala-wrapper/koalaui/compat/dist/src/typescript/utils.js.map new file mode 100644 index 000000000..6613d4ec6 --- /dev/null +++ b/koala-wrapper/koalaui/compat/dist/src/typescript/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/typescript/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,SAAgB,aAAa,CAAC,KAAY;;IACtC,OAAO,MAAA,KAAK,CAAC,KAAK,mCAAI,KAAK,CAAC,QAAQ,EAAE,CAAA;AAC1C,CAAC;AAFD,sCAEC;AAED,SAAgB,UAAU,CAAI,KAAc;IACxC,OAAO,KAAqB,CAAA;AAChC,CAAC;AAFD,gCAEC;AAED,SAAgB,iBAAiB,KAAU,CAAC;AAA5C,8CAA4C;AAE5C,SAAgB,WAAW;IACvB,OAAO,MAAM,CAAA;AACjB,CAAC;AAFD,kCAEC;AAED,SAAgB,SAAS,CAAC,GAAe;IACrC,OAAO,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE;QAC5C,OAAO,EAAE,CAAA;QACT,GAAG,EAAE,CAAA;IACT,CAAC,EAAE,CAAC,CAAC,CACR,CAAA;AACL,CAAC;AAND,8BAMC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/src/arkts/array.ts b/koala-wrapper/koalaui/compat/src/arkts/array.ts deleted file mode 100644 index 123dd33d7..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/array.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { float64, int32, int8 } from "./types" - -// TODO: this can be a performance disaster -// just wait for the library to provide the proper functionality. -export function asArray(value: T[]): Array { - return Array.of(...value) -} - -// TODO: this can be a performance disaster -// just wait for the library to provide the proper functionality. -export function Array_from_set(set: Set): Array { - const array = new Array() // to avoid creation of undefined content - const values = set.values() - for (let it = values.next(); it.done != true; it = values.next()) { - array.push(it.value as T) - } - return array -} - -// TODO: this can be a performance disaster -// just wait for the library to provide the proper functionality. -export function Array_from_int32(data: Int32Array): number[] { - const result: number[] = [] - for (let i: int32 = 0; i < data.length; i++) { - result[i] = data.at(i) as number - } - return result -} - -// TODO: this can be a performance disaster -// just wait for the library to provide the proper functionality. -export function Array_from_number(data: float64[]): Array { - const result = new Array(data.length) - for (let i: int32 = 0; i < data.length; i++) { - result[i] = data[i] - } - return result -} - -export function int8Array(size: int32): int8[] { - return new int8[size] -} - diff --git a/koala-wrapper/koalaui/compat/src/arkts/atomic.ts b/koala-wrapper/koalaui/compat/src/arkts/atomic.ts deleted file mode 100644 index 241b0944c..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/atomic.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * A reference that may be updated atomically. - */ -export class AtomicRef { - value: Value - - /** - * Creates a new reference object with the given initial value. - * @param value - the new value - */ - constructor(value: Value) { - this.value = value - } - - /** - * Atomically sets the reference value to the given value and returns the previous one. - * @param value - the new value - * @returns the previous value - */ - getAndSet(value: Value): Value { - // TODO: replace with the implementation from ArkTS language when it is ready - const result = this.value - this.value = value - return result - } -} diff --git a/koala-wrapper/koalaui/compat/src/arkts/double.ts b/koala-wrapper/koalaui/compat/src/arkts/double.ts deleted file mode 100644 index 0dfb7fea3..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/double.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { float64, int32, float32 } from "./types" - -export function asFloat64(value: string): float64 { - return (new Number(value)).valueOf() -} - -export function asString(value: float64 | undefined): string | undefined { - if (value === undefined) return undefined - return (new Number(value)).toString() -} - -export function float32FromBits(value: int32): float32 { - return Float.bitCastFromInt(value) -} - -export function int32BitsFromFloat(value: float32): int32 { - return Float.bitCastToInt(value) -} diff --git a/koala-wrapper/koalaui/compat/src/arkts/finalization.ts b/koala-wrapper/koalaui/compat/src/arkts/finalization.ts deleted file mode 100644 index 92ba81b14..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/finalization.ts +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export interface Thunk { - clean(): void -} - -const registry = new FinalizationRegistry((thunk: Thunk) => { - thunk.clean() -}) - -export function finalizerRegister(target: Object, thunk: Object) { - registry.register(target, thunk as Thunk) -} - -export function finalizerUnregister(target: Object) { - registry.unregister(target) -} diff --git a/koala-wrapper/koalaui/compat/src/arkts/index.ts b/koala-wrapper/koalaui/compat/src/arkts/index.ts deleted file mode 100644 index c6077254c..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from "./array" -export * from "./atomic" -export * from "./double" -export * from "./finalization" -export * from "./performance" -export * from "./prop-deep-copy" -export * from "./observable" -export * from "./reflection" -export * from "./strings" -export * from "./ts-reflection" -export * from "./types" -export * from "./utils" diff --git a/koala-wrapper/koalaui/compat/src/arkts/observable.ts b/koala-wrapper/koalaui/compat/src/arkts/observable.ts deleted file mode 100644 index 4326f0122..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/observable.ts +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { int32 } from "./types" - -const OBSERVABLE_TARGET = "target" - -export function getObservableTarget(proxy: Object): Object { - try { - return Reflect.get(proxy, OBSERVABLE_TARGET) ?? proxy - } catch (error) { - return proxy - } -} - -/** - * Data class decorator that makes all child fields trackable. - */ -export function Observed() { - throw new Error("TypeScript class decorators are not supported yet") -} - -/** @internal */ -export interface Observable { - /** It is called when the observable value is accessed. */ - onAccess(): void - /** It is called when the observable value is modified. */ - onModify(): void -} - -/** @internal */ -export class ObservableHandler implements Observable { - private static handlers: WeakMap | undefined = undefined - - private parents = new Set() - private children = new Map() - - private readonly observables = new Set() - private _modified = false - - readonly observed: boolean - constructor(parent?: ObservableHandler, observed: boolean = false) { - this.observed = observed - if (parent) this.addParent(parent) - } - - onAccess(): void { - if (this.observables.size > 0) { - const it = this.observables.keys() - while (true) { - const result = it.next() - if (result.done) break - result.value?.onAccess() - } - } - } - - onModify(): void { - const set = new Set() - this.collect(true, set) - set.forEach((handler: ObservableHandler) => { - handler._modified = true - if (handler.observables.size > 0) { - const it = handler.observables.keys() - while (true) { - const result = it.next() - if (result.done) break - result.value?.onModify() - } - } - }) - } - - static dropModified(value: Value): boolean { - const handler = ObservableHandler.findIfObject(value) - if (handler === undefined) return false - const result = handler._modified - handler._modified = false - return result - } - - /** Adds the specified `observable` to the handler corresponding to the given `value`. */ - static attach(value: Value, observable: Observable): void { - const handler = ObservableHandler.findIfObject(value) - if (handler) handler.observables.add(observable) - } - - /** Deletes the specified `observable` from the handler corresponding to the given `value`. */ - static detach(value: Value, observable: Observable): void { - const handler = ObservableHandler.findIfObject(value) - if (handler) handler.observables.delete(observable) - } - - /** @returns the handler corresponding to the given `value` if it was installed */ - private static findIfObject(value: Value): ObservableHandler | undefined { - const handlers = ObservableHandler.handlers - return handlers !== undefined && value instanceof Object ? handlers.get(getObservableTarget(value as Object)) : undefined - } - - /** - * @param value - any non-null object including arrays - * @returns an observable handler or `undefined` if it is not installed - */ - static find(value: Object): ObservableHandler | undefined { - const handlers = ObservableHandler.handlers - return handlers ? handlers.get(getObservableTarget(value)) : undefined - } - - /** - * @param value - any non-null object including arrays - * @param observable - a handler to install on this object - * @throws an error if observable handler cannot be installed - */ - static installOn(value: Object, observable?: ObservableHandler): void { - let handlers = ObservableHandler.handlers - if (handlers === undefined) { - handlers = new WeakMap() - ObservableHandler.handlers = handlers - } - observable - ? handlers.set(getObservableTarget(value), observable) - : handlers.delete(getObservableTarget(value)) - } - - addParent(parent: ObservableHandler) { - const count = parent.children.get(this) ?? 0 - parent.children.set(this, count + 1) - this.parents.add(parent) - } - - removeParent(parent: ObservableHandler) { - const count = parent.children.get(this) ?? 0 - if (count > 1) { - parent.children.set(this, count - 1) - } - else if (count == 1) { - parent.children.delete(this) - this.parents.delete(parent) - } - } - - removeChild(value: Value) { - const child = ObservableHandler.findIfObject(value) - if (child) child.removeParent(this) - } - - private collect(all: boolean, guards: Set) { - if (guards.has(this)) return guards // already collected - guards.add(this) // handler is already guarded - this.parents.forEach((handler: ObservableHandler) => { handler.collect(all, guards) }) - if (all) this.children.forEach((_count: number, handler: ObservableHandler) => { handler.collect(all, guards) }) - return guards - } - - static contains(observable: ObservableHandler, guards?: Set) { - if (observable.observed) return true - if (guards === undefined) guards = new Set() // create if needed - else if (guards!.has(observable)) return false // already checked - guards.add(observable) // handler is already guarded - for (const it of observable.parents.keys()) { - if (ObservableHandler.contains(it, guards)) return true - } - return false - } -} - -/** @internal */ -export function observableProxyArray(...value: Value[]): Array { - return observableProxy(Array.of(...value)) -} - -const PROXY_DISABLED = true // because of ArkTS Reflection performance - -/** @internal */ -export function observableProxy(value: Value, parent?: ObservableHandler, observed?: boolean, strict: boolean = true): Value { - if (PROXY_DISABLED) return value - if (value instanceof ObservableHandler) return value as Value // do not proxy a marker itself - if (value == null || !(value instanceof Object)) return value as Value // only non-null object can be observable - const observable = ObservableHandler.find(value as Object) - if (observable) { - if (parent) { - if (strict) observable.addParent(parent) - if (observed === undefined) observed = ObservableHandler.contains(parent) - } - if (observed) { - if (value instanceof Array) { - for (let index = 0; index < value.length; index++) { - value[index] = observableProxy(value[index], observable, observed, false) - } - } else { - // TODO: proxy fields of the given object - } - } - return value as Value - } - if (value instanceof Array) { - const handler = new ObservableHandler(parent) - const array = proxyChildrenOnly(value, handler, observed) - ObservableHandler.installOn(array, handler) - return createProxyArray(array) as Value - } - // TODO: proxy the given object - return value as Value -} - -function createProxyArray(array: Array): Array { - return Proxy.create(array, new CustomArrayProxyHandler()) -} - -function proxyChildrenOnly(array: Array, parent: ObservableHandler, observed?: boolean): Array { - if (observed === undefined) observed = ObservableHandler.contains(parent) - return array.map((it: T) => observableProxy(it, parent, observed)) -} - -class CustomArrayProxyHandler extends DefaultArrayProxyHandler { - override get(target: Array, index: int32): T { - const observable = ObservableHandler.find(target) - if (observable) observable.onAccess() - return super.get(target, index) - } - - override set(target: Array, index: int32, value: T): boolean { - const observable = ObservableHandler.find(target) - if (observable) { - observable.onModify() - observable.removeChild(super.get(target, index)) - value = observableProxy(value, observable, ObservableHandler.contains(observable)) - } - return super.set(target, index, value) - } - - override get(target: Array, name: string): NullishType { - const observable = ObservableHandler.find(target) - if (observable) observable.onAccess() - return super.get(target, name) - } - - override set(target: Array, name: string, value: NullishType): boolean { - const observable = ObservableHandler.find(target) - if (observable) { - observable.onModify() - observable.removeChild(super.get(target, name)) - value = observableProxy(value, observable, ObservableHandler.contains(observable)) - } - return super.set(target, name, value) - } - - override invoke(target: Array, method: Method, args: NullishType[]): NullishType { - const observable = ObservableHandler.find(target) - if (observable) { - const name = method.getName() - if (name == "copyWithin" || name == "reverse" || name == "sort") { - observable.onModify() - return super.invoke(target, method, args) - } - if (name == "fill") { - observable.onModify() - if (args.length > 0) { - args[0] = observableProxy(args[0], observable) - } - return super.invoke(target, method, args) - } - if (name == "pop" || name == "shift") { - observable.onModify() - const result = super.invoke(target, method, args) - observable.removeChild(result) - return result - } - if (name == "push" || name == "unshift") { - observable.onModify() - if (args.length > 0) { - const items = args[0] - if (items instanceof Array) { - args[0] = proxyChildrenOnly(items, observable) - } - } - return super.invoke(target, method, args) - } - if (name == "splice") { - observable.onModify() - if (args.length > 2) { - const items = args[2] - if (items instanceof Array) { - args[2] = proxyChildrenOnly(items, observable) - } - } - const result = super.invoke(target, method, args) - if (result instanceof Array) { - for (let i = 0; i < result.length; i++) { - observable.removeChild(result[i]) - } - } - return result - } - observable.onAccess() - } - return super.invoke(target, method, args) - } -} diff --git a/koala-wrapper/koalaui/compat/src/arkts/performance.ts b/koala-wrapper/koalaui/compat/src/arkts/performance.ts deleted file mode 100644 index 2755960e8..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/performance.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @returns the number of milliseconds elapsed since midnight, - * January 1, 1970 Universal Coordinated Time (UTC). - */ -export function timeNow(): number { - return Date.now() -} - -/** - * @param fractionDigits - number of digits after the decimal point [0 - 20] - * @returns a string representing a number in fixed-point notation - */ -export function numberToFixed(value: number, fractionDigits: number): string { - return new Number(value).toFixed(fractionDigits) -} diff --git a/koala-wrapper/koalaui/compat/src/arkts/reflection.ts b/koala-wrapper/koalaui/compat/src/arkts/reflection.ts deleted file mode 100644 index 75bdadc33..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/reflection.ts +++ /dev/null @@ -1,22 +0,0 @@ - -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { className } from "./ts-reflection" - -export function lcClassName(object: Object) { - return className(object).toLowerCase() -} - -export @interface Entry {} diff --git a/koala-wrapper/koalaui/compat/src/arkts/strings.ts b/koala-wrapper/koalaui/compat/src/arkts/strings.ts deleted file mode 100644 index b0129c085..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/strings.ts +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { int32, uint8 } from "./types" -import { Array_from_int32 } from "./array" - - -interface SystemTextEncoder { - encode(input?: string): Uint8Array; - encodeInto(src: string, dest: Uint8Array): void; -} - -interface WithStreamOption { - stream: Boolean | undefined; -} - -interface SystemTextDecoder { - decode( - input: ArrayBuffer | null | undefined | Uint8Array, - options: WithStreamOption | undefined - ): string; -} - -export class CustomTextEncoder { - static readonly HeaderLen: int32 = Int32Array.BYTES_PER_ELEMENT - - constructor(encoder:SystemTextEncoder|undefined = undefined) { - this.encoder = encoder - } - - private readonly encoder: SystemTextEncoder|undefined - - public static stringLength(input: string): int32 { - let length = 0 - for (let i = 0; i < input.length; i++) { - length++ - let cp = input.codePointAt(i)! - if (cp >= 0x10000) { - i++ - } - } - return length - } - - encodedLength(input: string): int32 { - let length = 0 - for (let i = 0; i < input.length; i++) { - let cp = input.codePointAt(i)! - if (cp < 0x80) { - length += 1 - } else if (cp < 0x800) { - length += 2 - } else if (cp < 0x10000) { - length += 3 - } else { - length += 4 - i++ - } - } - return length - } - - private addLength(array: Uint8Array, offset: int32, length: int32 | number): void { - const len = length as int32 - array.set(offset, len & 0xff) - array.set(offset + 1, (len >> 8) & 0xff) - array.set(offset + 2, (len >> 16) & 0xff) - array.set(offset + 3, (len >> 24) & 0xff) - } - - static getHeaderLength(array: Uint8Array, offset: int32 = 0): int32 { - return ( - (array.at(offset) as int32) | - (array.at(((offset + 1) << 8)) as int32) | - (array.at((offset + 2) << 16) as int32) | - (array.at((offset + 3) << 24)) as int32) - } - - // Produces array of bytes with encoded string headed by 4 bytes (little endian) size information: - // [s0][s1][s2][s3] [c_0] ... [c_size-1] - encode(input: string | undefined, addLength: boolean = true): Uint8Array { - let headerLen = addLength ? CustomTextEncoder.HeaderLen : 0 - let result: Uint8Array - if (!input) { - result = new Uint8Array(headerLen) - } else if (this.encoder !== undefined) { - result = this.encoder!.encode('s'.repeat(headerLen) + input) - } else { - let length = this.encodedLength(input) - result = new Uint8Array(length + headerLen) - this.encodeInto(input, result, headerLen) - } - if (addLength) { - this.addLength(result, 0, (result.length - headerLen) as int32) - } - return result - } - - // Produces encoded array of strings with size information. - encodeArray(strings: Array): Uint8Array { - let totalBytes = CustomTextEncoder.HeaderLen - let lengths = new Int32Array(strings.length) - for (let i = 0; i < lengths.length; i++) { - let len = this.encodedLength(strings[i]) - lengths[i] = len - totalBytes += len + CustomTextEncoder.HeaderLen - } - let array = new Uint8Array(totalBytes) - let position = 0 - this.addLength(array, position, lengths.length as int32) - position += CustomTextEncoder.HeaderLen - for (let i = 0; i < lengths.length; i++) { - this.addLength(array, position, lengths[i] as int32) - position += CustomTextEncoder.HeaderLen - this.encodeInto(strings[i], array, position) - position += lengths[i] - } - return array - } - - encodeInto(input: string, result: Uint8Array, position: int32): Uint8Array { - if (this.encoder !== undefined) { - this.encoder!.encodeInto(input, result.subarray(position, result.length)) - return result - } - let index = position - for (let stringPosition = 0; stringPosition < input.length; stringPosition++) { - let cp = input.codePointAt(stringPosition)! - if (cp < 0x80) { - result[index++] = (cp | 0) - } else if (cp < 0x800) { - result[index++] = ((cp >> 6) | 0xc0) - result[index++] = ((cp & 0x3f) | 0x80) - } else if (cp < 0x10000) { - result[index++] = ((cp >> 12) | 0xe0) - result[index++] = (((cp >> 6) & 0x3f) | 0x80) - result[index++] = ((cp & 0x3f) | 0x80) - } else { - result[index++] = ((cp >> 18) | 0xf0) - result[index++] = (((cp >> 12) & 0x3f) | 0x80) - result[index++] = (((cp >> 6) & 0x3f) | 0x80) - result[index++] = ((cp & 0x3f) | 0x80) - stringPosition++ - } - } - result[index] = 0 - return result - } -} - -export class CustomTextDecoder { - static cpArrayMaxSize = 128 - constructor(decoder: SystemTextDecoder|undefined = undefined) { - this.decoder = decoder - } - - private readonly decoder: SystemTextDecoder|undefined - - decode(input: Uint8Array): string { - if (this.decoder !== undefined) { - return this.decoder!.decode(input, undefined) - } - - const cpSize = Math.min(CustomTextDecoder.cpArrayMaxSize, input.length) - let codePoints = new Int32Array(cpSize) - let cpIndex = 0; - let index = 0 - let result = "" - while (index < input.length) { - let elem = input[index] as uint8 - let lead = elem & 0xff - let count = 0 - let value = 0 - if (lead < 0x80) { - count = 1 - value = elem - } else if ((lead >> 5) == 0x6) { - value = (((elem << 6) & 0x7ff) + (input[index + 1] & 0x3f)) as int32 - count = 2 - } else if ((lead >> 4) == 0xe) { - value = (((elem << 12) & 0xffff) + ((input[index + 1] << 6) & 0xfff) + - (input[index + 2] & 0x3f)) as int32 - count = 3 - } else if ((lead >> 3) == 0x1e) { - value = (((elem << 18) & 0x1fffff) + ((input[index + 1] << 12) & 0x3ffff) + - ((input[index + 2] << 6) & 0xfff) + (input[index + 3] & 0x3f)) as int32 - count = 4 - } - codePoints[cpIndex++] = value - if (cpIndex == cpSize) { - cpIndex = 0 - //result += String.fromCodePoint(...codePoints) - result += String.fromCodePoint(...Array_from_int32(codePoints)) - } - index += count - } - if (cpIndex > 0) { - result += String.fromCodePoint(...Array_from_int32(codePoints.slice(0, cpIndex))) - } - return result - } -} diff --git a/koala-wrapper/koalaui/compat/src/arkts/ts-reflection.ts b/koala-wrapper/koalaui/compat/src/arkts/ts-reflection.ts deleted file mode 100644 index 0214ccf02..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/ts-reflection.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export function className(object?: Object): string { - return object ? (Type.of(object) as ClassType).getName() : "null" -} - -export function isFunction(object?: Object): boolean { - return Type.of(object) instanceof FunctionType -} - -// TODO: This is an very ad hoc function, -// but I could not find in ArkTS stdlib enough functionality -// for a more generic way. -export function functionOverValue(value: Value|(()=>Value)): boolean { - return Type.of(value) instanceof FunctionType -} - -// Somehow es2panda only allows === on reference types. -export function refEqual(a: Value, b: Value): boolean { - return a == b -} - -export function isNotPrimitive(value: Object): boolean { - return !Type.of(value).isPrimitive() -} diff --git a/koala-wrapper/koalaui/compat/src/arkts/types.ts b/koala-wrapper/koalaui/compat/src/arkts/types.ts deleted file mode 100644 index 3f4d932f4..000000000 --- a/koala-wrapper/koalaui/compat/src/arkts/types.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export type uint8 = byte -export type int8 = byte -export type unt16 = short -export type int16 = short -export type int32 = int -export type uint32 = int -export type int64 = long -export type uint64 = long -export type float32 = float -export type float64 = double diff --git a/koala-wrapper/koalaui/compat/src/index.ts b/koala-wrapper/koalaui/compat/src/index.ts deleted file mode 100644 index e2760b0c7..000000000 --- a/koala-wrapper/koalaui/compat/src/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { - asArray, - Array_from_set, - Array_from_int32, - Array_from_number, - AtomicRef, - asFloat64, - asString, - float32FromBits, - int32BitsFromFloat, - Thunk, - finalizerRegister, - finalizerUnregister, - timeNow, - numberToFixed, - Observed, - Observable, - ObservableHandler, - observableProxy, - observableProxyArray, - propDeepCopy, - lcClassName, - CustomTextEncoder, - CustomTextDecoder, - className, - isFunction, - functionOverValue, - refEqual, - isNotPrimitive, - uint8, - int8, - int16, - int32, - uint32, - int64, - uint64, - float32, - float64, - int8Array, - unsafeCast, -} from "#platform" diff --git a/koala-wrapper/koalaui/compat/src/ohos/index.ts b/koala-wrapper/koalaui/compat/src/ohos/index.ts deleted file mode 100644 index b5bd901b4..000000000 --- a/koala-wrapper/koalaui/compat/src/ohos/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { - asArray, - Array_from_set, - Array_from_int32, - Array_from_number, - AtomicRef, - asFloat64, - asString, - float32FromBits, - int32BitsFromFloat, - Thunk, - finalizerRegister, - finalizerUnregister, - Observed, - Observable, - ObservableHandler, - observableProxy, - observableProxyArray, - propDeepCopy, - lcClassName, - CustomTextEncoder, - CustomTextDecoder, - className, - isFunction, - functionOverValue, - refEqual, - isNotPrimitive, - uint8, - int8, - int16, - int32, - uint32, - int64, - uint64, - float32, - float64, - int8Array, - unsafeCast, -} from "../typescript" - -export { - timeNow, - numberToFixed, -} from "./performance" diff --git a/koala-wrapper/koalaui/compat/src/ohos/performance.ts b/koala-wrapper/koalaui/compat/src/ohos/performance.ts deleted file mode 100644 index 2755960e8..000000000 --- a/koala-wrapper/koalaui/compat/src/ohos/performance.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @returns the number of milliseconds elapsed since midnight, - * January 1, 1970 Universal Coordinated Time (UTC). - */ -export function timeNow(): number { - return Date.now() -} - -/** - * @param fractionDigits - number of digits after the decimal point [0 - 20] - * @returns a string representing a number in fixed-point notation - */ -export function numberToFixed(value: number, fractionDigits: number): string { - return new Number(value).toFixed(fractionDigits) -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/Types.d.ts b/koala-wrapper/koalaui/compat/src/typescript/Types.d.ts deleted file mode 100644 index 6b3ee5d94..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/Types.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -type int = number -type long = number -type float = number -type double = number diff --git a/koala-wrapper/koalaui/compat/src/typescript/array.ts b/koala-wrapper/koalaui/compat/src/typescript/array.ts deleted file mode 100644 index 9392bb412..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/array.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { float64, int32, int8 } from "./types" - -export function asArray(value: T[]): Array { - return value -} - -export function Array_from_set(set: Set): Array { - return Array.from(set) -} - -export function Array_from_int32(data: Int32Array): int32[] { - return Array.from(data) -} - -export function Array_from_number(data: float64[]): Array { - return data -} - -export function int8Array(size: int32): int8[] { - return [] -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/atomic.ts b/koala-wrapper/koalaui/compat/src/typescript/atomic.ts deleted file mode 100644 index e6312b700..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/atomic.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * A reference that may be updated atomically. - */ -export class AtomicRef { - value: Value - - /** - * Creates a new reference object with the given initial value. - * @param value - the new value - */ - constructor(value: Value) { - this.value = value - } - - /** - * Atomically sets the reference value to the given value and returns the previous one. - * @param value - the new value - * @returns the previous value - */ - getAndSet(value: Value): Value { - const result = this.value - this.value = value - return result - } -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/double.ts b/koala-wrapper/koalaui/compat/src/typescript/double.ts deleted file mode 100644 index ee4ad821e..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/double.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { float64, int32, float32 } from "./types" - -export function asFloat64(value: string): float64 { - return Number(value) -} - -export function asString(value: float64 | undefined): string | undefined { - return value?.toString() -} - -export function float32FromBits(value: int32): float32 { - return value -} - -export function int32BitsFromFloat(value: float32): int32 { - return value -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/finalization.ts b/koala-wrapper/koalaui/compat/src/typescript/finalization.ts deleted file mode 100644 index 4aa68d116..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/finalization.ts +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export interface Thunk { - clean(): void -} - -interface FinalizationRegistry { - register(target: object, value: any, token?: object): void; - unregister(token: object): void; -} - -interface FinalizationRegistryConstructor { - readonly prototype: FinalizationRegistry; - new(callback: (value: any) => void): FinalizationRegistry; -} - -declare const FinalizationRegistry: FinalizationRegistryConstructor - -const registry = new FinalizationRegistry((thunk: Thunk) => { - thunk.clean() -}) - -export function finalizerRegister(target: object, thunk: object) { - registry.register(target, thunk) -} - -export function finalizerUnregister(target: object) { - registry.unregister(target) -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/index.ts b/koala-wrapper/koalaui/compat/src/typescript/index.ts deleted file mode 100644 index 84eed3cf9..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from "./array" -export * from "./atomic" -export * from "./double" -export * from "./finalization" -export * from "./observable" -export * from "./performance" -export * from "./prop-deep-copy" -export * from "./reflection" -export * from "./strings" -export * from "./ts-reflection" -export * from "./types" -export * from "./utils" diff --git a/koala-wrapper/koalaui/compat/src/typescript/observable.ts b/koala-wrapper/koalaui/compat/src/typescript/observable.ts deleted file mode 100644 index fd40fcdcf..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/observable.ts +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -const OBSERVABLE_TARGET = "__proxy_observable_target__" - -export function getObservableTarget(proxy: Object): Object { - return getPropertyValue(OBSERVABLE_TARGET, proxy) ?? proxy -} - -function getPropertyValue(name: string, object: any): any { - return object[name] -} - -/** - * Data class decorator that makes all child fields trackable. - */ -export function Observed(constructorFunction: Function) { - constructorFunction.prototype[OBSERVED] = true -} - -const OBSERVED = "__ObservedByArkUI__" -function isObserved(value: any): boolean { - return value[OBSERVED] === true -} - -/** @internal */ -export interface Observable { - /** It is called when the observable value is accessed. */ - onAccess(): void - /** It is called when the observable value is modified. */ - onModify(): void -} - -/** @internal */ -export class ObservableHandler implements Observable { - private static handlers: WeakMap | undefined = undefined - - private parents = new Set() - private children = new Map() - - private readonly observables = new Set() - private _modified = false - - readonly observed: boolean - constructor(parent?: ObservableHandler, observed: boolean = false) { - this.observed = observed - if (parent) this.addParent(parent) - } - - onAccess(): void { - if (this.observables.size > 0) { - const it = this.observables.keys() - while (true) { - const result = it.next() - if (result.done) break - result.value?.onAccess() - } - } - } - - onModify(): void { - const set = new Set() - this.collect(true, set) - set.forEach((handler: ObservableHandler) => { - handler._modified = true - if (handler.observables.size > 0) { - const it = handler.observables.keys() - while (true) { - const result = it.next() - if (result.done) break - result.value?.onModify() - } - } - }) - } - - static dropModified(value: Value): boolean { - const handler = ObservableHandler.findIfObject(value) - if (handler === undefined) return false - const result = handler._modified - handler._modified = false - return result - } - - /** Adds the specified `observable` to the handler corresponding to the given `value`. */ - static attach(value: Value, observable: Observable): void { - const handler = ObservableHandler.findIfObject(value) - if (handler) handler.observables.add(observable) - } - - /** Deletes the specified `observable` from the handler corresponding to the given `value`. */ - static detach(value: Value, observable: Observable): void { - const handler = ObservableHandler.findIfObject(value) - if (handler) handler.observables.delete(observable) - } - - /** @returns the handler corresponding to the given `value` if it was installed */ - private static findIfObject(value: Value): ObservableHandler | undefined { - const handlers = ObservableHandler.handlers - return handlers !== undefined && value instanceof Object ? handlers.get(getObservableTarget(value as Object)) : undefined - } - - /** - * @param value - any non-null object including arrays - * @returns an observable handler or `undefined` if it is not installed - */ - static find(value: Object): ObservableHandler | undefined { - const handlers = ObservableHandler.handlers - return handlers ? handlers.get(getObservableTarget(value)) : undefined - } - - /** - * @param value - any non-null object including arrays - * @param observable - a handler to install on this object - * @throws an error if observable handler cannot be installed - */ - static installOn(value: Object, observable?: ObservableHandler): void { - let handlers = ObservableHandler.handlers - if (handlers === undefined) { - handlers = new WeakMap() - ObservableHandler.handlers = handlers - } - observable - ? handlers.set(getObservableTarget(value), observable) - : handlers.delete(getObservableTarget(value)) - } - - addParent(parent: ObservableHandler) { - const count = parent.children.get(this) ?? 0 - parent.children.set(this, count + 1) - this.parents.add(parent) - } - - removeParent(parent: ObservableHandler) { - const count = parent.children.get(this) ?? 0 - if (count > 1) { - parent.children.set(this, count - 1) - } - else if (count == 1) { - parent.children.delete(this) - this.parents.delete(parent) - } - } - - removeChild(value: Value) { - const child = ObservableHandler.findIfObject(value) - if (child) child.removeParent(this) - } - - private collect(all: boolean, guards = new Set()) { - if (guards.has(this)) return guards // already collected - guards.add(this) // handler is already guarded - this.parents.forEach(handler => handler.collect(all, guards)) - if (all) this.children.forEach((_count, handler) => handler.collect(all, guards)) - return guards - } - - static contains(observable: ObservableHandler, guards?: Set) { - if (observable.observed) return true - if (guards === undefined) guards = new Set() // create if needed - else if (guards.has(observable)) return false // already checked - guards.add(observable) // handler is already guarded - for (const it of observable.parents.keys()) { - if (ObservableHandler.contains(it, guards)) return true - } - return false - } -} - -/** @internal */ -export function observableProxyArray(...value: Value[]): Array { - return observableProxy(value) -} - -/** @internal */ -export function observableProxy(value: Value, parent?: ObservableHandler, observed?: boolean, strict = true): Value { - if (value instanceof ObservableHandler) return value // do not proxy a marker itself - if (value === null || !(value instanceof Object)) return value // only non-null object can be observable - const observable = ObservableHandler.find(value) - if (observable) { - if (parent) { - if (strict) observable.addParent(parent) - if (observed === undefined) observed = ObservableHandler.contains(parent) - } - if (observed) { - if (Array.isArray(value)) { - for (let index = 0; index < value.length; index++) { - value[index] = observableProxy(value[index], observable, observed, false) - } - } else { - proxyFields(value, false, observable) - } - } - return value - } - if (Array.isArray(value)) { - const handler = new ObservableHandler(parent) - const array = proxyChildrenOnly(value, handler, observed) - copyWithinObservable(array) - fillObservable(array) - popObservable(array) - pushObservable(array) - reverseObservable(array) - shiftObservable(array) - sortObservable(array) - spliceObservable(array) - unshiftObservable(array) - return proxyObject(array, handler) - } - if (value instanceof Date) { - const valueAsAny = (value as any) - const handler = new ObservableHandler(parent) - const setMethods = new Set([ - "setFullYear", "setMonth", "setDate", "setHours", "setMinutes", "setSeconds", - "setMilliseconds", "setTime", "setUTCFullYear", "setUTCMonth", "setUTCDate", - "setUTCHours", "setUTCMinutes", "setUTCSeconds", "setUTCMilliseconds" - ]) - setMethods.forEach((method: string) => { - const originalMethod = method + 'Original' - if (valueAsAny[originalMethod] !== undefined) { - return - } - valueAsAny[originalMethod] = valueAsAny[method] - valueAsAny[method] = function (...args: any[]) { - ObservableHandler.find(this)?.onModify() - return this[originalMethod](...args) - } - }) - return proxyObject(value, handler) - } - // TODO: support set/map - const handler = new ObservableHandler(parent, isObserved(value)) - if (handler.observed || observed) proxyFields(value, true, handler) - return proxyObject(value, handler) -} - -function proxyObject(value: any, observable: ObservableHandler) { - ObservableHandler.installOn(value, observable) - return new Proxy(value, { - get(target, property, receiver) { - if (property == OBSERVABLE_TARGET) return target - const value: any = Reflect.get(target, property, receiver) - ObservableHandler.find(target)?.onAccess() - return typeof value == "function" - ? value.bind(target) - : value - }, - set(target, property, value, receiver) { - const old = Reflect.get(target, property, receiver) - if (value === old) return true - const observable = ObservableHandler.find(target) - if (observable) { - observable.onModify() - observable.removeChild(old) - const observed = ObservableHandler.contains(observable) - if (observed || Array.isArray(target)) { - value = observableProxy(value, observable, observed) - } - } - return Reflect.set(target, property, value, receiver) - }, - deleteProperty(target, property) { - ObservableHandler.find(target)?.onModify() - delete target[property] - return true - }, - }) -} - -function proxyFields(value: any, strict: boolean, parent?: ObservableHandler) { - for (const name of Object.getOwnPropertyNames(value)) { - const descriptor = Object.getOwnPropertyDescriptor(value, name) - if (descriptor?.writable) value[name] = observableProxy(value[name], parent, true, strict) - } -} - -function proxyChildrenOnly(array: any[], parent: ObservableHandler, observed?: boolean): any[] { - if (observed === undefined) observed = ObservableHandler.contains(parent) - return array.map(it => observableProxy(it, parent, observed)) -} - -function copyWithinObservable(array: any) { - if (array.copyWithinOriginal === undefined) { - array.copyWithinOriginal = array.copyWithin - array.copyWithin = function (this, target: number, start: number, end?: number) { - const observable = ObservableHandler.find(this) - observable?.onModify() - return this.copyWithinOriginal(target, start, end) - } - } -} - -function fillObservable(array: any) { - if (array.fillOriginal === undefined) { - array.fillOriginal = array.fill - array.fill = function (this, value: any, start?: number, end?: number) { - const observable = ObservableHandler.find(this) - observable?.onModify() - if (observable) value = observableProxy(value, observable) - return this.fillOriginal(value, start, end) - } - } -} - -function popObservable(array: any) { - if (array.popOriginal === undefined) { - array.popOriginal = array.pop - array.pop = function (...args: any[]) { - const observable = ObservableHandler.find(this) - observable?.onModify() - const result = this.popOriginal(...args) - if (observable) observable.removeChild(result) - return result - } - } -} - -function pushObservable(array: any) { - if (array.pushOriginal === undefined) { - array.pushOriginal = array.push - array.push = function (this, ...args: any[]) { - const observable = ObservableHandler.find(this) - observable?.onModify() - if (observable) args = proxyChildrenOnly(args, observable) - return this.pushOriginal(...args) - } - } -} - -function reverseObservable(array: any) { - if (array.reverseOriginal === undefined) { - array.reverseOriginal = array.reverse - array.reverse = function (this) { - const observable = ObservableHandler.find(this) - observable?.onModify() - return this.reverseOriginal() - } - } -} - -function shiftObservable(array: any) { - if (array.shiftOriginal === undefined) { - array.shiftOriginal = array.shift - array.shift = function (this, ...args: any[]) { - const observable = ObservableHandler.find(this) - observable?.onModify() - const result = this.shiftOriginal(...args) - if (observable) observable.removeChild(result) - return result - } - } -} - -function sortObservable(array: any) { - if (array.sortOriginal === undefined) { - array.sortOriginal = array.sort - array.sort = function (this, compareFn?: (a: any, b: any) => number) { - const observable = ObservableHandler.find(this) - observable?.onModify() - return this.sortOriginal(compareFn) - } - } -} - -function spliceObservable(array: any) { - if (array.spliceOriginal === undefined) { - array.spliceOriginal = array.splice - array.splice = function (this, start: number, deleteCount: number, ...items: any[]) { - const observable = ObservableHandler.find(this) - observable?.onModify() - if (observable) items = proxyChildrenOnly(items, observable) - if (deleteCount === undefined) deleteCount = array.length - const result = this.spliceOriginal(start, deleteCount, ...items) - if (observable && Array.isArray(result)) { - result.forEach(it => observable.removeChild(it)) - } - return result - } - } -} - -function unshiftObservable(array: any) { - if (array.unshiftOriginal === undefined) { - array.unshiftOriginal = array.unshift - array.unshift = function (this, ...items: any[]) { - const observable = ObservableHandler.find(this) - observable?.onModify() - if (observable) items = proxyChildrenOnly(items, observable) - return this.unshiftOriginal(...items) - } - } -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/performance.ts b/koala-wrapper/koalaui/compat/src/typescript/performance.ts deleted file mode 100644 index 80ea8a14e..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/performance.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @returns the number of milliseconds elapsed since midnight, - * January 1, 1970 Universal Coordinated Time (UTC). - */ -export function timeNow(): number { - return performance.now() -} - -/** - * @param fractionDigits - number of digits after the decimal point [0 - 20] - * @returns a string representing a number in fixed-point notation - */ -export function numberToFixed(value: number, fractionDigits: number): string { - return value.toFixed(fractionDigits) -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/prop-deep-copy.ts b/koala-wrapper/koalaui/compat/src/typescript/prop-deep-copy.ts deleted file mode 100644 index 8da5c4f71..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/prop-deep-copy.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { getObservableTarget } from "./observable" - -/* - When decorating variables of complex types, - @Prop makes a deep copy, during which all types, - except primitive types, Map, Set, Date, and Array, will be lost. - */ - -export function propDeepCopy(sourceObject: T): T { - if (!sourceObject || typeof sourceObject !== 'object') { - return sourceObject - } - - const copiedObjects = new Map() - return recursiveDeepCopy(sourceObject) as T - - function recursiveDeepCopy(sourceObject: Object): Object { - if (!sourceObject || typeof sourceObject !== 'object') { - return sourceObject - } - - const storedObject = copiedObjects.get(sourceObject) - if (storedObject !== undefined) { - return storedObject - } - - const copy: any = copyDeepTrackable(sourceObject) - - const objectToCopyFrom = getObservableTarget(sourceObject) - Object.keys(objectToCopyFrom) - .forEach((key) => { - const property = objectToCopyFrom[key as keyof Object] - - if (typeof property === "function") { - Reflect.set(copy, key, property) - copy[key] = copy[key].bind(copy) - return - } - Reflect.set(copy, key, recursiveDeepCopy(property)); - }) - - return copy - } - - function copyDeepTrackable(sourceObject: T): T { - if (sourceObject instanceof Set) { - const copy = new Set() - Object.setPrototypeOf(copy, Object.getPrototypeOf(sourceObject)) - copiedObjects.set(sourceObject, copy) - for (const setKey of sourceObject.keys()) { - copy.add(recursiveDeepCopy(setKey)) - } - return copy as T - } - if (sourceObject instanceof Map) { - const copy = new Map() - Object.setPrototypeOf(copy, Object.getPrototypeOf(sourceObject)) - copiedObjects.set(sourceObject, copy) - for (const mapKey of sourceObject.keys()) { - copy.set(mapKey, recursiveDeepCopy(sourceObject.get(mapKey))) - } - return copy as T - } - if (sourceObject instanceof Date) { - const copy = new Date() - copy.setTime(sourceObject.getTime()) - Object.setPrototypeOf(copy, Object.getPrototypeOf(sourceObject)) - copiedObjects.set(sourceObject, copy) - return copy as T - } - if (sourceObject instanceof Object) { - const copy = Array.isArray(sourceObject) ? [] : {} - Object.setPrototypeOf(copy, Object.getPrototypeOf(sourceObject)) - copiedObjects.set(sourceObject, copy) - return copy as T - } - - return sourceObject - } -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/reflection.ts b/koala-wrapper/koalaui/compat/src/typescript/reflection.ts deleted file mode 100644 index 50e1863f0..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/reflection.ts +++ /dev/null @@ -1,20 +0,0 @@ - -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { className } from "./ts-reflection" - -export function lcClassName(object: Object) { - return className(object).toLowerCase() -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/strings.ts b/koala-wrapper/koalaui/compat/src/typescript/strings.ts deleted file mode 100644 index 79ad7c2d6..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/strings.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { int32 } from "./types" - -interface SystemTextEncoder { - encode(input?: string): Uint8Array; - encodeInto(src: string, dest: Uint8Array): void; -} - -interface WithStreamOption { - stream?: boolean | undefined; -} - -interface SystemTextDecoder { - decode( - input?: ArrayBuffer | null, - options?: WithStreamOption - ): string; -} - -export class CustomTextEncoder { - static readonly HeaderLen: int32 = Int32Array.BYTES_PER_ELEMENT - - constructor(encoder: SystemTextEncoder|undefined = ((typeof TextEncoder != "undefined") ? new TextEncoder() : undefined)) { - this.encoder = encoder - } - - private readonly encoder: SystemTextEncoder|undefined - - public static stringLength(input: string): int32 { - let length = 0 - for (let i = 0; i < input.length; i++) { - length++ - let cp = input.codePointAt(i)! - if (cp >= 0x10000) { - i++ - } - } - return length - } - - encodedLength(input: string): int32 { - let length = 0 - for (let i = 0; i < input.length; i++) { - let cp = input.codePointAt(i)! - if (cp < 0x80) { - length += 1 - } else if (cp < 0x800) { - length += 2 - } else if (cp < 0x10000) { - length += 3 - } else { - length += 4 - i++ - } - } - return length - } - - private addLength(array: Uint8Array, offset: int32, len: int32): void { - array[offset] = (len & 0xff) - array[offset + 1] = ((len >> 8) & 0xff) - array[offset + 2] = ((len >> 16) & 0xff) - array[offset + 3] = ((len >> 24) & 0xff) - } - - static getHeaderLength(array: Uint8Array, offset: int32 = 0): int32 { - return (array[offset] | (array[offset + 1] << 8) | (array[offset + 2] << 16) | (array[offset + 3] << 24)) - } - - // Produces array of bytes with encoded string headed by 4 bytes (little endian) size information: - // [s0][s1][s2][s3] [c_0] ... [c_size-1] - encode(input: string | undefined, addLength: boolean = true): Uint8Array { - let headerLen = addLength ? CustomTextEncoder.HeaderLen : 0 - let result: Uint8Array - if (!input) { - result = new Uint8Array(headerLen) - } else if (this.encoder !== undefined) { - result = this.encoder!.encode('s'.repeat(headerLen) + input) - } else { - let length = this.encodedLength(input) - result = new Uint8Array(length + headerLen) - this.encodeInto(input, result, headerLen) - } - if (addLength) { - this.addLength(result, 0, result.length - headerLen) - } - return result - } - - // Produces encoded array of strings with size information. - encodeArray(strings: Array): Uint8Array { - let totalBytes = CustomTextEncoder.HeaderLen - let lengths = new Int32Array(strings.length) - for (let i = 0; i < lengths.length; i++) { - let len = this.encodedLength(strings[i]) - lengths[i] = len - totalBytes += len + CustomTextEncoder.HeaderLen - } - let array = new Uint8Array(totalBytes) - let position = 0 - this.addLength(array, position, lengths.length) - position += CustomTextEncoder.HeaderLen - for (let i = 0; i < lengths.length; i++) { - this.addLength(array, position, lengths[i]) - position += CustomTextEncoder.HeaderLen - this.encodeInto(strings[i], array, position) - position += lengths[i] - } - return array - } - - encodeInto(input: string, result: Uint8Array, position: int32): Uint8Array { - if (this.encoder !== undefined) { - this.encoder!.encodeInto(input, result.subarray(position, result.length)) - return result - } - let index = position - for (let stringPosition = 0; stringPosition < input.length; stringPosition++) { - let cp = input.codePointAt(stringPosition)! - if (cp < 0x80) { - result[index++] = (cp | 0) - } else if (cp < 0x800) { - result[index++] = ((cp >> 6) | 0xc0) - result[index++] = ((cp & 0x3f) | 0x80) - } else if (cp < 0x10000) { - result[index++] = ((cp >> 12) | 0xe0) - result[index++] = (((cp >> 6) & 0x3f) | 0x80) - result[index++] = ((cp & 0x3f) | 0x80) - } else { - result[index++] = ((cp >> 18) | 0xf0) - result[index++] = (((cp >> 12) & 0x3f) | 0x80) - result[index++] = (((cp >> 6) & 0x3f) | 0x80) - result[index++] = ((cp & 0x3f) | 0x80) - stringPosition++ - } - } - result[index] = 0 - return result - } -} - -export class CustomTextDecoder { - static cpArrayMaxSize = 128 - constructor(decoder: SystemTextDecoder|undefined = ((typeof TextDecoder != "undefined") ? new TextDecoder() : undefined)) { - this.decoder = decoder - } - - private readonly decoder: SystemTextDecoder|undefined - - decode(input: Uint8Array): string { - if (this.decoder !== undefined) { - return this.decoder!.decode(input) - } - const cpSize = Math.min(CustomTextDecoder.cpArrayMaxSize, input.length) - let codePoints = new Int32Array(cpSize) - let cpIndex = 0; - let index = 0 - let result = "" - while (index < input.length) { - let elem = input[index] - let lead = elem & 0xff - let count = 0 - let value = 0 - if (lead < 0x80) { - count = 1 - value = elem - } else if ((lead >> 5) == 0x6) { - value = ((elem << 6) & 0x7ff) + (input[index + 1] & 0x3f) - count = 2 - } else if ((lead >> 4) == 0xe) { - value = ((elem << 12) & 0xffff) + ((input[index + 1] << 6) & 0xfff) + - (input[index + 2] & 0x3f) - count = 3 - } else if ((lead >> 3) == 0x1e) { - value = ((elem << 18) & 0x1fffff) + ((input[index + 1] << 12) & 0x3ffff) + - ((input[index + 2] << 6) & 0xfff) + (input[index + 3] & 0x3f) - count = 4 - } - codePoints[cpIndex++] = value - if (cpIndex == cpSize) { - cpIndex = 0 - result += String.fromCodePoint(...codePoints) - } - index += count - } - if (cpIndex > 0) { - result += String.fromCodePoint(...codePoints.slice(0, cpIndex)) - } - return result - } -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/ts-reflection.ts b/koala-wrapper/koalaui/compat/src/typescript/ts-reflection.ts deleted file mode 100644 index f820e0045..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/ts-reflection.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export function className(object?: Object): string { - return object?.constructor.name ?? "" -} - -export function isFunction(object?: Object): boolean { - return typeof object === 'function' -} - -// TODO: this is to match arkts counterpart -export function functionOverValue(value: Value|(()=>Value)): boolean { - return typeof value === 'function' -} - -export function refEqual(a: Value, b: Value): boolean { - return a === b -} - -export function isNotPrimitive(value: Object): boolean { - return true -} diff --git a/koala-wrapper/koalaui/compat/src/typescript/types.ts b/koala-wrapper/koalaui/compat/src/typescript/types.ts deleted file mode 100644 index 4a2c8a411..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/types.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/// -export type uint8 = int -export type int8 = int -export type int16 = int -export type int32 = int -export type uint32 = int -export type int64 = long -export type uint64 = long -export type float32 = float -export type float64 = double diff --git a/koala-wrapper/koalaui/compat/src/typescript/utils.ts b/koala-wrapper/koalaui/compat/src/typescript/utils.ts deleted file mode 100644 index a689f8905..000000000 --- a/koala-wrapper/koalaui/compat/src/typescript/utils.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export function unsafeCast(value: unknown): T { - return value as unknown as T -} diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.d.ts index 87813a2b6..86b4ff153 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.d.ts @@ -1,29 +1,23 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/common"; export type ResourceId = int32; +export interface Disposable { + dispose(): void; +} export declare class ResourceHolder { private static nextResourceId; private resources; private static _instance; + private static disposables; + private static disposablesSize; static instance(): ResourceHolder; hold(resourceId: ResourceId): void; release(resourceId: ResourceId): void; registerAndHold(resource: object): ResourceId; get(resourceId: ResourceId): object; has(resourceId: ResourceId): boolean; + static register(resource: Disposable): void; + static unregister(resource: Disposable): void; + static disposeAll(): void; + static compactDisposables(): void; } //# sourceMappingURL=ResourceManager.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.d.ts.map new file mode 100644 index 000000000..37853eb57 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ResourceManager.d.ts","sourceRoot":"","sources":["../../../../src/arkts/ResourceManager.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,MAAM,UAAU,GAAG,KAAK,CAAA;AAO9B,MAAM,WAAW,UAAU;IACvB,OAAO,IAAI,IAAI,CAAC;CACnB;AAED,qBAAa,cAAc;IACvB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAkB;IAC/C,OAAO,CAAC,SAAS,CAAqE;IACtF,OAAO,CAAC,MAAM,CAAC,SAAS,CAAsC;IAC9D,OAAO,CAAC,MAAM,CAAC,WAAW,CAA2B;IACrD,OAAO,CAAC,MAAM,CAAC,eAAe,CAAI;IAElC,MAAM,CAAC,QAAQ,IAAI,cAAc;IAO1B,IAAI,CAAC,UAAU,EAAE,UAAU;IAM3B,OAAO,CAAC,UAAU,EAAE,UAAU;IAS9B,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU;IAS7C,GAAG,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;IAMnC,GAAG,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAI3C,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU;IASpC,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU;IAUtC,MAAM,CAAC,UAAU;IAOjB,MAAM,CAAC,kBAAkB;CAG5B"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.js b/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.js index 3671e17e8..bcdf8d29b 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -54,8 +54,37 @@ class ResourceHolder { has(resourceId) { return this.resources.has(resourceId); } + static register(resource) { + if (ResourceHolder.disposablesSize < ResourceHolder.disposables.length) { + ResourceHolder.disposables[ResourceHolder.disposablesSize] = resource; + } + else { + ResourceHolder.disposables.push(resource); + } + ResourceHolder.disposablesSize++; + } + static unregister(resource) { + const index = ResourceHolder.disposables.indexOf(resource); + if (index !== -1 && index < ResourceHolder.disposablesSize) { + if (index !== ResourceHolder.disposablesSize - 1) { + ResourceHolder.disposables[index] = ResourceHolder.disposables[ResourceHolder.disposablesSize - 1]; + } + ResourceHolder.disposablesSize--; + } + } + static disposeAll() { + for (let i = 0; i < ResourceHolder.disposablesSize; ++i) { + ResourceHolder.disposables[i].dispose(); + } + ResourceHolder.disposablesSize = 0; + } + static compactDisposables() { + ResourceHolder.disposables = ResourceHolder.disposables.slice(0, ResourceHolder.disposablesSize); + } } exports.ResourceHolder = ResourceHolder; ResourceHolder.nextResourceId = 100; ResourceHolder._instance = undefined; +ResourceHolder.disposables = new Array(); +ResourceHolder.disposablesSize = 0; //# sourceMappingURL=ResourceManager.js.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.js.map new file mode 100644 index 000000000..ed6e6a521 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/arkts/ResourceManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ResourceManager.js","sourceRoot":"","sources":["../../../../src/arkts/ResourceManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAeH,MAAa,cAAc;IAA3B;QAEY,cAAS,GAAkC,IAAI,GAAG,EAA4B,CAAA;IA2E1F,CAAC;IAtEG,MAAM,CAAC,QAAQ;QACX,IAAI,cAAc,CAAC,SAAS,IAAI,SAAS,EAAE;YACvC,cAAc,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAA;SAClD;QACD,OAAO,cAAc,CAAC,SAAU,CAAA;IACpC,CAAC;IAEM,IAAI,CAAC,UAAsB;QAC9B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,YAAY,UAAU,gCAAgC,CAAC,CAAA;QAC3E,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,YAAY,EAAE,CAAA;IAClD,CAAC;IAEM,OAAO,CAAC,UAAsB;QACjC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,YAAY,UAAU,mCAAmC,CAAC,CAAA;QAC9E,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAE,CAAA;QAChD,QAAQ,CAAC,YAAY,EAAE,CAAA;QACvB,IAAI,QA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C,eAAe,GAAG,CAAC,EAAE;gBAC9C,cAAc,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,WAAW,CAAC,cAAc,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;aACtG;YACD,cAAc,CAAC,eAAe,EAAE,CAAC;SACpC;IACL,CAAC;IAED,MAAM,CAAC,UAAU;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,EAAE;YACrD,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;SAC1C;QACD,cAAc,CAAC,eAAe,GAAG,CAAC,CAAA;IACtC,CAAC;IAED,MAAM,CAAC,kBAAkB;QACrB,cAAc,CAAC,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IACrG,CAAC;;AA5EL,wCA6EC;AA5EkB,6BAAc,GAAe,GAAG,CAAA;AAEhC,wBAAS,GAA6B,SAAS,CAAA;AAC/C,0BAAW,GAAG,IAAI,KAAK,EAAc,CAAC;AACtC,8BAAe,GAAG,CAAC,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.d.ts index 5edd7608a..87655a5f0 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.d.ts @@ -1,21 +1,7 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { float32, int32, int64 } from "#koalaui/common"; import { CallbackResource } from "./SerializerBase"; -import { pointer } from "./InteropTypes"; +import { pointer, KUint8ArrayPtr, KSerializerBuffer } from "./InteropTypes"; +import { NativeBuffer } from "./NativeBuffer"; export declare class DeserializerBase { private position; private readonly buffer; @@ -24,9 +10,10 @@ export declare class DeserializerBase { private static textDecoder; private static customDeserializers; static registerCustomDeserializer(deserializer: CustomDeserializer): void; - constructor(buffer: ArrayBuffer, length: int32); + constructor(buffer: ArrayBuffer | KSerializerBuffer | KUint8ArrayPtr, length: int32); static get(factory: (args: Uint8Array, length: int32) => T, args: Uint8Array, length: int32): T; - asArray(position?: number, length?: number): Uint8Array; + asBuffer(position?: int32, length?: int32): KSerializerBuffer; + asArray(position?: int32, length?: int32): Uint8Array; currentPosition(): int32; resetCurrentPosition(): void; private checkCapacity; @@ -40,10 +27,11 @@ export declare class DeserializerBase { readMaterialized(): object; readString(): string; readCustomObject(kind: string): any; - readNumber(): number | undefined; + readNumber(): int32 | undefined; readCallbackResource(): CallbackResource; + readObject(): any; static lengthUnitFromInt(unit: int32): string; - readBuffer(): ArrayBuffer; + readBuffer(): NativeBuffer; } export declare abstract class CustomDeserializer { protected supported: Array; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.d.ts.map new file mode 100644 index 000000000..0f7ba168d --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DeserializerBase.d.ts","sourceRoot":"","sources":["../../../../src/interop/DeserializerBase.ts"],"names":[],"mappings":"AAcA,OAAO,EAAqB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,EAAQ,gBAAgB,EAAE,MAAM,kBAAkB,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EAAE,MAAM,GAAG,GAAG;IAanC,UAAU,IAAI,KAAK,GAAG,SAAS;IAe/B,oBAAoB,IAAI,gBAAgB;IAOxC,UAAU,IAAG,GAAG;IAKhB,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM;IAoB7C,UAAU,IAAI,YAAY;CAO7B;AAED,8BAAsB,kBAAkB;IACd,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC;IAAxD,SAAS,aAAuB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC;IAGxD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI/B,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG;IAErE,IAAI,EAAE,kBAAkB,GAAG,SAAS,CAAY;CACnD"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.js index 4e72e82db..1652b62aa 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.js @@ -1,23 +1,8 @@ "use strict"; -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - Object.defineProperty(exports, "__esModule", { value: true }); exports.CustomDeserializer = exports.DeserializerBase = void 0; /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -32,7 +17,8 @@ exports.CustomDeserializer = exports.DeserializerBase = void 0; */ const common_1 = require("#koalaui/common"); const SerializerBase_1 = require("./SerializerBase"); -const InteropNativeModule_1 = require("./InteropNativeModule"); +const NativeBuffer_1 = require("./NativeBuffer"); +const ResourceManager_1 = require("../arkts/ResourceManager"); class DeserializerBase { static registerCustomDeserializer(deserializer) { let current = DeserializerBase.customDeserializers; @@ -48,6 +34,11 @@ class DeserializerBase { } constructor(buffer, length) { this.position = 0; + if (typeof buffer != 'object') + throw new Error('Must be used only with ArrayBuffer'); + if (buffer && ("buffer" in buffer)) { + buffer = buffer.buffer; + } this.buffer = buffer; this.length = length; this.view = new DataView(this.buffer); @@ -56,6 +47,9 @@ class DeserializerBase { // TBD: Use cache return factory(args, length); } + asBuffer(position, length) { + return new Uint8Array(this.buffer, position, length); + } asArray(position, length) { return new Uint8Array(this.buffer, position, length); } @@ -156,6 +150,10 @@ class DeserializerBase { release: this.readPointer(), }; } + readObject() { + const resource = this.readCallbackResource(); + return ResourceManager_1.ResourceHolder.instance().get(resource.resourceId); + } static lengthUnitFromInt(unit) { let suffix; switch (unit) { @@ -180,7 +178,7 @@ class DeserializerBase { const resource = this.readCallbackResource(); const data = this.readPointer(); const length = this.readInt64(); - return InteropNativeModule_1.InteropNativeModule._MaterializeBuffer(data, length, resource.resourceId, resource.hold, resource.release); + return NativeBuffer_1.NativeBuffer.wrap(data, length, resource.resourceId, resource.hold, resource.release); } } exports.DeserializerBase = DeserializerBase; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.js.map new file mode 100644 index 000000000..fcf0722d9 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/DeserializerBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DeserializerBase.js","sourceRoot":"","sources":["../../../../src/interop/DeserializerBase.ts"],"names":[],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ala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.d.ts index 2df1edf89..8e8d2615a 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { Wrapper } from "./Wrapper"; import { Thunk } from "#koalaui/common"; import { pointer } from "./InteropTypes"; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.d.ts.map new file mode 100644 index 000000000..b84e71f79 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Finalizable.d.ts","sourceRoot":"","sources":["../../../../src/interop/Finalizable.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAW,MAAM,WAAW,CAAA;AAC5C,OAAO,EAA0C,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAE/E,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,qBAAa,WAAY,YAAW,KAAK;IACrC,SAAS,EAAE,OAAO,CAAA;IAClB,GAAG,EAAE,OAAO,CAAA;IACZ,IAAI,EAAE,MAAM,GAAC,SAAS,CAAA;gBAEV,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM;IAM3D,KAAK;IAOL,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;CAGxD;AAED;;;GAGG;AACH,qBAAa,WAAY,SAAQ,OAAO;IACpC,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,WAAW,CAAY;IACjC,OAAO,EAAE,OAAO,CAAA;gBACJ,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAE,OAAc;IAiBrE,YAAY,IAAI,MAAM,GAAG,SAAS;IAIlC,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW;IAI1F,KAAK;IAaL,OAAO,IAAI,OAAO;IASlB,SAAS,CAAC,OAAO,EAAE,OAAO;IAK1B,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,CAAC,GAAG,CAAC;CAK7C"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.js index 21c45b5b0..7acbc0b49 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -25,7 +25,7 @@ class NativeThunk { this.name = name; } clean() { - if (!(0, Wrapper_1.isNullPtr)(this.obj)) { + if (this.obj != Wrapper_1.nullptr) { this.destroyNative(this.obj, this.finalizer); } this.obj = Wrapper_1.nullptr; @@ -64,7 +64,7 @@ class Finalizable extends Wrapper_1.Wrapper { return new NativeThunk(ptr, finalizer, handle); } close() { - if ((0, Wrapper_1.isNullPtr)(this.ptr)) { + if (this.ptr == Wrapper_1.nullptr) { throw new Error(`Closing a closed object: ` + this.toString()); } else if (this.cleaner == null) { diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.js.map new file mode 100644 index 000000000..d1ef38fb1 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Finalizable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Finalizable.js","sourceRoot":"","sources":["../../../../src/interop/Finalizable.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,uCAA4C;AAC5C,4CAA+E;AAC/E,+DAA2D;AAG3D,MAAa,WAAW;IAKpB,YAAY,GAAY,EAAE,SAAkB,EAAE,IAAa;QACvD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;IAED,KAAK;QACD,IAAI,IAAI,CAAC,GAAG,IAAI,iBAAO,EAAE;YACrB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;SAC/C;QACD,IAAI,CAAC,GAAG,GAAG,iBAAO,CAAA;IACtB,CAAC;IAED,aAAa,CAAC,GAAY,EAAE,SAAkB;QAC1C,yCAAmB,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;IACxD,CAAC;CACJ;AArBD,kCAqBC;AAED;;;GAGG;AACH,MAAa,WAAY,SAAQ,iBAAO;IAIpC,YAAY,GAAY,EAAE,SAAkB,EAAE,UAAmB,IAAI;QACjE,KAAK,CAAC,GAAG,CAAC,CAAA;QAHd,YAAO,GAAiB,SAAS,CAAA;QAI7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,O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IAAI,CAAC,OAAO;YACZ,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,iBAAO,CAAA;QAC9B,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,CAAA;QACrB,IAAI,CAAC,GAAG,GAAG,iBAAO,CAAA;QAClB,OAAO,MAAM,CAAA;IACjB,CAAC;IAED,SAAS,CAAC,OAAgB;QACtB,IAAI,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;QAChF,IAAI,CAAC,GAAG,GAAG,OAAO,CAAA;IACtB,CAAC;IAED,GAAG,CAAI,IAA+B;QAClC,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;QACvB,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,OAAO,MAAM,CAAA;IACjB,CAAC;CACJ;AA7DD,kCA6DC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.d.ts index 75ea2a718..19e3e1e65 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.d.ts @@ -1,20 +1,5 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/common"; -import { KPointer, KStringPtr, KUint8ArrayPtr } from "./InteropTypes"; +import { KPointer, KSerializerBuffer, KStringPtr, KUint8ArrayPtr } from "./InteropTypes"; export declare class InteropNativeModule { static _SetCallbackDispatcher(dispatcher: (id: int32, args: Uint8Array, length: int32) => int32): void; static _CleanCallbackDispatcher(): void; @@ -24,6 +9,7 @@ export declare class InteropNativeModule { static _AppendGroupedLog(index: int32, message: string): void; static _PrintGroupedLog(index: int32): void; static _GetStringFinalizer(): KPointer; + static _IncrementNumber(value: number): number; static _InvokeFinalizer(ptr1: KPointer, ptr2: KPointer): void; static _GetPtrVectorElement(ptr1: KPointer, arg: int32): KPointer; static _StringLength(ptr1: KPointer): int32; @@ -32,22 +18,25 @@ export declare class InteropNativeModule { static _GetPtrVectorSize(ptr1: KPointer): int32; static _ManagedStringWrite(str1: string, arr: Uint8Array, arg: int32): int32; static _NativeLog(str1: string): void; - static _Utf8ToString(data: KUint8ArrayPtr, offset: int32, length: int32): string; + static _Utf8ToString(data: KSerializerBuffer, offset: int32, length: int32): string; static _StdStringToString(cstring: KPointer): string; - static _CheckCallbackEvent(buffer: KUint8ArrayPtr, bufferLength: int32): int32; + static _CheckCallbackEvent(buffer: KSerializerBuffer, bufferLength: int32): int32; static _HoldCallbackResource(resourceId: int32): void; static _ReleaseCallbackResource(resourceId: int32): void; - static _CallCallback(callbackKind: int32, args: Uint8Array, argsSize: int32): void; - static _CallCallbackSync(callbackKind: int32, args: Uint8Array, argsSize: int32): void; + static _CallCallback(callbackKind: int32, args: KSerializerBuffer, argsSize: int32): void; + static _CallCallbackSync(callbackKind: int32, args: KSerializerBuffer, argsSize: int32): void; static _CallCallbackResourceHolder(holder: KPointer, resourceId: int32): void; static _CallCallbackResourceReleaser(releaser: KPointer, resourceId: int32): void; - static _MaterializeBuffer(data: KPointer, length: int32, resourceId: int32, hold: KPointer, release: KPointer): ArrayBuffer; + static _MaterializeBuffer(data: KPointer, length: bigint, resourceId: int32, hold: KPointer, release: KPointer): ArrayBuffer; static _GetNativeBufferPointer(data: ArrayBuffer): KPointer; - static _LoadVirtualMachine(arg0: int32, arg1: string, arg2: string): int32; + static _LoadVirtualMachine(arg0: int32, arg1: string, arg2: string, arg3: string): int32; static _RunApplication(arg0: int32, arg1: int32): number; static _StartApplication(appUrl: string, appParams: string): KPointer; - static _EmitEvent(eventType: int32, target: int32, arg0: int32, arg1: int32): void; - static _CallForeignVM(foreignContext: KPointer, kind: int32, args: Uint8Array, argsSize: int32): int32; + static _EmitEvent(eventType: int32, target: int32, arg0: int32, arg1: int32): string; + static _CallForeignVM(foreignContext: KPointer, kind: int32, args: KSerializerBuffer, argsSize: int32): int32; + static _SetForeignVMContext(context: KPointer): void; + static _ReadByte(data: KPointer, index: int32, length: bigint): int32; + static _WriteByte(data: KPointer, index: int32, length: bigint, value: int32): void; } export declare function loadInteropNativeModule(): void; //# sourceMappingURL=InteropNativeModule.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.d.ts.map new file mode 100644 index 000000000..9648fd6b0 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"InteropNativeModule.d.ts","sourceRoot":"","sources":["../../../../src/interop/InteropNativeModule.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAS,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGzF,qBAAa,mBAAmB;WACd,sBAAsB,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,KAAK,KAAK,GAAG,IAAI;WAC/F,wBAAwB,IAAI,IAAI;WAEhC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ;WACtC,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;WACpC,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;WACnC,iBAAiB,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 No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.js index 404c7f6c0..15f2a270f 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,8 +12,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ - +*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.loadInteropNativeModule = exports.InteropNativeModule = void 0; const loadLibraries_1 = require("./loadLibraries"); @@ -26,6 +25,7 @@ class InteropNativeModule { static _AppendGroupedLog(index, message) { throw "method not loaded"; } static _PrintGroupedLog(index) { throw "method not loaded"; } static _GetStringFinalizer() { throw "method not loaded"; } + static _IncrementNumber(value) { throw "method not loaded"; } static _InvokeFinalizer(ptr1, ptr2) { throw "method not loaded"; } static _GetPtrVectorElement(ptr1, arg) { throw "method not loaded"; } static _StringLength(ptr1) { throw "method not loaded"; } @@ -45,11 +45,14 @@ class InteropNativeModule { static _CallCallbackResourceReleaser(releaser, resourceId) { throw "method not loaded"; } static _MaterializeBuffer(data, length, resourceId, hold, release) { throw "method not loaded"; } static _GetNativeBufferPointer(data) { throw "method not loaded"; } - static _LoadVirtualMachine(arg0, arg1, arg2) { throw "method not loaded"; } + static _LoadVirtualMachine(arg0, arg1, arg2, arg3) { throw "method not loaded"; } static _RunApplication(arg0, arg1) { throw "method not loaded"; } static _StartApplication(appUrl, appParams) { throw "method not loaded"; } static _EmitEvent(eventType, target, arg0, arg1) { throw "method not loaded"; } static _CallForeignVM(foreignContext, kind, args, argsSize) { throw "method not loaded"; } + static _SetForeignVMContext(context) { throw "method not loaded"; } + static _ReadByte(data, index, length) { throw "method not loaded"; } + static _WriteByte(data, index, length, value) { throw "method not loaded"; } } exports.InteropNativeModule = InteropNativeModule; function loadInteropNativeModule() { diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.js.map new file mode 100644 index 000000000..ec3667d5b --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropNativeModule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"InteropNativeModule.js","sourceRoot":"","sources":["../../../../src/interop/InteropNativeModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;EAaE;;;AAIF,mDAA0D;AAE1D,MAAa,mBAAmB;IACrB,MAAM,CAAC,sBAAsB,CAAC,UAAiE,IAAU,MAAM,mBAAmB,CAAA,CAAC,CAAC;IACpI,MAAM,CAAC,wBAAwB,KAAW,MAAM,mBAAmB,CAAA,CAAC,CAAC;IAErE,MAAM,CAAC,cAAc,CAAC,KAAY,IAAc,MAAM,mBAAmB,CAAA,CAAC,CAAC;IAC3E,MAAM,CAAC,gBAAgB,CAAC,KAAY,IAAU,MAAM,mBAAmB,CAAA,CAAC,CAAC;IACzE,MAAM,CAAC,eAAe,CAAC,KAAY,IAAU,MAAM,mBAAmB,CAAA,CAAC,CAAC;IACxE,MAAM,CAAC,iBAAiB,CAAC,KAAY,EAAE,OAAe,IAAU,MAAM,mBAAmB,CAAA,CAAC,CAAC;IAC3F,MAAM,CAAC,gBAAgB,CAAC,KAAY,IAAU,MAAM,mBAAmB,CAAA,CAAC,CAAC;IACzE,MAAM,CAAC,mBAAmB,KAAe,MAAM,mBAAmB,CAAA,CAAC,CAAC;IACpE,MAAM,CAAC,gBAAgB,CAAC,KAAa,IAAY,MAAM,mBAAmB,CAAA,CAAC,CAAC;IAC5E,MAAM,CAAC,gBAAgB,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M,mBAAmB,CAAA,CAAC,CAAC;CAC5H;AAvCD,kDAuCC;AAED,SAAgB,uBAAuB;IACnC,IAAA,uCAAuB,EAAC,qBAAqB,EAAE,mBAAmB,CAAC,CAAA;AACvE,CAAC;AAFD,0DAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.d.ts index 2b1206036..59c7e540e 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/common"; export type CallbackType = (args: Uint8Array, length: int32) => int32; export declare function wrapCallback(callback: CallbackType, autoDisposable?: boolean): int32; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.d.ts.map new file mode 100644 index 000000000..860bb0dff --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"InteropOps.d.ts","sourceRoot":"","sources":["../../../../src/interop/InteropOps.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAIvC,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,KAAK,KAAK,CAAA;AAsDrE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,cAAc,GAAE,OAAc,GAAG,KAAK,CAE1F;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,KAAK,CAE3E;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,KAAK,QAExC;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,GAAG,KAAK,CAE9E"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.js index 150decb9c..9bb6a450a 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.js.map new file mode 100644 index 000000000..b2212d5bf --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropOps.js.map @@ -0,0 +1 @@ +{"version":3,"file":"InteropOps.js","sourceRoot":"","sources":["../../../../src/interop/InteropOps.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAQH,MAAM,cAAc;IAChB,YACoB,QAAsB,EACtB,cAAuB;QADvB,aAAQ,GAAR,QAAQ,CAAc;QACtB,mBAAc,GAAd,cAAc,CAAS;IACvC,CAAC;CACR;AAED,MAAM,gBAAgB;IAOlB;QAHQ,cAAS,GAAG,IAAI,GAAG,EAAyB,CAAA;QAC5C,OAAE,GAAG,IAAI,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,EAAE,CAAC,CAAA;IAC7B,CAAC;;AAxCM,yBAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAA;AA2C5C,SAAgB,YAAY,CAAC,QAAsB,EAAE,iBAA0B,IAAI;IAC/E,OAAO,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AACnE,CAAC;AAFD,oCAEC;AAED,SAAgB,kBAAkB,CAAC,EAAS,EAAE,QAAsB;IAChE,OAAO,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;AACpE,CAAC;AAFD,gDAEC;AAED,SAAgB,eAAe,CAAC,EAAS;IACrC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;AACzC,CAAC;AAFD,0CAEC;AAED,SAAgB,YAAY,CAAC,EAAS,EAAE,IAAgB,EAAE,MAAa;IACnE,OAAO,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;AAC3D,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.d.ts index 2b012790e..db150c61b 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32, int64, float32, float64 } from "#koalaui/common"; export type KStringPtr = int32 | string | null; export type KStringArrayPtr = int32 | Uint8Array | null; @@ -29,4 +14,5 @@ export type KPointer = number | bigint; export type pointer = KPointer; export type KNativePointer = KPointer; export type KInteropReturnBuffer = Uint8Array; +export type KSerializerBuffer = KUint8ArrayPtr; //# sourceMappingURL=InteropTypes.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.d.ts.map new file mode 100644 index 000000000..486799562 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"InteropTypes.d.ts","sourceRoot":"","sources":["../../../../src/interop/InteropTypes.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEhE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,CAAA;AAC9C,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,UAAU,GAAG,IAAI,CAAA;AACvD,MAAM,MAAM,cAAc,GAAI,KAAK,GAAG,UAAU,GAAG,IAAI,CAAA;AACvD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,YAAY,GAAG,IAAI,CAAA;AAC1D,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,UAAU,GAAG,IAAI,CAAA;AACtD,MAAM,MAAM,IAAI,GAAG,KAAK,CAAA;AACxB,MAAM,MAAM,KAAK,GAAG,KAAK,CAAA;AACzB,MAAM,MAAM,KAAK,GAAG,KAAK,CAAA;AACzB,MAAM,MAAM,MAAM,GAAG,OAAO,CAAA;AAC5B,MAAM,MAAM,OAAO,GAAG,OAAO,CAAA;AAC7B,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAA;AAC5B,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;AACtC,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAA;AAC9B,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAA;AACrC,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAA;AAC7C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.js index 41af5b8e8..4576ba9b1 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.js @@ -1,18 +1,3 @@ "use strict"; -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - Object.defineProperty(exports, "__esModule", { value: true }); //# sourceMappingURL=InteropTypes.js.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.js.map new file mode 100644 index 000000000..6bd4aec9b --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/InteropTypes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"InteropTypes.js","sourceRoot":"","sources":["../../../../src/interop/InteropTypes.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.d.ts index beaa7d02c..e115f6ce1 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { Finalizable } from "./Finalizable"; export interface MaterializedBase { getPeer(): Finalizable | undefined; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.d.ts.map new file mode 100644 index 000000000..87faaf509 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MaterializedBase.d.ts","sourceRoot":"","sources":["../../../../src/interop/MaterializedBase.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,WAAW,gBAAgB;IAC7B,OAAO,IAAI,WAAW,GAAG,SAAS,CAAA;CACrC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.js index 629c7d70e..28162e00a 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.js.map new file mode 100644 index 000000000..b95901f24 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/MaterializedBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MaterializedBase.js","sourceRoot":"","sources":["../../../../src/interop/MaterializedBase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.d.ts index 8c309b51f..057a8b323 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.d.ts @@ -1,27 +1,14 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { pointer } from './InteropTypes'; import { int32, int64 } from '#koalaui/common'; -export declare class NativeBuffer extends ArrayBuffer { +export declare class NativeBuffer { data: pointer; length: int64; resourceId: int32; hold: pointer; release: pointer; constructor(data: pointer, length: int64, resourceId: int32, hold: pointer, release: pointer); + readByte(index: int64): int32; + writeByte(index: int64, value: int32): void; static wrap(data: pointer, length: int64, resourceId: int32, hold: pointer, release: pointer): NativeBuffer; } //# sourceMappingURL=NativeBuffer.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.d.ts.map new file mode 100644 index 000000000..f92dabf12 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeBuffer.d.ts","sourceRoot":"","sources":["../../../../src/interop/NativeBuffer.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAM9C,qBAAa,YAAY;IACd,IAAI,EAAE,OAAO,CAAI;IACjB,MAAM,EAAE,KAAK,CAAI;IACjB,UAAU,EAAE,KAAK,CAAI;IACrB,IAAI,EAAE,OAAO,CAAI;IACjB,OAAO,EAAE,OAAO,CAAI;gBAEf,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;IAQrF,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAI7B,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAIlD,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,YAAY;CAG9G"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.js index 96755df13..3b6702728 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,10 +15,11 @@ */ Object.defineProperty(exports, "__esModule", { value: true }); exports.NativeBuffer = void 0; +const InteropNativeModule_1 = require("./InteropNativeModule"); // stub wrapper for KInteropBuffer -class NativeBuffer extends ArrayBuffer { +// export type NativeBuffer = ArrayBuffer +class NativeBuffer { constructor(data, length, resourceId, hold, release) { - super(length); this.data = 0; this.length = 0; this.resourceId = 0; @@ -30,6 +31,12 @@ class NativeBuffer extends ArrayBuffer { this.hold = hold; this.release = release; } + readByte(index) { + return InteropNativeModule_1.InteropNativeModule._ReadByte(this.data, index, BigInt(this.length)); + } + writeByte(index, value) { + InteropNativeModule_1.InteropNativeModule._WriteByte(this.data, index, BigInt(this.length), value); + } static wrap(data, length, resourceId, hold, release) { return new NativeBuffer(data, length, resourceId, hold, release); } diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.js.map new file mode 100644 index 000000000..edd2912bb --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeBuffer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeBuffer.js","sourceRoot":"","sources":["../../../../src/interop/NativeBuffer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAIH,+DAA2D;AAE3D,kCAAkC;AAClC,yCAAyC;AAEzC,MAAa,YAAY;IAOrB,YAAY,IAAa,EAAE,MAAa,EAAE,UAAiB,EAAE,IAAa,EAAE,OAAgB;QANrF,SAAI,GAAY,CAAC,CAAA;QACjB,WAAM,GAAU,CAAC,CAAA;QACjB,eAAU,GAAU,CAAC,CAAA;QACrB,SAAI,GAAY,CAAC,CAAA;QACjB,YAAO,GAAY,CAAC,CAAA;QAGvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IAC1B,CAAC;IAEM,QAAQ,CAAC,KAAY;QACxB,OAAO,yCAAmB,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IAC/E,CAAC;IAEM,SAAS,CAAC,KAAY,EAAE,KAAY;QACvC,yCAAmB,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAA;IAChF,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,IAAa,EAAE,MAAa,EAAE,UAAiB,EAAE,IAAa,EAAE,OAAgB;QACxF,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;IACpE,CAAC;CACJ;AA1BD,oCA0BC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.d.ts index e59b72f42..f81c04747 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { Finalizable } from "./Finalizable"; import { pointer } from "./InteropTypes"; export declare class NativeString extends Finalizable { diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.d.ts.map new file mode 100644 index 000000000..0761e11d6 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeString.d.ts","sourceRoot":"","sources":["../../../../src/interop/NativeString.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,qBAAa,YAAa,SAAQ,WAAW;gBAC7B,GAAG,EAAE,OAAO;IAGxB,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAGxC,QAAQ,IAAI,MAAM;CAGrB"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.js index 0bd0d1586..5ba7f061b 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.js.map new file mode 100644 index 000000000..a9e55da1f --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/NativeString.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeString.js","sourceRoot":"","sources":["../../../../src/interop/NativeString.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,+CAA2C;AAC3C,+DAA2D;AAG3D,MAAa,YAAa,SAAQ,yBAAW;IACzC,YAAY,GAAY;QACpB,KAAK,CAAC,GAAG,EAAE,yCAAmB,CAAC,mBAAmB,EAAE,CAAC,CAAA;IACzD,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,KAAa;QACrB,OAAO,IAAI,YAAY,CAAC,yCAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAA;IACnE,CAAC;IACD,QAAQ;QACJ,OAAO,yCAAmB,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC3D,CAAC;CACJ;AAVD,oCAUC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.d.ts index 078095680..3ebb79728 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/common"; import { Wrapper } from "./Wrapper"; import { KPointer } from "./InteropTypes"; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.d.ts.map new file mode 100644 index 000000000..883d887f4 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.d.ts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Q,GAAG,MAAM,GAAC,SAAS,CAMhE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAIlE"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.js index adf11745b..b6fcb315f 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.js.map new file mode 100644 index 000000000..25a89c49b --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Platform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Platform.js","sourceRoot":"","sources":["../../../../src/interop/Platform.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAGH,uCAAuD;AACvD,oDAAwD;AACxD,wDAA+D;AAG/D,MAAsB,gBAAiB,SAAQ,iBAAO;IAClD,YAAY,GAAa;QACrB,KAAK,CAAC,GAAG,CAAC,CAAA;IACd,CAAC;IAKD,QAAQ;QACJ,IAAI,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;QAC/B,IAAI,IAAI,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAA;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAClB,OAAO,IAAA,uBAAc,EAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CAGJ;AAhBD,4CAgBC;AAED,MAAsB,YAAY;IAK9B,MAAM,CAAC,IAAc;Q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AAkB,CAAC,GAAG,CAAC,CAAC,YAA6B,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC7F,CAAC;AAJD,sDAIC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.d.ts index 6dbd43280..63a6c6ff5 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.d.ts @@ -1,21 +1,7 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { float32, int32, int64 } from "#koalaui/common"; -import { pointer, KPointer } from "./InteropTypes"; +import { pointer, KPointer, KSerializerBuffer } from "./InteropTypes"; import { ResourceId } from "../arkts/ResourceManager"; +import { NativeBuffer } from "./NativeBuffer"; /** * Value representing possible JS runtime object type. * Must be synced with "enum RuntimeType" in C++. @@ -46,10 +32,9 @@ export declare enum Tags { OBJECT = 107 } export declare function runtimeType(value: any): int32; -export declare function isResource(value: unknown): boolean; export declare function isInstanceOf(className: string, value: object | undefined): boolean; export declare function registerCallback(value: object | undefined): int32; -export declare function registerMaterialized(value: object | undefined): number; +export declare function toPeerPtr(value: object): KPointer; export interface CallbackResource { resourceId: int32; hold: pointer; @@ -70,8 +55,10 @@ export declare class SerializerBase { static registerCustomSerializer(serializer: CustomSerializer): void; constructor(); release(): void; - asArray(): Uint8Array; + asBuffer(): KSerializerBuffer; length(): int32; + getByte(offset: int32): int32; + toArray(): Uint8Array; currentPosition(): int32; private checkCapacity; private heldResources; @@ -79,6 +66,7 @@ export declare class SerializerBase { holdAndWriteCallbackForPromiseVoid(hold?: KPointer, release?: KPointer, call?: KPointer, callSync?: number): [Promise, ResourceId]; holdAndWriteCallbackForPromise(hold?: KPointer, release?: KPointer, call?: KPointer): [Promise, ResourceId]; writeCallbackResource(resource: CallbackResource): void; + holdAndWriteObject(obj: any, hold?: KPointer, release?: KPointer): ResourceId; private releaseResources; writeCustomObject(kind: string, value: any): void; writeNumber(value: number | undefined): void; @@ -90,7 +78,7 @@ export declare class SerializerBase { writeBoolean(value: boolean | undefined): void; writeFunction(value: object | undefined): void; writeString(value: string): void; - writeBuffer(buffer: ArrayBuffer): void; + writeBuffer(buffer: NativeBuffer): void; } export declare function unsafeCast(value: unknown): T; //# sourceMappingURL=SerializerBase.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.d.ts.map new file mode 100644 index 000000000..194234bb0 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SerializerBase.d.ts","sourceRoot":"","sources":["../../../../src/interop/SerializerBase.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGrE,OAAO,EAAkB,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAI7C;;;GAGG;AACH,oBAAY,WAAW;IACnB,UAAU,KAAK;IACf,MAAM,IAAI;IACV,MAAM,IAAI;IACV,MAAM,IAAI;IACV,OAAO,IAAI;IACX,SAAS,IAAI;IACb,MAAM,IAAI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KAAK,EAAE,MAAM;IAOzB,WAAW,CAAC,MAAM,EAAE,YAAY;CASnC;AAaD,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,KAE3C"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.js index 5af311bb5..dd82986a2 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.js @@ -1,25 +1,10 @@ "use strict"; -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - Object.defineProperty(exports, "__esModule", { value: true }); -exports.unsafeCast = exports.SerializerBase = exports.CustomSerializer = exports.registerMaterialized = exports.registerCallback = exports.isInstanceOf = exports.isResource = exports.runtimeType = exports.Tags = exports.RuntimeType = void 0; +exports.unsafeCast = exports.SerializerBase = exports.CustomSerializer = exports.toPeerPtr = exports.registerCallback = exports.isInstanceOf = exports.runtimeType = exports.Tags = exports.RuntimeType = void 0; const InteropOps_1 = require("./InteropOps"); const InteropNativeModule_1 = require("./InteropNativeModule"); const ResourceManager_1 = require("../arkts/ResourceManager"); +const Wrapper_1 = require("./Wrapper"); // imports required interfaces (now generation is disabled) // import { Resource } from "@arkoala/arkui" /** @@ -74,14 +59,6 @@ function runtimeType(value) { throw new Error(`bug: ${value} is ${type}`); } exports.runtimeType = runtimeType; -function isResource(value) { - return value !== undefined - && typeof value === 'object' - && value !== null - && value.hasOwnProperty("bundleName") - && value.hasOwnProperty("moduleName"); -} -exports.isResource = isResource; // Poor man's instanceof, fails on subclasses function isInstanceOf(className, value) { return (value === null || value === void 0 ? void 0 : value.constructor.name) === className; @@ -94,11 +71,14 @@ function registerCallback(value) { }); } exports.registerCallback = registerCallback; -function registerMaterialized(value) { - // TODO: fix me! - return 42; +function toPeerPtr(value) { + var _a, _b; + if (value.hasOwnProperty("peer")) + return (_b = (_a = unsafeCast(value).getPeer()) === null || _a === void 0 ? void 0 : _a.ptr) !== null && _b !== void 0 ? _b : Wrapper_1.nullptr; + else + throw new Error("Value is not a MaterializedBase instance"); } -exports.registerMaterialized = registerMaterialized; +exports.toPeerPtr = toPeerPtr; /* Serialization extension point */ class CustomSerializer { constructor(supported) { @@ -131,12 +111,18 @@ class SerializerBase { this.releaseResources(); this.position = 0; } - asArray() { + asBuffer() { return new Uint8Array(this.buffer); } length() { return this.position; } + getByte(offset) { + return this.view.getUint8(offset); + } + toArray() { + return new Uint8Array(this.buffer.slice(0, this.currentPosition())); + } currentPosition() { return this.position; } checkCapacity(value) { if (value < 1) { @@ -148,6 +134,7 @@ class SerializerBase { const resizedSize = Math.max(minSize, Math.round(3 * buffSize / 2)); let resizedBuffer = new ArrayBuffer(resizedSize); // TODO: can we grow without new? + // TODO: check the status of ArrayBuffer.transfer function implementation in STS new Uint8Array(resizedBuffer).set(new Uint8Array(this.buffer)); this.buffer = resizedBuffer; this.view = new DataView(resizedBuffer); @@ -164,7 +151,7 @@ class SerializerBase { return resourceId; } holdAndWriteCallbackForPromiseVoid(hold = 0, release = 0, call = 0, callSync = 0) { - let resourceId; + let resourceId = 0; const promise = new Promise((resolve, reject) => { const callback = (err) => { if (err !== undefined) @@ -177,7 +164,7 @@ class SerializerBase { return [promise, resourceId]; } holdAndWriteCallbackForPromise(hold = 0, release = 0, call = 0) { - let resourceId; + let resourceId = 0; const promise = new Promise((resolve, reject) => { const callback = (value, err) => { if (err !== undefined) @@ -194,6 +181,14 @@ class SerializerBase { this.writePointer(resource.hold); this.writePointer(resource.release); } + holdAndWriteObject(obj, hold = 0, release = 0) { + const resourceId = ResourceManager_1.ResourceHolder.instance().registerAndHold(obj); + this.heldResources.push(resourceId); + this.writeInt32(resourceId); + this.writePointer(hold); + this.writePointer(release); + return resourceId; + } releaseResources() { for (const resourceId of this.heldResources) InteropNativeModule_1.InteropNativeModule._ReleaseCallbackResource(resourceId); @@ -269,15 +264,13 @@ class SerializerBase { this.position += encodedLength + 4; } writeBuffer(buffer) { - const resourceId = ResourceManager_1.ResourceHolder.instance().registerAndHold(buffer); this.writeCallbackResource({ - resourceId, - hold: 0, - release: 0 + resourceId: buffer.resourceId, + hold: buffer.hold, + release: buffer.release, }); - const ptr = InteropNativeModule_1.InteropNativeModule._GetNativeBufferPointer(buffer); - this.writePointer(ptr); - this.writeInt64(buffer.byteLength); + this.writePointer(buffer.data); + this.writeInt64(buffer.length); } } exports.SerializerBase = SerializerBase; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.js.map new file mode 100644 index 000000000..c670ff1c8 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/SerializerBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SerializerBase.js","sourceRoot":"","sources":["../../../../src/interop/SerializerBase.ts"],"names":[],"mappings":";;;AAgBA,6CAA2C;AAC3C,+DAA2D;AAC3D,8DAAqE;AAErE,uCAAmC;AAGnC,2DAA2D;AAC3D,4CAA4C;AAC5C;;;GAGG;AACH,IAAY,WAWX;AAXD,WAAY,WAAW;IACnB,0DAAe,CAAA;IACf,iDAAU,CAAA;IACV,iDAAU,CAAA;IACV,iDAAU,CAAA;IACV,mDAAW,CAAA;IACX,uDAAa,CAAA;IACb,iDAAU,CAAA;IACV,qDAAY,CAAA;IACZ,iDAAU,CAAA;IACV,6DAAgB,CAAA;AACpB,CAAC,EAXW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAWtB;AAED;;;GAGG;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CAAA;IAClC,CAAC;;AA1LL,wCA2LC;AAtLkB,gCAAiB,GAAiC,SAAS,CAAA;AAwL9E,MAAM,cAAe,SAAQ,gBAAgB;IACzC;QACI,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IACnB,CAAC;IAED,SAAS,CAAC,UAA0B,EAAE,KAAa,EAAE,IAAY;QAC7D,UAAU,CAAC,WAAW,CAAE,KAAc,CAAC,WAAW,EAAE,CAAC,CAAA;IACzD,CAAC;CACJ;AACD,cAAc,CAAC,wBAAwB,CAAC,IAAI,cAAc,EAAE,CAAC,CAAA;AAE7D,SAAgB,UAAU,CAAI,KAAc;IACxC,OAAO,KAAqB,CAAA;AAChC,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.d.ts index 44c84a9f8..4deed8a11 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { KPointer } from "./InteropTypes"; export { isNullPtr, nullptr, ptrToBits, bitsToPtr, isSamePtr, ptrToString } from "#common/wrappers/Wrapper"; /** diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.d.ts.map new file mode 100644 index 000000000..4f734c382 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Wrapper.d.ts","sourceRoot":"","sources":["../../../../src/interop/Wrapper.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3G;;GAEG;AACH,qBAAa,OAAO;IAChB,GAAG,EAAE,QAAQ,CAAA;gBACD,GAAG,EAAE,QAAQ;IAKzB,QAAQ,IAAI,MAAM;CAGrB;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAC,SAAS,GAAG,QAAQ,CAEzD;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAC,SAAS,EAAE,CAAC,EAAE,OAAO,GAAC,SAAS,GAAG,OAAO,CAI5E"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.js index dfbdcd17e..ad9cd17b2 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.js.map new file mode 100644 index 000000000..7bc76360d --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/Wrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Wrapper.js","sourceRoot":"","sources":["../../../../src/interop/Wrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,sDAA0E;AAC1E,4CAA2C;AAG3C,oDAA2G;AAAlG,oGAAA,SAAS,OAAA;AAAE,kGAAA,OAAO,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,sGAAA,WAAW,OAAA;AAEzE;;GAEG;AACH,MAAa,OAAO;IAEhB,YAAY,GAAa;QACrB,IAAI,GAAG,IAAI,IAAI;YACX,MAAM,IAAI,KAAK,CAAC,SAAS,IAAA,kBAAS,EAAC,IAAI,CAAC,yBAAyB,CAAC,CAAA;QACtE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAClB,CAAC;IACD,QAAQ;QACJ,OAAO,mBAAmB,IAAA,kBAAS,EAAC,IAAI,CAAC,QAAQ,IAAA,qBAAW,EAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAA;IAC7E,CAAC;CACJ;AAVD,0BAUC;AAED,SAAgB,MAAM,CAAC,KAAwB;;IAC3C,OAAO,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,mCAAI,iBAAO,CAAA;AAChC,CAAC;AAFD,wBAEC;AAED,SAAgB,QAAQ,CAAC,CAAoB,EAAE,CAAoB;IAC/D,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IACxB,IAAI,CAAC,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS;QAAE,OAAO,KAAK,CAAA;IAClD,OAAO,IAAA,mBAAS,EAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;AAClC,CAAC;AAJD,4BAIC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.d.ts index e610b47da..0973caafc 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/common"; export declare enum Access { READ = 1, diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.d.ts.map new file mode 100644 index 000000000..9d8fe0696 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../../src/interop/arrays.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,oBAAY,MAAM;IACd,IAAI,IAAI;IACR,KAAK,IAAI;IACT,SAAS,IAAI;CAChB;AACD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,UAEpC;AACD,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,UAErC;AAED,MAAM,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;AAC1C,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,KAAK,CAAC,CAAA;AAEnE,MAAM,MAAM,UAAU,GAClB,UAAU,GACR,SAAS,GACT,WAAW,GACX,UAAU,GACV,WAAW,GACX,UAAU,GACV,YAAY,GACZ,YAAY,CAAA;AAElB,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,cAAc,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.js index 783d697f1..d3a8966bb 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.js.map new file mode 100644 index 000000000..efcbdf306 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/arrays.js.map @@ -0,0 +1 @@ +{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../../../src/interop/arrays.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAIH,IAAY,MAIX;AAJD,WAAY,MAAM;IACd,mCAAQ,CAAA;IACR,qCAAS,CAAA;IACT,6CAAa,CAAA;AACjB,CAAC,EAJW,MAAM,GAAN,cAAM,KAAN,cAAM,QAIjB;AACD,SAAgB,MAAM,CAAC,MAAc;IACjC,OAAO,MAAM,GAAG,MAAM,CAAC,IAAI,CAAA;AAC/B,CAAC;AAFD,wBAEC;AACD,SAAgB,OAAO,CAAC,MAAc;IAClC,OAAO,MAAM,GAAG,MAAM,CAAC,KAAK,CAAA;AAChC,CAAC;AAFD,0BAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.d.ts index 09fa8065b..2af546a0b 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.d.ts @@ -1,24 +1,10 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +import { int32 } from "#koalaui/common"; export declare class KBuffer { private readonly _buffer; get buffer(): ArrayBuffer; - get length(): number; - constructor(length: number); - set(index: number, value: number): void; - get(index: number): number; + get length(): int32; + constructor(length: int32); + set(index: int32, value: int32): void; + get(index: int32): int32; } //# sourceMappingURL=buffer.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.d.ts.map new file mode 100644 index 000000000..f6b9b4006 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../../../src/interop/buffer.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAGvC,qBAAa,OAAO;IAChB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;IACpC,IAAW,MAAM,IAAI,WAAW,CAE/B;IACD,IAAW,MAAM,IAAI,KAAK,CAEzB;gBAEW,MAAM,EAAE,KAAK;IAIzB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAIrC,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;CAG3B"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.js index 9a8111a81..73bfc32fb 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,8 +12,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ - +*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.KBuffer = void 0; // todo can be removed if passing ArrayBuffer type through interop is possible diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.js.map new file mode 100644 index 000000000..493d5c85a --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/buffer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"buffer.js","sourceRoot":"","sources":["../../../../src/interop/buffer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;EAaE;;;AAIF,8EAA8E;AAC9E,MAAa,OAAO;IAEhB,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAA;IACvB,CAAC;IACD,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA;IAC9B,CAAC;IAED,YAAY,MAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAA;IACzC,CAAC;IAED,GAAG,CAAC,KAAY,EAAE,KAAY;QAC1B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAA;IAC/B,CAAC;IAED,GAAG,CAAC,KAAY;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ;AApBD,0BAoBC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.d.ts index b06ae1e32..2602f36ea 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { withFloat32Array, withFloat64Array, withInt16Array, withInt32Array, withInt8Array, withUint16Array, withUint32Array, withUint8Array, wasmHeap as wasmHeapArrayBuffer } from "#common/wrappers/arrays"; export { registerCallback, setCallbackRegistry } from "#common/wrappers/Callback"; export { Access, Exec } from "./arrays"; @@ -33,7 +18,7 @@ export * from "./buffer"; export * from "../arkts/ResourceManager"; export * from "./NativeBuffer"; export { InteropNativeModule, loadInteropNativeModule } from "./InteropNativeModule"; -export { SerializerBase, RuntimeType, Tags, runtimeType, CallbackResource, unsafeCast, isResource, isInstanceOf } from "./SerializerBase"; +export { SerializerBase, RuntimeType, Tags, runtimeType, CallbackResource, unsafeCast, isInstanceOf, toPeerPtr } from "./SerializerBase"; export { DeserializerBase } from "./DeserializerBase"; export { loadNativeModuleLibrary, loadNativeLibrary, registerNativeModuleLibraryName } from "./loadLibraries"; export * from "./MaterializedBase"; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.d.ts.map new file mode 100644 index 000000000..f9ed95996 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interop/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EACf,cAAc,EACd,QAAQ,IAAI,mBAAmB,EAClC,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAEjF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAE/F,OAAO,EACH,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,UAAU,EACb,MAAM,yBAAyB,CAAA;AAEhC,eAAO,MAAM,cAAc,yBAAmB,CAAA;AAC9C,eAAO,MAAM,aAAa,uBAAiB,CAAA;AAC3C,eAAO,MAAM,YAAY,uBAAiB,CAAA;AAE1C,eAAO,MAAM,QAAQ,4BAAsB,CAAA;AAE3C,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,GAClB,CAAA;AAED,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAE9B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACxI,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAA;AAC7G,cAAc,oBAAoB,CAAA"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.js index 8067bd807..b46532c92 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -28,7 +28,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.registerNativeModuleLibraryName = exports.loadNativeLibrary = exports.loadNativeModuleLibrary = exports.DeserializerBase = exports.isInstanceOf = exports.isResource = exports.unsafeCast = exports.runtimeType = exports.Tags = exports.RuntimeType = exports.SerializerBase = exports.loadInteropNativeModule = exports.InteropNativeModule = exports.withUint32Array = exports.withUint16Array = exports.withUint8Array = exports.withInt32Array = exports.withInt16Array = exports.withInt8Array = exports.withFloat64Array = exports.withFloat32Array = exports.wasmHeap = exports.withIntArray = exports.withByteArray = exports.withFloatArray = exports.toPtrArray = exports.fromPtrArray = exports.withPtrArray = exports.withStringArray = exports.withString = exports.encodeToData = exports.decodeToString = exports.bitsToPtr = exports.ptrToBits = exports.Wrapper = exports.ptrEqual = exports.nullptr = exports.isNullPtr = exports.getPtr = exports.nullable = exports.NativeThunk = exports.Finalizable = exports.Access = exports.setCallbackRegistry = exports.registerCallback = void 0; +exports.registerNativeModuleLibraryName = exports.loadNativeLibrary = exports.loadNativeModuleLibrary = exports.DeserializerBase = exports.toPeerPtr = exports.isInstanceOf = exports.unsafeCast = exports.runtimeType = exports.Tags = exports.RuntimeType = exports.SerializerBase = exports.loadInteropNativeModule = exports.InteropNativeModule = exports.withUint32Array = exports.withUint16Array = exports.withUint8Array = exports.withInt32Array = exports.withInt16Array = exports.withInt8Array = exports.withFloat64Array = exports.withFloat32Array = exports.wasmHeap = exports.withIntArray = exports.withByteArray = exports.withFloatArray = exports.toPtrArray = exports.fromPtrArray = exports.withPtrArray = exports.withStringArray = exports.withString = exports.encodeToData = exports.decodeToString = exports.bitsToPtr = exports.ptrToBits = exports.Wrapper = exports.ptrEqual = exports.nullptr = exports.isNullPtr = exports.getPtr = exports.nullable = exports.NativeThunk = exports.Finalizable = exports.Access = exports.setCallbackRegistry = exports.registerCallback = void 0; const arrays_1 = require("#common/wrappers/arrays"); Object.defineProperty(exports, "withFloat32Array", { enumerable: true, get: function () { return arrays_1.withFloat32Array; } }); Object.defineProperty(exports, "withFloat64Array", { enumerable: true, get: function () { return arrays_1.withFloat64Array; } }); @@ -84,8 +84,8 @@ Object.defineProperty(exports, "RuntimeType", { enumerable: true, get: function Object.defineProperty(exports, "Tags", { enumerable: true, get: function () { return SerializerBase_1.Tags; } }); Object.defineProperty(exports, "runtimeType", { enumerable: true, get: function () { return SerializerBase_1.runtimeType; } }); Object.defineProperty(exports, "unsafeCast", { enumerable: true, get: function () { return SerializerBase_1.unsafeCast; } }); -Object.defineProperty(exports, "isResource", { enumerable: true, get: function () { return SerializerBase_1.isResource; } }); Object.defineProperty(exports, "isInstanceOf", { enumerable: true, get: function () { return SerializerBase_1.isInstanceOf; } }); +Object.defineProperty(exports, "toPeerPtr", { enumerable: true, get: function () { return SerializerBase_1.toPeerPtr; } }); var DeserializerBase_1 = require("./DeserializerBase"); Object.defineProperty(exports, "DeserializerBase", { enumerable: true, get: function () { return DeserializerBase_1.DeserializerBase; } }); var loadLibraries_1 = require("./loadLibraries"); diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.js.map new file mode 100644 index 000000000..2a35626d6 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interop/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;AAEH,oDAUgC;AA0B5B,iGAnCA,yBAAgB,OAmCA;AAChB,iGAnCA,yBAAgB,OAmCA;AAEhB,+FApCA,uBAAc,OAoCA;AACd,+FApCA,uBAAc,OAoCA;AAFd,8FAjCA,sBAAa,OAiCA;AAIb,gGApCA,wBAAe,OAoCA;AACf,gGApCA,wBAAe,OAoCA;AAFf,+FAjCA,uBAAc,OAiCA;AA7BlB,sDAAiF;AAAxE,4GAAA,gBAAgB,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAE9C,mCAAuC;AAA9B,gGAAA,MAAM,OAAA;AACf,6CAAwD;AAA/C,0GAAA,WAAW,OAAA;AAAE,0GAAA,WAAW,OAAA;AACjC,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,qCAA+F;AAAtF,iGAAA,MAAM,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,kGAAA,OAAO,OAAA;AAAE,mGAAA,QAAQ,OAAA;AAAE,kGAAA,OAAO,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,oGAAA,SAAS,OAAA;AAE5E,kDAQgC;AAP5B,wGAAA,cAAc,OAAA;AACd,sGAAA,YAAY,OAAA;AACZ,oGAAA,UAAU,OAAA;AACV,yGAAA,eAAe,OAAA;AACf,sGAAA,YAAY,OAAA;AACZ,sGAAA,YAAY,OAAA;AACZ,oGAAA,UAAU,OAAA;AAGD,QAAA,cAAc,GAAG,yBAAgB,CAAA;AACjC,QAAA,aAAa,GAAG,uBAAc,CAAA;AAC9B,QAAA,YAAY,GAAG,uBAAc,CAAA;AAE7B,QAAA,QAAQ,GAAG,iBAAmB,CAAA;AAa3C,6CAA0B;AAC1B,iDAA8B;AAE9B,+CAA4B;AAC5B,iDAA8B;AAC9B,2CAAwB;AACxB,2DAAwC;AACxC,iDAA8B;AAC9B,6DAAoF;AAA3E,0HAAA,mBAAmB,OAAA;AAAE,8HAAA,uBAAuB,OAAA;AACrD,mDAAwI;AAA/H,gHAAA,cAAc,OAAA;AAAE,6GAAA,WAAW,OAAA;AAAE,sGAAA,IAAI,OAAA;AAAE,6GAAA,WAAW,OAAA;AAAoB,4GAAA,UAAU,OAAA;AAAE,8GAAA,YAAY,OAAA;AAAE,2GAAA,SAAS,OAAA;AAC9G,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,iDAA6G;AAApG,wHAAA,uBAAuB,OAAA;AAAE,kHAAA,iBAAiB,OAAA;AAAE,gIAAA,+BAA+B,OAAA;AACpF,qDAAkC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.d.ts index 1089c8bd4..ddb460079 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export declare function loadNativeLibrary(name: string): Record; export declare function registerNativeModuleLibraryName(nativeModule: string, libraryName: string): void; export declare function loadNativeModuleLibrary(moduleName: string, module?: object): void; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.d.ts.map new file mode 100644 index 000000000..5d242f0f7 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"loadLibraries.d.ts","sourceRoot":"","sources":["../../../../src/interop/loadLibraries.ts"],"names":[],"mappings":"AAkBA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBtE;AAED,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAExF;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,QAS1E"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.js.map new file mode 100644 index 000000000..2d5de1ace --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/loadLibraries.js.map @@ -0,0 +1 @@ +{"version":3,"file":"loadLibraries.js","sourceRoot":"","sources":["../../../../src/interop/loadLibraries.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;EAaE;AACF,yBAAwB;AAExB,MAAM,qBAAqB,GAAwB,IAAI,GAAG,EAAE,CAAA;AAE5D,SAAgB,iBAAiB,CAAC,IAAY;IAC1C,MAAM,MAAM,GAAG,CAAC,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AM,OAAO,GAAG,iBAAiB,CAAC,MAAA,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,mCAAI,UAAU,CAAC,CAAA;IACtF,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAClC,OAAO,CAAC,KAAK,CAAC,qCAAqC,UAAU,EAAE,CAAC,CAAA;QAChE,OAAM;KACT;IACD,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC9C,CAAC;AATD,0DASC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.d.ts index bf90c00ac..4f968f2cc 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { KPointer } from "./InteropTypes"; export declare function nullable(value: KPointer, body: (arg: KPointer) => T | undefined): T | undefined; //# sourceMappingURL=nullable.d.ts.map \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.d.ts.map new file mode 100644 index 000000000..28cf52892 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"nullable.d.ts","sourceRoot":"","sources":["../../../../src/interop/nullable.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,GAAG,SAAS,CAMlG"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.js b/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.js index 13b7d505e..8ec1719e3 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.js.map new file mode 100644 index 000000000..1a8bbaca2 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/interop/nullable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../../src/interop/nullable.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,uCAAqC;AAGrC,SAAgB,QAAQ,CAAI,KAAe,EAAE,IAAsC;IAC/E,IAAI,IAAA,mBAAS,EAAC,KAAK,CAAC,EAAE;QAClB,OAAO,SAAS,CAAA;KACnB;SAAM;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,CAAA;KACrB;AACL,CAAC;AAND,4BAMC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.d.ts index bef3cebce..3e5c3d46c 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { KPointer } from "../../interop/InteropTypes"; import { CallbackRegistry } from "../../interop/Platform"; export declare function registerCallback(callback: any, obj?: any): KPointer; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.d.ts.map new file mode 100644 index 000000000..f9f6f45a0 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Callback.d.ts","sourceRoot":"","sources":["../../../../../src/napi/wrappers/Callback.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAE,GAAU,GAAG,QAAQ,CAEzE;AAID,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,QAE7D"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.js b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.js index c30af143e..8eb19c53e 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.js.map new file mode 100644 index 000000000..96079acf2 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Callback.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Callback.js","sourceRoot":"","sources":["../../../../../src/napi/wrappers/Callback.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAKH,SAAgB,gBAAgB,CAAC,QAAa,EAAE,MAAW,IAAI;IAC3D,OAAO,WAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACvD,CAAC;AAFD,4CAEC;AAED,IAAI,WAAW,GAA+B,SAAS,CAAA;AAEvD,SAAgB,mBAAmB,CAAC,QAA0B;IAC1D,WAAW,GAAG,QAAQ,CAAA;AAC1B,CAAC;AAFD,kDAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.d.ts index 6a35ba0bd..c35209197 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/common"; import { KPointer } from "../../interop/InteropTypes"; export declare const nullptr: bigint; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.d.ts.map new file mode 100644 index 000000000..0e8195353 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/napi/wrappers/Wrapper.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,eAAO,MAAM,OAAO,QAAY,CAAA;AAEhC,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAElD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,UAExC;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,WAEjD;AAGD,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,GAAG,IAAI,CAM3D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,CAIpE"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.js b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.js index dd3dd6116..f6e92823d 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.js.map new file mode 100644 index 000000000..fd099b0ea --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/Wrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Wrapper.js","sourceRoot":"","sources":["../../../../../src/napi/wrappers/Wrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAKU,QAAA,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;AAEhC,SAAgB,SAAS,CAAC,KAAe;IACrC,OAAO,KAAK,KAAK,eAAO,CAAA;AAC5B,CAAC;AAFD,8BAEC;AAED,SAAgB,WAAW,CAAC,GAAa;IACrC,OAAO,KAAK,GAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAA;AACpD,CAAC;AAFD,kCAEC;AAED,SAAgB,SAAS,CAAC,CAAW,EAAE,CAAW;IAC9C,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;AACpB,CAAC;AAFD,8BAEC;AAED,kBAAkB;AAClB,SAAgB,SAAS,CAAC,GAAa;IACnC,IAAI,MAAM,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAA;IAC/B,IAAI,SAAS,GAAG,GAAa,CAAA;IAC7B,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IAClD,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IAClE,OAAO,MAAM,CAAA;AACjB,CAAC;AAND,8BAMC;AAED,SAAgB,SAAS,CAAC,KAAiB,EAAE,MAAa;IACtD,IAAI,SAAS,GAAW,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;IACtE,SAAS,GAAG,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IACpF,OAAO,SAAS,CAAA;AACpB,CAAC;AAJD,8BAIC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.d.ts index c6a9d1171..7bd234c91 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { Access, Exec, ExecWithLength, PtrArray } from "../../interop/arrays"; import { Wrapper } from "../../interop/Wrapper"; import { KPointer, KStringArrayPtr } from "../../interop"; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.d.ts.map new file mode 100644 index 000000000..328a3c8ce --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../../../src/napi/wrappers/arrays.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAc,MAAM,sBAAsB,CAAA;AAEzF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAKzD,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAExD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEvD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,GAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAErF;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,CAOxG;AASD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,CAAC,cAAc,GAAG,IAAI,EAAE,CAAC,CAAC,KAEnH;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,SAAS,GAAG,cAAc,CAUpG;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,E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C,CAAC,KAE/H;AACD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,CAAC,YAAY,GAAG,IAAI,EAAE,CAAC,CAAC,KAE/H;AACD,wBAAgB,QAAQ,IAAI,WAAW,CAEtC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.js b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.js index bf8bea46d..e60730679 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.js.map new file mode 100644 index 000000000..7cca79eda --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/napi/wrappers/arrays.js.map @@ -0,0 +1 @@ +{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../../../../src/napi/wrappers/arrays.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,4CAAsE;AAEtE,uCAAmC;AAInC,MAAM,OAAO,GAAG,IAAI,0BAAiB,EAAE,CAAA;AACvC,MAAM,OAAO,GAAG,IAAI,0BAAiB,EAAE,CAAA;AAEvC,SAAgB,cAAc,CAAC,KAAiB;IAC5C,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AAFD,wCAEC;AAED,SAAgB,YAAY,CAAC,MAAc;IACvC,OAAO,OAAO,CAAC,M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E,IAA2C;IACzH,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAChC,CAAC;AAFD,0CAEC;AACD,SAAgB,cAAc,CAAI,IAA4B,EAAE,MAAc,EAAE,IAA0C;IACtH,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAChC,CAAC;AAFD,wCAEC;AACD,SAAgB,eAAe,CAAI,IAA6B,EAAE,MAAc,EAAE,IAA2C;IACzH,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAChC,CAAC;AAFD,0CAEC;AACD,SAAgB,cAAc,CAAI,IAA4B,EAAE,MAAc,EAAE,IAA0C;IACtH,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAChC,CAAC;AAFD,wCAEC;AACD,SAAgB,gBAAgB,CAAI,IAA8B,EAAE,MAAc,EAAE,IAA4C;IAC5H,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAChC,CAAC;AAFD,4CAEC;AACD,SAAgB,gBAAgB,CAAI,IAA8B,EAAE,MAAc,EAAE,IAA4C;IAC5H,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAChC,CAAC;AAFD,4CAEC;AACD,SAAgB,QAAQ;IACpB,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAA;AAC7B,CAAC;AAFD,4BAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.d.ts index 558d0b4fd..abd030bad 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { KPointer } from "../../interop/InteropTypes"; import { CallbackRegistry } from "../../interop/Platform"; export declare function registerCallback(callback: any, obj?: any): KPointer; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.d.ts.map new file mode 100644 index 000000000..d0c8a425f --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Callback.d.ts","sourceRoot":"","sources":["../../../../../src/wasm/wrappers/Callback.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAgEzD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAE,GAAU,GAAG,QAAQ,CAEzE;AAcD,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,gBAAgB,QAErE"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.js b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.js index 42d551ac4..23703f628 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.js.map new file mode 100644 index 000000000..64cd3d7c2 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Callback.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Callback.js","sourceRoot":"","sources":["../../../../../src/wasm/wrappers/Callback.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;AAKH,MAAM,YAAY;IAGd,YAAY,QAAa,EAAE,MAAW,IAAI;QACtC,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAA;QAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;IACnB,CAAC;CACJ;AAED,MAAM,YAAY,GAAG,UAAI,MAAM,aAAa;QAaxC;YACI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;YACf,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAA;YAC5B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;QACzE,CAAC;QAED,WAAW,CAAC,EAAO,EAAE,GAAQ;;YACzB,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAA;YACtB,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,CAAC,EAAE,EAAE,IAAI,YAAY,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;YACpD,OAAO,EAAE,CAAA;QACb,CAAC;QAED,WAAW,CAAC,EAAU;;YAClB,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,CAAC,EAAE,CAAC,KAAI,aAAa,CAAC,YAAY,CAAA;QAClE,CAAC;QAED,cAAc,CAAC,EAAU;;YACrB,IAAI,EAAE,GAAG,aAAa,CAAC,UAAU,EAAE;gBAC/B,MAAA,IAAI,CAAC,WAAW,0CAAE,M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--git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.d.ts index dc132570a..cc82867df 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { int32 } from "#koalaui/common"; import { KPointer } from "../../interop/InteropTypes"; export declare const nullptr: number; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.d.ts.map new file mode 100644 index 000000000..26c21222e --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/wasm/wrappers/Wrapper.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,eAAO,MAAM,OAAO,EAAE,MAAU,CAAA;AAEhC,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAElD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,UAKxC;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,WAEjD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAIpD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,CAEpE"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.js b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.js index b849ad662..7c2c005d0 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.js.map new file mode 100644 index 000000000..c11ec301c --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/Wrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Wrapper.js","sourceRoot":"","sources":["../../../../../src/wasm/wrappers/Wrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAKU,QAAA,OAAO,GAAW,CAAC,CAAA;AAEhC,SAAgB,SAAS,CAAC,KAAe;IACrC,OAAO,CAAC,KAAK,IAAI,eAAO,CAAC,CAAA;AAC7B,CAAC;AAFD,8BAEC;AAED,SAAgB,WAAW,CAAC,GAAa;IACrC,IAAI,GAAG,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAE3B,MAAM,GAAG,GAAI,GAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IACzD,OAAO,KAAK,GAAG,EAAE,CAAA;AACrB,CAAC;AALD,kCAKC;AAED,SAAgB,SAAS,CAAC,CAAW,EAAE,CAAW;IAC9C,OAAO,CAAC,KAAK,CAAC,CAAA;AAClB,CAAC;AAFD,8BAEC;AAED,SAAgB,SAAS,CAAC,GAAa;IACnC,IAAI,MAAM,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAA;IAC/B,MAAM,CAAC,CAAC,CAAC,GAAG,GAAY,CAAA;IACxB,OAAO,MAAM,CAAA;AACjB,CAAC;AAJD,8BAIC;AAED,SAAgB,SAAS,CAAC,KAAiB,EAAE,MAAa;IACtD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAA;AACxB,CAAC;AAFD,8BAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.d.ts b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.d.ts index e539c7462..03a99f5ff 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.d.ts +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.d.ts @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { KPointer } from "../../interop/InteropTypes"; import { Wrapper } from "../../interop/Wrapper"; import { Access, Exec, ExecWithLength } from "../../interop/arrays"; diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.d.ts.map b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.d.ts.map new file mode 100644 index 000000000..319fa39d0 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../../../src/wasm/wrappers/arrays.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAmB,IAAI,EAAc,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAKhG,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAExD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEvD;AAsBD,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAKhF;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAO/F;AA+BD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,KAIjG;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,SAAS,GAAG,WAAW,CASjG;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,CAAC,GAAI,KAAK,CAAC,CAAC,GAAG,SA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AAC,KAIlH;AAED,wBAAgB,QAAQ,IAAI,WAAW,CAEtC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.js b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.js index 9ee0f6369..a38870940 100644 --- a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.js +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.js @@ -1,6 +1,6 @@ "use strict"; /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.js.map b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.js.map new file mode 100644 index 000000000..1d45306c7 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/src/wasm/wrappers/arrays.js.map @@ -0,0 +1 @@ +{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../../../../src/wasm/wrappers/arrays.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,4CAA6E;AAI7E,iDAAgG;AAEhG,MAAM,OAAO,GAAG,IAAI,0BAAiB,EAAE,CAAA;AACvC,MAAM,OAAO,GAAG,IAAI,0BAAiB,EAAE,CAAA;AAEvC,SAAgB,cAAc,CAAC,KAAiB;IAC5C,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AAFD,wCAEC;AAED,SAAgB,YAAY,CAAC,MAAc;IACvC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACxC,CAAC;AAFD,oCAEC;AAmBD,MAAM,OAAO,GAAW,CAAC,CAAA;AAEzB,qDAAqD;AACrD,SAAgB,UAAU,CAAI,IAAwB,EAAE,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AAJD,4CAIC;AACD,SAAgB,gBAAgB,CAAI,IAA8B,EAAE,MAAc,EAAE,IAA+B;IAC/G,OAAO,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,iBAAiB,EAAE,CAAC,GAAW,EAAE,MAAc,EAAE,EAAE;QACjG,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;AACN,CAAC;AAJD,4CAIC;AAED,SAAgB,QAAQ;IACpB,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,CAAA;AACjC,CAAC;AAFD,4BAEC"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/dist/lib/tsconfig.tsbuildinfo b/koala-wrapper/koalaui/interop/dist/lib/tsconfig.tsbuildinfo new file mode 100644 index 000000000..9314e0cc5 --- /dev/null +++ b/koala-wrapper/koalaui/interop/dist/lib/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../node_modules/@koalaui/ets-tsc/lib/lib.es5.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2016.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2017.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2018.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2019.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2020.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2021.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2022.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.esnext.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.core.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.collection.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.generator.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.iterable.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.promise.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.proxy.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.reflect.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.symbol.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2016.array.include.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2017.object.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2017.string.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2017.intl.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2017.typedarrays.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2018.asynciterable.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2018.intl.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2018.promise.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2018.regexp.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2019.array.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2019.object.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2019.string.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2019.symbol.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2019.intl.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2020.bigint.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2020.date.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2020.promise.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2020.string.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2020.intl.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2020.number.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2021.promise.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2021.string.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2021.weakref.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2021.intl.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2022.array.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2022.error.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2022.intl.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2022.object.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.es2022.string.d.ts","../../node_modules/@koalaui/ets-tsc/lib/lib.esnext.intl.d.ts","../../../incremental/compat/build/src/typescript/types.d.ts","../../../incremental/compat/build/src/typescript/array.d.ts","../../../incremental/compat/build/src/typescript/atomic.d.ts","../../../incremental/compat/build/src/typescript/primitive.d.ts","../../../incremental/compat/build/src/typescript/finalization.d.ts","../../../incremental/compat/build/src/typescript/observable.d.ts","../../../incremental/compat/build/src/typescript/performance.d.ts","../../../incremental/compat/build/src/typescript/prop-deep-copy.d.ts","../../../incremental/compat/build/src/typescript/reflection.d.ts","../../../incremental/compat/build/src/typescript/strings.d.ts","../../../incremental/compat/build/src/typescript/ts-reflection.d.ts","../../../incremental/compat/build/src/typescript/utils.d.ts","../../../incremental/compat/build/src/typescript/index.d.ts","../../../incremental/compat/build/src/index.d.ts","../../../incremental/common/build/lib/src/math.d.ts","../../../incremental/common/build/lib/src/stringUtils.d.ts","../../../incremental/common/build/lib/src/KoalaProfiler.d.ts","../../../incremental/common/build/lib/src/PerfProbe.d.ts","../../../incremental/common/build/lib/src/Errors.d.ts","../../../incremental/common/build/lib/src/LifecycleEvent.d.ts","../../../incremental/common/build/lib/src/Finalization.d.ts","../../../incremental/common/build/lib/src/MarkableQueue.d.ts","../../../incremental/common/build/lib/src/Matrix33.d.ts","../../../incremental/common/build/lib/src/Point3.d.ts","../../../incremental/common/build/lib/src/Matrix44.d.ts","../../../incremental/common/build/lib/src/Point.d.ts","../../../incremental/common/build/lib/src/sha1.d.ts","../../../incremental/common/build/lib/src/uniqueId.d.ts","../../../incremental/common/build/lib/src/koalaKey.d.ts","../../../incremental/common/build/lib/src/index.d.ts","../../src/interop/InteropTypes.ts","../../src/napi/wrappers/Wrapper.ts","../../src/interop/Wrapper.ts","../../src/interop/arrays.ts","../../src/napi/wrappers/Callback.ts","../../src/interop/loadLibraries.ts","../../src/interop/InteropNativeModule.ts","../../src/interop/Finalizable.ts","../../src/interop/nullable.ts","../../src/interop/NativeString.ts","../../src/interop/buffer.ts","../../src/arkts/ResourceManager.ts","../../src/interop/NativeBuffer.ts","../../src/interop/MaterializedBase.ts","../../src/interop/index.ts","../../src/napi/wrappers/arrays.ts","../../src/interop/Platform.ts","../../src/interop/InteropOps.ts","../../src/interop/SerializerBase.ts","../../src/interop/DeserializerBase.ts","../../src/wasm/wrappers/Callback.ts","../../src/wasm/wrappers/Wrapper.ts","../../src/wasm/wrappers/arrays.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/dom-events.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/ts5.6/index.d.ts"],"fileInfos":[{"version":"14dd5dc695734e52d7c38a0c3e227e5ea9043b66410bbcacb8772093f6134d92","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","d11a03592451da2d1065e09e61f4e2a9bf68f780f4f6623c18b57816a9679d17","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"34c839eaaa6d78c8674ae2c37af2236dee6831b13db7b4ef4df3ec889a04d4f2","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"ab7d58e6161a550ff92e5aff755dc37fe896245348332cd5f1e1203479fe0ed1","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"a4da0551fd39b90ca7ce5f68fb55d4dc0c1396d589b612e1902f68ee090aaada","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"168660b1574e99365c968af11d848be4ef38c92aa1817320c5c8155295394e8f","73253d11ee7aabbccde30ab9a8c493ded6ffc57247f58fc270e4ad94d406f25f","107fe39b503f4aa5eb209928c6570e64970be58409a140c180421aa2e2e777ae","ed68521db67e07fd133b619e59b04db8d60bd0e92a82493d3b66eff2ea6eb7ed","40d59757c37369349c81eaa28b6368f8d7d7db473662cb9d08c7440d3c8cbd77","fc3ccf197082101c44fadfbf831c4e0a5ae3cbbdcbccc4c43f168aa45dab6981","9e3a3c75130c30cfd692bb750495f855e5e56353890f4195080ec44e74783181","9c4dfde250536e69425bfd810e17a4a2e95437902f1519e3228147ecb68777b2","52131cc3d1e3e0de3cc07ee36798ae3c06e083a67ddb22c6c3679d08ce03bc3e","85ea0c635e0e91e4305350c41e59d6318ec6a235d8909007d2f1b9fafc3707fe","279b03a1207f07b9a190b6681a1d4e6ddd783faaf76d00880d3ded20daa79b1e","6a1509bef473f8a5522a419138bad8b1de52803c00c70741d8bd02377214e2b6","9b2279d1835fedcbaf4f13484767d5a1f1e258b217e6bfb6df5c28c4e1264b84","ae7293760b8e64f57bafa709c263e75ec19422deeb42ab3922fe49aa20db07d9","7403e3ab869841ec197b1dc145b92932122487ad8f0828824d45c531df63f09b","194e619f79b9692a4cd83225102e99e452bc0e211b261f1c8f889921ec1c74de","c2c371ae2525729b152dca2c7e9681b399b60fb92d2beb844c8d32060a7c3506","53a3c0a6663bf5099151fadb67c1b50967673417661b8e0e70aec10f0728d28b","adedb27ba4a300f7e084b6efed59279ed01f62f0886f5bff54b78634bfafae67","a3368e6d3278633d3820f39424a724294a157e7dfb26a865faf9c26d22083263","3741dbcaf9c2a7a9c63099409cc659d3076a8ccf91e2e1bc8d6f21e6207f13b7","b1cd4a3de15ba6e8ebba34dea1675e5e7a09961388a9062d30882c4bab5575ab","487a699ea2ae4c0adffac1bc8087abde361c83567e814effc7335fd31bff08fd","f7da887d89e2bc8d33e4fb30ac776143fa29fec06d511c624f670517891d6bdb","4093c398b4303bb410e4ab9634f0449b31bf217ac021717588be70835b1ee539","418261c1fb0ba5f9acf49ed2a955603370afac56b573da4515fc8ce5f0b4d28d","2acbdcc162ea232a57601eba11f74a5b79ab492d8fdf4f2e32789fd040a52374","f89301e77fc32c66344345e25f7c65c01b6b0e7b6b219eefe168a9c20bbc5735","6fd1aa9d9d45fd4aa998ea846a49a35a3aff6b3284690ceea6511cd36e0959ef","03d8e7717096473ade25381c8f65dcba19334f348183434c9bcf35a6957ae931",{"version":"9cf134c040d3dd4e947e00ad92444ff58d12689a429d41596f0b792ea486b3fb","signature":"32d240c11eaf0a0b53c0c5e309904cdcb3d5474d03d9c3f1003366dd3924eda4"},{"version":"856b67ed112d47e6332522e7b52070a449976cfb1664a3428a0f7df0fd6bf9be","signature":"94df6b2186c9ebc69eca2e513cde7fcd56aab44bb4ead2f44602d1c38a555ef1"},{"version":"39c6d4642b1aa1057bc49c0c6645eff282791cdaeece5bbbca64d91d57dc8061","signature":"34256b35b51b48906827a4a4cb7465a40700bef5e92d014f810246f9072e215d"},{"version":"3b24073ec1d9b9f1517545da9c63e9e97180a778eed76b9883a8b41f55d95d55","signature":"bf108da4f9318d39d205eb9af2d2bcba2e6f12fbced96898939e279e98655e7f"},{"version":"82faae268aa53856effeb25a75963a9d29fd872a08af3b7cdc900168ab739f72","signature":"a5ea9ba551b2d6808c95f5950c561cae89be631799676f8def128c731d76ae27"},{"version":"e34900f79c450de389970ce961fc08d4f74bd2d6288180c270b69aec3d2d44a1","signature":"800a9b20359a4a86dfa47a4547ed2fb2ce0add9a450949477616f4e55fc0b6be"},{"version":"28918c60a81b85a2c0da23178b5583b4ce727b3404351d9e243cbb284114d1cd","signature":"6ab682392e2f3fa2d92a35ce572668fbd1e327c7103ace897de8086ab92101f4"},{"version":"723b5140c32f500a0b8799dba91c97c97d4c8df31d954a9d94e954b6e911d593","signature":"4a8b95fe80b258dfee09077a99c65227e77838fcd86ee1ae0e0117a16bb82efc"},{"version":"c0ff9d6c67b88c9ea6e1d2f38ba5a000015e11e0fa2f4a90e9e1c4ae8229e3ed","signature":"7524209de6ecbac32f7683b40cd32b99ff5a369ae1500feae3e3d0fad6970f73"},{"version":"8b39737a2b20b0d1ebbb98d094e9381e8160764a103fb75585a0d362dc44971b","signature":"1fdc4eb4dad4fe6eacaed0877248c6ad1506a50a2b758e7b2759859c56cf5dd4"},{"version":"52b8cb0e3758178d186a42663846e715857256adf5e0e7c79650321e222bcde2","signature":"adb1fc0508127e8e5964392a949040a610cc8e2f37852c2c384698c98c35e240"},{"version":"bee20d3892f641f8a2ca06c45108ba502473cf088c6ef29f20a7b8c74377cce5","signature":"42bae2dd0bb4fd45d154dc63bde78a91305eb82591b97f9904708080671ac740"},{"version":"f187a81d01d8494a26afb7654427176ee862813ff641f0a048300ba4c6a24c17","signature":"98ffcb9b4ef5b768fef10e21bff02b6d48804921721db9342869f4d58422b1d5"},{"version":"d01285bf9c528287a46fe5d54c2377bf13832fd32d64f8530a43b3d7e17cce73","signature":"30878fcc77eb3c96e65479f87fe1fcbed6b0bc4eebbc8dfb2bc0f0b49ea6dffb"},{"version":"01c9a2010298597c659e142e84113434bf32a3ce0de062319426c6c626ed2ec0","signature":"981ff469567fd7917d188940e3fc00b528aa0af2d468830ecb332bb6a624fe74"},{"version":"43f9b2bbb02bbb27013239773cafcf2ea410fa0e03f93c7d5d08d050c748268c","signature":"8a7840818a6c3281df82530110f297502e1309d9bd18d3fa619149ef5ac6764a"},{"version":"d002db1accbaf34e64af067d73a63911dedfc49fc1363debf472566d3adfe25b","signature":"571ca883dfd7c892d148b02c5f3c690858a0beb7e2e66188f1f87e048e860c3f"},{"version":"e41c950a37a091a8ac925c4c52c4caa34be3ca420731be80c6ab2ff05525bcb9","signature":"5ef4f09647579feab129707df76e5e43a5e1df96d3feea0fa9349d3f3b651c98"},{"version":"80e40b7108aa2b717b823d4484d6deeac7fd3ab6f5db1b95987034d30a80f0cd","signature":"a4baf42eb70324a8cb29044e0d57fe5ad6a361150ef76ead44664eb0956b277f"},{"version":"06b6ef7b3c6b847cd2f4563c912743d32ea3d2084173ca21199f1b46866b0e48","signature":"e09772cb0061080ec9b70e96c77e37bf416d193107cf19b449b573dc209307ae"},{"version":"ecee95d6f621696aaa9ea9ee4ab1b5140251bbdf30f6a4bd7c2dcc7b58171136","signature":"75c99a32aac3e3095f2f87fdfdfa72d33af175b1c8c378840c0cf2f6e63f2ccd"},{"version":"6fc9500af87860124bd7186e8e8e35c71537440864a90a61002e4bb15d15affc","signature":"9805cf76a492c8fab3b05ce111524f6616c2f3d9b44fb98f2e4e2e4a105da8fb"},{"version":"ad6a5f82bd59eecb0e17800f234e78ff8e9c7c8ab08411d33a2c757aa416925c","signature":"bb29a603df290158b1a921ddf1ed42543cdc8f3f7548894df184dc05d6a18cc6"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true},"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a",{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true},{"version":"d2662405c15ec112ebc0c3ec787edb82d58d6acb1a9d109317d7bf9cff9d09a7","affectsGlobalScope":true},"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"1a2e588ce04b57f262959afb54933563431bf75304cfda6165703fe08f4018c5","affectsGlobalScope":true},"c775b106d611ae2c068ed8429a132608d10007918941311214892dcd4a571ad7","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","75eb536b960b85f75e21490beeab53ea616646a995ad203e1af532d67a774fb6",{"version":"13d89433c6a26f983b5858dae1d04c637474d37188c936acb8a0f316a0501184","affectsGlobalScope":true},"51bb58ef3a22fdc49a2d338a852050855d1507f918d4d7fa77a68d72fee9f780","7646ad748a9ca15bf43d4c88f83cc851c67f8ec9c1186295605b59ba6bb36dcb",{"version":"cef8931bc129687165253f0642427c2a72705a4613b3ac461b9fa78c7cdaef32","affectsGlobalScope":true},"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","47b62c294beb69daa5879f052e416b02e6518f3e4541ae98adbfb27805dd6711","f8375506002c556ec412c7e2a5a9ece401079ee5d9eb2c1372e9f5377fac56c7","8edd6482bd72eca772f9df15d05c838dd688cdbd4d62690891fca6578cfda6fe","548d9051fd6a3544216aec47d3520ce922566c2508df667a1b351658b2e46b8d","c175f4dd3b15b38833abfe19acb8ee38c6be2f80f5964b01a4354cafb676a428","b9a4824bb83f25d6d227394db2ed99985308cf2a3a35f0d6d39aa72b15473982",{"version":"6e57c0b7b3d2716fbc0ca28aa23f62bc997ad534d1369f3853dcb9d453d1fb91","affectsGlobalScope":true},{"version":"b84f34005e497dbc0c1948833818cdb38e8c01ff4f88d810b4d70aa2e6c52916","affectsGlobalScope":true},"8e8e284b3832911aeede987e4d74cf0a00f2b03896b2fd3bf924344cc0f96b3c","37d37474a969ab1b91fc332eb6a375885dfd25279624dfa84dea48c9aedf4472","1847596521723ecb1ee2b62aa30c89aface1a1955378a8c0f1fb7cc7f21bbd92","f1a79b6047d006548185e55478837dfbcdd234d6fe51532783f5dffd401cfb2b","565fda33feca88f4b5db23ba8e605da1fd28b6d63292d276bdbd2afe6cd4c490","e822320b448edce0c7ede9cbeada034c72e1f1c8c8281974817030564c63dcb1",{"version":"c5ea83ef86cc930db2ed42cafeef63013c59720cdc127b23feeb77df412950b9","affectsGlobalScope":true},"f23e3d484de54d235bf702072100b541553a1df2550bad691fe84995e15cf7be","821c79b046e40d54a447bebd9307e70b86399a89980a87bbc98114411169e274","17bc38afc78d40b2f54af216c0cc31a4bd0c6897a5945fa39945dfc43260be2c",{"version":"d201b44ff390c220a94fb0ff6a534fe9fa15b44f8a86d0470009cdde3a3e62ab","affectsGlobalScope":true},{"version":"d44445141f204d5672c502a39c1124bcf1df225eba05df0d2957f79122be87b5","affectsGlobalScope":true},"de905bc5f7e7a81cb420e212b95ab5e3ab840f93e0cfa8ce879f6e7fa465d4a2","bc2ff43214898bc6d53cab92fb41b5309efec9cbb59a0650525980aee994de2b","bede3143eeddca3b8ec3592b09d7eb02042f9e195251040c5146eac09b173236","64a40cf4ec8a7a29db2b4bc35f042e5be8537c4be316e5221f40f30ca8ed7051","294c082d609e6523520290db4f1d54114ebc83643fb42abd965be5bcc5d9416b","cf7d740e39bd8adbdc7840ee91bef0af489052f6467edfcefb7197921757ec3b","37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093",{"version":"63c3208a57f10a4f89944c80a6cdb31faff343e41a2d3e06831c621788969fa7","affectsGlobalScope":true},"b85151402164ab7cb665e58df5c1a29aa25ea4ed3a367f84a15589e7d7a9c8ca","89eb8abe2b5c146fbb8f3bf72f4e91de3541f2fb559ad5fed4ad5bf223a3dedb",{"version":"bc6cb10764a82f3025c0f4822b8ad711c16d1a5c75789be2d188d553b69b2d48","affectsGlobalScope":true},"41d510caf7ed692923cb6ef5932dc9cf1ed0f57de8eb518c5bab8358a21af674","2751c5a6b9054b61c9b03b3770b2d39b1327564672b63e3485ac03ffeb28b4f6","dc058956a93388aab38307b7b3b9b6379e1021e73a244aab6ac9427dc3a252a7","f33302cf240672359992c356f2005d395b559e176196d03f31a28cc7b01e69bc",{"version":"3ce25041ff6ae06c08fcaccd5fcd9baf4ca6e80e6cb5a922773a1985672e74c2","affectsGlobalScope":true},{"version":"652c0de14329a834ff06af6ad44670fac35849654a464fd9ae36edb92a362c12","affectsGlobalScope":true},"3b1e178016d3fc554505ae087c249b205b1c50624d482c542be9d4682bab81fc","5db7c5bb02ef47aaaec6d262d50c4e9355c80937d649365c343fa5e84569621d","cf45d0510b661f1da461479851ff902f188edb111777c37055eff12fa986a23a",{"version":"ec9a5f06328f61e09f44d6781d1bd862475f9900c16cef82621a46305def3c4d","affectsGlobalScope":true},"37bef1064b7d015aeaa7c0716fe23a0b3844abe2c0a3df7144153ca8445fe0da","75bd411256302c183207051fd198b4e0dbab45d28a6daf04d3ad61f70a2c8e90"],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":1,"noEmitOnError":true,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"target":4},"fileIdsList":[[113,150],[68,113,150],[68,77,78,113,150],[68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,113,150],[67,113,150],[55,113,150],[55,56,57,58,59,60,61,62,63,64,65,66,113,150],[113,147,150],[113,149,150],[113,150,155,183],[113,150,151,162,163,170,180,191],[113,150,151,152,162,170],[108,109,110,113,150],[113,150,153,192],[113,150,154,155,163,171],[113,150,155,180,188],[113,150,156,158,162,170],[113,149,150,157],[113,150,158,159],[113,150,160,162],[113,149,150,162],[113,150,162,163,164,180,191],[113,150,162,163,164,177,180,183],[113,145,150],[113,150,158,162,165,170,180,191],[113,150,162,163,165,166,170,180,188,191],[113,150,165,167,180,188,191],[113,150,162,168],[113,150,169,191,196],[113,150,158,162,170,180],[113,150,171],[113,150,172],[113,149,150,173],[113,150,174,190,196],[113,150,175],[113,150,176],[113,150,162,177,178],[113,150,177,179,192,194],[113,150,162,180,181,183],[113,150,182,183],[113,150,180,181],[113,150,183],[113,150,184],[113,150,180,185],[113,150,162,186,187],[113,150,186,187],[113,150,155,170,180,188],[113,150,189],[150],[111,112,113,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[113,150,170,190],[113,150,165,176,191],[113,150,155,192],[113,150,180,193],[113,150,169,194],[113,150,195],[113,150,162,164,173,180,183,191,194,196],[113,150,180,197],[113,122,126,150,191],[113,122,150,180,191],[113,117,150],[113,119,122,150,188,191],[113,150,170,188],[113,150,198],[113,117,150,198],[113,119,122,150,170,191],[113,114,115,118,121,150,162,180,191],[113,114,120,150],[113,118,122,150,183,191,198],[113,138,150,198],[113,116,117,150,198],[113,122,150],[113,116,117,118,119,120,121,122,123,124,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,150],[113,122,129,130,150],[113,120,122,130,131,150],[113,121,150],[113,114,117,122,150],[113,122,126,130,131,150],[113,126,150],[113,120,122,125,150,191],[113,114,119,120,122,126,129,150],[113,150,180],[113,117,122,138,150,196,198],[84,113,150],[84,85,96,97,103,113,150],[84,85,87,91,113,150],[84,85,90,113,150],[84,85,101,113,150],[92,113,150],[84,85,91,113,150],[85,91,92,113,150],[84,85,87,89,100,113,150],[84,85,87,91,96,97,98,102,113,150],[84,85,86,113,150],[85,87,88,89,90,91,92,93,94,95,96,97,98,100,101,102,103,104,113,150],[85,87,113,150],[85,101,113,150],[84,85,113,150],[84,86,87,88,99,113,150],[84,85,87,88,113,150],[84],[84,85,97,103],[84,85,87],[84,85],[92],[85,92],[84,85,96,97],[85,86],[85,87,88,89,90,91,92,93,94,95,96,97,98,100,101,102,103,104],[85],[85,101],[87,88,99],[85,87,88]],"referencedMap":[[73,1],[75,2],[71,2],[74,1],[76,1],[77,2],[79,3],[72,1],[80,2],[78,2],[84,4],[83,2],[69,2],[81,2],[70,2],[82,2],[68,5],[56,6],[57,1],[59,1],[67,7],[60,1],[61,1],[58,6],[62,1],[63,1],[64,6],[65,1],[55,1],[66,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[35,1],[32,1],[33,1],[34,1],[36,1],[7,1],[37,1],[42,1],[43,1],[38,1],[39,1],[40,1],[41,1],[8,1],[47,1],[44,1],[45,1],[46,1],[48,1],[9,1],[49,1],[50,1],[51,1],[52,1],[53,1],[1,1],[10,1],[54,1],[147,8],[148,8],[149,9],[150,10],[151,11],[152,12],[108,1],[111,13],[109,1],[110,1],[153,14],[154,15],[155,16],[156,17],[157,18],[158,19],[159,19],[161,1],[160,20],[162,21],[163,22],[164,23],[146,24],[165,25],[166,26],[167,27],[168,28],[169,29],[170,30],[171,31],[172,32],[173,33],[174,34],[175,35],[176,36],[177,37],[178,37],[179,38],[180,39],[182,40],[181,41],[183,42],[184,43],[185,44],[186,45],[187,46],[188,47],[189,48],[113,49],[112,1],[198,50],[190,51],[191,52],[192,53],[193,54],[194,55],[195,56],[196,57],[197,58],[129,59],[136,60],[128,59],[143,61],[120,62],[119,63],[142,64],[137,65],[140,66],[122,67],[121,68],[117,69],[116,64],[139,70],[118,71],[123,72],[124,1],[127,72],[114,1],[145,73],[144,72],[131,74],[132,75],[134,76],[130,77],[133,78],[138,64],[125,79],[126,80],[135,81],[115,82],[141,83],[96,84],[104,85],[92,86],[91,87],[102,88],[85,84],[98,89],[97,90],[94,91],[101,92],[103,93],[87,94],[88,84],[95,84],[99,95],[90,31],[93,96],[89,97],[86,98],[100,99],[105,97],[106,98],[107,100]],"exportedModulesMap":[[73,1],[75,2],[71,2],[74,1],[76,1],[77,2],[79,3],[72,1],[80,2],[78,2],[84,4],[83,2],[69,2],[81,2],[70,2],[82,2],[68,5],[56,6],[57,1],[59,1],[67,7],[60,1],[61,1],[58,6],[62,1],[63,1],[64,6],[65,1],[55,1],[66,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[35,1],[32,1],[33,1],[34,1],[36,1],[7,1],[37,1],[42,1],[43,1],[38,1],[39,1],[40,1],[41,1],[8,1],[47,1],[44,1],[45,1],[46,1],[48,1],[9,1],[49,1],[50,1],[51,1],[52,1],[53,1],[1,1],[10,1],[54,1],[147,8],[148,8],[149,9],[150,10],[151,11],[152,12],[108,1],[111,13],[109,1],[110,1],[153,14],[154,15],[155,16],[156,17],[157,18],[158,19],[159,19],[161,1],[160,20],[162,21],[163,22],[164,23],[146,24],[165,25],[166,26],[167,27],[168,28],[169,29],[170,30],[171,31],[172,32],[173,33],[174,34],[175,35],[176,36],[177,37],[178,37],[179,38],[180,39],[182,40],[181,41],[183,42],[184,43],[185,44],[186,45],[187,46],[188,47],[189,48],[113,49],[112,1],[198,50],[190,51],[191,52],[192,53],[193,54],[194,55],[195,56],[196,57],[197,58],[129,59],[136,60],[128,59],[143,61],[120,62],[119,63],[142,64],[137,65],[140,66],[122,67],[121,68],[117,69],[116,64],[139,70],[118,71],[123,72],[124,1],[127,72],[114,1],[145,73],[144,72],[131,74],[132,75],[134,76],[130,77],[133,78],[138,64],[125,79],[126,80],[135,81],[115,82],[141,83],[96,101],[104,102],[92,103],[91,104],[102,101],[85,101],[98,105],[97,104],[94,106],[101,103],[103,107],[87,108],[88,101],[95,101],[99,109],[93,110],[89,111],[86,104],[100,112],[105,111],[106,104],[107,113]],"semanticDiagnosticsPerFile":[73,75,71,74,76,77,79,72,80,78,84,83,69,81,70,82,68,56,57,59,67,60,61,58,62,63,64,65,55,66,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,35,32,33,34,36,7,37,42,43,38,39,40,41,8,47,44,45,46,48,9,49,50,51,52,53,1,10,54,147,148,149,150,151,152,108,111,109,110,153,154,155,156,157,158,159,161,160,162,163,164,146,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,181,183,184,185,186,187,188,189,113,112,198,190,191,192,193,194,195,196,197,129,136,128,143,120,119,142,137,140,122,121,117,116,139,118,123,124,127,114,145,144,131,132,134,130,133,138,125,126,135,115,141,96,104,92,91,102,85,98,97,94,101,103,87,88,95,99,90,93,89,86,100,105,106,107],"latestChangedDtsFile":"./src/wasm/wrappers/arrays.d.ts"},"version":"4.9.5"} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/oh-package.json5 b/koala-wrapper/koalaui/interop/oh-package.json5 deleted file mode 100644 index 49ca1a9b2..000000000 --- a/koala-wrapper/koalaui/interop/oh-package.json5 +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "@koalaui/interop", - "version": "1.4.1+devel", - "description": "", - "files": [ - "build/lib/src/**/*.js", - "build/lib/src/**/*.d.ts" - ], - "main": "./build/lib/src/interop/index.js", - "exports": { - ".": "./build/lib/src/interop/index.js", - "./*.js": "./build/lib/src/interop/*.js", - "./*": "./build/lib/src/interop/*.js" - }, - "imports": { - "#common/wrappers": { - "browser": "./build/lib/src/wasm/wrappers/index.js", - "node": "./build/lib/src/napi/wrappers/index.js" - }, - "#common/wrappers/*": { - "browser": "./build/lib/src/wasm/wrappers/*.js", - "node": "./build/lib/src/napi/wrappers/*.js" - } - }, - "types": "./index.d.ts", - "typesVersions": { - "*": { - "*": ["./build/lib/src/interop/*"] - } - }, - "scripts": { - "clean": "tsc -b . --clean && rimraf dist build types", - "ets-api": "node scripts/download-ets-api.mjs", - "compile": "tsc -b .", - "compile:ohos": "npm run ets-api && npm run compile", - "compile:all": "npm run compile:ohos", - "compile:arkts": "bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig.json", - "lint": "eslint src test components", - "test:wasm:coverage": "NODE_OPTIONS='--conditions browser --no-experimental-fetch' nyc mocha", - "test:wasm": "NODE_OPTIONS='--conditions browser --no-experimental-fetch' mocha", - "test:node:coverage": "nyc mocha", - "test:node": "mocha", - "test:coverage": "npm run test:node:coverage", - "test": "npm run test:node", - "watch": "tsc -b . --watch" - }, - "keywords": [], - "dependencies": { - "@koalaui/common": "../common" - }, - "devDependencies": { - "@types/chai": "^4.3.1", - "@types/mocha": "^9.1.0", - "@typescript-eslint/eslint-plugin": "^5.20.0", - "@typescript-eslint/parser": "^5.20.0", - "chai": "^4.3.6", - "eslint": "^8.13.0", - "eslint-plugin-unused-imports": "^2.0.0", - "mocha": "^9.2.2", - "source-map-support": "^0.5.21" - } -} diff --git a/koala-wrapper/koalaui/interop/src/arkts/DeserializerBase.sts b/koala-wrapper/koalaui/interop/src/arkts/DeserializerBase.ts similarity index 39% rename from koala-wrapper/koalaui/interop/src/arkts/DeserializerBase.sts rename to koala-wrapper/koalaui/interop/src/arkts/DeserializerBase.ts index 13b585d03..378cd7f48 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/DeserializerBase.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/DeserializerBase.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,17 +13,20 @@ * limitations under the License. */ -import { float32, int32, int64, float32FromBits } from "@koalaui/common" -import { pointer, KUint8ArrayPtr } from "./InteropTypes" -import { KBuffer } from "./buffer" +import { float32, int32, int64, float32FromBits, uint8 } from "#koalaui/common" +import { pointer, KUint8ArrayPtr, KSerializerBuffer, nullptr } from "./InteropTypes" import { NativeBuffer } from "./NativeBuffer" import { InteropNativeModule } from "./InteropNativeModule" import { Tags, CallbackResource } from "./SerializerBase"; - -export class DeserializerBase { - private position = 0 - private readonly buffer: KBuffer - private readonly length: int32 +import { ResourceHolder, Disposable } from "./ResourceManager" +import {unsafeMemory} from "std/core" + +export class DeserializerBase implements Disposable { + private position : int64 = 0 + private _buffer: KSerializerBuffer + private readonly _isOwnBuffer: boolean; + private readonly _length: int32 + private readonly _end: int64 private static customDeserializers: CustomDeserializer | undefined = new DateDeserializer() static registerCustomDeserializer(deserializer: CustomDeserializer) { @@ -38,111 +41,124 @@ export class DeserializerBase { } } - constructor(buffer: KUint8ArrayPtr, length: int32) { - this.buffer = new KBuffer(buffer) - this.length = length - } - - static get( - factory: (args: Uint8Array, length: int32) => T, - args: Uint8Array, length: int32): T { + constructor(buffer: KUint8ArrayPtr|KSerializerBuffer, length: int32) { + if (buffer instanceof KUint8ArrayPtr) { + const newBuffer = InteropNativeModule._Malloc(length) + this._isOwnBuffer = true + for (let i = 0; i < length; i++) { + unsafeMemory.writeInt8(newBuffer + i, buffer[i] as byte) + } + this._buffer = newBuffer + } else { + this._buffer = buffer + } - // TBD: Use cache - return factory(args, length); + const newBuffer = this._buffer; + this._length = length + this.position = newBuffer + this._end = newBuffer + length; } - asArray(): KUint8ArrayPtr { - return this.buffer.buffer + public final dispose() { + if (this._isOwnBuffer) { + InteropNativeModule._Free(this._buffer) + this._buffer = 0 + this.position = 0 + } } - currentPosition(): int32 { - return this.position + final asBuffer(): KSerializerBuffer { + return this._buffer } - resetCurrentPosition(): void { - this.position = 0 + final resetCurrentPosition(): void { + this.position = this._buffer } - private checkCapacity(value: int32) { - if (value > this.length) { - throw new Error(`${value} is less than remaining buffer length`) + final readInt8(): int32 { + const pos = this.position + const newPos = pos + 1 + + if (newPos > this._end) { + throw new Error(`value size(1) is less than remaining buffer length`) } - } - readInt8(): int32 { - this.checkCapacity(1) - const value = this.buffer.get(this.position) - this.position += 1 - return value + this.position = newPos + return unsafeMemory.readInt8(pos) } - readInt32(): int32 { - this.checkCapacity(4) - let res: int32 = 0; - for (let i = 0; i < 4; i++) { - let byteVal = this.buffer.get(this.position + i) as int32; - byteVal &= 0xff - res = (res | byteVal << (8 * i)) as int32; + final readInt32(): int32 { + const pos = this.position + const newPos = pos + 4 + + if (newPos > this._end) { + throw new Error(`value size(4) is less than remaining buffer length`) } - this.position += 4 - return res + + this.position = newPos + return unsafeMemory.readInt32(pos) } - readPointer(): pointer { - this.checkCapacity(8) - let res: int64 = 0; - for (let i = 0; i < 8; i++) { - let byteVal = this.buffer.get(this.position + i) as int64; - byteVal &= 0xff - res = (res | byteVal << (8 * i)) as int64; + final readPointer(): pointer { + const pos = this.position + const newPos = pos + 8 + + if (newPos > this._end) { + throw new Error(`value size(8) is less than remaining buffer length`) } - this.position += 8 - return res + + this.position = newPos + return unsafeMemory.readInt64(pos) } - readInt64(): int64 { - this.checkCapacity(8) - let res: int64 = 0; - for (let i = 0; i < 8; i++) { - let byteVal = this.buffer.get(this.position + i) as int64; - byteVal &= 0xff - res = (res | byteVal << (8 * i)) as int64; + final readInt64(): int64 { + const pos = this.position + const newPos = pos + 8 + + if (newPos > this._end) { + throw new Error(`value size(8) is less than remaining buffer length`) } - this.position += 8 - return res + + this.position = newPos + return unsafeMemory.readInt64(pos) } - readFloat32(): float32 { - this.checkCapacity(4) - let res: int32 = 0; - for (let i = 0; i < 4; i++) { - let byteVal = this.buffer.get(this.position + i) as int32; - byteVal &= 0xff - res = (res | byteVal << (8 * i)) as int32; + final readFloat32(): float32 { + const pos = this.position + const newPos = pos + 4 + + if (newPos > this._end) { + throw new Error(`value size(4) is less than remaining buffer length`) } - this.position += 4 - return float32FromBits(res) + + + this.position = newPos + return unsafeMemory.readFloat32(pos) } - readBoolean(): boolean { - this.checkCapacity(1) - const value = this.buffer.get(this.position) - this.position += 1 + final readBoolean(): boolean { + const pos = this.position + const newPos = pos + 1 + + if (newPos > this._end) { + throw new Error(`value size(1) is less than remaining buffer length`) + } + + + this.position = newPos + const value = unsafeMemory.readInt8(pos); + if (value == 5) + return false; + return value == 1 } - readFunction(): int32 { + final readFunction(): int32 { // TODO: not exactly correct. - const id = this.readInt32() - return id + return this.readInt32() } - // readMaterialized(): object { - // const ptr = this.readPointer() - // return { ptr: ptr } - // } - - readCallbackResource(): CallbackResource { + final readCallbackResource(): CallbackResource { return ({ resourceId: this.readInt32(), hold: this.readPointer(), @@ -150,16 +166,21 @@ export class DeserializerBase { } as CallbackResource) } - readString(): string { - const length = this.readInt32() - this.checkCapacity(length) - // read without null-terminated byte - const value = InteropNativeModule._Utf8ToString(this.buffer.buffer, this.position, length) - this.position += length - return value + final readString(): string { + const encodedLength = this.readInt32(); + const pos = this.position + const newPos = pos + encodedLength + + if (newPos > this._end) { + throw new Error(`value size(${encodedLength}) is less than remaining buffer length`) + } + + this.position = newPos + // NOTE: skip null-terminated byte + return unsafeMemory.readString(pos, encodedLength - 1) } - readCustomObject(kind: string): object { + final readCustomObject(kind: string): object { let current = DeserializerBase.customDeserializers while (current) { if (current!.supports(kind)) { @@ -172,51 +193,32 @@ export class DeserializerBase { throw Error(`${kind} is not supported`) } - readNumber(): number | undefined { - const tag = this.readInt8() - if (tag == Tags.UNDEFINED) { - return undefined - } else if (tag == Tags.INT32) { - return this.readInt32() - } else if (tag == Tags.FLOAT32) { - return this.readFloat32() - } else { - throw new Error(`Unknown number tag: ${tag}`) + final readNumber(): number | undefined { + const pos = this.position + const tag = this.readInt8() as int + switch (tag) { + case Tags.UNDEFINED as int: + return undefined; + case Tags.INT32 as int: + return this.readInt32() + case Tags.FLOAT32 as int: + return this.readFloat32() + default: + throw new Error(`Unknown number tag: ${tag}`) } } - static lengthUnitFromInt(unit: int32): string { - let suffix: string - switch (unit) { - case 0: - suffix = "px" - break - case 1: - suffix = "vp" - break - case 3: - suffix = "%" - break - case 4: - suffix = "lpx" - break - default: - suffix = "" - } - return suffix + final readObject():object { + const resource = this.readCallbackResource() + return ResourceHolder.instance().get(resource.resourceId) } - readBuffer(): NativeBuffer { - /* not implemented */ + final readBuffer(): NativeBuffer { const resource = this.readCallbackResource() const data = this.readPointer() const length = this.readInt64() return NativeBuffer.wrap(data, length, resource.resourceId, resource.hold, resource.release) } - - readUint8ClampedArray(): Uint8ClampedArray { - throw new Error("Not implemented") - } } export abstract class CustomDeserializer { diff --git a/koala-wrapper/koalaui/interop/src/arkts/Finalizable.sts b/koala-wrapper/koalaui/interop/src/arkts/Finalizable.ts similarity index 90% rename from koala-wrapper/koalaui/interop/src/arkts/Finalizable.sts rename to koala-wrapper/koalaui/interop/src/arkts/Finalizable.ts index 6ae3ac2d8..5f3f69d5d 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/Finalizable.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/Finalizable.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { finalizerRegister, finalizerUnregister, Thunk } from "@koalaui/common" +import { finalizerRegister, finalizerUnregister, Thunk } from "#koalaui/common" import { InteropNativeModule } from "./InteropNativeModule" import { pointer, nullptr } from "./InteropTypes" @@ -49,13 +49,22 @@ export class Finalizable { finalizer: pointer cleaner: NativeThunk|undefined = undefined managed: boolean - constructor(ptr: pointer, finalizer: pointer, managed: boolean = true) { + + constructor(ptr: pointer, finalizer: pointer) { + this.init(ptr, finalizer, true) + } + + constructor(ptr: pointer, finalizer: pointer, managed: boolean) { + this.init(ptr, finalizer, managed) + } + + init(ptr: pointer, finalizer: pointer, managed: boolean) { this.ptr = ptr this.finalizer = finalizer this.managed = managed const handle = undefined - if (this.managed) { + if (managed) { if (this.ptr == nullptr) throw new Error("Can't have nullptr ptr ${}") if (this.finalizer == nullptr) throw new Error("Managed finalizer is 0") diff --git a/koala-wrapper/koalaui/interop/src/arkts/InteropNativeModule.sts b/koala-wrapper/koalaui/interop/src/arkts/InteropNativeModule.ts similarity index 60% rename from koala-wrapper/koalaui/interop/src/arkts/InteropNativeModule.sts rename to koala-wrapper/koalaui/interop/src/arkts/InteropNativeModule.ts index d804174f6..05ef4bbb7 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/InteropNativeModule.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/InteropNativeModule.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -11,10 +11,10 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ +*/ -import { int32 } from "@koalaui/common"; -import { KPointer, KUint8ArrayPtr, KInt } from "./InteropTypes"; +import { int32, int64 } from "#koalaui/common"; +import { KPointer, KUint8ArrayPtr, KInt, KSerializerBuffer } from "./InteropTypes"; import { callCallback } from "./callback" import { loadNativeModuleLibrary } from "./loadLibraries" @@ -22,7 +22,7 @@ export class InteropNativeModule { static { loadNativeModuleLibrary("InteropNativeModule") } - static callCallbackFromNative(id: KInt, args: KUint8ArrayPtr, length: KInt): KInt { + static callCallbackFromNative(id: KInt, args: KSerializerBuffer, length: KInt): KInt { return callCallback(id, args, length) } native static _GetGroupedLog(index: int32): KPointer @@ -32,27 +32,43 @@ export class InteropNativeModule { native static _PrintGroupedLog(index: int32): void native static _GetStringFinalizer(): KPointer native static _InvokeFinalizer(ptr1: KPointer, ptr2: KPointer): void + native static _IncrementNumber(value: number): number native static _GetPtrVectorElement(ptr1: KPointer, arg: int32): KPointer native static _StringLength(ptr1: KPointer): int32 native static _StringData(ptr1: KPointer, arr: KUint8ArrayPtr, i: int32): void native static _StringMake(str1: string): KPointer native static _GetPtrVectorSize(ptr1: KPointer): int32 - native static _ManagedStringWrite(str1: string, arr: KUint8ArrayPtr, arg: int32): int32 + @ani.unsafe.Quick + native static _ManagedStringWrite(str1: string, arr: KPointer, arg: int32): int32 native static _NativeLog(str1: string): void - native static _Utf8ToString(data: KUint8ArrayPtr, offset: int32, length: int32): string + @ani.unsafe.Quick + native static _Utf8ToString(data: KPointer, offset: int32, length: int32): string native static _StdStringToString(cstring: KPointer): string - native static _CheckCallbackEvent(buffer: KUint8ArrayPtr, bufferLength: int32): int32 + @ani.unsafe.Direct + native static _CheckCallbackEvent(buffer: KSerializerBuffer, bufferLength: int32): int32 native static _HoldCallbackResource(resourceId: int32): void native static _ReleaseCallbackResource(resourceId: int32): void - native static _CallCallback(callbackKind: int32, args: KUint8ArrayPtr, argsSize: int32): void - native static _CallCallbackSync(callbackKind: int32, args: KUint8ArrayPtr, argsSize: int32): void + native static _CallCallback(callbackKind: int32, args: KSerializerBuffer, argsSize: int32): void + native static _CallCallbackSync(callbackKind: int32, args: KSerializerBuffer, argsSize: int32): void native static _CallCallbackResourceHolder(holder: KPointer, resourceId: int32): void native static _CallCallbackResourceReleaser(releaser: KPointer, resourceId: int32): void - native static _LoadVirtualMachine(arg0: int32, arg1: string, arg2: string): int32 + native static _LoadVirtualMachine(arg0: int32, arg1: string, arg2: string, arg3: string): int32 native static _RunApplication(arg0: int32, arg1: int32): boolean native static _StartApplication(appUrl: string, appParams: string): KPointer - native static _EmitEvent(eventType: int32, target: int32, arg0: int32, arg1: int32): void - native static _CallForeignVM(context:KPointer, callback: int32, data: KUint8ArrayPtr, dataLength: int32): int32 - native static _RestartWith(page: string): void + native static _EmitEvent(eventType: int32, target: int32, arg0: int32, arg1: int32): string + native static _CallForeignVM(context:KPointer, callback: int32, data: KSerializerBuffer, dataLength: int32): int32 + native static _SetForeignVMContext(context: KPointer): void + native static _RestartWith(page: string): void + @ani.unsafe.Direct + native static _ReadByte(data: KPointer, index: int64, length: int64): int32 + @ani.unsafe.Direct + native static _WriteByte(data: KPointer, index: int64, length: int64, value: int32): void + @ani.unsafe.Direct + native static _Malloc(length: int64): KPointer + @ani.unsafe.Direct + native static _Free(data: KPointer): void + @ani.unsafe.Quick + native static _CopyArray(data: KPointer, length: int64, args: KUint8ArrayPtr): void + native static _ReportMemLeaks(): void } diff --git a/koala-wrapper/koalaui/interop/src/arkts/InteropTypes.sts b/koala-wrapper/koalaui/interop/src/arkts/InteropTypes.ts similarity index 73% rename from koala-wrapper/koalaui/interop/src/arkts/InteropTypes.sts rename to koala-wrapper/koalaui/interop/src/arkts/InteropTypes.ts index adbf6e433..656b34f45 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/InteropTypes.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/InteropTypes.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,10 +16,10 @@ export type NodePointer = pointer // todo: move to NativeModule export type KStringPtr = string -export type KStringPtrArray = byte[] -export type KUint8ArrayPtr = byte[] -export type KInt32ArrayPtr = int[] -export type KFloat32ArrayPtr = float[] +export type KStringPtrArray = FixedArray +export type KUint8ArrayPtr = FixedArray +export type KInt32ArrayPtr = FixedArray +export type KFloat32ArrayPtr = FixedArray export type KInt = int export type KLong = long export type KUInt = KInt @@ -28,7 +28,8 @@ export type KFloat = float export type KPointer = long // look once again export type pointer = KPointer export type KNativePointer = KPointer -export type KInteropReturnBuffer = byte[] +export type KInteropReturnBuffer = FixedArray +export type KSerializerBuffer = pointer export const nullptr: pointer = 0 diff --git a/koala-wrapper/koalaui/interop/src/arkts/MaterializedBase.sts b/koala-wrapper/koalaui/interop/src/arkts/MaterializedBase.ts similarity index 93% rename from koala-wrapper/koalaui/interop/src/arkts/MaterializedBase.sts rename to koala-wrapper/koalaui/interop/src/arkts/MaterializedBase.ts index f0ea6ee4c..3f26a861e 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/MaterializedBase.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/MaterializedBase.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/arkts/NativeBuffer.sts b/koala-wrapper/koalaui/interop/src/arkts/NativeBuffer.ts similarity index 42% rename from koala-wrapper/koalaui/interop/src/arkts/NativeBuffer.sts rename to koala-wrapper/koalaui/interop/src/arkts/NativeBuffer.ts index 3c7eb7afe..b6095f0bc 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/NativeBuffer.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/NativeBuffer.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,11 +13,14 @@ * limitations under the License. */ -import { pointer } from './InteropTypes' -import { int32, int64 } from '@koalaui/common' +import { pointer, KSerializerBuffer, nullptr } from './InteropTypes' +import { int32, int64 } from '#koalaui/common' +import { InteropNativeModule } from "./InteropNativeModule" +import { Disposable } from "./ResourceManager" +import {unsafeMemory} from "std/core" // stub wrapper for KInteropBuffer -export class NativeBuffer { +export final class NativeBuffer { public data:pointer = 0 public length: int64 = 0 public resourceId: int32 = 0 @@ -32,7 +35,53 @@ export class NativeBuffer { this.release = release } + public readByte(index:int64): int32 { + return unsafeMemory.readInt8(this.data + index) + } + + public writeByte(index:int64, value: int32): void { + unsafeMemory.writeInt8(this.data + index, value as byte) + } + static wrap(data:pointer, length: int64, resourceId: int32, hold:pointer, release: pointer): NativeBuffer { return new NativeBuffer(data, length, resourceId, hold, release) } } + +export class KBuffer implements Disposable { + private _buffer: KSerializerBuffer + private readonly _length: int64 + private readonly _owned: boolean + constructor(length: int64) { + this._buffer = InteropNativeModule._Malloc(length) + this._length = length + this._owned = true + } + constructor(buffer: KSerializerBuffer, length: int64) { + this._buffer = buffer + this._length = length + this._owned = false + } + + dispose(): void { + if (this._owned && this._buffer != nullptr) { + InteropNativeModule._Free(this._buffer) + this._buffer = nullptr + } + } + + public get buffer(): KSerializerBuffer { + return this._buffer + } + + public get length(): int64 { + return this._length + } + + public get(index: int64): byte { + return unsafeMemory.readInt8(this._buffer + index) + } + public set(index: int64, value: byte): void { + unsafeMemory.writeInt8(this._buffer + index, value) + } +} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/arkts/ResourceManager.ts b/koala-wrapper/koalaui/interop/src/arkts/ResourceManager.ts index 985c81298..c5af3e0f4 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/ResourceManager.ts +++ b/koala-wrapper/koalaui/interop/src/arkts/ResourceManager.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ -import { int32 } from "@koalaui/common" +import { int32 } from "#koalaui/common" export type ResourceId = int32 @@ -22,10 +22,17 @@ interface ResourceInfo { holdersCount: int32 } +export interface Disposable { + dispose(): void; +} + export class ResourceHolder { private static nextResourceId: ResourceId = 100 private resources: Map = new Map() private static _instance: ResourceHolder|undefined = undefined + private static disposables = new Array(); + private static disposablesSize = 0 + static instance(): ResourceHolder { if (ResourceHolder._instance == undefined) { ResourceHolder._instance = new ResourceHolder() @@ -66,4 +73,34 @@ export class ResourceHolder { public has(resourceId: ResourceId): boolean { return this.resources.has(resourceId) } + + static register(resource: Disposable) { + if (ResourceHolder.disposablesSize < ResourceHolder.disposables.length) { + ResourceHolder.disposables[ResourceHolder.disposablesSize] = resource + } else { + ResourceHolder.disposables.push(resource) + } + ResourceHolder.disposablesSize++ + } + + static unregister(resource: Disposable) { + const index = ResourceHolder.disposables.indexOf(resource); + if (index !== -1 && index < ResourceHolder.disposablesSize) { + if (index !== ResourceHolder.disposablesSize - 1) { + ResourceHolder.disposables[index] = ResourceHolder.disposables[ResourceHolder.disposablesSize - 1]; + } + ResourceHolder.disposablesSize--; + } + } + + static disposeAll() { + for (let i = 0; i < ResourceHolder.disposablesSize; ++i) { + ResourceHolder.disposables[i].dispose() + } + ResourceHolder.disposablesSize = 0 + } + + static compactDisposables() { + ResourceHolder.disposables = ResourceHolder.disposables.slice(0, ResourceHolder.disposablesSize); + } } diff --git a/koala-wrapper/koalaui/interop/src/arkts/SerializerBase.sts b/koala-wrapper/koalaui/interop/src/arkts/SerializerBase.ts similarity index 36% rename from koala-wrapper/koalaui/interop/src/arkts/SerializerBase.sts rename to koala-wrapper/koalaui/interop/src/arkts/SerializerBase.ts index 764590c8d..88c033b0c 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/SerializerBase.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/SerializerBase.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,76 +12,85 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { float32, float64, int8, int32, int64, int32BitsFromFloat } from "@koalaui/common" -import { pointer, KUint8ArrayPtr } from "./InteropTypes" -import { ResourceId, ResourceHolder } from "./ResourceManager" -import { KBuffer } from "./buffer" +import { float32, float64, int8, int32, int64, uint8, int32BitsFromFloat } from "#koalaui/common" +import { pointer, nullptr, KSerializerBuffer } from "./InteropTypes" +import { ResourceId, ResourceHolder, Disposable } from "./ResourceManager" import { NativeBuffer } from "./NativeBuffer" import { InteropNativeModule } from "./InteropNativeModule" +import { MaterializedBase } from "./MaterializedBase" +import {unsafeMemory} from "std/core" /** * Value representing possible JS runtime object type. * Must be synced with "enum RuntimeType" in C++. */ -export class RuntimeType { - static UNEXPECTED = -1 - static NUMBER = 1 - static STRING = 2 - static OBJECT = 3 - static BOOLEAN = 4 - static UNDEFINED = 5 - static BIGINT = 6 - static FUNCTION = 7 - static SYMBOL = 8 - static MATERIALIZED = 9 +export final class RuntimeType { + static readonly UNEXPECTED = -1 + static readonly NUMBER = 1 + static readonly STRING = 2 + static readonly OBJECT = 3 + static readonly BOOLEAN = 4 + static readonly UNDEFINED = 5 + static readonly BIGINT = 6 + static readonly FUNCTION = 7 + static readonly SYMBOL = 8 + static readonly MATERIALIZED = 9 } /** * Value representing object type in serialized data. * Must be synced with "enum Tags" in C++. */ -export class Tags { - static UNDEFINED = 101 - static INT32 = 102 - static FLOAT32 = 103 - static STRING = 104 - static LENGTH = 105 - static RESOURCE = 106 - static OBJECT = 107 +export enum Tags { + UNDEFINED = 101, + INT32 = 102, + FLOAT32 = 103, + STRING = 104, + LENGTH = 105, + RESOURCE = 106, + OBJECT = 107, } -export function runtimeType(value: Object|String|number|undefined|null): int32 { - let type = typeof value - if (type == "number") return RuntimeType.NUMBER - if (type == "string") return RuntimeType.STRING - if (type == "undefined") return RuntimeType.UNDEFINED - if (type == "object") return RuntimeType.OBJECT - if (type == "boolean") return RuntimeType.BOOLEAN - if (type == "bigint") return RuntimeType.BIGINT - if (type == "function") return RuntimeType.FUNCTION - if (type == "symbol") return RuntimeType.SYMBOL - - throw new Error(`bug: ${value} is ${type}`) -} +export function runtimeType(value: T): int32 { + if (value === undefined) + return RuntimeType.UNDEFINED; -export function registerCallback(value: object): int32 { - // TODO: fix me! - return 42 -} + if (value === null) + return RuntimeType.OBJECT; -function registerMaterialized(value: Object): int32 { - // TODO: fix me! - return 42 + if (value instanceof String) + return RuntimeType.STRING + + if (value instanceof Numeric) + return RuntimeType.NUMBER + + if (value instanceof Boolean) + return RuntimeType.BOOLEAN + + if (value instanceof BigInt) + return RuntimeType.BIGINT + + if (value instanceof Function) + return RuntimeType.FUNCTION + + if (value instanceof Object) + return RuntimeType.OBJECT + + throw new Error(`bug: ${value} is ${typeof value}`) } -export function isResource(value: Object|undefined): boolean { +export function registerCallback(value: object): int32 { // TODO: fix me! - return false + return 42 } -export function isInstanceOf(className: string, value: Object|undefined): boolean { - // TODO: fix me! - return false +export function toPeerPtr(value: object): pointer { + if (value instanceof MaterializedBase) { + const peer = (value as MaterializedBase).getPeer() + return peer ? peer.ptr : nullptr + } else { + throw new Error("Value is not a MaterializedBase instance") + } } export interface CallbackResource { @@ -103,7 +112,7 @@ export abstract class CustomSerializer { class DateSerializer extends CustomSerializer { constructor() { - super(Array.of("Date" as string)) + super(new Array("Date" as string)) } serialize(serializer: SerializerBase, value: object, kind: string): void { @@ -112,9 +121,11 @@ class DateSerializer extends CustomSerializer { } SerializerBase.registerCustomSerializer(new DateSerializer()) -export class SerializerBase { - private position = 0 - private buffer: KBuffer +export class SerializerBase implements Disposable { + private position: int64 = 0 + private _buffer: KSerializerBuffer + private _length: int32 + private _last: int64 private static customSerializers: CustomSerializer | undefined = new DateSerializer() static registerCustomSerializer(serializer: CustomSerializer) { @@ -129,41 +140,68 @@ export class SerializerBase { } } - resetCurrentPosition(): void { this.position = 0 } - constructor() { - this.buffer = new KBuffer(96) + let length = 96 + this._buffer = InteropNativeModule._Malloc(length as int64) + this._length = length + this.position = this._buffer + this._last = this._buffer + length - 1; } + public release() { this.releaseResources() - this.position = 0 + this.position = this._buffer + } + public final dispose() { + InteropNativeModule._Free(this._buffer) + this._buffer = nullptr } - asArray(): KUint8ArrayPtr { - return this.buffer.buffer + + final asBuffer(): KSerializerBuffer { + return this._buffer } - length(): int32 { - return this.position + final length(): int32 { + return (this.position - this._buffer) as int32 } - currentPosition(): int32 { return this.position } - private checkCapacity(value: int32) { - if (value < 1) { - throw new Error(`${value} is less than 1`) + + final toArray(): byte[] { + const len = this.length() + let result = new byte[len] + for (let i = 0; i < len; i++) { + result[i] = unsafeMemory.readInt8(this._buffer + i) } - let buffSize = this.buffer.length - if (this.position > buffSize - value) { - const minSize = this.position + value - const resizedSize = Math.max(minSize, Math.round(3 * buffSize / 2)) - let resizedBuffer = new KBuffer(resizedSize as int32) - for (let i = 0; i < this.buffer.length; i++) { - resizedBuffer.set(i, this.buffer.get(i)) - } - this.buffer = resizedBuffer + return result + } + + private final updateCapacity(value: int32) { + let buffSize = this._length + const minSize = buffSize + value + const resizedSize = Math.max(minSize, Math.round(3 * buffSize / 2)) as int32 + let resizedBuffer = InteropNativeModule._Malloc(resizedSize) + let oldBuffer = this._buffer + for (let i = 0; i < this.position; i++) { + let val = unsafeMemory.readInt8(oldBuffer + i); + unsafeMemory.writeInt8(resizedBuffer + i, val) } + this._buffer = resizedBuffer + this.position = this.position - oldBuffer + resizedBuffer + this._length = resizedSize + this._last = resizedBuffer + resizedSize - 1; + InteropNativeModule._Free(oldBuffer) } + private heldResources: Array = new Array() - holdAndWriteCallback(callback: object, hold: pointer = 0, release: pointer = 0, call: pointer = 0, callSync: pointer = 0): ResourceId { + private heldResourcesCount: int32 = 0 + private final addHeldResource(resourceId: ResourceId) { + if (this.heldResourcesCount == this.heldResources.length) + this.heldResources.push(resourceId) + else + this.heldResources[this.heldResourcesCount] = resourceId + this.heldResourcesCount++ + } + final holdAndWriteCallback(callback: object, hold: pointer = 0, release: pointer = 0, call: pointer = 0, callSync: pointer = 0): ResourceId { const resourceId = ResourceHolder.instance().registerAndHold(callback) - this.heldResources.push(resourceId) + this.addHeldResource(resourceId) this.writeInt32(resourceId) this.writePointer(hold) this.writePointer(release) @@ -171,10 +209,10 @@ export class SerializerBase { this.writePointer(callSync) return resourceId } - holdAndWriteCallbackForPromiseVoid(hold: pointer = 0, release: pointer = 0, call: pointer = 0): [Promise, ResourceId] { - let resourceId: ResourceId - const promise = new Promise((resolve: (value: PromiseLike) => void, reject: (err: Object|null|undefined) => void) => { - const callback = (err: string[]|undefined) => { + final holdAndWriteCallbackForPromiseVoid(hold: pointer = 0, release: pointer = 0, call: pointer = 0): [Promise, ResourceId] { + let resourceId: ResourceId = 0 + const promise = new Promise((resolve: (value: PromiseLike) => void, reject: (err: Error) => void) => { + const callback = (err: Error|undefined) => { if (err !== undefined) reject(err!) else @@ -184,10 +222,10 @@ export class SerializerBase { }) return [promise, resourceId] } - holdAndWriteCallbackForPromise(hold: pointer = 0, release: pointer = 0, call: pointer = 0): [Promise, ResourceId] { - let resourceId: ResourceId - const promise = new Promise((resolve: (value: T|PromiseLike) => void, reject: (err: Object|null|undefined) => void) => { - const callback = (value: T|undefined, err: string[]|undefined) => { + final holdAndWriteCallbackForPromise(hold: pointer = 0, release: pointer = 0, call: pointer = 0): [Promise, ResourceId] { + let resourceId: ResourceId = 0 + const promise = new Promise((resolve: (value: T|PromiseLike) => void, reject: (err: Error) => void) => { + const callback = (value?: T|undefined, err?: Error|undefined) => { if (err !== undefined) reject(err!) else @@ -197,23 +235,32 @@ export class SerializerBase { }) return [promise, resourceId] } - writeCallbackResource(resource: CallbackResource) { + final holdAndWriteObject(obj:object, hold: pointer = 0, release: pointer = 0): ResourceId { + const resourceId = ResourceHolder.instance().registerAndHold(obj) + this.addHeldResource(resourceId) + this.writeInt32(resourceId) + this.writePointer(hold) + this.writePointer(release) + return resourceId + } + final writeCallbackResource(resource: CallbackResource) { this.writeInt32(resource.resourceId) this.writePointer(resource.hold) this.writePointer(resource.release) } - writeResource(resource: object) { + final writeResource(resource: object) { const resourceId = ResourceHolder.instance().registerAndHold(resource) - this.heldResources.push(resourceId) + this.addHeldResource(resourceId) this.writeInt32(resourceId) } - private releaseResources() { - for (const resourceId of this.heldResources) - InteropNativeModule._ReleaseCallbackResource(resourceId) - // todo think about effective array clearing/pushing - this.heldResources = new Array() + private final releaseResources() { + if (this.heldResourcesCount == 0) return + for (let i = 0; i < this.heldResourcesCount; i++) { + InteropNativeModule._ReleaseCallbackResource(this.heldResources[i]) + } + this.heldResourcesCount = 0 } - writeCustomObject(kind: string, value: object) { + final writeCustomObject(kind: string, value: object) { let current = SerializerBase.customSerializers while (current) { if (current!.supports(kind)) { @@ -222,96 +269,116 @@ export class SerializerBase { } current = current!.next } - // console.log(`Unsupported custom serialization for ${kind}, write undefined`) this.writeInt8(Tags.UNDEFINED as int32) } - writeFunction(value: Object) { + final writeFunction(value: Object) { this.writeInt32(registerCallback(value)) } - writeTag(tag: int32): void { - this.buffer.set(this.position, tag as int8) - this.position++ + final writeTag(tag: int32): void { + this.writeInt8(tag) } - writeNumber(value: number|undefined) { - this.checkCapacity(5) + final writeNumber(value: number|undefined) { if (value == undefined) { this.writeTag(Tags.UNDEFINED) - this.position++ return } - if ((value as float64) == Math.round(value)) { + if (value == Math.round(value)) { this.writeTag(Tags.INT32) this.writeInt32(value as int32) - return } else { - this.writeTag(Tags.FLOAT32) - this.writeFloat32(value as float32) + this.writeInt8(Tags.FLOAT32) + this.writeFloat32(value as float) } } - writeInt8(value: int32) { - this.checkCapacity(1) - this.buffer.set(this.position, value as int8) - this.position += 1 - } - private setInt32(position: int32, value: int32): void { - this.buffer.set(position + 0, ((value ) & 0xff) as int8) - this.buffer.set(position + 1, ((value >> 8) & 0xff) as int8) - this.buffer.set(position + 2, ((value >> 16) & 0xff) as int8) - this.buffer.set(position + 3, ((value >> 24) & 0xff) as int8) - } - writeInt32(value: int32) { - this.checkCapacity(4) - this.setInt32(this.position, value) - this.position += 4 - } - writeInt64(value: int64) { - this.checkCapacity(8) - this.buffer.set(this.position + 0, ((value ) & 0xff) as int8) - this.buffer.set(this.position + 1, ((value >> 8) & 0xff) as int8) - this.buffer.set(this.position + 2, ((value >> 16) & 0xff) as int8) - this.buffer.set(this.position + 3, ((value >> 24) & 0xff) as int8) - this.buffer.set(this.position + 4, ((value >> 32) & 0xff) as int8) - this.buffer.set(this.position + 5, ((value >> 40) & 0xff) as int8) - this.buffer.set(this.position + 6, ((value >> 48) & 0xff) as int8) - this.buffer.set(this.position + 7, ((value >> 56) & 0xff) as int8) - this.position += 8 - } - writeFloat32(value: float32) { - let bits = int32BitsFromFloat(value) - // TODO: this is wrong! - this.checkCapacity(4) - this.buffer.set(this.position + 0, ((bits ) & 0xff) as int8) - this.buffer.set(this.position + 1, ((bits >> 8) & 0xff) as int8) - this.buffer.set(this.position + 2, ((bits >> 16) & 0xff) as int8) - this.buffer.set(this.position + 3, ((bits >> 24) & 0xff) as int8) - this.position += 4 - } - writePointer(value: pointer) { - if (typeof value === "bigint") - // todo where it is possible to be called from? - throw new Error("Not implemented") - this.writeInt64(value) + + final writeInt8(value: int32) { + let pos = this.position + let newPos = pos + 1 + if (newPos > this._last) { + this.updateCapacity(1) + pos = this.position + newPos = pos + 1 + } + + unsafeMemory.writeInt8(pos, value as byte) + this.position = newPos } - writeBoolean(value: boolean|undefined) { - this.checkCapacity(1) - if (value == undefined) { - this.buffer.set(this.position, RuntimeType.UNDEFINED as int32 as int8) - } else { - this.buffer.set(this.position, (value ? 1 : 0) as int8) + + final writeInt32(value: int32) { + let pos = this.position + let newPos = pos + 4 + if (newPos > this._last) { + this.updateCapacity(4) + pos = this.position + newPos = pos + 4 } - this.position++ + + unsafeMemory.writeInt32(pos, value) + this.position = newPos } - writeMaterialized(value: Object) { - this.writePointer(registerMaterialized(value)) + final writeInt64(value: int64) { + let pos = this.position + let newPos = pos + 8 + if (newPos > this._last) { + this.updateCapacity(8) + pos = this.position + newPos = pos + 8 + } + + unsafeMemory.writeInt64(pos, value) + this.position = newPos + } + final writeFloat32(value: float32) { + let pos = this.position + let newPos = pos + 4 + if (newPos > this._last) { + this.updateCapacity(4) + pos = this.position + newPos = pos + 4 + } + + unsafeMemory.writeFloat32(pos, value) + this.position = newPos + } + final writePointer(value: pointer) { + this.writeInt64(value) } - writeString(value: string) { - this.checkCapacity((4 + value.length * 4 + 1) as int32) // length, data - let encodedLength = InteropNativeModule._ManagedStringWrite(value, this.asArray(), this.position + 4) - this.setInt32(this.position, encodedLength) - this.position += encodedLength + 4 + final writeBoolean(value: boolean|undefined) { + let pos = this.position + let newPos = pos + 1 + if (newPos > this._last) { + this.updateCapacity(1) + pos = this.position + newPos = pos + 1 + } + this.position = newPos + + if (value == undefined) + unsafeMemory.writeInt8(pos, 5 as byte); + else if (value == true) + unsafeMemory.writeInt8(pos, 1 as byte); + else if (value == false) + unsafeMemory.writeInt8(pos, 0 as byte); + } + final writeString(value: string) { + const encodedLength = unsafeMemory.getStringSizeInBytes(value) + + let pos = this.position + if (pos + encodedLength + 5 > this._last) { + this.updateCapacity(encodedLength + 5) + pos = this.position + } + + if (encodedLength > 0) + unsafeMemory.writeString(pos + 4, value) + // NOTE: add \0 for supporting C char* reading from buffer for utf8-strings, + // need check native part fot utf16 cases and probably change this solution. + unsafeMemory.writeInt8(pos + encodedLength + 4, 0 as byte) + unsafeMemory.writeInt32(pos, encodedLength + 1) + this.position = pos + encodedLength + 4 + 1 } //TODO: Needs to be implemented - writeBuffer(value: NativeBuffer) { + final writeBuffer(value: NativeBuffer) { this.writeCallbackResource({ resourceId: value.resourceId, hold: value.hold, diff --git a/koala-wrapper/koalaui/interop/src/arkts/callback.sts b/koala-wrapper/koalaui/interop/src/arkts/callback.ts similarity index 84% rename from koala-wrapper/koalaui/interop/src/arkts/callback.sts rename to koala-wrapper/koalaui/interop/src/arkts/callback.ts index 06992e1ac..71cd05dd9 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/callback.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/callback.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,10 +13,10 @@ * limitations under the License. */ -import { KUint8ArrayPtr } from "./InteropTypes" -import { int32 } from "@koalaui/common" +import { KUint8ArrayPtr, KSerializerBuffer } from "./InteropTypes" +import { int32 } from "#koalaui/common" -export type CallbackType = (args: KUint8ArrayPtr, length: int32) => int32 +export type CallbackType = (args: KSerializerBuffer, length: int32) => int32 class CallbackRecord { public readonly callback: CallbackType @@ -25,7 +25,7 @@ class CallbackRecord { constructor( callback: CallbackType, autoDisposable: boolean - ) { + ) { this.callback = callback this.autoDisposable = autoDisposable } @@ -40,7 +40,7 @@ class CallbackRegistry { constructor() { this.callbacks.set(0, new CallbackRecord( - (args: KUint8ArrayPtr, length: int32): int32 => { + (args: KSerializerBuffer, length: int32): int32 => { console.log(`Callback 0 called with args = ${args} and length = ${length}`) throw new Error(`Null callback called`) }, false) @@ -58,7 +58,7 @@ class CallbackRegistry { return id } - call(id: int32, args: KUint8ArrayPtr, length: int32): int32 { + call(id: int32, args: KSerializerBuffer, length: int32): int32 { const record = this.callbacks.get(id) if (!record) { console.log(`Callback ${id} is not known`) @@ -87,6 +87,6 @@ export function disposeCallback(id: int32) { CallbackRegistry.INSTANCE.dispose(id) } -export function callCallback(id: int32, args: KUint8ArrayPtr, length: int32): int32 { +export function callCallback(id: int32, args: KSerializerBuffer, length: int32): int32 { return CallbackRegistry.INSTANCE.call(id, args, length) } diff --git a/koala-wrapper/koalaui/interop/src/arkts/index.sts b/koala-wrapper/koalaui/interop/src/arkts/index.ts similarity index 92% rename from koala-wrapper/koalaui/interop/src/arkts/index.sts rename to koala-wrapper/koalaui/interop/src/arkts/index.ts index b57068080..b31a7b7ac 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/index.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/index.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,7 +15,6 @@ export * from "./InteropTypes" export * from "./callback" -export * from "./buffer" export * from "./ResourceManager" export * from "./NativeBuffer" export * from "./InteropNativeModule" diff --git a/koala-wrapper/koalaui/interop/src/arkts/loadLibraries.sts b/koala-wrapper/koalaui/interop/src/arkts/loadLibraries.ts similarity index 76% rename from koala-wrapper/koalaui/interop/src/arkts/loadLibraries.sts rename to koala-wrapper/koalaui/interop/src/arkts/loadLibraries.ts index 1db028d2e..feda358f4 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/loadLibraries.sts +++ b/koala-wrapper/koalaui/interop/src/arkts/loadLibraries.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -11,18 +11,21 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ +*/ const nativeModuleLibraries: Map = new Map() export function loadNativeLibrary(library: string) { + console.log(`[loadLibraries] Loading ${library} [${library}]`) loadLibrary(library) } export function registerNativeModuleLibraryName(nativeModule: string, libraryName: string) { + console.log(`[loadLibraries] Registered ${libraryName} as ${nativeModule}`) nativeModuleLibraries.set(nativeModule, libraryName) } export function loadNativeModuleLibrary(nativeModule: string) { + console.log(`[loadLibraries] Loading ${nativeModule} [${nativeModuleLibraries.get(nativeModule) ?? nativeModule}]`) loadLibrary(nativeModuleLibraries.get(nativeModule) ?? nativeModule) } diff --git a/koala-wrapper/koalaui/interop/src/cangjie/DeserializerBase.cj b/koala-wrapper/koalaui/interop/src/cangjie/DeserializerBase.cj index 0e3e2d449..22861ded2 100644 --- a/koala-wrapper/koalaui/interop/src/cangjie/DeserializerBase.cj +++ b/koala-wrapper/koalaui/interop/src/cangjie/DeserializerBase.cj @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -29,20 +29,34 @@ public class CallbackResource { } public open class DeserializerBase { - private var position = 0 - private var length = 96 - private var buffer: Array + private var position: Int32 = 0 + public var length: Int32 = 96 // make private + public var buffer: pointer // make private - public init(buffer: Array, length: Int64) { + public init(buffer: UInt64, length: Int32) { this.buffer = buffer this.length = length } + public init(buffer: Array, length: Int32) { + this.buffer = InteropNativeModule._Malloc(length) + for (i in 0..length) { + DeserializerBase.writeu8(this.buffer, i, length, buffer[Int64(i)]) + } + this.length = length + } + + private static func writeu8(buffer: pointer, offset: Int32, length: Int32, value: UInt8): Unit { + InteropNativeModule._WriteByte(buffer, Int64(offset), Int64(length), Int32(value)) + } + private static func readu8(buffer: pointer, offset: Int32, length: Int32): Int32 { + return InteropNativeModule._ReadByte(buffer, Int64(offset), Int64(length)) + } - public func asArray(position: Int64, length: Int64): ArrayList { - return ArrayList() + public func asBuffer(): pointer { + return this.buffer } - public func currentPosition(): Int64 { + public func currentPosition(): Int32 { return this.position } @@ -50,7 +64,7 @@ public open class DeserializerBase { this.position = 0 } - private func checkCapacity(value: Int64) { + private func checkCapacity(value: Int32) { if (value > this.length) { throw Exception("${value} is less than remaining buffer length") } @@ -58,63 +72,77 @@ public open class DeserializerBase { public func readInt8(): Int8 { this.checkCapacity(1) - let res = Int8.readLittleEndian(this.buffer[this.position..this.position+1]) + var res = DeserializerBase.readu8(this.buffer, this.position, this.length) this.position += 1 - return res + return Int8(res) } public func readInt32(): Int32 { this.checkCapacity(4) - let res = Int32.readLittleEndian(this.buffer[this.position..this.position+4]) + let arr = Array(4, {i => UInt8(DeserializerBase.readu8(this.buffer, this.position + Int32(i), this.length))}) this.position += 4 - return res + return Int32.readLittleEndian(arr) } public func readInt64(): Int64 { this.checkCapacity(8) - let res = Int64.readLittleEndian(this.buffer[this.position..this.position+8]) + let arr = Array(8, {i => UInt8(DeserializerBase.readu8(this.buffer, this.position + Int32(i), this.length))}) this.position += 8 - return res + return Int64.readLittleEndian(arr) } public func readPointer(): KPointer { this.checkCapacity(8) - let res = UInt64.readLittleEndian(this.buffer[this.position..this.position+8]) + let arr = Array(8, {i => UInt8(DeserializerBase.readu8(this.buffer, this.position + Int32(i), this.length))}) this.position += 8 - return res + return UInt64.readLittleEndian(arr) } public func readFloat32(): Float32 { this.checkCapacity(4) - let res = Float32.readLittleEndian(this.buffer[this.position..this.position+4]) + let arr = Array(4, {i => UInt8(DeserializerBase.readu8(this.buffer, this.position + Int32(i), this.length))}) this.position += 4 - return res + return Float32.readLittleEndian(arr) + } + public func readFloat64(): Float64 { + this.checkCapacity(8) + let arr = Array(8, {i => UInt8(DeserializerBase.readu8(this.buffer, this.position + Int32(i), this.length))}) + this.position += 8 + return Float64.readLittleEndian(arr) } public func readBoolean(): Bool { - let res = Bool.readLittleEndian(this.buffer[this.position..this.position+1]) + var byteVal = DeserializerBase.readu8(this.buffer, this.position, this.length) this.position += 1 - return res + return byteVal == 1 } - // readMaterialized(): object { - // const ptr = this.readPointer() - // return { ptr: ptr } - // } - public func readString(): String { - let length = Int64(this.readInt32()) + let length = this.readInt32() this.checkCapacity(length) // read without null-terminated byte - let value = InteropNativeModule._Utf8ToString(this.buffer.toArray(), Int32(this.position), Int32(length)) + let value = InteropNativeModule._Utf8ToString(this.buffer, Int32(this.position), Int32(length)) this.position += length return value } - public func readCustomObject(kind: String): Object{ + public func readCustomObject(kind: String): Object { throw Exception("readCustomObject") } + public func readObject(): Any { + let resource = this.readCallbackResource() + return ResourceHolder.instance().get(resource.resourceId) + } + + public func readBuffer(): Array { + return Array() + } + + public func readFunction(): Any { + return { => } + } + public func readNumber(): Float64 { let tag = this.readInt8() if (tag == Tag.UNDEFINED.value) { diff --git a/koala-wrapper/koalaui/interop/src/cangjie/InteropNativeModule.cj b/koala-wrapper/koalaui/interop/src/cangjie/InteropNativeModule.cj index 5d4617498..bc7fce815 100644 --- a/koala-wrapper/koalaui/interop/src/cangjie/InteropNativeModule.cj +++ b/koala-wrapper/koalaui/interop/src/cangjie/InteropNativeModule.cj @@ -18,7 +18,11 @@ package Interop import std.collection.* foreign { - func CheckCallbackEvent(buffer: CPointer, bufferLength: Int32): Int32 + func Malloc(length: Int32): UInt64 + func Free(data: KPointer): Unit + func ReadByte(data: KPointer, index: Int64, length: Int64): Int32 + func WriteByte(data: KPointer, index: Int64, length: Int64, value: Int32): Unit + func ReleaseCallbackResource(resourceId: Int32): Unit func GetGroupedLog(index: Int32): UInt64 func StartGroupedLog(index: Int32): Unit @@ -32,27 +36,48 @@ foreign { func StringData(ptr1: UInt64, arr: CPointer, i: Int32): Unit func StringMake(str1: CString): UInt64 func GetPtrVectorSize(ptr1: UInt64): Int32 - func ManagedStringWrite(str1: CString, arr: CPointer, arg: Int32): Int32 + func ManagedStringWrite(str1: CString, arr: pointer, arg: Int32): Int32 func NativeLog(str1: CString): Unit - func Utf8ToString(data: CPointer, offset: Int32, length: Int32): CString + func Utf8ToString(data: pointer, offset: Int32, length: Int32): CString + func CheckCallbackEvent(buffer: KSerializerBuffer, bufferLength: Int32): Int32 func StdStringToString(cstring: UInt64): CString - func CallCallback(callbackKind: Int32, args: CPointer, argsSize: Int32): Unit - func CallCallbackSync(callbackKind: Int32, args: CPointer, argsSize: Int32): Unit + func IncrementNumber(input: Float64): Float64 + func CallCallback(callbackKind: Int32, args: KSerializerBuffer, argsSize: Int32): Unit + func CallCallbackSync(callbackKind: Int32, args: KSerializerBuffer, argsSize: Int32): Unit func CallCallbackResourceHolder(holder: UInt64, resourceId: Int32): Unit func CallCallbackResourceReleaser(releaser: UInt64, resourceId: Int32): Unit + func CallForeignVM(foreignContext: UInt64, kind: Int32, data: CPointer, length: Int32): Int32 func LoadVirtualMachine(arg0: Int32, arg1: CString, arg2: CString): Int32 func RunApplication(arg0: Int32, arg1: Int32): Bool func StartApplication(appUrl: CString, appParams: CString): UInt64 - func EmitEvent(eventType: Int32, target: Int32, arg0: Int32, arg1: Int32): Unit + func EmitEvent(eventType: Int32, target: Int32, arg0: Int32, arg1: Int32): CString + func RestartWith(page: CString): Unit } public open class InteropNativeModule { - public static func _CheckCallbackEvent(buffer: Array, bufferLength: Int32): Int32 { + public static func _Malloc(length: Int32) { unsafe { - let handle_0 = acquireArrayRawData(buffer) - let result = CheckCallbackEvent(handle_0.pointer, bufferLength) - releaseArrayRawData(handle_0); - return result + return Malloc(length) + } + } + public static func _Free(data: KPointer): Unit { + unsafe { + Free(data) + } + } + public static func _ReadByte(data: KPointer, index: Int64, length: Int64): Int32 { + unsafe { + return ReadByte(data, index, length) + } + } + public static func _WriteByte(data: KPointer, index: Int64, length: Int64, value: Int32) { + unsafe { + WriteByte(data, index, length, value) + } + } + public static func _ReleaseCallbackResource(resourceId: Int32): Unit { + unsafe { + ReleaseCallbackResource(resourceId) } } public static func _GetGroupedLog(index: Int32): UInt64 { @@ -106,9 +131,9 @@ public open class InteropNativeModule { return result } } - public static func _StringData(ptr1: UInt64, arr: ArrayList, i: Int32): Unit { + public static func _StringData(ptr1: UInt64, arr: Array, i: Int32): Unit { unsafe { - let handle_1 = acquireArrayRawData(arr.toArray()) + let handle_1 = acquireArrayRawData(arr) StringData(ptr1, handle_1.pointer, i) releaseArrayRawData(handle_1) } @@ -127,13 +152,11 @@ public open class InteropNativeModule { return result } } - public static func _ManagedStringWrite(str1: String, arr: ArrayList, arg: Int32): Int32 { + public static func _ManagedStringWrite(str1: String, arr: pointer, arg: Int32): Int32 { unsafe { let str1 = LibC.mallocCString(str1) - let handle_1 = acquireArrayRawData(arr.toArray()) - let result = ManagedStringWrite(str1, handle_1.pointer, arg) + let result = ManagedStringWrite(str1, arr, arg) LibC.free(str1) - releaseArrayRawData(handle_1) return result } } @@ -144,32 +167,37 @@ public open class InteropNativeModule { LibC.free(str1) } } - public static func _Utf8ToString(data: Array, offset: Int32, length: Int32): String { + public static func _Utf8ToString(data: pointer, offset: Int32, length: Int32): String { unsafe { - let handle_0 = acquireArrayRawData(data) - let result = Utf8ToString(handle_0.pointer, offset, length) - releaseArrayRawData(handle_0) + let result = Utf8ToString(data, offset, length) return result.toString() } } + public static func _CheckCallbackEvent(buffer: KSerializerBuffer, bufferLength: Int32): Int32 { + unsafe { + return CheckCallbackEvent(buffer, bufferLength) + } + } public static func _StdStringToString(cstring: UInt64): String { unsafe { let result = StdStringToString(cstring) return result.toString() } } - public static func _CallCallback(callbackKind: Int32, args: ArrayList, argsSize: Int32): Unit { + public static func _IncrementNumber(input: Float64): Float64 { unsafe { - let handle_1 = acquireArrayRawData(args.toArray()) - CallCallback(callbackKind, handle_1.pointer, argsSize) - releaseArrayRawData(handle_1) + let result = IncrementNumber(input) + return result } } - public static func _CallCallbackSync(callbackKind: Int32, args: ArrayList, argsSize: Int32): Unit { + public static func _CallCallback(callbackKind: Int32, args: KSerializerBuffer, argsSize: Int32): Unit { unsafe { - let handle_1 = acquireArrayRawData(args.toArray()) - CallCallbackSync(callbackKind, handle_1.pointer, argsSize) - releaseArrayRawData(handle_1) + CallCallback(callbackKind, args, argsSize) + } + } + public static func _CallCallbackSync(callbackKind: Int32, args: KSerializerBuffer, argsSize: Int32): Unit { + unsafe { + CallCallbackSync(callbackKind, args, argsSize) } } public static func _CallCallbackResourceHolder(holder: UInt64, resourceId: Int32): Unit { @@ -182,13 +210,21 @@ public open class InteropNativeModule { CallCallbackResourceReleaser(releaser, resourceId) } } + public static func _CallForeignVM(foreignContext: UInt64, kind: Int32, data: ArrayList, length: Int32): Int32 { + unsafe { + let handle_2 = acquireArrayRawData(data.toArray()) + let result = CallForeignVM(foreignContext, kind, handle_2.pointer, length) + releaseArrayRawData(handle_2) + return result + } + } public static func _LoadVirtualMachine(arg0: Int32, arg1: String, arg2: String): Int32 { unsafe { let arg1 = LibC.mallocCString(arg1) let arg2 = LibC.mallocCString(arg2) let result = LoadVirtualMachine(arg0, arg1, arg2) LibC.free(arg1) - LibC.free(arg1) + LibC.free(arg2) return result } } @@ -204,20 +240,21 @@ public open class InteropNativeModule { let appParams = LibC.mallocCString(appParams) let result = StartApplication(appUrl, appParams) LibC.free(appUrl) - LibC.free(appUrl) + LibC.free(appParams) return result } } - public static func _EmitEvent(eventType: Int32, target: Int32, arg0: Int32, arg1: Int32): Unit { + public static func _EmitEvent(eventType: Int32, target: Int32, arg0: Int32, arg1: Int32): String { unsafe { - EmitEvent(eventType, target, arg0, arg1) + let result = EmitEvent(eventType, target, arg0, arg1) + return result.toString() } } - public static func _StringData(ptr: KPointer, data: Array, arg2: Int32): Unit { + public static func _RestartWith(page: String): Unit { unsafe { - let handle_1 = acquireArrayRawData(data) - StringData(ptr, handle_1.pointer, arg2) - releaseArrayRawData(handle_1) + let page = LibC.mallocCString(page) + RestartWith(page) + LibC.free(page) } } } \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cangjie/InteropTypes.cj b/koala-wrapper/koalaui/interop/src/cangjie/InteropTypes.cj index 2e2895609..ddda5415d 100644 --- a/koala-wrapper/koalaui/interop/src/cangjie/InteropTypes.cj +++ b/koala-wrapper/koalaui/interop/src/cangjie/InteropTypes.cj @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,5 +20,19 @@ public type KPointer = UInt64 public type KFloat = Float32 public type pointer = KPointer public type KInt = Int32 +public type KLong = Int64 public type KStringPtr = String -public type ArrayBuffer = ArrayList \ No newline at end of file +public type ArrayBuffer = ArrayList +public type KSerializerBuffer = pointer +public const nullptr: UInt64 = 0 +@C +public struct KInteropReturnBuffer { + public var length: Int32 + public var data: CPointer + public var dispose: CPointer, Int32) -> Unit>> + init (length: Int32, data: CPointer, dispose: CPointer, Int32) -> Unit>>) { + this.length = length + this.data = data + this.dispose = dispose + } +} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cangjie/Finalizable.cj b/koala-wrapper/koalaui/interop/src/cangjie/MaterializedBase.cj similarity index 61% rename from koala-wrapper/koalaui/interop/src/cangjie/Finalizable.cj rename to koala-wrapper/koalaui/interop/src/cangjie/MaterializedBase.cj index b5ac709d4..362de947c 100644 --- a/koala-wrapper/koalaui/interop/src/cangjie/Finalizable.cj +++ b/koala-wrapper/koalaui/interop/src/cangjie/MaterializedBase.cj @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -24,10 +24,18 @@ public open class Finalizable { } } -public abstract class MaterializedBase { - public var peer: Option = Option.None +public interface MaterializedBase { + public func getPeer(): ?Finalizable - public func getPeer(): ?Finalizable { - return this.peer + public static func toPeerPtr(value: Any): KPointer + { + let base: MaterializedBase = match (value as MaterializedBase) { + case Some(x) => x + case None => throw Exception("Value is not a MaterializedBase instance!") + } + return match (base.getPeer()) { + case Some(peer) => peer.ptr + case None => nullptr + } } } diff --git a/koala-wrapper/koalaui/interop/src/cangjie/ResourceManager.cj b/koala-wrapper/koalaui/interop/src/cangjie/ResourceManager.cj index 61d207889..d2e589d5f 100644 --- a/koala-wrapper/koalaui/interop/src/cangjie/ResourceManager.cj +++ b/koala-wrapper/koalaui/interop/src/cangjie/ResourceManager.cj @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/cangjie/SerializerBase.cj b/koala-wrapper/koalaui/interop/src/cangjie/SerializerBase.cj index 526e566d6..0081f7986 100644 --- a/koala-wrapper/koalaui/interop/src/cangjie/SerializerBase.cj +++ b/koala-wrapper/koalaui/interop/src/cangjie/SerializerBase.cj @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,8 +16,7 @@ package Interop import std.binary.* -import std.math.* -import std.reflect.* +import std.math.* import std.collection.* public enum RuntimeType { @@ -49,6 +48,15 @@ public enum RuntimeType { } } +public class PromiseAndResourceId { + public var promise: Any + public var resourceId: ResourceId + init (promise: Any, resourceId: ResourceId) { + this.promise = promise + this.resourceId = resourceId + } +} + /* Serialization extension point */ public abstract class CustomSerializer { @@ -62,9 +70,9 @@ public abstract class CustomSerializer { } public open class SerializerBase { - protected var isHolding: Bool = false - private var position: Int64 = 0 - private var buffer: ArrayList = ArrayList() + private var position: Int32 = 0 + private var _buffer: pointer + private var _length: Int32 private static var customSerializers: ?CustomSerializer = Option.None static func registerCustomSerializer(serializer: CustomSerializer) { @@ -72,33 +80,54 @@ public open class SerializerBase { } public init() { - this.buffer = ArrayList(Array(96, repeat: UInt8(0))) + let length: Int32 = 96 + this._buffer = InteropNativeModule._Malloc(length) + this._length = length + } + + private static func writeu8(_buffer: pointer, offset: Int32, length: Int32, value: Int32): Unit { + InteropNativeModule._WriteByte(_buffer, Int64(offset), Int64(length), value) } + private static func readu8(_buffer: pointer, offset: Int32, length: Int32): Int32 { + return InteropNativeModule._ReadByte(_buffer, Int64(offset), Int64(length)) + } + public open func release() { - this.isHolding = false - // todo handle release resources + this.releaseResources() this.position = 0 } - public func asArray(): ArrayList { - return this.buffer + private func releaseResources() { + if (this.heldResourcesCount == 0) { + return + } + for (i in 0..this.heldResourcesCount) { + InteropNativeModule._ReleaseCallbackResource(this.heldResources[i]) + } + this.heldResourcesCount = 0 + } + public func asBuffer(): KSerializerBuffer { + this._buffer } public func length(): Int32 { return Int32(this.position) } - public func currentPosition(): Int64 { return this.position } - private func checkCapacity(value: Int64) { + public func currentPosition(): Int32 { return this.position } + private func checkCapacity(value: Int32) { if (value < 1) { throw Exception("${value} is less than 1") } - var buffSize = this.buffer.size + var buffSize = this._length if (this.position > buffSize - value) { - let minSize = this.position + value - let resizedSize = max(minSize, Int64(round(3.0 * Float64(buffSize) / 2.0))) - var resizedBuffer = ArrayList(this.buffer) - while (resizedBuffer.size < resizedSize) { - resizedBuffer.add(0) + let minSize: Int32 = this.position + value + let resizedSize: Int32 = max(minSize, Int32(round(1.5 * Float64(buffSize)))) + let resizedBuffer = InteropNativeModule._Malloc(resizedSize) + let oldBuffer = this._buffer + for (i in 0..this.position) { + SerializerBase.writeu8(resizedBuffer, Int32(i), resizedSize, SerializerBase.readu8(oldBuffer, i, this.position)) } - this.buffer = resizedBuffer + this._buffer = resizedBuffer + this._length = resizedSize + InteropNativeModule._Free(oldBuffer) } } public func writeCustomObject(kind: String, value: Any): Unit { @@ -107,7 +136,19 @@ public open class SerializerBase { println("Unsupported custom serialization for ${kind}, write undefined") this.writeInt8(Tag.UNDEFINED.value) } + private var heldResources: ArrayList = ArrayList() + private var heldResourcesCount: Int64 = 0 + private func addHeldResource(resourceId: ResourceId) { + if (this.heldResourcesCount == this.heldResources.size) { + this.heldResources.add(resourceId) + } + else { + this.heldResources[this.heldResourcesCount] = resourceId + } + this.heldResourcesCount += 1 + } + public func holdAndWriteCallback(callback: Any): ResourceId { let resourceId = ResourceHolder.instance().registerAndHold(callback) this.heldResources.add(resourceId) @@ -128,33 +169,46 @@ public open class SerializerBase { this.writePointer(callSync) return resourceId } + public func holdAndWriteCallbackForPromiseVoid(): PromiseAndResourceId { + return holdAndWriteCallbackForPromiseVoid(0, 0, 0, 0) + } + public func holdAndWriteCallbackForPromiseVoid(hold: KPointer, release: KPointer, call: KPointer, callSync: KPointer): PromiseAndResourceId { + var resourceId: ResourceId = 0 + let promise = { => } + return PromiseAndResourceId(promise, resourceId) + } + public func holdAndWriteCallbackForPromise(): PromiseAndResourceId { + return holdAndWriteCallbackForPromise(0, 0, 0) + } + public func holdAndWriteCallbackForPromise(hold: KPointer, release: KPointer, call: KPointer): PromiseAndResourceId { + var resourceId: ResourceId = 0 + let promise = { => } + return PromiseAndResourceId(promise, resourceId) + } public func writeFunction(value: Any): Unit { // TODO } - private func setBytes(position: Int64, value: T): Unit where T <: LittleEndianOrder{ - var arr = Array(100, repeat: 0) - let n = value.writeLittleEndian(arr) - this.checkCapacity(n) - for (i in 0..n) { - this.buffer[this.position + i] = arr[i] - } - this.position += n - } public func writeTag(tag: Int32): Unit { - this.setBytes(this.position, tag) + this.checkCapacity(1) + SerializerBase.writeu8(this._buffer, this.position, this._length, tag) + this.position++ + } + public func writeTag(tag: Int8): Unit { + this.checkCapacity(1) + SerializerBase.writeu8(this._buffer, this.position, this._length, Int32(tag)) + this.position++ } public func writeNumber(value: ?Float32): Unit { if (let Some(value) <- value) { if(value == Float32(Int32(value))) { this.writeNumber(Int32(value)) } else { - this.setBytes(this.position, Tag.FLOAT32.value) - this.setBytes(this.position, value) + this.writeTag(Tag.FLOAT32.value) + this.writeInt32(Int64(value.toBits())) } } else { - this.buffer[Int64(this.position)] = UInt8(RuntimeType.UNDEFINED.ordinal) - this.position++ + this.writeTag(Tag.UNDEFINED.value) } } public func writeNumber(value: ?Float64): Unit { @@ -162,62 +216,92 @@ public open class SerializerBase { if(value == Float64(Int32(value))) { this.writeNumber(Int32(value)) } else { - this.setBytes(this.position, Tag.FLOAT32.value) - this.setBytes(this.position, Float32(value)) + this.writeTag(Tag.FLOAT32.value) + this.writeInt32(Int64(Float32(value).toBits())) } } else { - this.buffer[Int64(this.position)] = UInt8(RuntimeType.UNDEFINED.ordinal) - this.position++ + this.writeTag(Tag.UNDEFINED.value) } } public func writeNumber(value: ?Int32): Unit { if (let Some(value) <- value) { - this.setBytes(this.position, Tag.INT32.value) - this.setBytes(this.position, value) - } + this.writeTag(Tag.INT32.value) + this.writeInt32(Int32(value)) + } else { - this.buffer[Int64(this.position)] = UInt8(RuntimeType.UNDEFINED.ordinal) - this.position++ + this.writeTag(Tag.UNDEFINED.value) } } public func writeNumber(value: ?Int64): Unit { + this.checkCapacity(5) if (let Some(value) <- value) { - this.setBytes(this.position, Tag.INT32.value) - this.setBytes(this.position, Int32(value)) + this.writeTag(Tag.INT32.value) + this.writeInt32(Int32(value)) } else { - this.buffer[Int64(this.position)] = UInt8(RuntimeType.UNDEFINED.ordinal) - this.position++ + this.writeTag(Tag.UNDEFINED.value) } } public func writeInt8(value: Int8): Unit { - this.setBytes(this.position, value) + this.checkCapacity(1) + SerializerBase.writeu8(this._buffer, this.position, this._length, Int32(value)) + this.position += 1 } public func writeInt8(value: Int32): Unit { - this.setBytes(this.position, Int8(value)) + this.checkCapacity(1) + SerializerBase.writeu8(this._buffer, this.position, this._length, Int32(value)) + this.position += 1 } public func writeInt32(value: Int32): Unit { - this.setBytes(this.position, Int32(value)) + this.checkCapacity(4) + let arr = Array(4, repeat: 0) + value.writeLittleEndian(arr) + for (idx in 0..4) { + SerializerBase.writeu8(this._buffer, this.position + Int32(idx), this._length, Int32(arr[idx])) + } + this.position += 4 + } + public func writeInt32(value: Int64): Unit { + this.checkCapacity(4) + let arr = Array(4, repeat: 0) + Int32(value).writeLittleEndian(arr) + for (idx in 0..4) { + SerializerBase.writeu8(this._buffer, this.position + Int32(idx), this._length, Int32(arr[idx])) + } + this.position += 4 } public func writeInt64(value: Int64): Unit { - this.setBytes(this.position, Int64(value)) + this.checkCapacity(8) + let arr = Array(8, repeat: 0) + value.writeLittleEndian(arr) + for (idx in 0..8) { + SerializerBase.writeu8(this._buffer, this.position + Int32(idx), this._length, Int32(arr[idx])) + } + this.position += 8 } public func writeFloat32(value: Float32): Unit { - this.setBytes(this.position, value) + this.checkCapacity(4) + this.position += 4 } public func writePointer(ptr: UInt64): Unit { - this.setBytes(this.position, ptr) + this.checkCapacity(8) + let arr = Array(8, repeat: 0) + ptr.writeLittleEndian(arr) + for (idx in 0..8) { + SerializerBase.writeu8(this._buffer, this.position + Int32(idx), this._length, Int32(arr[idx])) + } + this.position += 8 } public func writeBoolean(value: ?Bool): Unit { this.checkCapacity(1) if(let Some(value) <- value) { - this.setBytes(this.position, value) + SerializerBase.writeu8(this._buffer, this.position, this._length, if (value) {1} else {0}) } else { - this.buffer[Int64(this.position)] = UInt8(RuntimeType.UNDEFINED.ordinal) - this.position++ + SerializerBase.writeu8(this._buffer, this.position, this._length, RuntimeType.UNDEFINED.ordinal) } + this.position++ } public func writeMaterialized(value: Object): Unit { // TODO @@ -228,21 +312,30 @@ public open class SerializerBase { this.writePointer(resource.release) } public func writeString(value: String): Unit { - this.checkCapacity(4 + value.size * 4 + 1) // length, data - this.writeInt32(Int32(value.size + 1)) - for (i in 0..value.size) { - this.setBytes(this.position, value[i]) - } - this.writeInt8(Int8(0)) - } - public func writeBuffer(buffer: Array) { - let resourceId = ResourceHolder.instance().registerAndHold(buffer) - this.writeCallbackResource(CallbackResource(resourceId, 0, 0)) - unsafe { - let ptr = acquireArrayRawData(buffer).pointer - this.writePointer(UInt64(ptr.toUIntNative())) - this.writeInt64(buffer.size) - } + this.checkCapacity(Int32(4 + value.size * 4 + 1)) // length, data + let encodedLength = InteropNativeModule._ManagedStringWrite(value, this.asBuffer(), this.position + 4) + this.writeInt32(encodedLength) + this.position += encodedLength + } + public func writeBuffer(_buffer: Array) { + // let resourceId = ResourceHolder.instance().registerAndHold(_buffer) + // this.writeCallbackResource(CallbackResource(resourceId, 0, 0)) + // unsafe { + // let ptr = acquireArrayRawData(_buffer).pointer + // this.writePointer(UInt64(ptr.toUIntNative())) + // this.writeInt64(_buffer.size) + // } + } + public func holdAndWriteObject(obj: Any): ResourceId { + return this.holdAndWriteObject(obj, 0, 0) + } + public func holdAndWriteObject(obj: Any, hold: pointer, release: pointer): ResourceId { + let resourceId = ResourceHolder.instance().registerAndHold(obj) + this.addHeldResource(resourceId) + this.writeInt32(resourceId) + this.writePointer(hold) + this.writePointer(release) + return resourceId } } diff --git a/koala-wrapper/koalaui/interop/src/cangjie/Tag.cj b/koala-wrapper/koalaui/interop/src/cangjie/Tag.cj index 621a1fd57..8c5cc317f 100644 --- a/koala-wrapper/koalaui/interop/src/cangjie/Tag.cj +++ b/koala-wrapper/koalaui/interop/src/cangjie/Tag.cj @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/cangjie/cjpm.toml b/koala-wrapper/koalaui/interop/src/cangjie/cjpm.toml index d29229886..54130b377 100644 --- a/koala-wrapper/koalaui/interop/src/cangjie/cjpm.toml +++ b/koala-wrapper/koalaui/interop/src/cangjie/cjpm.toml @@ -1,3 +1,16 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [dependencies] [package] cjc-version = "0.56.4" diff --git a/koala-wrapper/koalaui/interop/src/cpp/DeserializerBase.h b/koala-wrapper/koalaui/interop/src/cpp/DeserializerBase.h index e09c40524..55e6c54cb 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/DeserializerBase.h +++ b/koala-wrapper/koalaui/interop/src/cpp/DeserializerBase.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,7 +16,6 @@ #define _DESERIALIZER_BASE_H_ #include -#include #include #include #include @@ -24,6 +23,7 @@ #include "interop-types.h" #include "interop-logging.h" +#include "koala-types.h" void holdManagedCallbackResource(InteropInt32); void releaseManagedCallbackResource(InteropInt32); @@ -173,6 +173,12 @@ inline void WriteToString(std::string *result, InteropNativePointer value) result->append("0x" + std::to_string((uint64_t)value)); } +template <> +inline void WriteToString(std::string *result, const InteropNativePointer* value) +{ + result->append("0x" + std::to_string((uint64_t)(*value))); +} + template <> inline void WriteToString(std::string *result, InteropNodeHandle value) { @@ -199,7 +205,11 @@ template <> inline void WriteToString(std::string *result, const InteropMaterialized *value) { char hex[20]; - std::snprintf(hex, sizeof(hex), "0x%llx", (long long)value->ptr); + #ifdef __STDC_LIB_EXT1__ + std::snprintf_s(hex, sizeof(hex), "0x%llx", (long long)value->ptr); + #else + std::snprintf(hex, sizeof(hex), "0x%llx", (long long)value->ptr); + #endif result->append("\""); result->append("Materialized "); result->append(hex); @@ -252,6 +262,19 @@ inline void WriteToString(std::string *result, const InteropCustomObject *value) result->append(value->kind); result->append("\"}"); } +template <> +inline void WriteToString(std::string *result, const InteropObject *value) +{ + result->append("{"); + result->append(".resource="); + WriteToString(result, &(value->resource)); + result->append("}"); +} +template <> +inline void WriteToString(std::string *result, const InteropObject value) +{ + WriteToString(result, &value); +} struct CustomDeserializer { @@ -277,7 +300,10 @@ protected: static CustomDeserializer *customDeserializers; public: - DeserializerBase(uint8_t *data, int32_t length) + DeserializerBase(KSerializerBuffer data, int32_t length) + : data(reinterpret_cast(data)), length(length), position(0) {} + + DeserializerBase(uint8_t* data, int32_t length) : data(data), length(length), position(0) {} ~DeserializerBase() @@ -310,7 +336,11 @@ public: if (length > 0) { value = malloc(length * sizeof(E)); - memset(value, 0, length * sizeof(E)); + #ifdef __STDC_LIB_EXT1__ + memset_s(value, length * sizeof(E), 0, length * sizeof(E)); + #else + memset(value, 0, length * sizeof(E)); + #endif toClean.push_back(value); } array->length = length; @@ -325,11 +355,19 @@ public: if (length > 0) { keys = malloc(length * sizeof(K)); - memset(keys, 0, length * sizeof(K)); + #ifdef __STDC_LIB_EXT1__ + memset_s(keys, length * sizeof(K), 0, length * sizeof(K)); + #else + memset(keys, 0, length * sizeof(K)); + #endif toClean.push_back(keys); values = malloc(length * sizeof(V)); - memset(values, 0, length * sizeof(V)); + #ifdef __STDC_LIB_EXT1__ + memset_s(values, length * sizeof(V), 0, length * sizeof(V)); + #else + memset(values, 0, length * sizeof(V)); + #endif toClean.push_back(values); } map->size = length; @@ -343,7 +381,7 @@ public: { if (position + count > length) { fprintf(stderr, "Incorrect serialized data, check for %d, buffer %d position %d\n", count, length, position); - assert(false); + ASSERT(false); abort(); } } @@ -375,6 +413,12 @@ public: return result; } + InteropObject readObject() { + InteropObject obj; + obj.resource = readCallbackResource(); + return obj; + } + int8_t readInt8() { check(1); @@ -398,7 +442,11 @@ public: check(4); #ifdef KOALA_NO_UNALIGNED_ACCESS InteropInt32 value; - memcpy(&value, data + position, 4); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(&value, 4, data + position, 4); + #else + memcpy(&value, data + position, 4); + #endif #else auto value = *(InteropInt32 *)(data + position); #endif @@ -410,7 +458,11 @@ public: check(8); #ifdef KOALA_NO_UNALIGNED_ACCESS InteropInt64 value; - memcpy(&value, data + position, 4); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(&value, 4, data + position, 4); + #else + memcpy(&value, data + position, 4); + #endif #else auto value = *(InteropInt64 *)(data + position); #endif @@ -422,7 +474,11 @@ public: check(8); #ifdef KOALA_NO_UNALIGNED_ACCESS InteropInt64 value; - memcpy(&value, data + position, 4); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(&value, 4, data + position, 4); + #else + memcpy(&value, data + position, 4); + #endif #else auto value = *(InteropUInt64 *)(data + position); #endif @@ -434,7 +490,11 @@ public: check(4); #ifdef KOALA_NO_UNALIGNED_ACCESS InteropFloat32 value; - memcpy(&value, data + position, 4); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(&value, 4, data + position, 4); + #else + memcpy(&value, data + position, 4); + #endif #else auto value = *(InteropFloat32 *)(data + position); #endif @@ -446,12 +506,16 @@ public: check(8); #ifdef KOALA_NO_UNALIGNED_ACCESS int64_t value = 0; - memcpy(&value, data + position, 8); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(&value, 8, data + position, 8); + #else + memcpy(&value, data + position, 8); + #endif #else int64_t value = *(int64_t *)(data + position); #endif position += 8; - return reinterpret_cast(value); + return reinterpret_cast(static_cast(value)); } InteropNativePointer readPointerOrDefault(InteropNativePointer defaultValue) { @@ -564,6 +628,11 @@ inline void WriteToString(std::string *result, const InteropInt32* value) result->append(std::to_string(*value)); } template <> +inline void WriteToString(std::string *result, InteropUInt64 value) +{ + result->append(std::to_string(value)); +} +template <> inline void WriteToString(std::string *result, InteropInt64 value) { result->append(std::to_string(value)); @@ -579,7 +648,11 @@ inline void WriteToString(std::string *result, InteropFloat32 value) #if (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED < 130300L)) // to_chars() is not available on older macOS. char buf[20]; - snprintf(buf, sizeof buf, "%f", value); + #ifdef __STDC_LIB_EXT1__ + snprintf_s(buf, sizeof buf, "%f", value); + #else + snprintf(buf, sizeof buf, "%f", value); + #endif result->append(buf); #else std::string storage; diff --git a/koala-wrapper/koalaui/interop/src/cpp/SerializerBase.h b/koala-wrapper/koalaui/interop/src/cpp/SerializerBase.h index f6cce0fae..019dbd727 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/SerializerBase.h +++ b/koala-wrapper/koalaui/interop/src/cpp/SerializerBase.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,13 +21,13 @@ #include #include #include -#include #include #include #include "callback-resource.h" #include "interop-types.h" #include "koala-types.h" +#include "interop-logging.h" #ifdef __arm__ #define KOALA_NO_UNALIGNED_ACCESS 1 @@ -55,7 +55,7 @@ T* allocArray(const std::array& ref) { std::size_t space = sizeof(buffer) - offset; void* ptr = buffer + offset; void* aligned_ptr = std::align(alignof(T), sizeof(T) * size, ptr, space); - assert(aligned_ptr != nullptr && "Insufficient space or alignment failed!"); + ASSERT(aligned_ptr != nullptr && "Insufficient space or alignment failed!"); offset = (char*)aligned_ptr + sizeof(T) * size - buffer; T* array = reinterpret_cast(aligned_ptr); for (size_t i = 0; i < size; ++i) { @@ -72,8 +72,8 @@ private: bool ownData; CallbackResourceHolder* resourceHolder; void resize(uint32_t newLength) { - assert(ownData); - assert(newLength > dataLength); + ASSERT(ownData); + ASSERT(newLength > dataLength); auto* newData = reinterpret_cast(malloc(newLength)); memcpy(newData, data, position); free(data); @@ -90,6 +90,10 @@ public: data(data), dataLength(dataLength), position(0), ownData(false), resourceHolder(resourceHolder) { } + SerializerBase(KSerializerBuffer data, uint32_t dataLength, CallbackResourceHolder* resourceHolder = nullptr): + data(reinterpret_cast(data)), dataLength(dataLength), position(0), ownData(false), resourceHolder(resourceHolder) { + } + virtual ~SerializerBase() { if (ownData) { free(data); @@ -110,10 +114,9 @@ public: inline void check(int more) { if (position + more > dataLength) { if (ownData) { - resize(dataLength * 3 / 2 + 2); + resize((position + more) * 3 / 2 + 2); } else { - fprintf(stderr, "Buffer overrun: %d > %d\n", position + more, dataLength); - assert(false); + INTEROP_FATAL("Buffer overrun: %d > %d\n", position + more, dataLength); } } } @@ -127,7 +130,11 @@ public: void writeInt32(InteropInt32 value) { check(4); #ifdef KOALA_NO_UNALIGNED_ACCESS - memcpy(data + position, &value, 4); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data + position, dataLength, &value, 4); + #else + memcpy(data + position, &value, 4); + #endif #else *((InteropInt32*)(data + position)) = value; #endif @@ -137,7 +144,11 @@ public: void writeInt64(InteropInt64 value) { check(8); #ifdef KOALA_NO_UNALIGNED_ACCESS - memcpy(data + position, &value, 8); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data + position, dataLength, &value, 8); + #else + memcpy(data + position, &value, 8); + #endif #else *((InteropInt64*)(data + position)) = value; #endif @@ -147,7 +158,11 @@ public: void writeUInt64(InteropUInt64 value) { check(8); #ifdef KOALA_NO_UNALIGNED_ACCESS - memcpy(data + position, &value, 8); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data + position, dataLength, &value, 8); + #else + memcpy(data + position, &value, 8); + #endif #else *((InteropUInt64*)(data + position)) = value; #endif @@ -155,9 +170,13 @@ public: } void writeFloat32(InteropFloat32 value) { - check(8); + check(4); #ifdef KOALA_NO_UNALIGNED_ACCESS - memcpy(data + position, &value, 4); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data + position, dataLength, &value, 4); + #else + memcpy(data + position, &value, 4); + #endif #else *((InteropFloat32*)(data + position)) = value; #endif @@ -166,10 +185,15 @@ public: void writePointer(InteropNativePointer value) { check(8); + int64_t value64 = static_cast(reinterpret_cast(value)); #ifdef KOALA_NO_UNALIGNED_ACCESS - memcpy(data + position, &value, 8); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data + position, dataLength, &value64, 8); + #else + memcpy(data + position, &value64, 8); + #endif #else - *((int64_t*)(data + position)) = reinterpret_cast(value); + *((int64_t*)(data + position)) = value64; #endif position += 8; } @@ -221,7 +245,11 @@ public: case 3: suffix = "%"; break; case 4: suffix = "lpx"; break; } - snprintf(buf, 64, "%.8f%s", value.value, suffix.c_str()); + #ifdef __STDC_LIB_EXT1__ + snprintf_s(buf, 64, "%.8f%s", value.value, suffix.c_str()); + #else + snprintf(buf, 64, "%.8f%s", value.value, suffix.c_str()); + #endif InteropString str = { buf, (InteropInt32) strlen(buf) }; writeString(str); break; @@ -240,6 +268,10 @@ public: } } + void writeObject(InteropObject any) { + writeCallbackResource(any.resource); + } + void writeCustomObject(std::string type, InteropCustomObject value) { // TODO implement } diff --git a/koala-wrapper/koalaui/interop/src/cpp/ani/ani.h b/koala-wrapper/koalaui/interop/src/cpp/ani/ani.h index 3adbe2416..523434170 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/ani/ani.h +++ b/koala-wrapper/koalaui/interop/src/cpp/ani/ani.h @@ -32,11 +32,23 @@ #define ANI_FALSE 0 #define ANI_TRUE 1 +// Logger interface: +// typedef void (*ani_logger)(FILE *stream, int log_level, const char *component, const char *message); +// ani_option: +// 'option': "--logger" +// 'extra': ani_logger +// where 'log_level' can have the following values: +#define ANI_LOGLEVEL_FATAL 0 +#define ANI_LOGLEVEL_ERROR 1 +#define ANI_LOGLEVEL_WARNING 2 +#define ANI_LOGLEVEL_INFO 3 +#define ANI_LOGLEVEL_DEBUG 4 + typedef size_t ani_size; // Primitive types: typedef uint8_t ani_boolean; -typedef uint32_t ani_char; +typedef uint16_t ani_char; typedef int8_t ani_byte; typedef int16_t ani_short; typedef int32_t ani_int; @@ -46,90 +58,129 @@ typedef double ani_double; // Reference types: #ifdef __cplusplus -class __ani_ref {}; -class __ani_module : public __ani_ref {}; -class __ani_namespace : public __ani_ref {}; -class __ani_object : public __ani_ref {}; -class __ani_fn_object : public __ani_object {}; -class __ani_enum_value : public __ani_object {}; -class __ani_error : public __ani_object {}; -class __ani_promise : public __ani_object {}; -class __ani_tuple_value : public __ani_object {}; -class __ani_type : public __ani_object {}; -class __ani_arraybuffer : public __ani_object {}; -class __ani_string : public __ani_object {}; -class __ani_stringliteral : public __ani_string {}; -class __ani_class : public __ani_type {}; -class __ani_enum : public __ani_type {}; -class __ani_tuple : public __ani_type {}; -class __ani_fixedarray : public __ani_object {}; -class __ani_fixedarray_boolean : public __ani_fixedarray {}; -class __ani_fixedarray_char : public __ani_fixedarray {}; -class __ani_fixedarray_byte : public __ani_fixedarray {}; -class __ani_fixedarray_short : public __ani_fixedarray {}; -class __ani_fixedarray_int : public __ani_fixedarray {}; -class __ani_fixedarray_long : public __ani_fixedarray {}; -class __ani_fixedarray_float : public __ani_fixedarray {}; -class __ani_fixedarray_double : public __ani_fixedarray {}; -class __ani_fixedarray_ref : public __ani_fixedarray {}; +class __ani_ref +{ +}; +class __ani_module : public __ani_ref +{ +}; +class __ani_namespace : public __ani_ref +{ +}; +class __ani_object : public __ani_ref +{ +}; +class __ani_fn_object : public __ani_object +{ +}; +class __ani_enum_item : public __ani_object +{ +}; +class __ani_error : public __ani_object +{ +}; +class __ani_tuple_value : public __ani_object +{ +}; +class __ani_type : public __ani_object +{ +}; +class __ani_arraybuffer : public __ani_object +{ +}; +class __ani_string : public __ani_object +{ +}; +class __ani_class : public __ani_type +{ +}; +class __ani_enum : public __ani_type +{ +}; +class __ani_union : public __ani_type +{ +}; +class __ani_array : public __ani_object +{ +}; +class __ani_array_boolean : public __ani_array +{ +}; +class __ani_array_char : public __ani_array +{ +}; +class __ani_array_byte : public __ani_array +{ +}; +class __ani_array_short : public __ani_array +{ +}; +class __ani_array_int : public __ani_array +{ +}; +class __ani_array_long : public __ani_array +{ +}; +class __ani_array_float : public __ani_array +{ +}; +class __ani_array_double : public __ani_array +{ +}; +class __ani_array_ref : public __ani_array +{ +}; typedef __ani_ref *ani_ref; typedef __ani_module *ani_module; typedef __ani_namespace *ani_namespace; typedef __ani_object *ani_object; typedef __ani_fn_object *ani_fn_object; -typedef __ani_enum_value *ani_enum_value; +typedef __ani_enum_item *ani_enum_item; typedef __ani_error *ani_error; -typedef __ani_promise *ani_promise; typedef __ani_tuple_value *ani_tuple_value; typedef __ani_type *ani_type; typedef __ani_arraybuffer *ani_arraybuffer; typedef __ani_string *ani_string; -typedef __ani_stringliteral *ani_stringliteral; typedef __ani_class *ani_class; typedef __ani_enum *ani_enum; -typedef __ani_tuple *ani_tuple; -typedef __ani_fixedarray *ani_fixedarray; -typedef __ani_fixedarray_boolean *ani_fixedarray_boolean; -typedef __ani_fixedarray_char *ani_fixedarray_char; -typedef __ani_fixedarray_byte *ani_fixedarray_byte; -typedef __ani_fixedarray_short *ani_fixedarray_short; -typedef __ani_fixedarray_int *ani_fixedarray_int; -typedef __ani_fixedarray_long *ani_fixedarray_long; -typedef __ani_fixedarray_float *ani_fixedarray_float; -typedef __ani_fixedarray_double *ani_fixedarray_double; -typedef __ani_fixedarray_ref *ani_fixedarray_ref; -#else // __cplusplus +typedef __ani_union *ani_union; +typedef __ani_array *ani_array; +typedef __ani_array_boolean *ani_array_boolean; +typedef __ani_array_char *ani_array_char; +typedef __ani_array_byte *ani_array_byte; +typedef __ani_array_short *ani_array_short; +typedef __ani_array_int *ani_array_int; +typedef __ani_array_long *ani_array_long; +typedef __ani_array_float *ani_array_float; +typedef __ani_array_double *ani_array_double; +typedef __ani_array_ref *ani_array_ref; +#else // __cplusplus struct __ani_ref; typedef struct __ani_ref *ani_ref; typedef ani_ref ani_module; typedef ani_ref ani_namespace; typedef ani_ref ani_object; typedef ani_object ani_fn_object; -typedef ani_object ani_enum_value; +typedef ani_object ani_enum_item; typedef ani_object ani_error; -typedef ani_object ani_promise; typedef ani_object ani_tuple_value; typedef ani_object ani_type; typedef ani_object ani_arraybuffer; typedef ani_object ani_string; -typedef ani_string ani_stringliteral; typedef ani_type ani_class; typedef ani_type ani_enum; -typedef ani_type ani_tuple; -typedef ani_object ani_fixedarray; -typedef ani_fixedarray ani_fixedarray_boolean; -typedef ani_fixedarray ani_fixedarray_char; -typedef ani_fixedarray ani_fixedarray_byte; -typedef ani_fixedarray ani_fixedarray_short; -typedef ani_fixedarray ani_fixedarray_int; -typedef ani_fixedarray ani_fixedarray_long; -typedef ani_fixedarray ani_fixedarray_float; -typedef ani_fixedarray ani_fixedarray_double; -typedef ani_fixedarray ani_fixedarray_ref; -#endif // __cplusplus - -struct __ani_gref; -typedef struct __ani_gref *ani_gref; +typedef ani_type ani_union; +typedef ani_object ani_array; +typedef ani_array ani_array_boolean; +typedef ani_array ani_array_char; +typedef ani_array ani_array_byte; +typedef ani_array ani_array_short; +typedef ani_array ani_array_int; +typedef ani_array ani_array_long; +typedef ani_array ani_array_float; +typedef ani_array ani_array_double; +typedef ani_array ani_array_ref; +#endif // __cplusplus struct __ani_wref; typedef struct __ani_wref *ani_wref; @@ -146,32 +197,17 @@ typedef struct __ani_field *ani_field; struct __ani_static_field; typedef struct __ani_satic_field *ani_static_field; -struct __ani_property; -typedef struct __ani_property *ani_property; - struct __ani_method; typedef struct __ani_method *ani_method; struct __ani_static_method; typedef struct __ani_static_method *ani_static_method; -struct __ani_cls_slot; -typedef struct __ani_cls_slot *ani_cls_slot; +struct __ani_resolver; +typedef struct __ani_resolver *ani_resolver; typedef void (*ani_finalizer)(void *data, void *hint); -typedef enum { - ANI_KIND_BOOLEAN, - ANI_KIND_CHAR, - ANI_KIND_BYTE, - ANI_KIND_SHORT, - ANI_KIND_INT, - ANI_KIND_LONG, - ANI_KIND_FLOAT, - ANI_KIND_DOUBLE, - ANI_KIND_REF, -} ani_kind; - typedef union { ani_boolean z; ani_char c; @@ -204,6 +240,7 @@ typedef enum { ANI_INVALID_ARGS, ANI_INVALID_TYPE, ANI_INVALID_DESCRIPTOR, + ANI_INCORRECT_REF, ANI_PENDING_ERROR, ANI_NOT_FOUND, ANI_ALREADY_BINDED, @@ -211,9 +248,21 @@ typedef enum { ANI_OUT_OF_MEMORY, ANI_OUT_OF_RANGE, ANI_BUFFER_TO_SMALL, + ANI_INVALID_VERSION, + ANI_AMBIGUOUS, // NOTE: Add necessary status codes } ani_status; +typedef struct { + const char *option; + void *extra; +} ani_option; + +typedef struct { + size_t nr_options; + const ani_option *options; +} ani_options; + struct __ani_vm_api { void *reserved0; void *reserved1; @@ -222,27 +271,22 @@ struct __ani_vm_api { ani_status (*DestroyVM)(ani_vm *vm); ani_status (*GetEnv)(ani_vm *vm, uint32_t version, ani_env **result); - ani_status (*AttachThread)(ani_vm *vm, void *params, ani_env **result); - ani_status (*DetachThread)(ani_vm *vm); + ani_status (*AttachCurrentThread)(ani_vm *vm, const ani_options *options, uint32_t version, ani_env **result); + ani_status (*DetachCurrentThread)(ani_vm *vm); }; -typedef struct { - const char *option; - void *option_data; -} ani_vm_option; - #define ANI_EXPORT __attribute__((visibility("default"))) #ifdef __cplusplus extern "C" { #endif -ANI_EXPORT ani_status ANI_CreateVM(uint32_t version, size_t nr_options, const ani_vm_option *options, ani_vm **result); -ANI_EXPORT ani_status ANI_GetCreatedVMs(ani_vm **vms_buffer, ani_size vms_buffer_length, ani_size *result); + ANI_EXPORT ani_status ANI_CreateVM(const ani_options *options, uint32_t version, ani_vm **result); + ANI_EXPORT ani_status ANI_GetCreatedVMs(ani_vm **vms_buffer, ani_size vms_buffer_length, ani_size *result); -// Prototypes of exported functions for a shared library. -ANI_EXPORT ani_status ANI_Constructor(ani_vm *vm, uint32_t *result); -ANI_EXPORT ani_status ANI_Destructor(ani_vm *vm); + // Prototypes of exported functions for a shared library. + ANI_EXPORT ani_status ANI_Constructor(ani_vm *vm, uint32_t *result); + ANI_EXPORT ani_status ANI_Destructor(ani_vm *vm); #ifdef __cplusplus } @@ -276,210 +320,6 @@ struct __ani_interaction_api { */ ani_status (*GetVM)(ani_env *env, ani_vm **result); - /** - * @brief Checks if a reference is an object. - * - * This function determines whether the specified reference represents an object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the boolean result (true if the reference is an object, false otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsObject)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a functional object. - * - * This function determines whether the specified reference represents a functional object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the boolean result (true if the reference is a functional object, false - * otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFunctionalObject)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is an enum. - * - * This function determines whether the specified reference represents an enum. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the boolean result (true if the reference is an enum, false otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsEnum)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a tuple. - * - * This function determines whether the specified reference represents a tuple. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the boolean result (true if the reference is a tuple, false otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsTuple)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a string. - * - * This function determines whether the specified reference represents a string. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the boolean result (true if the reference is a string, false otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsString)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a string literal. - * - * This function determines whether the specified reference represents a string literal. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the boolean result (true if the reference is a string literal, false - * otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsStringLiteral)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array. - * - * This function determines whether the specified reference represents a fixed array. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the boolean result (true if the reference is a fixed array, false - * otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array of booleans. - * - * This function determines whether the specified reference represents a fixed array of booleans. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the boolean result (true if the reference is a fixed array of booleans, - * false otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray_Boolean)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array of chars. - * - * This function determines whether the specified reference represents a fixed array of chars. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the char result (true if the reference is a fixed array of chars, false - * otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray_Char)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array of bytes. - * - * This function determines whether the specified reference represents a fixed array of bytes. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the byte result (true if the reference is a fixed array of bytes, false - * otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray_Byte)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array of shorts. - * - * This function determines whether the specified reference represents a fixed array of shorts. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the short result (true if the reference is a fixed array of shorts, false - * otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray_Short)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array of integers. - * - * This function determines whether the specified reference represents a fixed array of integers. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the integer result (true if the reference is a fixed array of integers, - * false otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray_Int)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array of longs. - * - * This function determines whether the specified reference represents a fixed array of longs. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the long result (true if the reference is a fixed array of longs, false - * otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray_Long)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array of floats. - * - * This function determines whether the specified reference represents a fixed array of floats. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the float result (true if the reference is a fixed array of floats, false - * otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray_Float)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array of doubles. - * - * This function determines whether the specified reference represents a fixed array of doubles. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the double result (true if the reference is a fixed array of doubles, false - * otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray_Double)(ani_env *env, ani_ref ref, ani_boolean *result); - - /** - * @brief Checks if a reference is a fixed array of references. - * - * This function determines whether the specified reference represents a fixed array of references. - * - * @param[in] env A pointer to the environment structure. - * @param[in] ref The reference to check. - * @param[out] result A pointer to store the boolean result (true if the reference is a fixed array of references, - * false otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reference_IsFixedArray_Ref)(ani_env *env, ani_ref ref, ani_boolean *result); - /** * @brief Creates a new object of a specified class using a constructor method. * @@ -552,19 +392,6 @@ struct __ani_interaction_api { */ ani_status (*Object_InstanceOf)(ani_env *env, ani_object object, ani_type type, ani_boolean *result); - /** - * @brief Checks if two objects are the same. - * - * This function compares two objects to determine if they refer to the same instance. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object1 The first object to compare. - * @param[in] object2 The second object to compare. - * @param[out] result A pointer to store the boolean result (true if the objects are the same, false otherwise). - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_IsSame)(ani_env *env, ani_object object1, ani_object object2, ani_boolean *result); - /** * @brief Retrieves the superclass of a specified type. * @@ -638,42 +465,6 @@ struct __ani_interaction_api { */ ani_status (*FindEnum)(ani_env *env, const char *enum_descriptor, ani_enum *result); - /** - * @brief Finds a tuple by its descriptor. - * - * This function locates a tuple based on its descriptor and stores it in the result parameter. - * - * @param[in] env A pointer to the environment structure. - * @param[in] tuple_descriptor The descriptor of the tuple to find. - * @param[out] result A pointer to the tuple to be populated. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*FindTuple)(ani_env *env, const char *tuple_descriptor, ani_tuple *result); - - /** - * @brief Finds a function by its descriptor. - * - * This function locates a function based on its descriptor and stores it in the result parameter. - * - * @param[in] env A pointer to the environment structure. - * @param[in] function_descriptor The descriptor of the function to find. - * @param[out] result A pointer to the function to be populated. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*FindFunction)(ani_env *env, const char *function_descriptor, ani_function *result); - - /** - * @brief Finds a variable by its descriptor. - * - * This function locates a variable based on its descriptor and stores it in the result parameter. - * - * @param[in] env A pointer to the environment structure. - * @param[in] variable_descriptor The descriptor of the variable to find. - * @param[out] result A pointer to the variable to be populated. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*FindVariable)(ani_env *env, const char *variable_descriptor, ani_variable *result); - /** * @brief Finds a namespace within a module by its descriptor. * @@ -721,8 +512,8 @@ struct __ani_interaction_api { * * @param[in] env A pointer to the environment structure. * @param[in] module The module to search within. - * @param[in] name The name of the function to retrieve. - * @param[in] signature The signature of the function to retrieve. + * @param[in] name The name of the function to find. + * @param[in] signature The signature of the function to find. * @param[out] result A pointer to the function object. * @return Returns a status code of type `ani_status` indicating success or failure. */ @@ -730,18 +521,17 @@ struct __ani_interaction_api { ani_function *result); /** - * @brief Finds a variable within a module by its descriptor. + * @brief Finds a variable within a module by its name. * - * This function locates a variable within the specified module based on its descriptor. + * This function locates a variable within the specified module based on its name. * * @param[in] env A pointer to the environment structure. * @param[in] module The module to search within. - * @param[in] variable_descriptor The descriptor of the variable to find. + * @param[in] name The name of the variable to find. * @param[out] result A pointer to the variable object. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Module_FindVariable)(ani_env *env, ani_module module, const char *variable_descriptor, - ani_variable *result); + ani_status (*Module_FindVariable)(ani_env *env, ani_module module, const char *name, ani_variable *result); /** * @brief Finds a namespace within another namespace by its descriptor. @@ -790,8 +580,8 @@ struct __ani_interaction_api { * * @param[in] env A pointer to the environment structure. * @param[in] ns The namespace to search within. - * @param[in] name The name of the function to retrieve. - * @param[in] signature The signature of the function to retrieve. + * @param[in] name The name of the function to find. + * @param[in] signature The signature of the function to find. * @param[out] result A pointer to the function object. * @return Returns a status code of type `ani_status` indicating success or failure. */ @@ -799,18 +589,17 @@ struct __ani_interaction_api { ani_function *result); /** - * @brief Finds a variable within a namespace by its descriptor. + * @brief Finds a variable within a namespace by its name. * - * This function locates a variable within the specified namespace based on its descriptor. + * This function locates a variable within the specified namespace based on its name. * * @param[in] env A pointer to the environment structure. * @param[in] ns The namespace to search within. - * @param[in] variable_descriptor The descriptor of the variable to find. + * @param[in] name The name of the variable to find. * @param[out] result A pointer to the variable object. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Namespace_FindVariable)(ani_env *env, ani_namespace ns, const char *variable_descriptor, - ani_variable *result); + ani_status (*Namespace_FindVariable)(ani_env *env, ani_namespace ns, const char *name, ani_variable *result); /** * @brief Binds native functions to a module. @@ -972,7 +761,7 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*DescribeError)(ani_env *env); // NOTE: Print stacktrace for debugging? + ani_status (*DescribeError)(ani_env *env); // NOTE: Print stacktrace for debugging? /** * @brief Aborts execution with a message. @@ -1185,663 +974,479 @@ struct __ani_interaction_api { char *utf8_buffer, ani_size utf8_buffer_size, ani_size *result); /** - * @brief Retrieves critical information about a string. - * - * This function retrieves the type and data of a string for critical operations. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The string to analyze. - * @param[out] result_string_type A pointer to store the type of the string (e.g., UTF-16 or UTF-8). - * @param[out] result_data A pointer to the raw string data. - * @param[out] result_size A pointer to the size of the string data. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*String_GetCritical)(ani_env *env, ani_string string, uint32_t *result_string_type, - const void **result_data, - ani_size *result_size); // result_string_type - string type utf16/utf8, etc? - - /** - * @brief Releases critical string data. - * - * This function releases the raw string data retrieved using `String_GetCritical`. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The string whose data was retrieved. - * @param[in] data A pointer to the raw data to release. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*String_ReleaseCritical)(ani_env *env, ani_string string, const void *data); - - /** - * @brief Creates a new UTF-16 string literal. - * - * This function creates a new string literal from the provided UTF-16 encoded data. - * - * @param[in] env A pointer to the environment structure. - * @param[in] utf16_string A pointer to the UTF-16 encoded string data. - * @param[in] utf16_size The size of the UTF-16 string in code units. - * @param[out] result A pointer to store the created string literal. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_NewUTF16)(ani_env *env, const uint16_t *utf16_string, ani_size utf16_size, - ani_stringliteral *result); - - /** - * @brief Retrieves the size of a UTF-16 string literal. - * - * This function retrieves the size (in code units) of the specified UTF-16 string literal. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The UTF-16 string literal to measure. - * @param[out] result A pointer to store the size of the string literal. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_GetUTF16Size)(ani_env *env, ani_stringliteral string, ani_size *result); - - /** - * @brief Retrieves the UTF-16 encoded data of a string literal. - * - * This function copies the UTF-16 encoded data of the string literal into the provided buffer. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The string literal to retrieve data from. - * @param[out] utf16_buffer A buffer to store the UTF-16 encoded data. - * @param[in] utf16_buffer_size The size of the buffer in code units. - * @param[out] result A pointer to store the number of code units written. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_GetUTF16)(ani_env *env, ani_stringliteral string, uint16_t *utf16_buffer, - ani_size utf16_buffer_size, ani_size *result); - - /** - * @brief Retrieves a substring of a UTF-16 string literal. - * - * This function copies a portion of the UTF-16 string literal into the provided buffer. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The string literal to retrieve data from. - * @param[in] substr_offset The starting offset of the substring. - * @param[in] substr_size The size of the substring in code units. - * @param[out] utf16_buffer A buffer to store the substring. - * @param[in] utf16_buffer_size The size of the buffer in code units. - * @param[out] result A pointer to store the number of code units written. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_GetUTF16SubString)(ani_env *env, ani_stringliteral string, ani_size substr_offset, - ani_size substr_size, uint16_t *utf16_buffer, - ani_size utf16_buffer_size, ani_size *result); - - /** - * @brief Creates a new UTF-8 string literal. + * @brief Retrieves the length of an array. * - * This function creates a new string literal from the provided UTF-8 encoded data. + * This function retrieves the length of the specified array. * * @param[in] env A pointer to the environment structure. - * @param[in] utf8_string A pointer to the UTF-8 encoded string data. - * @param[in] size The size of the UTF-8 string in bytes. - * @param[out] result A pointer to store the created string literal. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_NewUTF8)(ani_env *env, const char *utf8_string, ani_size size, - ani_stringliteral *result); - - /** - * @brief Retrieves the size of a UTF-8 string literal. - * - * This function retrieves the size (in bytes) of the specified UTF-8 string literal. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The UTF-8 string literal to measure. - * @param[out] result A pointer to store the size of the string literal. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_GetUTF8Size)(ani_env *env, ani_stringliteral string, ani_size *result); - - /** - * @brief Retrieves the UTF-8 encoded data of a string literal. - * - * This function copies the UTF-8 encoded data of the string literal into the provided buffer. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The string literal to retrieve data from. - * @param[out] utf8_buffer A buffer to store the UTF-8 encoded data. - * @param[in] utf8_buffer_size The size of the buffer in bytes. - * @param[out] result A pointer to store the number of bytes written. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_GetUTF8)(ani_env *env, ani_stringliteral string, char *utf8_buffer, - ani_size utf8_buffer_size, ani_size *result); - - /** - * @brief Retrieves a substring of a UTF-8 string literal. - * - * This function copies a portion of the UTF-8 string literal into the provided buffer. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The string literal to retrieve data from. - * @param[in] substr_offset The starting offset of the substring. - * @param[in] substr_size The size of the substring in bytes. - * @param[out] utf8_buffer A buffer to store the substring. - * @param[in] utf8_buffer_size The size of the buffer in bytes. - * @param[out] result A pointer to store the number of bytes written. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_GetUTF8SubString)(ani_env *env, ani_stringliteral string, ani_size substr_offset, - ani_size substr_size, char *utf8_buffer, ani_size utf8_buffer_size, - ani_size *result); - - /** - * @brief Retrieves critical information about a string literal. - * - * This function retrieves the type and data of a string literal for critical operations. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The string literal to analyze. - * @param[out] result_string_type A pointer to store the type of the string literal (e.g., UTF-16 or UTF-8). - * @param[out] result_data A pointer to the raw string literal data. - * @param[out] result_size A pointer to the size of the string literal data. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_GetCritical)( - ani_env *env, ani_stringliteral string, uint32_t *result_string_type, const void **result_data, - ani_size *result_size); // result_string_type - string type utf16/utf8, etc? - - /** - * @brief Releases critical string literal data. - * - * This function releases the raw string literal data retrieved using `StringLiteral_GetCritical`. - * - * @param[in] env A pointer to the environment structure. - * @param[in] string The string literal whose data was retrieved. - * @param[in] data A pointer to the raw data to release. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*StringLiteral_ReleaseCritical)(ani_env *env, ani_stringliteral string, const void *data); - - /** - * @brief Retrieves the length of a fixed array. - * - * This function retrieves the length of the specified fixed array. - * - * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array whose length is to be retrieved. + * @param[in] array The array whose length is to be retrieved. * @param[out] result A pointer to store the length of the array. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_GetLength)(ani_env *env, ani_fixedarray array, ani_size *result); + ani_status (*Array_GetLength)(ani_env *env, ani_array array, ani_size *result); /** - * @brief Creates a new fixed array of booleans. + * @brief Creates a new array of booleans. * - * This function creates a new fixed array of the specified length for boolean values. + * This function creates a new array of the specified length for boolean values. * * @param[in] env A pointer to the environment structure. * @param[in] length The length of the array to be created. - * @param[out] result A pointer to store the created fixed array. + * @param[out] result A pointer to store the created array. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_New_Boolean)(ani_env *env, ani_size length, ani_fixedarray_boolean *result); + ani_status (*Array_New_Boolean)(ani_env *env, ani_size length, ani_array_boolean *result); /** - * @brief Creates a new fixed array of characters. + * @brief Creates a new array of characters. * - * This function creates a new fixed array of the specified length for character values. + * This function creates a new array of the specified length for character values. * * @param[in] env A pointer to the environment structure. * @param[in] length The length of the array to be created. - * @param[out] result A pointer to store the created fixed array. + * @param[out] result A pointer to store the created array. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_New_Char)(ani_env *env, ani_size length, ani_fixedarray_char *result); + ani_status (*Array_New_Char)(ani_env *env, ani_size length, ani_array_char *result); /** - * @brief Creates a new fixed array of bytes. + * @brief Creates a new array of bytes. * - * This function creates a new fixed array of the specified length for byte values. + * This function creates a new array of the specified length for byte values. * * @param[in] env A pointer to the environment structure. * @param[in] length The length of the array to be created. - * @param[out] result A pointer to store the created fixed array. + * @param[out] result A pointer to store the created array. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_New_Byte)(ani_env *env, ani_size length, ani_fixedarray_byte *result); + ani_status (*Array_New_Byte)(ani_env *env, ani_size length, ani_array_byte *result); /** - * @brief Creates a new fixed array of shorts. + * @brief Creates a new array of shorts. * - * This function creates a new fixed array of the specified length for short integer values. + * This function creates a new array of the specified length for short integer values. * * @param[in] env A pointer to the environment structure. * @param[in] length The length of the array to be created. - * @param[out] result A pointer to store the created fixed array. + * @param[out] result A pointer to store the created array. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_New_Short)(ani_env *env, ani_size length, ani_fixedarray_short *result); + ani_status (*Array_New_Short)(ani_env *env, ani_size length, ani_array_short *result); /** - * @brief Creates a new fixed array of integers. + * @brief Creates a new array of integers. * - * This function creates a new fixed array of the specified length for integer values. + * This function creates a new array of the specified length for integer values. * * @param[in] env A pointer to the environment structure. * @param[in] length The length of the array to be created. - * @param[out] result A pointer to store the created fixed array. + * @param[out] result A pointer to store the created array. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_New_Int)(ani_env *env, ani_size length, ani_fixedarray_int *result); + ani_status (*Array_New_Int)(ani_env *env, ani_size length, ani_array_int *result); /** - * @brief Creates a new fixed array of long integers. + * @brief Creates a new array of long integers. * - * This function creates a new fixed array of the specified length for long integer values. + * This function creates a new array of the specified length for long integer values. * * @param[in] env A pointer to the environment structure. * @param[in] length The length of the array to be created. - * @param[out] result A pointer to store the created fixed array. + * @param[out] result A pointer to store the created array. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_New_Long)(ani_env *env, ani_size length, ani_fixedarray_long *result); + ani_status (*Array_New_Long)(ani_env *env, ani_size length, ani_array_long *result); /** - * @brief Creates a new fixed array of floats. + * @brief Creates a new array of floats. * - * This function creates a new fixed array of the specified length for float values. + * This function creates a new array of the specified length for float values. * * @param[in] env A pointer to the environment structure. * @param[in] length The length of the array to be created. - * @param[out] result A pointer to store the created fixed array. + * @param[out] result A pointer to store the created array. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_New_Float)(ani_env *env, ani_size length, ani_fixedarray_float *result); + ani_status (*Array_New_Float)(ani_env *env, ani_size length, ani_array_float *result); /** - * @brief Creates a new fixed array of doubles. + * @brief Creates a new array of doubles. * - * This function creates a new fixed array of the specified length for double values. + * This function creates a new array of the specified length for double values. * * @param[in] env A pointer to the environment structure. * @param[in] length The length of the array to be created. - * @param[out] result A pointer to store the created fixed array. + * @param[out] result A pointer to store the created array. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_New_Double)(ani_env *env, ani_size length, ani_fixedarray_double *result); + ani_status (*Array_New_Double)(ani_env *env, ani_size length, ani_array_double *result); /** - * @brief Retrieves a region of boolean values from a fixed array. + * @brief Retrieves a region of boolean values from an array. * - * This function retrieves a portion of the specified boolean fixed array into a native buffer. + * This function retrieves a portion of the specified boolean array into a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to retrieve values from. + * @param[in] array The array to retrieve values from. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to retrieve. * @param[out] native_buffer A buffer to store the retrieved boolean values. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_GetRegion_Boolean)(ani_env *env, ani_fixedarray_boolean array, ani_size offset, - ani_size length, ani_boolean *native_buffer); + ani_status (*Array_GetRegion_Boolean)(ani_env *env, ani_array_boolean array, ani_size offset, ani_size length, + ani_boolean *native_buffer); /** - * @brief Retrieves a region of character values from a fixed array. + * @brief Retrieves a region of character values from an array. * - * This function retrieves a portion of the specified character fixed array into a native buffer. + * This function retrieves a portion of the specified character array into a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to retrieve values from. + * @param[in] array The array to retrieve values from. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to retrieve. * @param[out] native_buffer A buffer to store the retrieved character values. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_GetRegion_Char)(ani_env *env, ani_fixedarray_char array, ani_size offset, ani_size length, - ani_char *native_buffer); + ani_status (*Array_GetRegion_Char)(ani_env *env, ani_array_char array, ani_size offset, ani_size length, + ani_char *native_buffer); /** - * @brief Retrieves a region of byte values from a fixed array. + * @brief Retrieves a region of byte values from an array. * - * This function retrieves a portion of the specified byte fixed array into a native buffer. + * This function retrieves a portion of the specified byte array into a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to retrieve values from. + * @param[in] array The array to retrieve values from. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to retrieve. * @param[out] native_buffer A buffer to store the retrieved byte values. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_GetRegion_Byte)(ani_env *env, ani_fixedarray_byte array, ani_size offset, ani_size length, - ani_byte *native_buffer); + ani_status (*Array_GetRegion_Byte)(ani_env *env, ani_array_byte array, ani_size offset, ani_size length, + ani_byte *native_buffer); /** - * @brief Retrieves a region of short values from a fixed array. + * @brief Retrieves a region of short values from an array. * - * This function retrieves a portion of the specified short fixed array into a native buffer. + * This function retrieves a portion of the specified short array into a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to retrieve values from. + * @param[in] array The array to retrieve values from. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to retrieve. * @param[out] native_buffer A buffer to store the retrieved short values. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_GetRegion_Short)(ani_env *env, ani_fixedarray_short array, ani_size offset, ani_size length, - ani_short *native_buffer); + ani_status (*Array_GetRegion_Short)(ani_env *env, ani_array_short array, ani_size offset, ani_size length, + ani_short *native_buffer); /** - * @brief Retrieves a region of integer values from a fixed array. + * @brief Retrieves a region of integer values from an array. * - * This function retrieves a portion of the specified integer fixed array into a native buffer. + * This function retrieves a portion of the specified integer array into a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to retrieve values from. + * @param[in] array The array to retrieve values from. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to retrieve. * @param[out] native_buffer A buffer to store the retrieved integer values. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_GetRegion_Int)(ani_env *env, ani_fixedarray_int array, ani_size offset, ani_size length, - ani_int *native_buffer); + ani_status (*Array_GetRegion_Int)(ani_env *env, ani_array_int array, ani_size offset, ani_size length, + ani_int *native_buffer); /** - * @brief Retrieves a region of long integer values from a fixed array. + * @brief Retrieves a region of long integer values from an array. * - * This function retrieves a portion of the specified long integer fixed array into a native buffer. + * This function retrieves a portion of the specified long integer array into a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to retrieve values from. + * @param[in] array The array to retrieve values from. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to retrieve. * @param[out] native_buffer A buffer to store the retrieved long integer values. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_GetRegion_Long)(ani_env *env, ani_fixedarray_long array, ani_size offset, ani_size length, - ani_long *native_buffer); + ani_status (*Array_GetRegion_Long)(ani_env *env, ani_array_long array, ani_size offset, ani_size length, + ani_long *native_buffer); /** - * @brief Retrieves a region of float values from a fixed array. + * @brief Retrieves a region of float values from an array. * - * This function retrieves a portion of the specified float fixed array into a native buffer. + * This function retrieves a portion of the specified float array into a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to retrieve values from. + * @param[in] array The array to retrieve values from. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to retrieve. * @param[out] native_buffer A buffer to store the retrieved float values. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_GetRegion_Float)(ani_env *env, ani_fixedarray_float array, ani_size offset, ani_size length, - ani_float *native_buffer); + ani_status (*Array_GetRegion_Float)(ani_env *env, ani_array_float array, ani_size offset, ani_size length, + ani_float *native_buffer); /** - * @brief Retrieves a region of double values from a fixed array. + * @brief Retrieves a region of double values from an array. * - * This function retrieves a portion of the specified double fixed array into a native buffer. + * This function retrieves a portion of the specified double array into a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to retrieve values from. + * @param[in] array The array to retrieve values from. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to retrieve. * @param[out] native_buffer A buffer to store the retrieved double values. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_GetRegion_Double)(ani_env *env, ani_fixedarray_double array, ani_size offset, - ani_size length, ani_double *native_buffer); + ani_status (*Array_GetRegion_Double)(ani_env *env, ani_array_double array, ani_size offset, ani_size length, + ani_double *native_buffer); /** - * @brief Sets a region of boolean values in a fixed array. + * @brief Sets a region of boolean values in an array. * - * This function sets a portion of the specified boolean fixed array using a native buffer. + * This function sets a portion of the specified boolean array using a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to set values in. + * @param[in] array The array to set values in. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to set. * @param[in] native_buffer A buffer containing the boolean values to set. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_SetRegion_Boolean)(ani_env *env, ani_fixedarray_boolean array, ani_size offset, - ani_size length, const ani_boolean *native_buffer); + ani_status (*Array_SetRegion_Boolean)(ani_env *env, ani_array_boolean array, ani_size offset, ani_size length, + const ani_boolean *native_buffer); /** - * @brief Sets a region of character values in a fixed array. + * @brief Sets a region of character values in an array. * - * This function sets a portion of the specified character fixed array using a native buffer. + * This function sets a portion of the specified character array using a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to set values in. + * @param[in] array The array to set values in. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to set. * @param[in] native_buffer A buffer containing the character values to set. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_SetRegion_Char)(ani_env *env, ani_fixedarray_char array, ani_size offset, ani_size length, - const ani_char *native_buffer); + ani_status (*Array_SetRegion_Char)(ani_env *env, ani_array_char array, ani_size offset, ani_size length, + const ani_char *native_buffer); /** - * @brief Sets a region of byte values in a fixed array. + * @brief Sets a region of byte values in an array. * - * This function sets a portion of the specified byte fixed array using a native buffer. + * This function sets a portion of the specified byte array using a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to set values in. + * @param[in] array The array to set values in. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to set. * @param[in] native_buffer A buffer containing the byte values to set. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_SetRegion_Byte)(ani_env *env, ani_fixedarray_byte array, ani_size offset, ani_size length, - const ani_byte *native_buffer); - - /** - * @brief Sets a region of short values in a fixed array. - * - * This function sets a portion of the specified short fixed array using a native buffer. - * - * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to set values in. - * @param[in] offset The starting offset of the region. - * @param[in] length The number of elements to set. - * @param[in] native_buffer A buffer containing the short values to set. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*FixedArray_SetRegion_Short)(ani_env *env, ani_fixedarray_short array, ani_size offset, ani_size length, - const ani_short *native_buffer); - - /** - * @brief Sets a region of integer values in a fixed array. - * - * This function sets a portion of the specified integer fixed array using a native buffer. - * - * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to set values in. - * @param[in] offset The starting offset of the region. - * @param[in] length The number of elements to set. - * @param[in] native_buffer A buffer containing the integer values to set. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*FixedArray_SetRegion_Int)(ani_env *env, ani_fixedarray_int array, ani_size offset, ani_size length, - const ani_int *native_buffer); + ani_status (*Array_SetRegion_Byte)(ani_env *env, ani_array_byte array, ani_size offset, ani_size length, + const ani_byte *native_buffer); /** - * @brief Sets a region of long integer values in a fixed array. + * @brief Sets a region of short values in an array. * - * This function sets a portion of the specified long integer fixed array using a native buffer. + * This function sets a portion of the specified short array using a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to set values in. + * @param[in] array The array to set values in. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to set. - * @param[in] native_buffer A buffer containing the long integer values to set. + * @param[in] native_buffer A buffer containing the short values to set. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_SetRegion_Long)(ani_env *env, ani_fixedarray_long array, ani_size offset, ani_size length, - const ani_long *native_buffer); + ani_status (*Array_SetRegion_Short)(ani_env *env, ani_array_short array, ani_size offset, ani_size length, + const ani_short *native_buffer); /** - * @brief Sets a region of float values in a fixed array. + * @brief Sets a region of integer values in an array. * - * This function sets a portion of the specified float fixed array using a native buffer. + * This function sets a portion of the specified integer array using a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to set values in. + * @param[in] array The array to set values in. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to set. - * @param[in] native_buffer A buffer containing the float values to set. + * @param[in] native_buffer A buffer containing the integer values to set. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_SetRegion_Float)(ani_env *env, ani_fixedarray_float array, ani_size offset, ani_size length, - const ani_float *native_buffer); + ani_status (*Array_SetRegion_Int)(ani_env *env, ani_array_int array, ani_size offset, ani_size length, + const ani_int *native_buffer); /** - * @brief Sets a region of double values in a fixed array. + * @brief Sets a region of long integer values in an array. * - * This function sets a portion of the specified double fixed array using a native buffer. + * This function sets a portion of the specified long integer array using a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array to set values in. + * @param[in] array The array to set values in. * @param[in] offset The starting offset of the region. * @param[in] length The number of elements to set. - * @param[in] native_buffer A buffer containing the double values to set. + * @param[in] native_buffer A buffer containing the long integer values to set. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_SetRegion_Double)(ani_env *env, ani_fixedarray_double array, ani_size offset, - ani_size length, const ani_double *native_buffer); + ani_status (*Array_SetRegion_Long)(ani_env *env, ani_array_long array, ani_size offset, ani_size length, + const ani_long *native_buffer); /** - * @brief Pins a fixed array in memory. + * @brief Sets a region of float values in an array. * - * This function pins a fixed array of primitive types in memory to ensure it is not moved by the garbage collector. + * This function sets a portion of the specified float array using a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] primitive_array The fixed array to pin. - * @param[out] result A pointer to store the memory address of the pinned array. + * @param[in] array The array to set values in. + * @param[in] offset The starting offset of the region. + * @param[in] length The number of elements to set. + * @param[in] native_buffer A buffer containing the float values to set. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_Pin)(ani_env *env, ani_fixedarray primitive_array, void **result); + ani_status (*Array_SetRegion_Float)(ani_env *env, ani_array_float array, ani_size offset, ani_size length, + const ani_float *native_buffer); /** - * @brief Unpins a fixed array in memory. + * @brief Sets a region of double values in an array. * - * This function unpins a previously pinned fixed array, allowing it to be moved by the garbage collector. + * This function sets a portion of the specified double array using a native buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] primitive_array The fixed array to unpin. - * @param[in] data A pointer to the pinned memory that was previously retrieved. + * @param[in] array The array to set values in. + * @param[in] offset The starting offset of the region. + * @param[in] length The number of elements to set. + * @param[in] native_buffer A buffer containing the double values to set. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_Unpin)(ani_env *env, ani_fixedarray primitive_array, void *data); + ani_status (*Array_SetRegion_Double)(ani_env *env, ani_array_double array, ani_size offset, ani_size length, + const ani_double *native_buffer); /** - * @brief Creates a new fixed array of references. + * @brief Creates a new array of references. * - * This function creates a new fixed array of references, optionally initializing it with an array of references. + * This function creates a new array of references, optionally initializing it with an array of references. * * @param[in] env A pointer to the environment structure. + * @param[in] type The type of the elements of the array. * @param[in] length The length of the array to be created. - * @param[in] initial_array An optional array of references to initialize the fixed array. Can be null. - * @param[out] result A pointer to store the created fixed array of references. + * @param[in] initial_element An optional reference to initialize the array. Can be null. + * @param[out] result A pointer to store the created array of references. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_New_Ref)(ani_env *env, ani_size length, ani_ref *initial_array, ani_fixedarray_ref *result); + ani_status (*Array_New_Ref)(ani_env *env, ani_type type, ani_size length, ani_ref initial_element, + ani_array_ref *result); /** - * @brief Sets a reference at a specific index in a fixed array. + * @brief Sets a reference at a specific index in an array. * - * This function sets the value of a reference at the specified index in the fixed array. + * This function sets the value of a reference at the specified index in the array. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array of references to modify. + * @param[in] array The array of references to modify. * @param[in] index The index at which to set the reference. * @param[in] ref The reference to set at the specified index. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_Set_Ref)(ani_env *env, ani_fixedarray_ref array, ani_size index, ani_ref ref); + ani_status (*Array_Set_Ref)(ani_env *env, ani_array_ref array, ani_size index, ani_ref ref); /** - * @brief Retrieves a reference from a specific index in a fixed array. + * @brief Retrieves a reference from a specific index in an array. * - * This function retrieves the value of a reference at the specified index in the fixed array. + * This function retrieves the value of a reference at the specified index in the array. * * @param[in] env A pointer to the environment structure. - * @param[in] array The fixed array of references to query. + * @param[in] array The array of references to query. * @param[in] index The index from which to retrieve the reference. * @param[out] result A pointer to store the retrieved reference. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*FixedArray_Get_Ref)(ani_env *env, ani_fixedarray_ref array, ani_size index, ani_ref *result); + ani_status (*Array_Get_Ref)(ani_env *env, ani_array_ref array, ani_size index, ani_ref *result); /** - * @brief Retrieves an enum value by its name. + * @brief Retrieves an enum item by its name. * - * This function retrieves an enum value associated with the specified name. + * This function retrieves an enum item associated with the specified name. * * @param[in] env A pointer to the environment structure. * @param[in] enm The enum to search within. - * @param[in] name The name of the enum value to retrieve. - * @param[out] result A pointer to store the retrieved enum value. + * @param[in] name The name of the enum item to retrieve. + * @param[out] result A pointer to store the retrieved enum item. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Enum_GetEnumValueByName)(ani_env *env, ani_enum enm, const char *name, ani_enum_value *result); + ani_status (*Enum_GetEnumItemByName)(ani_env *env, ani_enum enm, const char *name, ani_enum_item *result); /** - * @brief Retrieves an enum value by its index. + * @brief Retrieves an enum item by its index. * - * This function retrieves an enum value located at the specified index. + * This function retrieves an enum item located at the specified index. * * @param[in] env A pointer to the environment structure. * @param[in] enm The enum to search within. - * @param[in] index The index of the enum value to retrieve. - * @param[out] result A pointer to store the retrieved enum value. + * @param[in] index The index of the enum item to retrieve. + * @param[out] result A pointer to store the retrieved enum item. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Enum_GetEnumValueByIndex)(ani_env *env, ani_enum enm, ani_size index, ani_enum_value *result); + ani_status (*Enum_GetEnumItemByIndex)(ani_env *env, ani_enum enm, ani_size index, ani_enum_item *result); /** - * @brief Retrieves the enum associated with an enum value. + * @brief Retrieves the enum associated with an enum item. * - * This function retrieves the enum to which the specified enum value belongs. + * This function retrieves the enum to which the specified enum item belongs. * * @param[in] env A pointer to the environment structure. - * @param[in] enum_value The enum value whose associated enum is to be retrieved. + * @param[in] enum_item The enum item whose associated enum is to be retrieved. * @param[out] result A pointer to store the retrieved enum. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*EnumValue_GetEnum)(ani_env *env, ani_enum_value enum_value, ani_enum *result); + ani_status (*EnumItem_GetEnum)(ani_env *env, ani_enum_item enum_item, ani_enum *result); + + /** + * @brief Retrieves the integer value of an enum item. + * + * This function retrieves the integer representing the value of the specified enum item. + * + * @param[in] env A pointer to the environment structure. + * @param[in] enum_item The enum item whose underlying value is to be retrieved. + * @param[out] result A pointer to store the retrieved integer. + * @return Returns a status code of type `ani_status` indicating success or failure. + */ + ani_status (*EnumItem_GetValue_Int)(ani_env *env, ani_enum_item enum_item, ani_int *result); /** - * @brief Retrieves the underlying value of an enum value. + * @brief Retrieves the string value of an enum item. * - * This function retrieves the object representing the value of the specified enum value. + * This function retrieves the string representing the value of the specified enum item. * * @param[in] env A pointer to the environment structure. - * @param[in] enum_value The enum value whose underlying value is to be retrieved. - * @param[out] result A pointer to store the retrieved object. + * @param[in] enum_item The enum item whose underlying value is to be retrieved. + * @param[out] result A pointer to store the retrieved string. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*EnumValue_GetValue)(ani_env *env, ani_enum_value enum_value, ani_object *result); + ani_status (*EnumItem_GetValue_String)(ani_env *env, ani_enum_item enum_item, ani_string *result); /** - * @brief Retrieves the name of an enum value. + * @brief Retrieves the name of an enum item. * - * This function retrieves the name associated with the specified enum value. + * This function retrieves the name associated with the specified enum item. * * @param[in] env A pointer to the environment structure. - * @param[in] enum_value The enum value whose name is to be retrieved. + * @param[in] enum_item The enum item whose name is to be retrieved. * @param[out] result A pointer to store the retrieved name. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*EnumValue_GetName)(ani_env *env, ani_enum_value enum_value, ani_string *result); + ani_status (*EnumItem_GetName)(ani_env *env, ani_enum_item enum_item, ani_string *result); /** - * @brief Retrieves the index of an enum value. + * @brief Retrieves the index of an enum item. * - * This function retrieves the index of the specified enum value within its enum. + * This function retrieves the index of the specified enum item within its enum. * * @param[in] env A pointer to the environment structure. - * @param[in] enum_value The enum value whose index is to be retrieved. + * @param[in] enum_item The enum item whose index is to be retrieved. * @param[out] result A pointer to store the retrieved index. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*EnumValue_GetIndex)(ani_env *env, ani_enum_value enum_value, ani_size *result); + ani_status (*EnumItem_GetIndex)(ani_env *env, ani_enum_item enum_item, ani_size *result); /** * @brief Invokes a functional object. @@ -1852,8 +1457,7 @@ struct __ani_interaction_api { * @param[in] fn The functional object to invoke. * @param[in] argc The number of arguments being passed to the functional object. * @param[in] argv A pointer to an array of references representing the arguments. Can be null if `argc` is 0. - * @param[out] result A pointer to store the result of the invocation. Can be null if the functional object does not - * return a value. + * @param[out] result A pointer to store the result of the invocation. Must be non null. * @return Returns a status code of type `ani_status` indicating success or failure. */ ani_status (*FunctionalObject_Call)(ani_env *env, ani_fn_object fn, ani_size argc, ani_ref *argv, ani_ref *result); @@ -2465,161 +2069,60 @@ struct __ani_interaction_api { ani_status (*Function_Call_Void_V)(ani_env *env, ani_function fn, va_list args); /** - * @brief Retrieves the partial class representation. - * - * This function retrieves the partial class representation of the specified class. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class to query. - * @param[out] result A pointer to store the partial class representation. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Class_GetPartial)(ani_env *env, ani_class cls, ani_class *result); - - /** - * @brief Retrieves the required class representation. - * - * This function retrieves the required class representation of the specified class. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class to query. - * @param[out] result A pointer to store the required class representation. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Class_GetRequired)(ani_env *env, ani_class cls, ani_class *result); - - /** - * @brief Retrieves a field from the class. - * - * This function retrieves the specified field by name from the given class. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class to query. - * @param[in] name The name of the field to retrieve. - * @param[out] result A pointer to store the retrieved field. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Class_GetField)(ani_env *env, ani_class cls, const char *name, ani_field *result); - - /** - * @brief Retrieves a static field from the class. - * - * This function retrieves the specified static field by name from the given class. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class to query. - * @param[in] name The name of the static field to retrieve. - * @param[out] result A pointer to store the retrieved static field. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Class_GetStaticField)(ani_env *env, ani_class cls, const char *name, ani_static_field *result); - - /** - * @brief Retrieves a method from the class. - * - * This function retrieves the specified method by name and signature from the given class. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class to query. - * @param[in] name The name of the method to retrieve. - * @param[in] signature The signature of the method to retrieve. - * @param[out] result A pointer to store the retrieved method. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Class_GetMethod)(ani_env *env, ani_class cls, const char *name, const char *signature, - ani_method *result); - - /** - * @brief Retrieves a static method from the class. - * - * This function retrieves the specified static method by name and signature from the given class. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class to query. - * @param[in] name The name of the static method to retrieve. - * @param[in] signature The signature of the static method to retrieve. - * @param[out] result A pointer to store the retrieved static method. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Class_GetStaticMethod)(ani_env *env, ani_class cls, const char *name, const char *signature, - ani_static_method *result); - - /** - * @brief Retrieves a property from the class. - * - * This function retrieves the specified property by name from the given class. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class to query. - * @param[in] name The name of the property to retrieve. - * @param[out] result A pointer to store the retrieved property. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Class_GetProperty)(ani_env *env, ani_class cls, const char *name, ani_property *result); - - /** - * @brief Retrieves the setter method of a property from the class. - * - * This function retrieves the setter method for the specified property by name from the given class. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class to query. - * @param[in] name The name of the property whose setter is to be retrieved. - * @param[out] result A pointer to store the retrieved setter method. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Class_GetSetter)(ani_env *env, ani_class cls, const char *name, ani_method *result); - - /** - * @brief Retrieves the getter method of a property from the class. + * @brief Finds a field from by its name. * - * This function retrieves the getter method for the specified property by name from the given class. + * This function locates a field based on its name and stores it in the result parameter. * * @param[in] env A pointer to the environment structure. * @param[in] cls The class to query. - * @param[in] name The name of the property whose getter is to be retrieved. - * @param[out] result A pointer to store the retrieved getter method. + * @param[in] name The name of the field to find. + * @param[out] result A pointer to the field to be populated. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_GetGetter)(ani_env *env, ani_class cls, const char *name, ani_method *result); + ani_status (*Class_FindField)(ani_env *env, ani_class cls, const char *name, ani_field *result); /** - * @brief Retrieves the indexable getter method from the class. + * @brief Finds a static field by its name. * - * This function retrieves the indexable getter method for the specified signature from the given class. + * This function locates a static field based on its name and stores it in the result parameter. * * @param[in] env A pointer to the environment structure. * @param[in] cls The class to query. - * @param[in] signature The signature of the indexable getter to retrieve. - * @param[out] result A pointer to store the retrieved indexable getter method. + * @param[in] name The name of the static field to find. + * @param[out] result A pointer to the static field to be populated. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_GetIndexableGetter)(ani_env *env, ani_class cls, const char *signature, ani_method *result); + ani_status (*Class_FindStaticField)(ani_env *env, ani_class cls, const char *name, ani_static_field *result); /** - * @brief Retrieves the indexable setter method from the class. + * @brief Finds a method from by its name and signature. * - * This function retrieves the indexable setter method for the specified signature from the given class. + * This function locates a method based on its name and signature and stores it in the result parameter. * * @param[in] env A pointer to the environment structure. * @param[in] cls The class to query. - * @param[in] signature The signature of the indexable setter to retrieve. - * @param[out] result A pointer to store the retrieved indexable setter method. + * @param[in] name The name of the method to find. + * @param[in] signature The signature of the method to find. + * @param[out] result A pointer to the method to be populated. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_GetIndexableSetter)(ani_env *env, ani_class cls, const char *signature, ani_method *result); + ani_status (*Class_FindMethod)(ani_env *env, ani_class cls, const char *name, const char *signature, + ani_method *result); /** - * @brief Retrieves the iterator method from the class. + * @brief Finds a static method from by its name and signature. * - * This function retrieves the iterator method from the specified class. + * This function locates a static method based on its name and signature and stores it in the result parameter. * * @param[in] env A pointer to the environment structure. * @param[in] cls The class to query. - * @param[out] result A pointer to store the retrieved iterator method. + * @param[in] name The name of the static method to find. + * @param[in] signature The signature of the static method to find. + * @param[out] result A pointer to the static method to be populated. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_GetIterator)(ani_env *env, ani_class cls, ani_method *result); + ani_status (*Class_FindStaticMethod)(ani_env *env, ani_class cls, const char *name, const char *signature, + ani_static_method *result); /** * @brief Retrieves a boolean value from a static field of a class. @@ -3561,12 +3064,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the boolean result. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ ani_status (*Class_CallStaticMethodByName_Boolean)(ani_env *env, ani_class cls, const char *name, - ani_boolean *result, ...); + const char *signature, ani_boolean *result, ...); /** * @brief Calls a static method by name with a boolean return type (array-based). @@ -3577,12 +3081,14 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the boolean result. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ ani_status (*Class_CallStaticMethodByName_Boolean_A)(ani_env *env, ani_class cls, const char *name, - ani_boolean *result, const ani_value *args); + const char *signature, ani_boolean *result, + const ani_value *args); /** * @brief Calls a static method by name with a boolean return type (variadic arguments). @@ -3593,12 +3099,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the boolean result. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ ani_status (*Class_CallStaticMethodByName_Boolean_V)(ani_env *env, ani_class cls, const char *name, - ani_boolean *result, va_list args); + const char *signature, ani_boolean *result, va_list args); /** * @brief Calls a static method by name with a char return type. @@ -3609,12 +3116,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the char result. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Char)(ani_env *env, ani_class cls, const char *name, ani_char *result, - ...); + ani_status (*Class_CallStaticMethodByName_Char)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_char *result, ...); /** * @brief Calls a static method by name with a char return type (array-based). @@ -3625,12 +3133,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the char result. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Char_A)(ani_env *env, ani_class cls, const char *name, ani_char *result, - const ani_value *args); + ani_status (*Class_CallStaticMethodByName_Char_A)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_char *result, const ani_value *args); /** * @brief Calls a static method by name with a char return type (variadic arguments). @@ -3641,12 +3150,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the char result. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Char_V)(ani_env *env, ani_class cls, const char *name, ani_char *result, - va_list args); + ani_status (*Class_CallStaticMethodByName_Char_V)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_char *result, va_list args); /** * @brief Calls a static method by name with a byte return type. @@ -3657,12 +3167,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the byte result. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Byte)(ani_env *env, ani_class cls, const char *name, ani_byte *result, - ...); + ani_status (*Class_CallStaticMethodByName_Byte)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_byte *result, ...); /** * @brief Calls a static method by name with a byte return type (array-based). @@ -3673,12 +3184,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the byte result. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Byte_A)(ani_env *env, ani_class cls, const char *name, ani_byte *result, - const ani_value *args); + ani_status (*Class_CallStaticMethodByName_Byte_A)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_byte *result, const ani_value *args); /** * @brief Calls a static method by name with a byte return type (variadic arguments). @@ -3689,12 +3201,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the byte result. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Byte_V)(ani_env *env, ani_class cls, const char *name, ani_byte *result, - va_list args); + ani_status (*Class_CallStaticMethodByName_Byte_V)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_byte *result, va_list args); /** * @brief Calls a static method by name with a short return type. @@ -3705,12 +3218,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the short result. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Short)(ani_env *env, ani_class cls, const char *name, ani_short *result, - ...); + ani_status (*Class_CallStaticMethodByName_Short)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_short *result, ...); /** * @brief Calls a static method by name with a short return type (array-based). @@ -3721,12 +3235,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the short result. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Short_A)(ani_env *env, ani_class cls, const char *name, ani_short *result, - const ani_value *args); + ani_status (*Class_CallStaticMethodByName_Short_A)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_short *result, const ani_value *args); /** * @brief Calls a static method by name with a short return type (variadic arguments). @@ -3737,12 +3252,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the short result. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Short_V)(ani_env *env, ani_class cls, const char *name, ani_short *result, - va_list args); + ani_status (*Class_CallStaticMethodByName_Short_V)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_short *result, va_list args); /** * @brief Calls a static method by name with a integer return type. @@ -3753,11 +3269,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the integer result. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Int)(ani_env *env, ani_class cls, const char *name, ani_int *result, ...); + ani_status (*Class_CallStaticMethodByName_Int)(ani_env *env, ani_class cls, const char *name, const char *signature, + ani_int *result, ...); /** * @brief Calls a static method by name with a integer return type (array-based). @@ -3768,12 +3286,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the integer result. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Int_A)(ani_env *env, ani_class cls, const char *name, ani_int *result, - const ani_value *args); + ani_status (*Class_CallStaticMethodByName_Int_A)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_int *result, const ani_value *args); /** * @brief Calls a static method by name with a integer return type (variadic arguments). @@ -3784,12 +3303,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the integer result. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Int_V)(ani_env *env, ani_class cls, const char *name, ani_int *result, - va_list args); + ani_status (*Class_CallStaticMethodByName_Int_V)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_int *result, va_list args); /** * @brief Calls a static method by name with a long return type. @@ -3800,12 +3320,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the long result. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Long)(ani_env *env, ani_class cls, const char *name, ani_long *result, - ...); + ani_status (*Class_CallStaticMethodByName_Long)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_long *result, ...); /** * @brief Calls a static method by name with a long return type (array-based). @@ -3816,12 +3337,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the long result. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Long_A)(ani_env *env, ani_class cls, const char *name, ani_long *result, - const ani_value *args); + ani_status (*Class_CallStaticMethodByName_Long_A)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_long *result, const ani_value *args); /** * @brief Calls a static method by name with a long return type (variadic arguments). @@ -3832,12 +3354,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the long result. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Long_V)(ani_env *env, ani_class cls, const char *name, ani_long *result, - va_list args); + ani_status (*Class_CallStaticMethodByName_Long_V)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_long *result, va_list args); /** * @brief Calls a static method by name with a float return type. @@ -3848,12 +3371,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the float result. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Float)(ani_env *env, ani_class cls, const char *name, ani_float *result, - ...); + ani_status (*Class_CallStaticMethodByName_Float)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_float *result, ...); /** * @brief Calls a static method by name with a float return type (array-based). @@ -3864,12 +3388,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the float result. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Float_A)(ani_env *env, ani_class cls, const char *name, ani_float *result, - const ani_value *args); + ani_status (*Class_CallStaticMethodByName_Float_A)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_float *result, const ani_value *args); /** * @brief Calls a static method by name with a float return type (variadic arguments). @@ -3880,12 +3405,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the float result. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Float_V)(ani_env *env, ani_class cls, const char *name, ani_float *result, - va_list args); + ani_status (*Class_CallStaticMethodByName_Float_V)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_float *result, va_list args); /** * @brief Calls a static method by name with a double return type. @@ -3896,12 +3422,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the double result. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Double)(ani_env *env, ani_class cls, const char *name, ani_double *result, - ...); + ani_status (*Class_CallStaticMethodByName_Double)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_double *result, ...); /** * @brief Calls a static method by name with a double return type (array-based). @@ -3912,12 +3439,14 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the double result. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ ani_status (*Class_CallStaticMethodByName_Double_A)(ani_env *env, ani_class cls, const char *name, - ani_double *result, const ani_value *args); + const char *signature, ani_double *result, + const ani_value *args); /** * @brief Calls a static method by name with a double return type (variadic arguments). @@ -3928,12 +3457,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the double result. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ ani_status (*Class_CallStaticMethodByName_Double_V)(ani_env *env, ani_class cls, const char *name, - ani_double *result, va_list args); + const char *signature, ani_double *result, va_list args); /** * @brief Calls a static method by name with a reference return type. @@ -3944,11 +3474,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the reference result. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Ref)(ani_env *env, ani_class cls, const char *name, ani_ref *result, ...); + ani_status (*Class_CallStaticMethodByName_Ref)(ani_env *env, ani_class cls, const char *name, const char *signature, + ani_ref *result, ...); /** * @brief Calls a static method by name with a reference return type (array-based). @@ -3959,12 +3491,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the reference result. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Ref_A)(ani_env *env, ani_class cls, const char *name, ani_ref *result, - const ani_value *args); + ani_status (*Class_CallStaticMethodByName_Ref_A)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_ref *result, const ani_value *args); /** * @brief Calls a static method by name with a reference return type (variadic arguments). @@ -3975,12 +3508,13 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[out] result A pointer to store the reference result. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Ref_V)(ani_env *env, ani_class cls, const char *name, ani_ref *result, - va_list args); + ani_status (*Class_CallStaticMethodByName_Ref_V)(ani_env *env, ani_class cls, const char *name, + const char *signature, ani_ref *result, va_list args); /** * @brief Calls a static method by name with no return value. @@ -3991,10 +3525,12 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[in] ... Variadic arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Void)(ani_env *env, ani_class cls, const char *name, ...); + ani_status (*Class_CallStaticMethodByName_Void)(ani_env *env, ani_class cls, const char *name, + const char *signature, ...); /** * @brief Calls a static method by name with no return value (array-based). @@ -4005,11 +3541,12 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[in] args An array of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ ani_status (*Class_CallStaticMethodByName_Void_A)(ani_env *env, ani_class cls, const char *name, - const ani_value *args); + const char *signature, const ani_value *args); /** * @brief Calls a static method by name with no return value (variadic arguments). @@ -4020,10 +3557,12 @@ struct __ani_interaction_api { * @param[in] env A pointer to the environment structure. * @param[in] cls The class containing the static method. * @param[in] name The name of the static method to call. + * @param[in] signature The signature of the static method to call. * @param[in] args A `va_list` of arguments to pass to the method. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Class_CallStaticMethodByName_Void_V)(ani_env *env, ani_class cls, const char *name, va_list args); + ani_status (*Class_CallStaticMethodByName_Void_V)(ani_env *env, ani_class cls, const char *name, + const char *signature, va_list args); /** * @brief Retrieves a boolean value from a field of an object. @@ -4468,265 +4007,30 @@ struct __ani_interaction_api { ani_status (*Object_SetFieldByName_Float)(ani_env *env, ani_object object, const char *name, ani_float value); /** - * @brief Sets a double value to a field of an object by its name. - * - * This function assigns a double value to the specified field of the given object by its name. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the field. - * @param[in] name The name of the field to set the double value to. - * @param[in] value The double value to assign to the field. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_SetFieldByName_Double)(ani_env *env, ani_object object, const char *name, ani_double value); - - /** - * @brief Sets a reference value to a field of an object by its name. - * - * This function assigns a reference value to the specified field of the given object by its name. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the field. - * @param[in] name The name of the field to set the reference value to. - * @param[in] value The reference value to assign to the field. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_SetFieldByName_Ref)(ani_env *env, ani_object object, const char *name, ani_ref value); - - /** - * @brief Retrieves a boolean value from a property of an object. - * - * This function retrieves the boolean value of the specified property from the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to retrieve the boolean value from. - * @param[out] result A pointer to store the retrieved boolean value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_GetProperty_Boolean)(ani_env *env, ani_object object, ani_property property, - ani_boolean *result); - - /** - * @brief Retrieves a char value from a property of an object. - * - * This function retrieves the char value of the specified property from the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to retrieve the char value from. - * @param[out] result A pointer to store the retrieved char value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_GetProperty_Char)(ani_env *env, ani_object object, ani_property property, ani_char *result); - - /** - * @brief Retrieves a byte value from a property of an object. - * - * This function retrieves the byte value of the specified property from the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to retrieve the byte value from. - * @param[out] result A pointer to store the retrieved byte value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_GetProperty_Byte)(ani_env *env, ani_object object, ani_property property, ani_byte *result); - - /** - * @brief Retrieves a short value from a property of an object. - * - * This function retrieves the short value of the specified property from the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to retrieve the short value from. - * @param[out] result A pointer to store the retrieved short value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_GetProperty_Short)(ani_env *env, ani_object object, ani_property property, ani_short *result); - - /** - * @brief Retrieves a integer value from a property of an object. - * - * This function retrieves the integer value of the specified property from the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to retrieve the integer value from. - * @param[out] result A pointer to store the retrieved integer value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_GetProperty_Int)(ani_env *env, ani_object object, ani_property property, ani_int *result); - - /** - * @brief Retrieves a long value from a property of an object. - * - * This function retrieves the long value of the specified property from the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to retrieve the long value from. - * @param[out] result A pointer to store the retrieved long value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_GetProperty_Long)(ani_env *env, ani_object object, ani_property property, ani_long *result); - - /** - * @brief Retrieves a float value from a property of an object. - * - * This function retrieves the float value of the specified property from the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to retrieve the float value from. - * @param[out] result A pointer to store the retrieved float value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_GetProperty_Float)(ani_env *env, ani_object object, ani_property property, ani_float *result); - - /** - * @brief Retrieves a double value from a property of an object. - * - * This function retrieves the double value of the specified property from the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to retrieve the double value from. - * @param[out] result A pointer to store the retrieved double value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_GetProperty_Double)(ani_env *env, ani_object object, ani_property property, ani_double *result); - - /** - * @brief Retrieves a reference value from a property of an object. - * - * This function retrieves the reference value of the specified property from the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to retrieve the reference value from. - * @param[out] result A pointer to store the retrieved reference value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_GetProperty_Ref)(ani_env *env, ani_object object, ani_property property, ani_ref *result); - - /** - * @brief Sets a boolean value to a property of an object. - * - * This function assigns a boolean value to the specified property of the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to set the boolean value to. - * @param[in] value The boolean value to assign to the property. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_SetProperty_Boolean)(ani_env *env, ani_object object, ani_property property, ani_boolean value); - - /** - * @brief Sets a char value to a property of an object. - * - * This function assigns a char value to the specified property of the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to set the char value to. - * @param[in] value The char value to assign to the property. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_SetProperty_Char)(ani_env *env, ani_object object, ani_property property, ani_char value); - - /** - * @brief Sets a byte value to a property of an object. - * - * This function assigns a byte value to the specified property of the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to set the byte value to. - * @param[in] value The byte value to assign to the property. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_SetProperty_Byte)(ani_env *env, ani_object object, ani_property property, ani_byte value); - - /** - * @brief Sets a short value to a property of an object. - * - * This function assigns a short value to the specified property of the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to set the short value to. - * @param[in] value The short value to assign to the property. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_SetProperty_Short)(ani_env *env, ani_object object, ani_property property, ani_short value); - - /** - * @brief Sets a integer value to a property of an object. - * - * This function assigns a integer value to the specified property of the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to set the integer value to. - * @param[in] value The integer value to assign to the property. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_SetProperty_Int)(ani_env *env, ani_object object, ani_property property, ani_int value); - - /** - * @brief Sets a long value to a property of an object. - * - * This function assigns a long value to the specified property of the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to set the long value to. - * @param[in] value The long value to assign to the property. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_SetProperty_Long)(ani_env *env, ani_object object, ani_property property, ani_long value); - - /** - * @brief Sets a float value to a property of an object. - * - * This function assigns a float value to the specified property of the given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to set the float value to. - * @param[in] value The float value to assign to the property. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Object_SetProperty_Float)(ani_env *env, ani_object object, ani_property property, ani_float value); - - /** - * @brief Sets a double value to a property of an object. + * @brief Sets a double value to a field of an object by its name. * - * This function assigns a double value to the specified property of the given object. + * This function assigns a double value to the specified field of the given object by its name. * * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to set the double value to. - * @param[in] value The double value to assign to the property. + * @param[in] object The object containing the field. + * @param[in] name The name of the field to set the double value to. + * @param[in] value The double value to assign to the field. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Object_SetProperty_Double)(ani_env *env, ani_object object, ani_property property, ani_double value); + ani_status (*Object_SetFieldByName_Double)(ani_env *env, ani_object object, const char *name, ani_double value); /** - * @brief Sets a reference value to a property of an object. + * @brief Sets a reference value to a field of an object by its name. * - * This function assigns a reference value to the specified property of the given object. + * This function assigns a reference value to the specified field of the given object by its name. * * @param[in] env A pointer to the environment structure. - * @param[in] object The object containing the property. - * @param[in] property The property to set the reference value to. - * @param[in] value The reference value to assign to the property. + * @param[in] object The object containing the field. + * @param[in] name The name of the field to set the reference value to. + * @param[in] value The reference value to assign to the field. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Object_SetProperty_Ref)(ani_env *env, ani_object object, ani_property property, ani_ref value); + ani_status (*Object_SetFieldByName_Ref)(ani_env *env, ani_object object, const char *name, ani_ref value); /** * @brief Retrieves a boolean value from a property of an object by its name. @@ -5920,93 +5224,16 @@ struct __ani_interaction_api { const char *signature, va_list args); /** - * @brief Creates a new tuple value. - * - * This function creates a new value for the specified tuple using variadic arguments. - * - * @param[in] env A pointer to the environment structure. - * @param[in] tuple The tuple for which to create a new value. - * @param[out] result A pointer to store the new tuple value. - * @param[in] ... Variadic arguments to initialize the tuple value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Tuple_NewTupleValue)(ani_env *env, ani_tuple tuple, ani_tuple_value *result, ...); - - /** - * @brief Creates a new tuple value (array-based). - * - * This function creates a new value for the specified tuple using arguments provided in an array. - * - * @param[in] env A pointer to the environment structure. - * @param[in] tuple The tuple for which to create a new value. - * @param[out] result A pointer to store the new tuple value. - * @param[in] args An array of arguments to initialize the tuple value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Tuple_NewTupleValue_A)(ani_env *env, ani_tuple tuple, ani_tuple_value *result, const ani_value *args); - - /** - * @brief Creates a new tuple value (variadic arguments). - * - * This function creates a new value for the specified tuple using a `va_list`. - * - * @param[in] env A pointer to the environment structure. - * @param[in] tuple The tuple for which to create a new value. - * @param[out] result A pointer to store the new tuple value. - * @param[in] args A `va_list` of arguments to initialize the tuple value. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Tuple_NewTupleValue_V)(ani_env *env, ani_tuple tuple, ani_tuple_value *result, va_list args); - - /** - * @brief Retrieves the number of items in a tuple. + * @brief Retrieves the number of items in a tuple value. * - * This function retrieves the total number of items in the specified tuple. + * This function retrieves the total number of items in the specified tuple value. * * @param[in] env A pointer to the environment structure. - * @param[in] tuple The tuple whose number of items is to be retrieved. + * @param[in] tuple_value The tuple value whose number of items is to be retrieved. * @param[out] result A pointer to store the number of items. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Tuple_GetNumberOfItems)(ani_env *env, ani_tuple tuple, ani_size *result); - - /** - * @brief Retrieves the kind of an item in a tuple. - * - * This function retrieves the kind of the item at the specified index in the tuple. - * - * @param[in] env A pointer to the environment structure. - * @param[in] tuple The tuple containing the item. - * @param[in] index The index of the item. - * @param[out] result A pointer to store the kind of the item. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Tuple_GetItemKind)(ani_env *env, ani_tuple tuple, ani_size index, ani_kind *result); - - /** - * @brief Retrieves the type of an item in a tuple. - * - * This function retrieves the type of the item at the specified index in the tuple. - * - * @param[in] env A pointer to the environment structure. - * @param[in] tuple The tuple containing the item. - * @param[in] index The index of the item. - * @param[out] result A pointer to store the type of the item. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Tuple_GetItemType)(ani_env *env, ani_tuple tuple, ani_size index, ani_type *result); - - /** - * @brief Retrieves the tuple associated with a tuple value. - * - * This function retrieves the tuple that corresponds to the specified tuple value. - * - * @param[in] env A pointer to the environment structure. - * @param[in] value The tuple value to query. - * @param[out] result A pointer to store the associated tuple. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*TupleValue_GetTuple)(ani_env *env, ani_tuple_value value, ani_tuple *result); + ani_status (*TupleValue_GetNumberOfItems)(ani_env *env, ani_tuple_value tuple_value, ani_size *result); /** * @brief Retrieves a boolean item from a tuple value. @@ -6258,7 +5485,7 @@ struct __ani_interaction_api { * @param[out] result A pointer to store the created global reference. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*GlobalReference_Create)(ani_env *env, ani_ref ref, ani_gref *result); + ani_status (*GlobalReference_Create)(ani_env *env, ani_ref ref, ani_ref *result); /** * @brief Deletes a global reference. @@ -6269,7 +5496,7 @@ struct __ani_interaction_api { * @param[in] gref The global reference to delete. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*GlobalReference_Delete)(ani_env *env, ani_gref gref); + ani_status (*GlobalReference_Delete)(ani_env *env, ani_ref gref); /** * @brief Creates a weak reference. @@ -6277,537 +5504,233 @@ struct __ani_interaction_api { * This function creates a weak reference from a local reference. * * @param[in] env A pointer to the environment structure. - * @param[in] ref The local reference to convert to a weak reference. - * @param[out] result A pointer to store the created weak reference. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*WeakReference_Create)(ani_env *env, ani_ref ref, ani_wref *result); - - /** - * @brief Deletes a weak reference. - * - * This function deletes the specified weak reference, releasing all associated resources. - * - * @param[in] env A pointer to the environment structure. - * @param[in] wref The weak reference to delete. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*WeakReference_Delete)(ani_env *env, ani_wref wref); - - /** - * @brief Retrieves the local reference associated with a weak reference. - * - * This function retrieves the local reference that corresponds to the specified weak reference. - * - * @param[in] env A pointer to the environment structure. - * @param[in] wref The weak reference to query. - * @param[out] result A pointer to store the retrieved local reference. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*WeakReference_GetReference)(ani_env *env, ani_wref wref, ani_ref *result); - - /** - * @brief Creates a new array buffer. - * - * This function creates a new array buffer with the specified length and returns a pointer to the allocated data. - * - * @param[in] env A pointer to the environment structure. - * @param[in] length The length of the array buffer in bytes. - * @param[out] data_result A pointer to store the allocated data of the array buffer. - * @param[out] arraybuffer_result A pointer to store the created array buffer object. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*CreateArrayBuffer)(ani_env *env, size_t length, void **data_result, - ani_arraybuffer *arraybuffer_result); - - /** - * @brief Creates a new array buffer using external data. - * - * This function creates an array buffer that uses external data. The provided finalizer will be called when the - * array buffer is no longer needed. - * - * @param[in] env A pointer to the environment structure. - * @param[in] external_data A pointer to the external data to be used by the array buffer. - * @param[in] length The length of the external data in bytes. - * @param[in] finalizer A callback function to be called when the array buffer is finalized. - * @param[in] hint A user-defined hint to be passed to the finalizer. - * @param[out] result A pointer to store the created array buffer object. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*CreateArrayBufferExternal)(ani_env *env, void *external_data, size_t length, ani_finalizer finalizer, - void *hint, ani_arraybuffer *result); - - /** - * @brief Retrieves information about an array buffer. - * - * This function retrieves the data pointer and length of the specified array buffer. - * - * @param[in] env A pointer to the environment structure. - * @param[in] arraybuffer The array buffer to query. - * @param[out] data_result A pointer to store the data of the array buffer. - * @param[out] length_result A pointer to store the length of the array buffer in bytes. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*ArrayBuffer_GetInfo)(ani_env *env, ani_arraybuffer arraybuffer, void **data_result, - size_t *length_result); - - /** - * @brief Converts an object to a method. - * - * This function extracts the method information from a given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] method The object representing the method. - * @param[out] result A pointer to store the extracted method. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_FromMethod)(ani_env *env, ani_object method, ani_method *result); - - /** - * @brief Converts a method to an object. - * - * This function creates an object representing the specified method. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class containing the method. - * @param[in] method The method to convert. - * @param[out] result A pointer to store the created object. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_ToMethod)(ani_env *env, ani_class cls, ani_method method, ani_object *result); - - /** - * @brief Converts an object to a field. - * - * This function extracts the field information from a given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] field The object representing the field. - * @param[out] result A pointer to store the extracted field. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_FromField)(ani_env *env, ani_object field, ani_field *result); - - /** - * @brief Converts a field to an object. - * - * This function creates an object representing the specified field. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class containing the field. - * @param[in] field The field to convert. - * @param[out] result A pointer to store the created object. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_ToField)(ani_env *env, ani_class cls, ani_field field, ani_object *result); - - /** - * @brief Converts an object to a static method. - * - * This function extracts the static method information from a given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] method The object representing the static method. - * @param[out] result A pointer to store the extracted static method. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_FromStaticMethod)(ani_env *env, ani_object method, ani_static_method *result); - - /** - * @brief Converts a static method to an object. - * - * This function creates an object representing the specified static method. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class containing the static method. - * @param[in] method The static method to convert. - * @param[out] result A pointer to store the created object. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_ToStaticMethod)(ani_env *env, ani_class cls, ani_static_method method, ani_object *result); - - /** - * @brief Converts an object to a static field. - * - * This function extracts the static field information from a given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] field The object representing the static field. - * @param[out] result A pointer to store the extracted static field. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_FromStaticField)(ani_env *env, ani_object field, ani_static_field *result); - - /** - * @brief Converts a static field to an object. - * - * This function creates an object representing the specified static field. - * - * @param[in] env A pointer to the environment structure. - * @param[in] cls The class containing the static field. - * @param[in] field The static field to convert. - * @param[out] result A pointer to store the created object. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_ToStaticField)(ani_env *env, ani_class cls, ani_static_field field, ani_object *result); - - /** - * @brief Converts an object to a function. - * - * This function extracts the function information from a given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] function The object representing the function. - * @param[out] result A pointer to store the extracted function. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_FromFunction)(ani_env *env, ani_object function, ani_function *result); - - /** - * @brief Converts a function to an object. - * - * This function creates an object representing the specified function. - * - * @param[in] env A pointer to the environment structure. - * @param[in] function The function to convert. - * @param[out] result A pointer to store the created object. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_ToFunction)(ani_env *env, ani_function function, ani_object *result); - - /** - * @brief Converts an object to a variable. - * - * This function extracts the variable information from a given object. - * - * @param[in] env A pointer to the environment structure. - * @param[in] variable The object representing the variable. - * @param[out] result A pointer to store the extracted variable. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_FromVariable)(ani_env *env, ani_object variable, ani_variable *result); - - /** - * @brief Converts a variable to an object. - * - * This function creates an object representing the specified variable. - * - * @param[in] env A pointer to the environment structure. - * @param[in] variable The variable to convert. - * @param[out] result A pointer to store the created object. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Reflection_ToVariable)(ani_env *env, ani_variable variable, ani_object *result); - - /** - * @brief Registers a new coroutine-local storage slot. - * - * This function registers a new coroutine-local storage (CLS) slot with an optional initial data, finalizer, and - * hint. - * - * @param[in] env A pointer to the environment structure. - * @param[in] initial_data A pointer to the initial data to associate with the slot. Can be null. - * @param[in] finalizer A callback function to finalize and clean up the data when it is no longer needed. - * @param[in] hint A user-defined pointer that is passed to the finalizer. Can be null. - * @param[out] result A pointer to store the created CLS slot. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*CLS_Register)(ani_env *env, void *initial_data, ani_finalizer finalizer, void *hint, - ani_cls_slot *result); - - /** - * @brief Unregisters a coroutine-local storage slot. - * - * This function unregisters a previously registered CLS slot, releasing its resources. - * - * @param[in] env A pointer to the environment structure. - * @param[in] slot The CLS slot to unregister. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*CLS_Unregister)(ani_env *env, ani_cls_slot slot); - - /** - * @brief Sets data for a CLS slot. - * - * This function associates the specified data with the given CLS slot. - * - * @param[in] env A pointer to the environment structure. - * @param[in] slot The CLS slot to set data for. - * @param[in] data A pointer to the data to associate with the slot. Can be null. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*CLS_SetData)(ani_env *env, ani_cls_slot slot, void *data); - - /** - * @brief Retrieves data from a CLS slot. - * - * This function retrieves the data associated with the given CLS slot. - * - * @param[in] env A pointer to the environment structure. - * @param[in] slot The CLS slot to retrieve data from. - * @param[out] result A pointer to store the retrieved data. Can be null if no data is associated. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*CLS_GetData)(ani_env *env, ani_cls_slot slot, void **result); - - /** - * @brief Launches a coroutine using a functional object. - * - * This function starts a coroutine that executes the specified functional object with the given arguments. - * - * @param[in] env A pointer to the environment structure. - * @param[in] fn The functional object to execute. - * @param[in] argc The number of arguments to pass to the functional object. - * @param[in] argv An array of arguments to pass to the functional object. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @return Returns a status code of type `ani_status` indicating success or failure. - */ - ani_status (*Coroutine_LaunchFunctionalObject)(ani_env *env, ani_fn_object fn, ani_size argc, ani_ref *argv, - ani_promise *result); - - /** - * @brief Launches a coroutine using a function with variadic arguments. - * - * This function starts a coroutine that executes the specified function with the given arguments. - * - * @param[in] env A pointer to the environment structure. - * @param[in] function The function to execute. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @param[in] ... Variadic arguments to pass to the function. + * @param[in] ref The local reference to convert to a weak reference. + * @param[out] result A pointer to store the created weak reference. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_LaunchFunction)(ani_env *env, ani_function function, ani_promise *result, ...); + ani_status (*WeakReference_Create)(ani_env *env, ani_ref ref, ani_wref *result); /** - * @brief Launches a coroutine using a function with array-based arguments. + * @brief Deletes a weak reference. * - * This function starts a coroutine that executes the specified function using arguments provided in an array. + * This function deletes the specified weak reference, releasing all associated resources. * * @param[in] env A pointer to the environment structure. - * @param[in] function The function to execute. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @param[in] args An array of arguments to pass to the function. + * @param[in] wref The weak reference to delete. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_LaunchFunction_A)(ani_env *env, ani_function function, ani_promise *result, - const ani_value *args); + ani_status (*WeakReference_Delete)(ani_env *env, ani_wref wref); /** - * @brief Launches a coroutine using a function with variadic arguments in a `va_list`. + * @brief Retrieves the local reference associated with a weak reference. * - * This function starts a coroutine that executes the specified function using arguments provided in a `va_list`. + * This function retrieves the local reference that corresponds to the specified weak reference. * * @param[in] env A pointer to the environment structure. - * @param[in] function The function to execute. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @param[in] args A `va_list` of arguments to pass to the function. + * @param[in] wref The weak reference to query. + * @param[out] was_released_result A pointer to boolean flag which indicates that wref is GC collected. + * @param[out] ref_result A pointer to store the retrieved local reference. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_LaunchFunction_V)(ani_env *env, ani_function function, ani_promise *result, va_list args); + ani_status (*WeakReference_GetReference)(ani_env *env, ani_wref wref, ani_boolean *was_released_result, + ani_ref *ref_result); /** - * @brief Launches a coroutine using an object method with variadic arguments. + * @brief Creates a new array buffer. * - * This function starts a coroutine that executes the specified method on the given object with the provided - * arguments. + * This function creates a new array buffer with the specified length and returns a pointer to the allocated data. * * @param[in] env A pointer to the environment structure. - * @param[in] self The object on which the method is to be executed. - * @param[in] function The method to execute. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @param[in] ... Variadic arguments to pass to the method. + * @param[in] length The length of the array buffer in bytes. + * @param[out] data_result A pointer to store the allocated data of the array buffer. + * @param[out] arraybuffer_result A pointer to store the created array buffer object. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_LaunchMethod)(ani_env *env, ani_object self, ani_function function, ani_promise *result, - ...); + ani_status (*CreateArrayBuffer)(ani_env *env, size_t length, void **data_result, + ani_arraybuffer *arraybuffer_result); /** - * @brief Launches a coroutine using an object method with array-based arguments. + * @brief Creates a new array buffer using external data. * - * This function starts a coroutine that executes the specified method on the given object using arguments provided - * in an array. + * This function creates an array buffer that uses external data. The provided finalizer will be called when the + * array buffer is no longer needed. * * @param[in] env A pointer to the environment structure. - * @param[in] self The object on which the method is to be executed. - * @param[in] function The method to execute. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @param[in] args An array of arguments to pass to the method. + * @param[in] external_data A pointer to the external data to be used by the array buffer. + * @param[in] length The length of the external data in bytes. + * @param[in] finalizer A callback function to be called when the array buffer is finalized. Can be nullptr. + * @param[in] hint A user-defined hint to be passed to the finalizer. Can be nullptr. + * @param[out] result A pointer to store the created array buffer object. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_LaunchMethod_A)(ani_env *env, ani_object self, ani_function function, ani_promise *result, - const ani_value *args); + ani_status (*CreateArrayBufferExternal)(ani_env *env, void *external_data, size_t length, ani_finalizer finalizer, + void *hint, ani_arraybuffer *result); /** - * @brief Launches a coroutine using an object method with variadic arguments in a `va_list`. + * @brief Retrieves information about an array buffer. * - * This function starts a coroutine that executes the specified method on the given object using arguments provided - * in a `va_list`. + * This function retrieves the data pointer and length of the specified array buffer. * * @param[in] env A pointer to the environment structure. - * @param[in] self The object on which the method is to be executed. - * @param[in] function The method to execute. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @param[in] args A `va_list` of arguments to pass to the method. + * @param[in] arraybuffer The array buffer to query. + * @param[out] data_result A pointer to store the data of the array buffer. + * @param[out] length_result A pointer to store the length of the array buffer in bytes. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_LaunchMethod_V)(ani_env *env, ani_object self, ani_function function, ani_promise *result, - va_list args); + ani_status (*ArrayBuffer_GetInfo)(ani_env *env, ani_arraybuffer arraybuffer, void **data_result, + size_t *length_result); /** - * @brief Launches a coroutine using a static method with variadic arguments. + * @brief Creates a new Promise. * - * This function starts a coroutine that executes the specified static method on the given class with the provided - * arguments. + * This function creates a new promise and a resolver to manage it. * * @param[in] env A pointer to the environment structure. - * @param[in] cls The class on which the static method is to be executed. - * @param[in] function The static method to execute. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @param[in] ... Variadic arguments to pass to the static method. + * @param[out] result_resolver A pointer to store the created resolver. + * @param[out] result_promise A pointer to store the created promise. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_LaunchStaticMethod)(ani_env *env, ani_class cls, ani_function function, ani_promise *result, - ...); + ani_status (*Promise_New)(ani_env *env, ani_resolver *result_resolver, ani_object *result_promise); /** - * @brief Launches a coroutine using a static method with array-based arguments. + * @brief Resolves a promise. * - * This function starts a coroutine that executes the specified static method on the given class using arguments - * provided in an array. + * This function resolves a promise by way of the resolver with which it is associated + * and queues promise `then` callbacks. * * @param[in] env A pointer to the environment structure. - * @param[in] cls The class on which the static method is to be executed. - * @param[in] function The static method to execute. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @param[in] args An array of arguments to pass to the static method. + * @param[in] resolver A resolver whose associated promise to resolve. + * @param[in] resolution A reference with which to resolve the promise. * @return Returns a status code of type `ani_status` indicating success or failure. + * The `resolver` is freed upon successful completion. */ - ani_status (*Coroutine_LaunchStaticMethod_A)(ani_env *env, ani_class cls, ani_function function, - ani_promise *result, const ani_value *args); + ani_status (*PromiseResolver_Resolve)(ani_env *env, ani_resolver resolver, ani_ref resolution); /** - * @brief Launches a coroutine using a static method with variadic arguments in a `va_list`. + * @brief Rejects a promise. * - * This function starts a coroutine that executes the specified static method on the given class using arguments - * provided in a `va_list`. + * This function rejects a promise by way of the resolver with which it is associated + * and queues promise `catch` callbacks. * * @param[in] env A pointer to the environment structure. - * @param[in] cls The class on which the static method is to be executed. - * @param[in] function The static method to execute. - * @param[out] result A pointer to store the promise representing the coroutine's result. - * @param[in] args A `va_list` of arguments to pass to the static method. + * @param[in] resolver A resolver whose associated promise to resolve. + * @param[in] rejection An error with which to reject the promise. * @return Returns a status code of type `ani_status` indicating success or failure. + * The `resolver` is freed upon successful completion. */ - ani_status (*Coroutine_LaunchStaticMethod_V)(ani_env *env, ani_class cls, ani_function function, - ani_promise *result, va_list args); + ani_status (*PromiseResolver_Reject)(ani_env *env, ani_resolver resolver, ani_error rejection); /** - * @brief Awaits the completion of a promise and retrieves a boolean result. + * @brief Creates a new fixedarray of booleans. * - * This function waits for the specified promise to complete and retrieves its result as a boolean value. + * This function creates a new array of the specified length for boolean values. * * @param[in] env A pointer to the environment structure. - * @param[in] promise The promise to await. - * @param[out] value A pointer to store the boolean result of the promise. + * @param[in] length The length of the fixedarray to be created. + * @param[out] result A pointer to store the created FixedArray. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_Await_Boolean)(ani_env *env, ani_promise promise, ani_boolean value); + ani_status (*FixedArray_New_Boolean)(ani_env *env, ani_size length, ani_array_boolean *result); /** - * @brief Awaits the completion of a promise and retrieves a char result. + * @brief Creates a new FixedArray of characters. * - * This function waits for the specified promise to complete and retrieves its result as a char value. + * This function creates a new FixedArray of the specified length for character values. * * @param[in] env A pointer to the environment structure. - * @param[in] promise The promise to await. - * @param[out] value A pointer to store the char result of the promise. + * @param[in] length The length of the FixedArray to be created. + * @param[out] result A pointer to store the created FixedArray. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_Await_Char)(ani_env *env, ani_promise promise, ani_char value); + ani_status (*FixedArray_New_Char)(ani_env *env, ani_size length, ani_array_char *result); /** - * @brief Awaits the completion of a promise and retrieves a byte result. + * @brief Creates a new FixedArray of bytes. * - * This function waits for the specified promise to complete and retrieves its result as a byte value. + * This function creates a new FixedArray of the specified length for byte values. * * @param[in] env A pointer to the environment structure. - * @param[in] promise The promise to await. - * @param[out] value A pointer to store the byte result of the promise. + * @param[in] length The length of the FixedArray to be created. + * @param[out] result A pointer to store the created FixedArray. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_Await_Byte)(ani_env *env, ani_promise promise, ani_byte value); + ani_status (*FixedArray_New_Byte)(ani_env *env, ani_size length, ani_array_byte *result); /** - * @brief Awaits the completion of a promise and retrieves a short result. + * @brief Creates a new FixedArray of shorts. * - * This function waits for the specified promise to complete and retrieves its result as a short value. + * This function creates a new FixedArray of the specified length for short integer values. * * @param[in] env A pointer to the environment structure. - * @param[in] promise The promise to await. - * @param[out] value A pointer to store the short result of the promise. + * @param[in] length The length of the FixedArray to be created. + * @param[out] result A pointer to store the created FixedArray. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_Await_Short)(ani_env *env, ani_promise promise, ani_short value); + ani_status (*FixedArray_New_Short)(ani_env *env, ani_size length, ani_array_short *result); /** - * @brief Awaits the completion of a promise and retrieves a integer result. + * @brief Creates a new FixedArray of integers. * - * This function waits for the specified promise to complete and retrieves its result as a integer value. + * This function creates a new FixedArray of the specified length for integer values. * * @param[in] env A pointer to the environment structure. - * @param[in] promise The promise to await. - * @param[out] value A pointer to store the integer result of the promise. + * @param[in] length The length of the FixedArray to be created. + * @param[out] result A pointer to store the created FixedArray. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_Await_Int)(ani_env *env, ani_promise promise, ani_int value); + ani_status (*FixedArray_New_Int)(ani_env *env, ani_size length, ani_array_int *result); /** - * @brief Awaits the completion of a promise and retrieves a long result. + * @brief Creates a new FixedArray of long integers. * - * This function waits for the specified promise to complete and retrieves its result as a long value. + * This function creates a new FixedArray of the specified length for long integer values. * * @param[in] env A pointer to the environment structure. - * @param[in] promise The promise to await. - * @param[out] value A pointer to store the long result of the promise. + * @param[in] length The length of the FixedArray to be created. + * @param[out] result A pointer to store the created FixedArray. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_Await_Long)(ani_env *env, ani_promise promise, ani_long value); + ani_status (*FixedArray_New_Long)(ani_env *env, ani_size length, ani_array_long *result); /** - * @brief Awaits the completion of a promise and retrieves a float result. + * @brief Creates a new FixedArray of floats. * - * This function waits for the specified promise to complete and retrieves its result as a float value. + * This function creates a new FixedArray of the specified length for float values. * * @param[in] env A pointer to the environment structure. - * @param[in] promise The promise to await. - * @param[out] value A pointer to store the float result of the promise. + * @param[in] length The length of the FixedArray to be created. + * @param[out] result A pointer to store the created FixedArray. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_Await_Float)(ani_env *env, ani_promise promise, ani_float value); + ani_status (*FixedArray_New_Float)(ani_env *env, ani_size length, ani_array_float *result); /** - * @brief Awaits the completion of a promise and retrieves a double result. + * @brief Creates a new FixedArray of doubles. * - * This function waits for the specified promise to complete and retrieves its result as a double value. + * This function creates a new FixedArray of the specified length for double values. * * @param[in] env A pointer to the environment structure. - * @param[in] promise The promise to await. - * @param[out] value A pointer to store the double result of the promise. + * @param[in] length The length of the FixedArray to be created. + * @param[out] result A pointer to store the created FixedArray. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_Await_Double)(ani_env *env, ani_promise promise, ani_double value); + ani_status (*FixedArray_New_Double)(ani_env *env, ani_size length, ani_array_double *result); /** - * @brief Awaits the completion of a promise and retrieves a reference result. + * @brief Creates a new FixedArray of references. * - * This function waits for the specified promise to complete and retrieves its result as a reference. + * This function creates a new FixedArray of references, optionally initializing it with an FixedArray of + * references. * * @param[in] env A pointer to the environment structure. - * @param[in] promise The promise to await. - * @param[out] value A pointer to store the reference result of the promise. + * @param[in] type The type of the elements of the FixedArray. + * @param[in] length The length of the FixedArray to be created. + * @param[in] initial_element An optional reference to initialize the FixedArray. Can be null. + * @param[out] result A pointer to store the created FixedArray of references. * @return Returns a status code of type `ani_status` indicating success or failure. */ - ani_status (*Coroutine_Await_Ref)(ani_env *env, ani_promise promise, ani_ref value); + ani_status (*FixedArray_New_Ref)(ani_env *env, ani_type type, ani_size length, ani_ref initial_element, + ani_array_ref *result); }; // C++ API @@ -6823,15 +5746,15 @@ struct __ani_vm { { return c_api->GetEnv(this, version, result); } - ani_status AttachThread(void *params, ani_env **result) + ani_status AttachCurrentThread(const ani_options *options, uint32_t version, ani_env **result) { - return c_api->AttachThread(this, params, result); + return c_api->AttachCurrentThread(this, options, version, result); } - ani_status DetachThread() + ani_status DetachCurrentThread() { - return c_api->DetachThread(this); + return c_api->DetachCurrentThread(this); } -#endif // __cplusplus +#endif // __cplusplus }; struct __ani_env { @@ -6846,70 +5769,6 @@ struct __ani_env { { return c_api->GetVM(this, result); } - ani_status Reference_IsObject(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsObject(this, ref, result); - } - ani_status Reference_IsFunctionalObject(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFunctionalObject(this, ref, result); - } - ani_status Reference_IsEnum(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsEnum(this, ref, result); - } - ani_status Reference_IsTuple(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsTuple(this, ref, result); - } - ani_status Reference_IsString(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsString(this, ref, result); - } - ani_status Reference_IsStringLiteral(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsStringLiteral(this, ref, result); - } - ani_status Reference_IsFixedArray(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray(this, ref, result); - } - ani_status Reference_IsFixedArray_Boolean(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray_Boolean(this, ref, result); - } - ani_status Reference_IsFixedArray_Char(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray_Char(this, ref, result); - } - ani_status Reference_IsFixedArray_Byte(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray_Byte(this, ref, result); - } - ani_status Reference_IsFixedArray_Short(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray_Short(this, ref, result); - } - ani_status Reference_IsFixedArray_Int(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray_Int(this, ref, result); - } - ani_status Reference_IsFixedArray_Long(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray_Long(this, ref, result); - } - ani_status Reference_IsFixedArray_Float(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray_Float(this, ref, result); - } - ani_status Reference_IsFixedArray_Double(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray_Double(this, ref, result); - } - ani_status Reference_IsFixedArray_Ref(ani_ref ref, ani_boolean *result) - { - return c_api->Reference_IsFixedArray_Ref(this, ref, result); - } ani_status Object_New(ani_class cls, ani_method method, ani_object *result, ...) { va_list args; @@ -6934,10 +5793,6 @@ struct __ani_env { { return c_api->Object_InstanceOf(this, object, type, result); } - ani_status Object_IsSame(ani_object object1, ani_object object2, ani_boolean *result) - { - return c_api->Object_IsSame(this, object1, object2, result); - } ani_status Type_GetSuperClass(ani_type type, ani_class *result) { return c_api->Type_GetSuperClass(this, type, result); @@ -6962,18 +5817,6 @@ struct __ani_env { { return c_api->FindEnum(this, enum_descriptor, result); } - ani_status FindTuple(const char *tuple_descriptor, ani_tuple *result) - { - return c_api->FindTuple(this, tuple_descriptor, result); - } - ani_status FindFunction(const char *function_descriptor, ani_function *result) - { - return c_api->FindFunction(this, function_descriptor, result); - } - ani_status FindVariable(const char *variable_descriptor, ani_variable *result) - { - return c_api->FindVariable(this, variable_descriptor, result); - } ani_status Module_FindNamespace(ani_module module, const char *namespace_descriptor, ani_namespace *result) { return c_api->Module_FindNamespace(this, module, namespace_descriptor, result); @@ -6990,9 +5833,9 @@ struct __ani_env { { return c_api->Module_FindFunction(this, module, name, signature, result); } - ani_status Module_FindVariable(ani_module module, const char *variable_descriptor, ani_variable *result) + ani_status Module_FindVariable(ani_module module, const char *name, ani_variable *result) { - return c_api->Module_FindVariable(this, module, variable_descriptor, result); + return c_api->Module_FindVariable(this, module, name, result); } ani_status Namespace_FindNamespace(ani_namespace ns, const char *namespace_descriptor, ani_namespace *result) { @@ -7010,9 +5853,9 @@ struct __ani_env { { return c_api->Namespace_FindFunction(this, ns, name, signature, result); } - ani_status Namespace_FindVariable(ani_namespace ns, const char *variable_descriptor, ani_variable *result) + ani_status Namespace_FindVariable(ani_namespace ns, const char *name, ani_variable *result) { - return c_api->Namespace_FindVariable(this, ns, variable_descriptor, result); + return c_api->Namespace_FindVariable(this, ns, name, result); } ani_status Module_BindNativeFunctions(ani_module module, const ani_native_function *functions, ani_size nr_functions) @@ -7140,222 +5983,154 @@ struct __ani_env { return c_api->String_GetUTF8SubString(this, string, substr_offset, substr_size, utf8_buffer, utf8_buffer_size, result); } - ani_status String_GetCritical(ani_string string, uint32_t *result_string_type, const void **result_data, - ani_size *result_size) // result_string_type - string type utf16/utf8, etc - { - return c_api->String_GetCritical(this, string, result_string_type, result_data, result_size); - } - ani_status String_ReleaseCritical(ani_string string, const void *data) - { - return c_api->String_ReleaseCritical(this, string, data); - } - ani_status StringLiteral_NewUTF16(const uint16_t *utf16_string, ani_size utf16_size, ani_stringliteral *result) - { - return c_api->StringLiteral_NewUTF16(this, utf16_string, utf16_size, result); - } - ani_status StringLiteral_GetUTF16Size(ani_stringliteral string, ani_size *result) - { - return c_api->StringLiteral_GetUTF16Size(this, string, result); - } - ani_status StringLiteral_GetUTF16(ani_stringliteral string, uint16_t *utf16_buffer, ani_size utf16_buffer_size, - ani_size *result) - { - return c_api->StringLiteral_GetUTF16(this, string, utf16_buffer, utf16_buffer_size, result); - } - ani_status StringLiteral_GetUTF16SubString(ani_stringliteral string, ani_size substr_offset, ani_size substr_size, - uint16_t *utf16_buffer, ani_size utf16_buffer_size, ani_size *result) - { - return c_api->StringLiteral_GetUTF16SubString(this, string, substr_offset, substr_size, utf16_buffer, - utf16_buffer_size, result); - } - ani_status StringLiteral_NewUTF8(const char *utf8_string, ani_size utf8_size, ani_stringliteral *result) - { - return c_api->StringLiteral_NewUTF8(this, utf8_string, utf8_size, result); - } - ani_status StringLiteral_GetUTF8Size(ani_stringliteral string, ani_size *result) + ani_status Array_GetLength(ani_array array, ani_size *result) { - return c_api->StringLiteral_GetUTF8Size(this, string, result); + return c_api->Array_GetLength(this, array, result); } - ani_status StringLiteral_GetUTF8(ani_stringliteral string, char *utf8_buffer, ani_size utf8_buffer_size, - ani_size *result) + ani_status Array_New_Boolean(ani_size length, ani_array_boolean *result) { - return c_api->StringLiteral_GetUTF8(this, string, utf8_buffer, utf8_buffer_size, result); + return c_api->Array_New_Boolean(this, length, result); } - ani_status StringLiteral_GetUTF8SubString(ani_stringliteral string, ani_size substr_offset, ani_size substr_size, - char *utf8_buffer, ani_size utf8_buffer_size, ani_size *result) + ani_status Array_New_Char(ani_size length, ani_array_char *result) { - return c_api->StringLiteral_GetUTF8SubString(this, string, substr_offset, substr_size, utf8_buffer, - utf8_buffer_size, result); + return c_api->Array_New_Char(this, length, result); } - ani_status StringLiteral_GetCritical(ani_stringliteral string, uint32_t *result_string_type, - const void **result_data, - ani_size *result_size) // result_string_type - string type utf16/utf8, etc + ani_status Array_New_Byte(ani_size length, ani_array_byte *result) { - return c_api->StringLiteral_GetCritical(this, string, result_string_type, result_data, result_size); + return c_api->Array_New_Byte(this, length, result); } - ani_status StringLiteral_ReleaseCritical(ani_stringliteral string, const void *data) + ani_status Array_New_Short(ani_size length, ani_array_short *result) { - return c_api->StringLiteral_ReleaseCritical(this, string, data); + return c_api->Array_New_Short(this, length, result); } - ani_status FixedArray_GetLength(ani_fixedarray array, ani_size *result) + ani_status Array_New_Int(ani_size length, ani_array_int *result) { - return c_api->FixedArray_GetLength(this, array, result); + return c_api->Array_New_Int(this, length, result); } - ani_status FixedArray_New_Boolean(ani_size length, ani_fixedarray_boolean *result) + ani_status Array_New_Long(ani_size length, ani_array_long *result) { - return c_api->FixedArray_New_Boolean(this, length, result); - } - ani_status FixedArray_New_Char(ani_size length, ani_fixedarray_char *result) - { - return c_api->FixedArray_New_Char(this, length, result); - } - ani_status FixedArray_New_Byte(ani_size length, ani_fixedarray_byte *result) - { - return c_api->FixedArray_New_Byte(this, length, result); - } - ani_status FixedArray_New_Short(ani_size length, ani_fixedarray_short *result) - { - return c_api->FixedArray_New_Short(this, length, result); - } - ani_status FixedArray_New_Int(ani_size length, ani_fixedarray_int *result) - { - return c_api->FixedArray_New_Int(this, length, result); - } - ani_status FixedArray_New_Long(ani_size length, ani_fixedarray_long *result) - { - return c_api->FixedArray_New_Long(this, length, result); + return c_api->Array_New_Long(this, length, result); } - ani_status FixedArray_New_Float(ani_size length, ani_fixedarray_float *result) + ani_status Array_New_Float(ani_size length, ani_array_float *result) { - return c_api->FixedArray_New_Float(this, length, result); - } - ani_status FixedArray_New_Double(ani_size length, ani_fixedarray_double *result) - { - return c_api->FixedArray_New_Double(this, length, result); + return c_api->Array_New_Float(this, length, result); } - ani_status FixedArray_GetRegion_Boolean(ani_fixedarray_boolean array, ani_size offset, ani_size length, - ani_boolean *native_buffer) + ani_status Array_New_Double(ani_size length, ani_array_double *result) { - return c_api->FixedArray_GetRegion_Boolean(this, array, offset, length, native_buffer); + return c_api->Array_New_Double(this, length, result); } - ani_status FixedArray_GetRegion_Char(ani_fixedarray_char array, ani_size offset, ani_size length, - ani_char *native_buffer) + ani_status Array_GetRegion_Boolean(ani_array_boolean array, ani_size offset, ani_size length, + ani_boolean *native_buffer) { - return c_api->FixedArray_GetRegion_Char(this, array, offset, length, native_buffer); + return c_api->Array_GetRegion_Boolean(this, array, offset, length, native_buffer); } - ani_status FixedArray_GetRegion_Byte(ani_fixedarray_byte array, ani_size offset, ani_size length, - ani_byte *native_buffer) + ani_status Array_GetRegion_Char(ani_array_char array, ani_size offset, ani_size length, ani_char *native_buffer) { - return c_api->FixedArray_GetRegion_Byte(this, array, offset, length, native_buffer); + return c_api->Array_GetRegion_Char(this, array, offset, length, native_buffer); } - ani_status FixedArray_GetRegion_Short(ani_fixedarray_short array, ani_size offset, ani_size length, - ani_short *native_buffer) + ani_status Array_GetRegion_Byte(ani_array_byte array, ani_size offset, ani_size length, ani_byte *native_buffer) { - return c_api->FixedArray_GetRegion_Short(this, array, offset, length, native_buffer); + return c_api->Array_GetRegion_Byte(this, array, offset, length, native_buffer); } - ani_status FixedArray_GetRegion_Int(ani_fixedarray_int array, ani_size offset, ani_size length, - ani_int *native_buffer) + ani_status Array_GetRegion_Short(ani_array_short array, ani_size offset, ani_size length, ani_short *native_buffer) { - return c_api->FixedArray_GetRegion_Int(this, array, offset, length, native_buffer); + return c_api->Array_GetRegion_Short(this, array, offset, length, native_buffer); } - ani_status FixedArray_GetRegion_Long(ani_fixedarray_long array, ani_size offset, ani_size length, - ani_long *native_buffer) + ani_status Array_GetRegion_Int(ani_array_int array, ani_size offset, ani_size length, ani_int *native_buffer) { - return c_api->FixedArray_GetRegion_Long(this, array, offset, length, native_buffer); + return c_api->Array_GetRegion_Int(this, array, offset, length, native_buffer); } - ani_status FixedArray_GetRegion_Float(ani_fixedarray_float array, ani_size offset, ani_size length, - ani_float *native_buffer) + ani_status Array_GetRegion_Long(ani_array_long array, ani_size offset, ani_size length, ani_long *native_buffer) { - return c_api->FixedArray_GetRegion_Float(this, array, offset, length, native_buffer); + return c_api->Array_GetRegion_Long(this, array, offset, length, native_buffer); } - ani_status FixedArray_GetRegion_Double(ani_fixedarray_double array, ani_size offset, ani_size length, - ani_double *native_buffer) + ani_status Array_GetRegion_Float(ani_array_float array, ani_size offset, ani_size length, ani_float *native_buffer) { - return c_api->FixedArray_GetRegion_Double(this, array, offset, length, native_buffer); + return c_api->Array_GetRegion_Float(this, array, offset, length, native_buffer); } - ani_status FixedArray_SetRegion_Boolean(ani_fixedarray_boolean array, ani_size offset, ani_size length, - const ani_boolean *native_buffer) + ani_status Array_GetRegion_Double(ani_array_double array, ani_size offset, ani_size length, + ani_double *native_buffer) { - return c_api->FixedArray_SetRegion_Boolean(this, array, offset, length, native_buffer); + return c_api->Array_GetRegion_Double(this, array, offset, length, native_buffer); } - ani_status FixedArray_SetRegion_Char(ani_fixedarray_char array, ani_size offset, ani_size length, - const ani_char *native_buffer) + ani_status Array_SetRegion_Boolean(ani_array_boolean array, ani_size offset, ani_size length, + const ani_boolean *native_buffer) { - return c_api->FixedArray_SetRegion_Char(this, array, offset, length, native_buffer); + return c_api->Array_SetRegion_Boolean(this, array, offset, length, native_buffer); } - ani_status FixedArray_SetRegion_Byte(ani_fixedarray_byte array, ani_size offset, ani_size length, - const ani_byte *native_buffer) + ani_status Array_SetRegion_Char(ani_array_char array, ani_size offset, ani_size length, + const ani_char *native_buffer) { - return c_api->FixedArray_SetRegion_Byte(this, array, offset, length, native_buffer); + return c_api->Array_SetRegion_Char(this, array, offset, length, native_buffer); } - ani_status FixedArray_SetRegion_Short(ani_fixedarray_short array, ani_size offset, ani_size length, - const ani_short *native_buffer) + ani_status Array_SetRegion_Byte(ani_array_byte array, ani_size offset, ani_size length, + const ani_byte *native_buffer) { - return c_api->FixedArray_SetRegion_Short(this, array, offset, length, native_buffer); + return c_api->Array_SetRegion_Byte(this, array, offset, length, native_buffer); } - ani_status FixedArray_SetRegion_Int(ani_fixedarray_int array, ani_size offset, ani_size length, - const ani_int *native_buffer) + ani_status Array_SetRegion_Short(ani_array_short array, ani_size offset, ani_size length, + const ani_short *native_buffer) { - return c_api->FixedArray_SetRegion_Int(this, array, offset, length, native_buffer); + return c_api->Array_SetRegion_Short(this, array, offset, length, native_buffer); } - ani_status FixedArray_SetRegion_Long(ani_fixedarray_long array, ani_size offset, ani_size length, - const ani_long *native_buffer) + ani_status Array_SetRegion_Int(ani_array_int array, ani_size offset, ani_size length, const ani_int *native_buffer) { - return c_api->FixedArray_SetRegion_Long(this, array, offset, length, native_buffer); + return c_api->Array_SetRegion_Int(this, array, offset, length, native_buffer); } - ani_status FixedArray_SetRegion_Float(ani_fixedarray_float array, ani_size offset, ani_size length, - const ani_float *native_buffer) + ani_status Array_SetRegion_Long(ani_array_long array, ani_size offset, ani_size length, + const ani_long *native_buffer) { - return c_api->FixedArray_SetRegion_Float(this, array, offset, length, native_buffer); + return c_api->Array_SetRegion_Long(this, array, offset, length, native_buffer); } - ani_status FixedArray_SetRegion_Double(ani_fixedarray_double array, ani_size offset, ani_size length, - const ani_double *native_buffer) + ani_status Array_SetRegion_Float(ani_array_float array, ani_size offset, ani_size length, + const ani_float *native_buffer) { - return c_api->FixedArray_SetRegion_Double(this, array, offset, length, native_buffer); + return c_api->Array_SetRegion_Float(this, array, offset, length, native_buffer); } - ani_status FixedArray_Pin(ani_fixedarray primitive_array, void **result) + ani_status Array_SetRegion_Double(ani_array_double array, ani_size offset, ani_size length, + const ani_double *native_buffer) { - return c_api->FixedArray_Pin(this, primitive_array, result); + return c_api->Array_SetRegion_Double(this, array, offset, length, native_buffer); } - ani_status FixedArray_Unpin(ani_fixedarray primitive_array, void *data) + ani_status Array_New_Ref(ani_type type, ani_size length, ani_ref initial_element, ani_array_ref *result) { - return c_api->FixedArray_Unpin(this, primitive_array, data); + return c_api->Array_New_Ref(this, type, length, initial_element, result); } - ani_status FixedArray_New_Ref(ani_size length, ani_ref *initial_array, ani_fixedarray_ref *result) + ani_status Array_Set_Ref(ani_array_ref array, ani_size index, ani_ref ref) { - return c_api->FixedArray_New_Ref(this, length, initial_array, result); + return c_api->Array_Set_Ref(this, array, index, ref); } - ani_status FixedArray_Set_Ref(ani_fixedarray_ref array, ani_size index, ani_ref ref) + ani_status Array_Get_Ref(ani_array_ref array, ani_size index, ani_ref *result) { - return c_api->FixedArray_Set_Ref(this, array, index, ref); + return c_api->Array_Get_Ref(this, array, index, result); } - ani_status FixedArray_Get_Ref(ani_fixedarray_ref array, ani_size index, ani_ref *result) + ani_status Enum_GetEnumItemByName(ani_enum enm, const char *name, ani_enum_item *result) { - return c_api->FixedArray_Get_Ref(this, array, index, result); + return c_api->Enum_GetEnumItemByName(this, enm, name, result); } - ani_status Enum_GetEnumValueByName(ani_enum enm, const char *name, ani_enum_value *result) + ani_status Enum_GetEnumItemByIndex(ani_enum enm, ani_size index, ani_enum_item *result) { - return c_api->Enum_GetEnumValueByName(this, enm, name, result); + return c_api->Enum_GetEnumItemByIndex(this, enm, index, result); } - ani_status Enum_GetEnumValueByIndex(ani_enum enm, ani_size index, ani_enum_value *result) + ani_status EnumItem_GetEnum(ani_enum_item enum_item, ani_enum *result) { - return c_api->Enum_GetEnumValueByIndex(this, enm, index, result); + return c_api->EnumItem_GetEnum(this, enum_item, result); } - ani_status EnumValue_GetEnum(ani_enum_value enum_value, ani_enum *result) + ani_status EnumItem_GetValue_Int(ani_enum_item enum_item, ani_int *result) { - return c_api->EnumValue_GetEnum(this, enum_value, result); + return c_api->EnumItem_GetValue_Int(this, enum_item, result); } - ani_status EnumValue_GetValue(ani_enum_value enum_value, ani_object *result) + ani_status EnumItem_GetValue_String(ani_enum_item enum_item, ani_string *result) { - return c_api->EnumValue_GetValue(this, enum_value, result); + return c_api->EnumItem_GetValue_String(this, enum_item, result); } - ani_status EnumValue_GetName(ani_enum_value enum_value, ani_string *result) + ani_status EnumItem_GetName(ani_enum_item enum_item, ani_string *result) { - return c_api->EnumValue_GetName(this, enum_value, result); + return c_api->EnumItem_GetName(this, enum_item, result); } - ani_status EnumValue_GetIndex(ani_enum_value enum_value, ani_size *result) + ani_status EnumItem_GetIndex(ani_enum_item enum_item, ani_size *result) { - return c_api->EnumValue_GetIndex(this, enum_value, result); + return c_api->EnumItem_GetIndex(this, enum_item, result); } ani_status FunctionalObject_Call(ani_fn_object fn, ani_size argc, ani_ref *argv, ani_ref *result) { @@ -7593,53 +6368,21 @@ struct __ani_env { { return c_api->Function_Call_Void_V(this, fn, args); } - ani_status Class_GetPartial(ani_class cls, ani_class *result) - { - return c_api->Class_GetPartial(this, cls, result); - } - ani_status Class_GetRequired(ani_class cls, ani_class *result) - { - return c_api->Class_GetRequired(this, cls, result); - } - ani_status Class_GetField(ani_class cls, const char *name, ani_field *result) - { - return c_api->Class_GetField(this, cls, name, result); - } - ani_status Class_GetStaticField(ani_class cls, const char *name, ani_static_field *result) - { - return c_api->Class_GetStaticField(this, cls, name, result); - } - ani_status Class_GetMethod(ani_class cls, const char *name, const char *signature, ani_method *result) - { - return c_api->Class_GetMethod(this, cls, name, signature, result); - } - ani_status Class_GetStaticMethod(ani_class cls, const char *name, const char *signature, ani_static_method *result) - { - return c_api->Class_GetStaticMethod(this, cls, name, signature, result); - } - ani_status Class_GetProperty(ani_class cls, const char *name, ani_property *result) + ani_status Class_FindField(ani_class cls, const char *name, ani_field *result) { - return c_api->Class_GetProperty(this, cls, name, result); + return c_api->Class_FindField(this, cls, name, result); } - ani_status Class_GetSetter(ani_class cls, const char *name, ani_method *result) + ani_status Class_FindStaticField(ani_class cls, const char *name, ani_static_field *result) { - return c_api->Class_GetSetter(this, cls, name, result); + return c_api->Class_FindStaticField(this, cls, name, result); } - ani_status Class_GetGetter(ani_class cls, const char *name, ani_method *result) + ani_status Class_FindMethod(ani_class cls, const char *name, const char *signature, ani_method *result) { - return c_api->Class_GetGetter(this, cls, name, result); + return c_api->Class_FindMethod(this, cls, name, signature, result); } - ani_status Class_GetIndexableGetter(ani_class cls, const char *signature, ani_method *result) + ani_status Class_FindStaticMethod(ani_class cls, const char *name, const char *signature, ani_static_method *result) { - return c_api->Class_GetIndexableGetter(this, cls, signature, result); - } - ani_status Class_GetIndexableSetter(ani_class cls, const char *signature, ani_method *result) - { - return c_api->Class_GetIndexableSetter(this, cls, signature, result); - } - ani_status Class_GetIterator(ani_class cls, ani_method *result) - { - return c_api->Class_GetIterator(this, cls, result); + return c_api->Class_FindStaticMethod(this, cls, name, signature, result); } ani_status Class_GetStaticField_Boolean(ani_class cls, ani_static_field field, ani_boolean *result) { @@ -7956,175 +6699,193 @@ struct __ani_env { { return c_api->Class_CallStaticMethod_Void_V(this, cls, method, args); } - ani_status Class_CallStaticMethodByName_Boolean(ani_class cls, const char *name, ani_boolean *result, ...) + ani_status Class_CallStaticMethodByName_Boolean(ani_class cls, const char *name, const char *signature, + ani_boolean *result, ...) { va_list args; va_start(args, result); - ani_status status = c_api->Class_CallStaticMethodByName_Boolean_V(this, cls, name, result, args); + ani_status status = c_api->Class_CallStaticMethodByName_Boolean_V(this, cls, name, signature, result, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Boolean_A(ani_class cls, const char *name, ani_boolean *result, - const ani_value *args) + ani_status Class_CallStaticMethodByName_Boolean_A(ani_class cls, const char *name, const char *signature, + ani_boolean *result, const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Boolean_A(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Boolean_A(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Boolean_V(ani_class cls, const char *name, ani_boolean *result, - va_list args) + ani_status Class_CallStaticMethodByName_Boolean_V(ani_class cls, const char *name, const char *signature, + ani_boolean *result, va_list args) { - return c_api->Class_CallStaticMethodByName_Boolean_V(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Boolean_V(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Char(ani_class cls, const char *name, ani_char *result, ...) + ani_status Class_CallStaticMethodByName_Char(ani_class cls, const char *name, const char *signature, + ani_char *result, ...) { va_list args; va_start(args, result); - ani_status status = c_api->Class_CallStaticMethodByName_Char_V(this, cls, name, result, args); + ani_status status = c_api->Class_CallStaticMethodByName_Char_V(this, cls, name, signature, result, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Char_A(ani_class cls, const char *name, ani_char *result, - const ani_value *args) + ani_status Class_CallStaticMethodByName_Char_A(ani_class cls, const char *name, const char *signature, + ani_char *result, const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Char_A(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Char_A(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Char_V(ani_class cls, const char *name, ani_char *result, va_list args) + ani_status Class_CallStaticMethodByName_Char_V(ani_class cls, const char *name, const char *signature, + ani_char *result, va_list args) { - return c_api->Class_CallStaticMethodByName_Char_V(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Char_V(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Byte(ani_class cls, const char *name, ani_byte *result, ...) + ani_status Class_CallStaticMethodByName_Byte(ani_class cls, const char *name, const char *signature, + ani_byte *result, ...) { va_list args; va_start(args, result); - ani_status status = c_api->Class_CallStaticMethodByName_Byte_V(this, cls, name, result, args); + ani_status status = c_api->Class_CallStaticMethodByName_Byte_V(this, cls, name, signature, result, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Byte_A(ani_class cls, const char *name, ani_byte *result, - const ani_value *args) + ani_status Class_CallStaticMethodByName_Byte_A(ani_class cls, const char *name, const char *signature, + ani_byte *result, const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Byte_A(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Byte_A(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Byte_V(ani_class cls, const char *name, ani_byte *result, va_list args) + ani_status Class_CallStaticMethodByName_Byte_V(ani_class cls, const char *name, const char *signature, + ani_byte *result, va_list args) { - return c_api->Class_CallStaticMethodByName_Byte_V(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Byte_V(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Short(ani_class cls, const char *name, ani_short *result, ...) + ani_status Class_CallStaticMethodByName_Short(ani_class cls, const char *name, const char *signature, + ani_short *result, ...) { va_list args; va_start(args, result); - ani_status status = c_api->Class_CallStaticMethodByName_Short_V(this, cls, name, result, args); + ani_status status = c_api->Class_CallStaticMethodByName_Short_V(this, cls, name, signature, result, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Short_A(ani_class cls, const char *name, ani_short *result, - const ani_value *args) + ani_status Class_CallStaticMethodByName_Short_A(ani_class cls, const char *name, const char *signature, + ani_short *result, const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Short_A(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Short_A(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Short_V(ani_class cls, const char *name, ani_short *result, va_list args) + ani_status Class_CallStaticMethodByName_Short_V(ani_class cls, const char *name, const char *signature, + ani_short *result, va_list args) { - return c_api->Class_CallStaticMethodByName_Short_V(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Short_V(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Int(ani_class cls, const char *name, ani_int *result, ...) + ani_status Class_CallStaticMethodByName_Int(ani_class cls, const char *name, const char *signature, ani_int *result, + ...) { va_list args; va_start(args, result); - ani_status status = c_api->Class_CallStaticMethodByName_Int_V(this, cls, name, result, args); + ani_status status = c_api->Class_CallStaticMethodByName_Int_V(this, cls, name, signature, result, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Int_A(ani_class cls, const char *name, ani_int *result, - const ani_value *args) + ani_status Class_CallStaticMethodByName_Int_A(ani_class cls, const char *name, const char *signature, + ani_int *result, const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Int_A(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Int_A(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Int_V(ani_class cls, const char *name, ani_int *result, va_list args) + ani_status Class_CallStaticMethodByName_Int_V(ani_class cls, const char *name, const char *signature, + ani_int *result, va_list args) { - return c_api->Class_CallStaticMethodByName_Int_V(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Int_V(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Long(ani_class cls, const char *name, ani_long *result, ...) + ani_status Class_CallStaticMethodByName_Long(ani_class cls, const char *name, const char *signature, + ani_long *result, ...) { va_list args; va_start(args, result); - ani_status status = c_api->Class_CallStaticMethodByName_Long_V(this, cls, name, result, args); + ani_status status = c_api->Class_CallStaticMethodByName_Long_V(this, cls, name, signature, result, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Long_A(ani_class cls, const char *name, ani_long *result, - const ani_value *args) + ani_status Class_CallStaticMethodByName_Long_A(ani_class cls, const char *name, const char *signature, + ani_long *result, const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Long_A(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Long_A(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Long_V(ani_class cls, const char *name, ani_long *result, va_list args) + ani_status Class_CallStaticMethodByName_Long_V(ani_class cls, const char *name, const char *signature, + ani_long *result, va_list args) { - return c_api->Class_CallStaticMethodByName_Long_V(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Long_V(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Float(ani_class cls, const char *name, ani_float *result, ...) + ani_status Class_CallStaticMethodByName_Float(ani_class cls, const char *name, const char *signature, + ani_float *result, ...) { va_list args; va_start(args, result); - ani_status status = c_api->Class_CallStaticMethodByName_Float_V(this, cls, name, result, args); + ani_status status = c_api->Class_CallStaticMethodByName_Float_V(this, cls, name, signature, result, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Float_A(ani_class cls, const char *name, ani_float *result, - const ani_value *args) + ani_status Class_CallStaticMethodByName_Float_A(ani_class cls, const char *name, const char *signature, + ani_float *result, const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Float_A(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Float_A(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Float_V(ani_class cls, const char *name, ani_float *result, va_list args) + ani_status Class_CallStaticMethodByName_Float_V(ani_class cls, const char *name, const char *signature, + ani_float *result, va_list args) { - return c_api->Class_CallStaticMethodByName_Float_V(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Float_V(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Double(ani_class cls, const char *name, ani_double *result, ...) + ani_status Class_CallStaticMethodByName_Double(ani_class cls, const char *name, const char *signature, + ani_double *result, ...) { va_list args; va_start(args, result); - ani_status status = c_api->Class_CallStaticMethodByName_Double_V(this, cls, name, result, args); + ani_status status = c_api->Class_CallStaticMethodByName_Double_V(this, cls, name, signature, result, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Double_A(ani_class cls, const char *name, ani_double *result, - const ani_value *args) + ani_status Class_CallStaticMethodByName_Double_A(ani_class cls, const char *name, const char *signature, + ani_double *result, const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Double_A(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Double_A(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Double_V(ani_class cls, const char *name, ani_double *result, va_list args) + ani_status Class_CallStaticMethodByName_Double_V(ani_class cls, const char *name, const char *signature, + ani_double *result, va_list args) { - return c_api->Class_CallStaticMethodByName_Double_V(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Double_V(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Ref(ani_class cls, const char *name, ani_ref *result, ...) + ani_status Class_CallStaticMethodByName_Ref(ani_class cls, const char *name, const char *signature, ani_ref *result, + ...) { va_list args; va_start(args, result); - ani_status status = c_api->Class_CallStaticMethodByName_Ref_V(this, cls, name, result, args); + ani_status status = c_api->Class_CallStaticMethodByName_Ref_V(this, cls, name, signature, result, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Ref_A(ani_class cls, const char *name, ani_ref *result, - const ani_value *args) + ani_status Class_CallStaticMethodByName_Ref_A(ani_class cls, const char *name, const char *signature, + ani_ref *result, const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Ref_A(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Ref_A(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Ref_V(ani_class cls, const char *name, ani_ref *result, va_list args) + ani_status Class_CallStaticMethodByName_Ref_V(ani_class cls, const char *name, const char *signature, + ani_ref *result, va_list args) { - return c_api->Class_CallStaticMethodByName_Ref_V(this, cls, name, result, args); + return c_api->Class_CallStaticMethodByName_Ref_V(this, cls, name, signature, result, args); } - ani_status Class_CallStaticMethodByName_Void(ani_class cls, const char *name, ...) + ani_status Class_CallStaticMethodByName_Void(ani_class cls, const char *name, const char *signature, ...) { va_list args; - va_start(args, name); - ani_status status = c_api->Class_CallStaticMethodByName_Void_V(this, cls, name, args); + va_start(args, signature); + ani_status status = c_api->Class_CallStaticMethodByName_Void_V(this, cls, name, signature, args); va_end(args); return status; } - ani_status Class_CallStaticMethodByName_Void_A(ani_class cls, const char *name, const ani_value *args) + ani_status Class_CallStaticMethodByName_Void_A(ani_class cls, const char *name, const char *signature, + const ani_value *args) { - return c_api->Class_CallStaticMethodByName_Void_A(this, cls, name, args); + return c_api->Class_CallStaticMethodByName_Void_A(this, cls, name, signature, args); } - ani_status Class_CallStaticMethodByName_Void_V(ani_class cls, const char *name, va_list args) + ani_status Class_CallStaticMethodByName_Void_V(ani_class cls, const char *name, const char *signature, va_list args) { - return c_api->Class_CallStaticMethodByName_Void_V(this, cls, name, args); + return c_api->Class_CallStaticMethodByName_Void_V(this, cls, name, signature, args); } ani_status Object_GetField_Boolean(ani_object object, ani_field field, ani_boolean *result) { @@ -8270,78 +7031,6 @@ struct __ani_env { { return c_api->Object_SetFieldByName_Ref(this, object, name, value); } - ani_status Object_GetProperty_Boolean(ani_object object, ani_property property, ani_boolean *result) - { - return c_api->Object_GetProperty_Boolean(this, object, property, result); - } - ani_status Object_GetProperty_Char(ani_object object, ani_property property, ani_char *result) - { - return c_api->Object_GetProperty_Char(this, object, property, result); - } - ani_status Object_GetProperty_Byte(ani_object object, ani_property property, ani_byte *result) - { - return c_api->Object_GetProperty_Byte(this, object, property, result); - } - ani_status Object_GetProperty_Short(ani_object object, ani_property property, ani_short *result) - { - return c_api->Object_GetProperty_Short(this, object, property, result); - } - ani_status Object_GetProperty_Int(ani_object object, ani_property property, ani_int *result) - { - return c_api->Object_GetProperty_Int(this, object, property, result); - } - ani_status Object_GetProperty_Long(ani_object object, ani_property property, ani_long *result) - { - return c_api->Object_GetProperty_Long(this, object, property, result); - } - ani_status Object_GetProperty_Float(ani_object object, ani_property property, ani_float *result) - { - return c_api->Object_GetProperty_Float(this, object, property, result); - } - ani_status Object_GetProperty_Double(ani_object object, ani_property property, ani_double *result) - { - return c_api->Object_GetProperty_Double(this, object, property, result); - } - ani_status Object_GetProperty_Ref(ani_object object, ani_property property, ani_ref *result) - { - return c_api->Object_GetProperty_Ref(this, object, property, result); - } - ani_status Object_SetProperty_Boolean(ani_object object, ani_property property, ani_boolean value) - { - return c_api->Object_SetProperty_Boolean(this, object, property, value); - } - ani_status Object_SetProperty_Char(ani_object object, ani_property property, ani_char value) - { - return c_api->Object_SetProperty_Char(this, object, property, value); - } - ani_status Object_SetProperty_Byte(ani_object object, ani_property property, ani_byte value) - { - return c_api->Object_SetProperty_Byte(this, object, property, value); - } - ani_status Object_SetProperty_Short(ani_object object, ani_property property, ani_short value) - { - return c_api->Object_SetProperty_Byte(this, object, property, value); - } - ani_status Object_SetProperty_Int(ani_object object, ani_property property, ani_int value) - { - return c_api->Object_SetProperty_Int(this, object, property, value); - } - ani_status Object_SetProperty_Long(ani_object object, ani_property property, ani_long value) - { - return c_api->Object_SetProperty_Long(this, object, property, value); - } - ani_status Object_SetProperty_Float(ani_object object, ani_property property, ani_float value) - { - return c_api->Object_SetProperty_Float(this, object, property, value); - } - ani_status Object_SetProperty_Double(ani_object object, ani_property property, ani_double value) - { - return c_api->Object_SetProperty_Double(this, object, property, value); - } - ani_status Object_SetProperty_Ref(ani_object object, ani_property property, ani_ref value) - { - return c_api->Object_SetProperty_Ref(this, object, property, value); - } ani_status Object_GetPropertyByName_Boolean(ani_object object, const char *name, ani_boolean *result) { return c_api->Object_GetPropertyByName_Boolean(this, object, name, result); @@ -8764,37 +7453,9 @@ struct __ani_env { { return c_api->Object_CallMethodByName_Void_V(this, object, name, signature, args); } - ani_status Tuple_NewTupleValue(ani_tuple tuple, ani_tuple_value *result, ...) - { - va_list args; - va_start(args, result); - ani_status status = c_api->Tuple_NewTupleValue_V(this, tuple, result, args); - va_end(args); - return status; - } - ani_status Tuple_NewTupleValue_A(ani_tuple tuple, ani_tuple_value *result, const ani_value *args) - { - return c_api->Tuple_NewTupleValue_A(this, tuple, result, args); - } - ani_status Tuple_NewTupleValue_V(ani_tuple tuple, ani_tuple_value *result, va_list args) - { - return c_api->Tuple_NewTupleValue_V(this, tuple, result, args); - } - ani_status Tuple_GetNumberOfItems(ani_tuple tuple, ani_size *result) - { - return c_api->Tuple_GetNumberOfItems(this, tuple, result); - } - ani_status Tuple_GetItemKind(ani_tuple tuple, ani_size index, ani_kind *result) - { - return c_api->Tuple_GetItemKind(this, tuple, index, result); - } - ani_status Tuple_GetItemType(ani_tuple tuple, ani_size index, ani_type *result) - { - return c_api->Tuple_GetItemType(this, tuple, index, result); - } - ani_status TupleValue_GetTuple(ani_tuple_value value, ani_tuple *result) + ani_status TupleValue_GetNumberOfItems(ani_tuple_value tuple_value, ani_size *result) { - return c_api->TupleValue_GetTuple(this, value, result); + return c_api->TupleValue_GetNumberOfItems(this, tuple_value, result); } ani_status TupleValue_GetItem_Boolean(ani_tuple_value tuple_value, ani_size index, ani_boolean *result) { @@ -8868,11 +7529,11 @@ struct __ani_env { { return c_api->TupleValue_SetItem_Ref(this, tuple_value, index, value); } - ani_status GlobalReference_Create(ani_ref ref, ani_gref *result) + ani_status GlobalReference_Create(ani_ref ref, ani_ref *result) { return c_api->GlobalReference_Create(this, ref, result); } - ani_status GlobalReference_Delete(ani_gref ref) + ani_status GlobalReference_Delete(ani_ref ref) { return c_api->GlobalReference_Delete(this, ref); } @@ -8884,9 +7545,9 @@ struct __ani_env { { return c_api->WeakReference_Delete(this, wref); } - ani_status WeakReference_GetReference(ani_wref wref, ani_ref *result) + ani_status WeakReference_GetReference(ani_wref wref, ani_boolean *was_released_result, ani_ref *ref_result) { - return c_api->WeakReference_GetReference(this, wref, result); + return c_api->WeakReference_GetReference(this, wref, was_released_result, ref_result); } ani_status CreateArrayBuffer(size_t length, void **data_result, ani_arraybuffer *arraybuffer_result) { @@ -8901,162 +7562,56 @@ struct __ani_env { { return c_api->ArrayBuffer_GetInfo(this, arraybuffer, data_result, length_result); } - ani_status Reflection_FromMethod(ani_object method, ani_method *result) - { - return c_api->Reflection_FromMethod(this, method, result); - } - ani_status Reflection_ToMethod(ani_class cls, ani_method method, ani_object *result) - { - return c_api->Reflection_ToMethod(this, cls, method, result); - } - ani_status Reflection_FromField(ani_object field, ani_field *result) - { - return c_api->Reflection_FromField(this, field, result); - } - ani_status Reflection_ToField(ani_class cls, ani_field field, ani_object *result) - { - return c_api->Reflection_ToField(this, cls, field, result); - } - ani_status Reflection_FromStaticMethod(ani_object method, ani_static_method *result) - { - return c_api->Reflection_FromStaticMethod(this, method, result); - } - ani_status Reflection_ToStaticMethod(ani_class cls, ani_static_method method, ani_object *result) - { - return c_api->Reflection_ToStaticMethod(this, cls, method, result); - } - ani_status Reflection_FromStaticField(ani_object field, ani_static_field *result) - { - return c_api->Reflection_FromStaticField(this, field, result); - } - ani_status Reflection_ToStaticField(ani_class cls, ani_static_field field, ani_object *result) - { - return c_api->Reflection_ToStaticField(this, cls, field, result); - } - ani_status Reflection_FromFunction(ani_object function, ani_function *result) - { - return c_api->Reflection_FromFunction(this, function, result); - } - ani_status Reflection_ToFunction(ani_function function, ani_object *result) - { - return c_api->Reflection_ToFunction(this, function, result); - } - ani_status Reflection_FromVariable(ani_object variable, ani_variable *result) - { - return c_api->Reflection_FromVariable(this, variable, result); - } - ani_status Reflection_ToVariable(ani_variable variable, ani_object *result) - { - return c_api->Reflection_ToVariable(this, variable, result); - } - ani_status CLS_Register(void *initial_data, ani_finalizer finalizer, void *hint, ani_cls_slot *result) - { - return c_api->CLS_Register(this, initial_data, finalizer, hint, result); - } - ani_status CLS_Unregister(ani_cls_slot slot) - { - return c_api->CLS_Unregister(this, slot); - } - ani_status CLS_SetData(ani_cls_slot slot, void *data) - { - return c_api->CLS_SetData(this, slot, data); - } - ani_status CLS_GetData(ani_cls_slot slot, void **result) - { - return c_api->CLS_GetData(this, slot, result); - } - ani_status Coroutine_LaunchFunctionalObject(ani_fn_object fn, ani_size argc, ani_ref *argv, ani_promise *result) - { - return c_api->Coroutine_LaunchFunctionalObject(this, fn, argc, argv, result); - } - ani_status Coroutine_LaunchFunction(ani_function function, ani_promise *result, ...) - { - va_list args; - va_start(args, result); - ani_status status = c_api->Coroutine_LaunchFunction_V(this, function, result, args); - va_end(args); - return status; - } - ani_status Coroutine_LaunchFunction_A(ani_function function, ani_promise *result, const ani_value *args) - { - return c_api->Coroutine_LaunchFunction_A(this, function, result, args); - } - ani_status Coroutine_LaunchFunction_V(ani_function function, ani_promise *result, va_list args) - { - return c_api->Coroutine_LaunchFunction_V(this, function, result, args); - } - ani_status Coroutine_LaunchMethod(ani_object self, ani_function function, ani_promise *result, ...) - { - va_list args; - va_start(args, result); - ani_status status = c_api->Coroutine_LaunchMethod_V(this, self, function, result, args); - va_end(args); - return status; - } - ani_status Coroutine_LaunchMethod_A(ani_object self, ani_function function, ani_promise *result, - const ani_value *args) - { - return c_api->Coroutine_LaunchMethod_A(this, self, function, result, args); - } - ani_status Coroutine_LaunchMethod_V(ani_object self, ani_function function, ani_promise *result, va_list args) - { - return c_api->Coroutine_LaunchMethod_V(this, self, function, result, args); - } - ani_status Coroutine_LaunchStaticMethod(ani_class cls, ani_function function, ani_promise *result, ...) + ani_status Promise_New(ani_resolver *result_resolver, ani_object *result_promise) { - va_list args; - va_start(args, result); - ani_status status = c_api->Coroutine_LaunchStaticMethod_V(this, cls, function, result, args); - va_end(args); - return status; + return c_api->Promise_New(this, result_resolver, result_promise); } - ani_status Coroutine_LaunchStaticMethod_A(ani_class cls, ani_function function, ani_promise *result, - const ani_value *args) + ani_status PromiseResolver_Resolve(ani_resolver resolver, ani_ref resolution) { - return c_api->Coroutine_LaunchStaticMethod_A(this, cls, function, result, args); + return c_api->PromiseResolver_Resolve(this, resolver, resolution); } - ani_status Coroutine_LaunchStaticMethod_V(ani_class cls, ani_function function, ani_promise *result, va_list args) + ani_status PromiseResolver_Reject(ani_resolver resolver, ani_error rejection) { - return c_api->Coroutine_LaunchStaticMethod_V(this, cls, function, result, args); + return c_api->PromiseResolver_Reject(this, resolver, rejection); } - ani_status Coroutine_Await_Boolean(ani_promise promise, ani_boolean value) + ani_status FixedArray_New_Boolean(ani_size length, ani_array_boolean *result) { - return c_api->Coroutine_Await_Boolean(this, promise, value); + return c_api->FixedArray_New_Boolean(this, length, result); } - ani_status Coroutine_Await_Char(ani_promise promise, ani_char value) + ani_status FixedArray_New_Char(ani_size length, ani_array_char *result) { - return c_api->Coroutine_Await_Char(this, promise, value); + return c_api->FixedArray_New_Char(this, length, result); } - ani_status Coroutine_Await_Byte(ani_promise promise, ani_byte value) + ani_status FixedArray_New_Byte(ani_size length, ani_array_byte *result) { - return c_api->Coroutine_Await_Byte(this, promise, value); + return c_api->FixedArray_New_Byte(this, length, result); } - ani_status Coroutine_Await_Short(ani_promise promise, ani_short value) + ani_status FixedArray_New_Short(ani_size length, ani_array_short *result) { - return c_api->Coroutine_Await_Short(this, promise, value); + return c_api->FixedArray_New_Short(this, length, result); } - ani_status Coroutine_Await_Int(ani_promise promise, ani_int value) + ani_status FixedArray_New_Int(ani_size length, ani_array_int *result) { - return c_api->Coroutine_Await_Int(this, promise, value); + return c_api->FixedArray_New_Int(this, length, result); } - ani_status Coroutine_Await_Long(ani_promise promise, ani_long value) + ani_status FixedArray_New_Long(ani_size length, ani_array_long *result) { - return c_api->Coroutine_Await_Long(this, promise, value); + return c_api->FixedArray_New_Long(this, length, result); } - ani_status Coroutine_Await_Float(ani_promise promise, ani_float value) + ani_status FixedArray_New_Float(ani_size length, ani_array_float *result) { - return c_api->Coroutine_Await_Float(this, promise, value); + return c_api->FixedArray_New_Float(this, length, result); } - ani_status Coroutine_Await_Double(ani_promise promise, ani_double value) + ani_status FixedArray_New_Double(ani_size length, ani_array_double *result) { - return c_api->Coroutine_Await_Double(this, promise, value); + return c_api->FixedArray_New_Double(this, length, result); } - ani_status Coroutine_Await_Ref(ani_promise promise, ani_ref value) + ani_status FixedArray_New_Ref(ani_type type, ani_size length, ani_ref initial_element, ani_array_ref *result) { - return c_api->Coroutine_Await_Ref(this, promise, value); + return c_api->FixedArray_New_Ref(this, type, length, initial_element, result); } -#endif // __cplusplus +#endif // __cplusplus }; // NOLINTEND -#endif // __ANI_H__ +#endif // __ANI_H__ diff --git a/koala-wrapper/koalaui/interop/src/cpp/ani/convertors-ani.cc b/koala-wrapper/koalaui/interop/src/cpp/ani/convertors-ani.cc index f41a2f5bf..43ead3226 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/ani/convertors-ani.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/ani/convertors-ani.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,17 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include #include #include "convertors-ani.h" #include "signatures.h" -#include "interop-logging.h" #include "interop-types.h" static const char* callCallbackFromNative = "callCallbackFromNative"; -static const char* callCallbackFromNativeSig = "I[BI:I"; - -static const char* FAST_NATIVE_PREFIX = "#F$"; +static const char* callCallbackFromNativeSig = "IJI:I"; const bool registerByOne = true; @@ -34,14 +32,14 @@ static bool registerNatives(ani_env *env, const ani_class clazz, const std::vect ani_native_function method; method.name = name.c_str(); method.pointer = func; - method.signature = (flag & ANI_SLOW_NATIVE_FLAG) == 0 ? FAST_NATIVE_PREFIX : nullptr; + method.signature = nullptr; if (registerByOne) { result &= env->Class_BindNativeMethods(clazz, &method, 1) == ANI_OK; ani_boolean isError = false; - env->ExistUnhandledError(&isError); + CHECK_ANI_FATAL(env->ExistUnhandledError(&isError)); if (isError) { - //env->ErrorDescribe(); - env->ResetError(); + CHECK_ANI_FATAL(env->DescribeError()); + CHECK_ANI_FATAL(env->ResetError()); } } else { @@ -54,44 +52,56 @@ static bool registerNatives(ani_env *env, const ani_class clazz, const std::vect return registerByOne ? true : result; } -bool registerAllModules(ani_env *env) { +bool registerAllModules(ani_env *aniEnv) { auto moduleNames = AniExports::getInstance()->getModules(); - for (auto it = moduleNames.begin(); it != moduleNames.end(); ++it) { std::string classpath = AniExports::getInstance()->getClasspath(*it); ani_class nativeModule = nullptr; - env->FindClass(classpath.c_str(), &nativeModule); + CHECK_ANI_FATAL(aniEnv->FindClass(classpath.c_str(), &nativeModule)); if (nativeModule == nullptr) { LOGE("Cannot find managed class %s", classpath.c_str()); continue; } - if (!registerNatives(env, nativeModule, AniExports::getInstance()->getMethods(*it))) { + if (!registerNatives(aniEnv, nativeModule, AniExports::getInstance()->getMethods(*it))) { return false; } } - return true; } -#if 0 -extern "C" ETS_EXPORT ets_int ETS_CALL EtsNapiOnLoad(ets_env *env) { - if (!registerAllModules(env)) { - LOGE("Failed to register ets modules"); - return ETS_ERR; +ANI_EXPORT ani_status ANI_Constructor(ani_vm *vm, uint32_t *result) { + LOGE("Use ANI") + ani_env* aniEnv = nullptr; + *result = 1; + CHECK_ANI_FATAL(vm->GetEnv(/* version */ 1, (ani_env**)&aniEnv)); + if (!registerAllModules(aniEnv)) { + LOGE("Failed to register ANI modules"); + return ANI_ERROR; + } + ani_boolean hasError = false; + CHECK_ANI_FATAL(aniEnv->ExistUnhandledError(&hasError)); + if (hasError) { + CHECK_ANI_FATAL(aniEnv->DescribeError()); + CHECK_ANI_FATAL(aniEnv->ResetError()); } - auto interopClasspath = AniExports::getInstance()->getClasspath("InteropNativeModule"); - auto interopClass = env->FindClass(interopClasspath.c_str()); + auto interopClassName = AniExports::getInstance()->getClasspath("InteropNativeModule"); + ani_class interopClass = nullptr; + CHECK_ANI_FATAL(aniEnv->FindClass(interopClassName.c_str(), &interopClass)); if (interopClass == nullptr) { - LOGE("Can not find InteropNativeModule classpath to set callback dispatcher"); - return ETS_ERR; + LOGE("Can not find InteropNativeModule class to set callback dispatcher"); + CHECK_ANI_FATAL(aniEnv->ExistUnhandledError(&hasError)); + if (hasError) { + CHECK_ANI_FATAL(aniEnv->DescribeError()); + CHECK_ANI_FATAL(aniEnv->ResetError()); + } + return ANI_OK; } - if (!setKoalaEtsNapiCallbackDispatcher(env, interopClass, callCallbackFromNative, callCallbackFromNativeSig)) { - LOGE("Failed to set koala ets callback dispatcher"); - return ETS_ERR; + if (!setKoalaANICallbackDispatcher(aniEnv, interopClass, callCallbackFromNative, callCallbackFromNativeSig)) { + LOGE("Failed to set ANI callback dispatcher"); + return ANI_ERROR; } - return ETS_NAPI_VERSION_1_0; + return ANI_OK; } -#endif AniExports* AniExports::getInstance() { static AniExports *instance = nullptr; @@ -135,12 +145,13 @@ void AniExports::setClasspath(const char* module, const char *classpath) { } static std::map g_defaultClasspaths = { - {"InteropNativeModule", "@koalaui/interop/InteropNativeModule/InteropNativeModule"}, + {"InteropNativeModule", "L#koalaui/interop/InteropNativeModule/InteropNativeModule;"}, // todo leave just InteropNativeModule, define others via KOALA_ETS_INTEROP_MODULE_CLASSPATH - {"TestNativeModule", "@koalaui/arkts-arkui/generated/arkts/TestNativeModule/TestNativeModule"}, - {"ArkUINativeModule", "@koalaui/arkts-arkui/generated/arkts/ArkUINativeModule/ArkUINativeModule"}, - {"ArkUIGeneratedNativeModule", "@koalaui/arkts-arkui/generated/arkts/ArkUIGeneratedNativeModule/ArkUIGeneratedNativeModule"}, + {"TestNativeModule", "L@ohos/arkui/generated/arkts/TestNativeModule/TestNativeModule;"}, + {"ArkUINativeModule", "L@ohos/arkui/generated/arkts/ArkUINativeModule/ArkUINativeModule;"}, + {"ArkUIGeneratedNativeModule", "L@ohos/arkui/generated/arkts/ArkUIGeneratedNativeModule/ArkUIGeneratedNativeModule;"}, }; + const std::string& AniExports::getClasspath(const std::string& module) { auto it = classpaths.find(module); if (it != classpaths.end()) { @@ -152,3 +163,30 @@ const std::string& AniExports::getClasspath(const std::string& module) { } INTEROP_FATAL("Classpath for module %s was not registered", module.c_str()); } + +static struct { + ani_class clazz = nullptr; + ani_static_method method = nullptr; +} g_koalaANICallbackDispatcher; + +bool setKoalaANICallbackDispatcher( + ani_env* aniEnv, + ani_class clazz, + const char* dispatcherMethodName, + const char* dispatcherMethodSig +) { + g_koalaANICallbackDispatcher.clazz = clazz; + CHECK_ANI_FATAL(aniEnv->Class_FindStaticMethod( + clazz, dispatcherMethodName, dispatcherMethodSig, + &g_koalaANICallbackDispatcher.method + )); + if (g_koalaANICallbackDispatcher.method == nullptr) { + return false; + } + return true; +} + +void getKoalaANICallbackDispatcher(ani_class* clazz, ani_static_method* method) { + *clazz = g_koalaANICallbackDispatcher.clazz; + *method = g_koalaANICallbackDispatcher.method; +} diff --git a/koala-wrapper/koalaui/interop/src/cpp/ani/convertors-ani.h b/koala-wrapper/koalaui/interop/src/cpp/ani/convertors-ani.h index 3be74d311..d5bc16b5d 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/ani/convertors-ani.h +++ b/koala-wrapper/koalaui/interop/src/cpp/ani/convertors-ani.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,10 +13,8 @@ * limitations under the License. */ -#ifndef KOALA_ANI -#define KOALA_ANI +#ifdef KOALA_ANI -#include #include #include #include @@ -26,15 +24,161 @@ #include "ani.h" #include "koala-types.h" +#include "interop-logging.h" + +#define CHECK_ANI_FATAL(result) \ +do { \ + ani_status res = (result); \ + if (res != ANI_OK) { \ + INTEROP_FATAL("ANI function failed (status: %d) at " __FILE__ ": %d", res, __LINE__); \ + } \ +} \ +while (0) template struct InteropTypeConverter { using InteropType = T; - static T convertFrom(ani_env* env, InteropType value) { return value; } - static InteropType convertTo(ani_env* env, T value) { return value; } + static T convertFrom(ani_env* env, InteropType value) = delete; + static InteropType convertTo(ani_env* env, T value) = delete; static void release(ani_env* env, InteropType value, T converted) {} }; +template<> +struct InteropTypeConverter { + using InteropType = ani_byte; + static inline KByte convertFrom(ani_env* env, InteropType value) { + return value; + } + static inline InteropType convertTo(ani_env* env, KByte value) { + return value; + } + static inline void release(ani_env* env, InteropType value, KByte converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ani_boolean; + static inline KBoolean convertFrom(ani_env* env, InteropType value) { + return value; + } + static inline InteropType convertTo(ani_env* env, KBoolean value) { + return value; + } + static inline void release(ani_env* env, InteropType value, KBoolean converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ani_int; + static inline KInt convertFrom(ani_env* env, InteropType value) { + return value; + } + static inline InteropType convertTo(ani_env* env, KInt value) { + return value; + } + static inline void release(ani_env* env, InteropType value, KInt converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ani_int; + static inline KUInt convertFrom(ani_env* env, InteropType value) { + return value; + } + static inline InteropType convertTo(ani_env* env, KUInt value) { + return value; + } + static inline void release(ani_env* env, InteropType value, KUInt converted) {} +}; + + +template<> +struct InteropTypeConverter { + using InteropType = ani_float; + static inline KFloat convertFrom(ani_env* env, InteropType value) { + return value; + } + static inline InteropType convertTo(ani_env* env, KFloat value) { + return value; + } + static inline void release(ani_env* env, InteropType value, KFloat converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ani_long; + static inline KLong convertFrom(ani_env* env, InteropType value) { + return value; + } + static inline InteropType convertTo(ani_env* env, KLong value) { + return value; + } + static inline void release(ani_env* env, InteropType value, KLong converted) {} +}; + + +template<> +struct InteropTypeConverter { + using InteropType = ani_object; + static inline KVMObjectHandle convertFrom(ani_env* env, InteropType value) { + return reinterpret_cast(value); + } + static inline InteropType convertTo(ani_env* env, KVMObjectHandle value) { + return reinterpret_cast(value); + } + static inline void release(ani_env* env, InteropType value, KVMObjectHandle converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ani_array_byte; + static inline KInteropBuffer convertFrom(ani_env* env, InteropType value) { + if (value == nullptr) return KInteropBuffer(); + ani_size length = 0; + CHECK_ANI_FATAL(env->Array_GetLength(value, &length)); + KByte* data = new KByte[length]; + CHECK_ANI_FATAL(env->Array_GetRegion_Byte(value, 0, length, (ani_byte*)data)); + KInteropBuffer result = { 0 }; + result.data = data; + result.length = length; + return result; + } + static inline InteropType convertTo(ani_env* env, KInteropBuffer value) { + ani_array_byte result; + CHECK_ANI_FATAL(env->FixedArray_New_Byte(value.length, &result)); + CHECK_ANI_FATAL(env->Array_SetRegion_Byte(result, 0, value.length, reinterpret_cast(value.data))); + value.dispose(value.resourceId); + return result; + } + static inline void release(ani_env* env, InteropType value, KInteropBuffer converted) { + delete [] (KByte*)converted.data; + } +}; + +template<> +struct InteropTypeConverter { + using InteropType = ani_long; + static KSerializerBuffer convertFrom(ani_env* env, InteropType value) { + return reinterpret_cast(static_cast(value)); + } + static InteropType convertTo(ani_env* env, KSerializerBuffer value) = delete; + static inline void release(ani_env* env, InteropType value, KSerializerBuffer converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ani_array_byte; + static inline KInteropReturnBuffer convertFrom(ani_env* env, InteropType value) = delete; + static inline InteropType convertTo(ani_env* env, KInteropReturnBuffer value) { + ani_array_byte result; + CHECK_ANI_FATAL(env->FixedArray_New_Byte(value.length, &result)); + CHECK_ANI_FATAL(env->Array_SetRegion_Byte(result, 0, value.length, reinterpret_cast(value.data))); + value.dispose(value.data, value.length); + return result; + }; + static inline void release(ani_env* env, InteropType value, KInteropReturnBuffer converted) {} +}; + template<> struct InteropTypeConverter { using InteropType = ani_string; @@ -43,17 +187,16 @@ struct InteropTypeConverter { KStringPtr result; // Notice that we use UTF length for buffer size, but counter is expressed in number of Unicode chars. ani_size lengthUtf8 = 0; - env->String_GetUTF8Size(value, &lengthUtf8); + CHECK_ANI_FATAL(env->String_GetUTF8Size(value, &lengthUtf8)); result.resize(lengthUtf8); - ani_size lengthUtf16 = 0; - env->String_GetUTF16Size(value, &lengthUtf16); - ani_size count; - env->String_GetUTF8SubString(value, 0, lengthUtf16, result.data(), result.length(), &count); + ani_size count = 0; + CHECK_ANI_FATAL(env->String_GetUTF8SubString(value, 0, lengthUtf8, result.data(), lengthUtf8 + 1, &count)); + result.data()[lengthUtf8] = 0; return result; } static InteropType convertTo(ani_env* env, const KStringPtr& value) { - ani_string result; - env->String_NewUTF8(value.c_str(), value.length(), &result); + ani_string result = nullptr; + CHECK_ANI_FATAL(env->String_NewUTF8(value.c_str(), value.length() - 1 /* drop zero terminator */, &result)); return result; } static void release(ani_env* env, InteropType value, const KStringPtr& converted) {} @@ -73,52 +216,67 @@ struct InteropTypeConverter { template<> struct InteropTypeConverter { - using InteropType = ani_fixedarray_int; + using InteropType = ani_array_int; static KInt* convertFrom(ani_env* env, InteropType value) { if (!value) return nullptr; ani_size length = 0; - env->FixedArray_GetLength(value, &length); - KInt* result = new KInt[length]; - env->FixedArray_GetRegion_Int(value, 0, length, result); - return result; + CHECK_ANI_FATAL(env->Array_GetLength(value, &length)); + KInt* data = new KInt[length]; + CHECK_ANI_FATAL(env->Array_GetRegion_Int(value, 0, length, (ani_int*)data)); + return data; } static InteropType convertTo(ani_env* env, KInt* value) = delete; static void release(ani_env* env, InteropType value, KInt* converted) { - if (converted) delete [] converted; + if (converted) { + ani_size length = 0; + CHECK_ANI_FATAL(env->Array_GetLength(value, &length)); + CHECK_ANI_FATAL(env->Array_SetRegion_Int(value, 0, length, (ani_int*)converted)); + } + delete [] converted; } }; template<> struct InteropTypeConverter { - using InteropType = ani_fixedarray_float; + using InteropType = ani_array_float; static KFloat* convertFrom(ani_env* env, InteropType value) { if (!value) return nullptr; ani_size length = 0; - env->FixedArray_GetLength(value, &length); - KFloat* result = new KFloat[length]; - env->FixedArray_GetRegion_Float(value, 0, length, result); - return result; + CHECK_ANI_FATAL(env->Array_GetLength(value, &length)); + KFloat* data = new KFloat[length]; + CHECK_ANI_FATAL(env->Array_GetRegion_Float(value, 0, length, (ani_float*)data)); + return data; } static InteropType convertTo(ani_env* env, KFloat* value) = delete; static void release(ani_env* env, InteropType value, KFloat* converted) { - if (converted) delete [] converted; + if (converted) { + ani_size length = 0; + CHECK_ANI_FATAL(env->Array_GetLength(value, &length)); + CHECK_ANI_FATAL(env->Array_SetRegion_Float(value, 0, length, (ani_float*)converted)); + } + delete [] converted; } }; template<> struct InteropTypeConverter { - using InteropType = ani_fixedarray_byte; + using InteropType = ani_array_byte; static KByte* convertFrom(ani_env* env, InteropType value) { if (!value) return nullptr; ani_size length = 0; - env->FixedArray_GetLength(value, &length); - KByte* result = new KByte[length]; - env->FixedArray_GetRegion_Byte(value, 0, length, (ani_byte*)result); - return result; + CHECK_ANI_FATAL(env->Array_GetLength(value, &length)); + KByte* data = new KByte[length]; + CHECK_ANI_FATAL(env->Array_GetRegion_Byte(value, 0, length, (ani_byte*)data)); + return data; } static InteropType convertTo(ani_env* env, KByte* value) = delete; static void release(ani_env* env, InteropType value, KByte* converted) { - if (converted) delete [] converted; + if (converted) { + ani_size length = 0; + CHECK_ANI_FATAL(env->Array_GetLength(value, &length)); + CHECK_ANI_FATAL(env->Array_SetRegion_Byte(value, 0, length, (ani_byte*)converted)); + } + delete[] converted; } }; @@ -138,7 +296,63 @@ template<> struct InteropTypeConverter { using InteropType = ani_ref; static KLength convertFrom(ani_env* env, InteropType value) { - // TODO: implement me + static ani_class double_class = nullptr; + static ani_class int_class = nullptr; + static ani_class string_class = nullptr; + static ani_class resource_class = nullptr; + if (!double_class) { + CHECK_ANI_FATAL(env->FindClass("Lstd/core/Double;", &double_class)); + } + if (!int_class) { + CHECK_ANI_FATAL(env->FindClass("Lstd/core/Int;", &int_class)); + } + if (!string_class) { + CHECK_ANI_FATAL(env->FindClass("Lstd/core/String;", &string_class)); + } + if (!resource_class) { + CHECK_ANI_FATAL(env->FindClass("L@ohos/arkui/generated/resource/Resource;", &resource_class)); + } + + const ani_object valueObj = reinterpret_cast(value); + + ani_boolean isInstanceOf; + CHECK_ANI_FATAL(env->Object_InstanceOf(valueObj, double_class, &isInstanceOf)); + if (isInstanceOf) { + static ani_method double_p = nullptr; + if (!double_p) CHECK_ANI_FATAL(env->Class_FindMethod(double_class, "unboxed", ":D", &double_p)); + ani_double result; + CHECK_ANI_FATAL(env->Object_CallMethod_Double(valueObj, double_p, &result)); + return KLength{ 1, (KFloat) result, 1, 0 }; + } + + CHECK_ANI_FATAL(env->Object_InstanceOf(valueObj, int_class, &isInstanceOf)); + if (isInstanceOf) { + static ani_method int_p = nullptr; + if (!int_p) CHECK_ANI_FATAL(env->Class_FindMethod(int_class, "unboxed", ":I", &int_p)); + ani_int result; + CHECK_ANI_FATAL(env->Object_CallMethod_Int(valueObj, int_p, &result)); + return KLength{ 1, (KFloat) result, 1, 0 }; + } + + CHECK_ANI_FATAL(env->Object_InstanceOf(valueObj, string_class, &isInstanceOf)); + if (isInstanceOf) { + KStringPtr ptr = InteropTypeConverter::convertFrom(env, reinterpret_cast(value)); + KLength length { 0 }; + parseKLength(ptr, &length); + length.type = 2; + length.resource = 0; + return length; + } + + CHECK_ANI_FATAL(env->Object_InstanceOf(valueObj, resource_class, &isInstanceOf)); + if (isInstanceOf) { + static ani_method resource_p = nullptr; + if (!resource_p) CHECK_ANI_FATAL(env->Class_FindMethod(resource_class, "id",":D", &resource_p)); + ani_double result; + CHECK_ANI_FATAL(env->Object_CallMethod_Double(valueObj, resource_p, &result)); + return KLength{ 3, 0, 1, (KInt) result }; + } + return KLength( { 0, 0, 0, 0}); } static InteropType convertTo(ani_env* env, KLength value) = delete; @@ -160,6 +374,44 @@ inline void releaseArgument(ani_env* env, typename InteropTypeConverter::I InteropTypeConverter::release(env, arg, data); } +template +struct DirectInteropTypeConverter { + using InteropType = T; + static T convertFrom(InteropType value) { return value; } + static InteropType convertTo(T value) { return value; } +}; + +template<> +struct DirectInteropTypeConverter { + using InteropType = ani_long; + static KNativePointer convertFrom(InteropType value) { + return reinterpret_cast(value); + } + static InteropType convertTo(KNativePointer value) { + return reinterpret_cast(value); + } +}; + +template<> +struct DirectInteropTypeConverter { + using InteropType = ani_long; + static KSerializerBuffer convertFrom(InteropType value) { + return reinterpret_cast(static_cast(value)); + } + static InteropType convertTo(KSerializerBuffer value) = delete; +}; + +template <> +struct DirectInteropTypeConverter { + using InteropType = ani_double; + static KInteropNumber convertFrom(InteropType value) { + return KInteropNumber::fromDouble(value); + } + static InteropType convertTo(KInteropNumber value) { + return value.asDouble(); + } +}; + #define ANI_SLOW_NATIVE_FLAG 1 class AniExports { @@ -193,7 +445,7 @@ public: } #define KOALA_ANI_INTEROP_MODULE_CLASSPATH(module, classpath) \ static void __init_classpath_##module() { \ - AniExports::getInstance()->setClasspath(KOALA_QUOTE(module), classpath); \ + AniExports::getInstance()->setClasspath(KOALA_QUOTE(module), "L" classpath ";"); \ } \ namespace { \ struct __Init_classpath_##module { \ @@ -203,13 +455,13 @@ public: #else #define MAKE_ANI_EXPORT(module, name, type, flag) \ __attribute__((constructor)) \ - static void __init_ets_##name() { \ + static void __init_ani_##name() { \ AniExports::getInstance()->addMethod(KOALA_QUOTE(module), "_"#name, type, reinterpret_cast(Ani_##name), flag); \ } #define KOALA_ANI_INTEROP_MODULE_CLASSPATH(module, classpath) \ __attribute__((constructor)) \ static void __init_ani_classpath_##module() { \ - AniExports::getInstance()->setClasspath(KOALA_QUOTE(module), classpath); \ + AniExports::getInstance()->setClasspath(KOALA_QUOTE(module), "L" classpath ";"); \ } #endif @@ -1199,7 +1451,7 @@ MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 InteropTypeConverter::InteropType _p0, \ InteropTypeConverter::InteropType _p1, \ InteropTypeConverter::InteropType _p2, \ - InteropTypeConverter::InteropType _p3 \ + InteropTypeConverter::InteropType _p3, \ InteropTypeConverter::InteropType _p4) { \ KOALA_MAYBE_LOG(name) \ P0 p0 = getArgument(env, _p0); \ @@ -1311,68 +1563,365 @@ MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void|" #P0 "|" #P1 "|" #P2 "|" #P3, } \ MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4, ANI_SLOW_NATIVE_FLAG) -bool setKoalaEtsNapiCallbackDispatcher( +#define KOALA_INTEROP_DIRECT_0(name, Ret) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name()); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret, 0) +#define KOALA_INTEROP_DIRECT_1(name, Ret, P0) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0, 0) +#define KOALA_INTEROP_DIRECT_2(name, Ret, P0, P1) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1, 0) +#define KOALA_INTEROP_DIRECT_3(name, Ret, P0, P1, P2) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2, 0) +#define KOALA_INTEROP_DIRECT_4(name, Ret, P0, P1, P2, P3) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3, 0) +#define KOALA_INTEROP_DIRECT_5(name, Ret, P0, P1, P2, P3, P4) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4, 0) +#define KOALA_INTEROP_DIRECT_6(name, Ret, P0, P1, P2, P3, P4, P5) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5, 0) +#define KOALA_INTEROP_DIRECT_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6, 0) +#define KOALA_INTEROP_DIRECT_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7, 0) +#define KOALA_INTEROP_DIRECT_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8, 0) +#define KOALA_INTEROP_DIRECT_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8, \ + InteropTypeConverter::InteropType p9 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8), DirectInteropTypeConverter::convertFrom(p9))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8 "|" #P9, 0) +#define KOALA_INTEROP_DIRECT_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + inline InteropTypeConverter::InteropType Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8, \ + InteropTypeConverter::InteropType p9, \ + InteropTypeConverter::InteropType p10 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8), DirectInteropTypeConverter::convertFrom(p9), DirectInteropTypeConverter::convertFrom(p10))); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8 "|" #P9 "|" #P10, 0) +#define KOALA_INTEROP_DIRECT_V0(name) \ + inline void Ani_##name( \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void", 0) +#define KOALA_INTEROP_DIRECT_V1(name, P0) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0, 0) +#define KOALA_INTEROP_DIRECT_V2(name, P0, P1) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1, 0) +#define KOALA_INTEROP_DIRECT_V3(name, P0, P1, P2) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2, 0) +#define KOALA_INTEROP_DIRECT_V4(name, P0, P1, P2, P3) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3, 0) +#define KOALA_INTEROP_DIRECT_V5(name, P0, P1, P2, P3, P4) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4, 0) +#define KOALA_INTEROP_DIRECT_V6(name, P0, P1, P2, P3, P4, P5) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5, 0) +#define KOALA_INTEROP_DIRECT_V7(name, P0, P1, P2, P3, P4, P5, P6) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6, 0) +#define KOALA_INTEROP_DIRECT_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7, 0) +#define KOALA_INTEROP_DIRECT_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8, 0) +#define KOALA_INTEROP_DIRECT_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8, \ + InteropTypeConverter::InteropType p9 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8), DirectInteropTypeConverter::convertFrom(p9)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8 "|" #P9, 0) +#define KOALA_INTEROP_DIRECT_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + inline void Ani_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8, \ + InteropTypeConverter::InteropType p9, \ + InteropTypeConverter::InteropType p10 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8), DirectInteropTypeConverter::convertFrom(p9), DirectInteropTypeConverter::convertFrom(p10)); \ + } \ + MAKE_ANI_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8 "|" #P9 "|" #P10, 0) + +bool setKoalaANICallbackDispatcher( ani_env* ani_env, ani_class clazz, const char* dispatcherMethodName, const char* dispactherMethodSig ); -void getKoalaEtsNapiCallbackDispatcher(ani_class* clazz, ani_method* method); - -#if 0 -#define KOALA_INTEROP_CALL_VOID(venv, id, length, args) \ -{ \ - ani_class clazz = nullptr; \ - ani_method method = nullptr; \ - getKoalaEtsNapiCallbackDispatcher(&clazz, &method); \ - ani_env* ani_env = reinterpret_cast(vmContext); \ - ani_env->PushLocalFrame(1); \ - ani_fixedarray_byte args_ets = ani_env->NewByteArray(length); \ - ani_env->SetByteArrayRegion(args_ets, 0, length, reinterpret_cast(args)); \ - ani_env->CallStaticIntMethod(clazz, method, id, args_ets, length); \ - ani_env->GetByteArrayRegion(args_ets, 0, length, reinterpret_cast(args)); \ - ani_env->PopLocalFrame(nullptr); \ +void getKoalaANICallbackDispatcher(ani_class* clazz, ani_static_method* method); + +// TODO: maybe use CreateArrayBufferExternal here instead, no need for allocations. +#define KOALA_INTEROP_CALL_VOID(venv, id, length, args) \ +{ \ + ani_class clazz = nullptr; \ + ani_static_method method = nullptr; \ + getKoalaANICallbackDispatcher(&clazz, &method); \ + ani_env* env = reinterpret_cast(venv); \ + ani_int result = 0; \ + long long args_casted = reinterpret_cast(args); \ + CHECK_ANI_FATAL(env->Class_CallStaticMethod_Int(clazz, method, &result, id, args_casted, length)); \ } -#define KOALA_INTEROP_CALL_INT(venv, id, length, args) \ -{ \ - ani_class clazz = nullptr; \ - ani_method method = nullptr; \ - getKoalaEtsNapiCallbackDispatcher(&clazz, &method); \ - ani_env* ani_env = reinterpret_cast(venv); \ - ani_env->PushLocalFrame(1); \ - ani_fixedarray_byte args_ets = ani_env->NewByteArray(length); \ - ani_env->SetByteArrayRegion(args_ets, 0, length, reinterpret_cast(args)); \ - int32_t rv = ani_env->CallStaticIntMethod(clazz, method, id, args_ets, length); \ - ani_env->GetByteArrayRegion(args_ets, 0, length, reinterpret_cast(args)); \ - ani_env->PopLocalFrame(nullptr); \ - return rv; \ +#define KOALA_INTEROP_CALL_INT(venv, id, length, args) \ +{ \ + ani_class clazz = nullptr; \ + ani_static_method method = nullptr; \ + getKoalaANICallbackDispatcher(&clazz, &method); \ + ani_env* env = reinterpret_cast(venv); \ + ani_int result = 0; \ + long long args_casted = reinterpret_cast(args); \ + CHECK_ANI_FATAL(env->Class_CallStaticMethod_Int(clazz, method, &result, id, args_casted, length)); \ + return result; \ } #define KOALA_INTEROP_CALL_VOID_INTS32(venv, id, argc, args) KOALA_INTEROP_CALL_VOID(venv, id, (argc) * sizeof(int32_t), args) #define KOALA_INTEROP_CALL_INT_INTS32(venv, id, argc, args) KOALA_INTEROP_CALL_INT(venv, id, (argc) * sizeof(int32_t), args) -#define KOALA_INTEROP_THROW(vmContext, object, ...) \ - do { \ - ani_env* env = reinterpret_cast(vmContext); \ - env->ThrowError(object); \ - return __VA_ARGS__; \ +#define KOALA_INTEROP_THROW(vmContext, object, ...) \ + do { \ + ani_env* env = reinterpret_cast(vmContext); \ + CHECK_ANI_FATAL(env->ThrowError(object)); \ + return __VA_ARGS__; \ } while (0) -#define KOALA_INTEROP_THROW_STRING(vmContext, message, ...) \ - do { \ - ani_env* env = reinterpret_cast(vmContext); \ - const static ani_class errorClass = env->FindClass("std/core/Error"); \ - env->ThrowErrorNew(errorClass, message); \ +#define KOALA_INTEROP_THROW_STRING(vmContext, message, ...) \ + do { \ + ani_env* env = reinterpret_cast(vmContext); \ + ani_class errorClass {}; \ + CHECK_ANI_FATAL(env->FindClass("Lescompat/Error;", &errorClass)); \ + ani_method errorCtor {}; \ + CHECK_ANI_FATAL(env->Class_FindMethod(errorClass, "", \ + "Lstd/core/String;Lescompat/ErrorOptions;:V", &errorCtor)); \ + ani_string messageObject{}; \ + CHECK_ANI_FATAL(env->String_NewUTF8(message, strlen(message), &messageObject)); \ + ani_ref undefined{}; \ + CHECK_ANI_FATAL(env->GetUndefined(&undefined)); \ + ani_object throwObject{}; \ + CHECK_ANI_FATAL(env->Object_New(errorClass, errorCtor, &throwObject, messageObject, undefined)); \ + CHECK_ANI_FATAL(env->ThrowError(static_cast(throwObject))); \ + return __VA_ARGS__; \ } while (0) -#else - -#define KOALA_INTEROP_CALL_VOID(venv, id, length, args) -#define KOALA_INTEROP_CALL_INT(venv, id, length, args) { return 0; } -#define KOALA_INTEROP_CALL_VOID_INTS32(venv, id, argc, args) { return; } -#define KOALA_INTEROP_CALL_INT_INTS32(venv, id, argc, args) { return 0; } -#define KOALA_INTEROP_THROW(vmContext, object, ...) { return __VA_ARGS__; } -#define KOALA_INTEROP_THROW_STRING(vmContext, message, ...) { return __VA_ARGS__; } -#endif -#endif // KOALA_ETS_NAPI +#endif // KOALA_ANI diff --git a/koala-wrapper/koalaui/interop/src/cpp/callback-resource.cc b/koala-wrapper/koalaui/interop/src/cpp/callback-resource.cc index d7851e405..acbe9cd23 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/callback-resource.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/callback-resource.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -11,8 +11,9 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ +*/ +#undef KOALA_INTEROP_MODULE #define KOALA_INTEROP_MODULE InteropNativeModule #include "common-interop.h" #include "interop-types.h" @@ -41,7 +42,8 @@ void releaseManagedCallbackResource(InteropInt32 resourceId) { callbackResourceSubqueue.push_back(resourceId); } -KInt impl_CheckCallbackEvent(KByte* result, KInt size) { +KInt impl_CheckCallbackEvent(KSerializerBuffer buffer, KInt size) { + KByte* result = (KByte*)buffer; if (needReleaseFront) { switch (callbackEventsQueue.front()) @@ -64,16 +66,29 @@ KInt impl_CheckCallbackEvent(KByte* result, KInt size) { return 0; } const CallbackEventKind frontEventKind = callbackEventsQueue.front(); - memcpy(result, &frontEventKind, 4); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(result, size, &frontEventKind, 4); + #else + memcpy(result, &frontEventKind, 4); + #endif + switch (frontEventKind) { case Event_CallCallback: - memcpy(result + 4, callbackCallSubqueue.front().buffer, sizeof(CallbackBuffer::buffer)); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(result + 4, size, callbackCallSubqueue.front().buffer, sizeof(CallbackBuffer::buffer)); + #else + memcpy(result + 4, callbackCallSubqueue.front().buffer, sizeof(CallbackBuffer::buffer)); + #endif break; case Event_HoldManagedResource: case Event_ReleaseManagedResource: { const InteropInt32 resourceId = callbackResourceSubqueue.front(); - memcpy(result + 4, &resourceId, 4); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(result + 4, size, &frontEventKind, 4); + #else + memcpy(result + 4, &resourceId, 4); + #endif break; } default: @@ -82,7 +97,7 @@ KInt impl_CheckCallbackEvent(KByte* result, KInt size) { needReleaseFront = true; return 1; } -KOALA_INTEROP_2(CheckCallbackEvent, KInt, KByte*, KInt) +KOALA_INTEROP_DIRECT_2(CheckCallbackEvent, KInt, KSerializerBuffer, KInt) void impl_ReleaseCallbackResource(InteropInt32 resourceId) { releaseManagedCallbackResource(resourceId); diff --git a/koala-wrapper/koalaui/interop/src/cpp/callback-resource.h b/koala-wrapper/koalaui/interop/src/cpp/callback-resource.h index 451e4a3db..c7a742a05 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/callback-resource.h +++ b/koala-wrapper/koalaui/interop/src/cpp/callback-resource.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,6 +19,11 @@ #include #include "interop-types.h" +#ifdef KOALA_WINDOWS +#define DLL_EXPORT __declspec(dllexport) +#else +#define DLL_EXPORT __attribute__ ((visibility ("default"))) +#endif class CallbackResourceHolder { private: @@ -38,7 +43,7 @@ public: struct CallbackBuffer { InteropInt32 kind; - uint8_t buffer[60 * 4]; + uint8_t buffer[4096]; CallbackResourceHolder resourceHolder; }; @@ -48,8 +53,8 @@ enum CallbackEventKind { Event_ReleaseManagedResource = 2, }; -void enqueueCallback(const CallbackBuffer* event); -void holdManagedCallbackResource(InteropInt32 resourceId); -void releaseManagedCallbackResource(InteropInt32 resourceId); +extern "C" DLL_EXPORT void enqueueCallback(const CallbackBuffer* event); +extern "C" DLL_EXPORT void holdManagedCallbackResource(InteropInt32 resourceId); +extern "C" DLL_EXPORT void releaseManagedCallbackResource(InteropInt32 resourceId); #endif diff --git a/koala-wrapper/koalaui/interop/src/cpp/cangjie/convertors-cj.cc b/koala-wrapper/koalaui/interop/src/cpp/cangjie/convertors-cj.cc index 0a26aa8d9..ebb0dac2f 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/cangjie/convertors-cj.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/cangjie/convertors-cj.cc @@ -1,14 +1,14 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ \ No newline at end of file +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/cangjie/convertors-cj.h b/koala-wrapper/koalaui/interop/src/cpp/cangjie/convertors-cj.h index 17949006b..9c8300740 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/cangjie/convertors-cj.h +++ b/koala-wrapper/koalaui/interop/src/cpp/cangjie/convertors-cj.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,15 +13,16 @@ * limitations under the License. */ -#pragma once +#ifndef CONVERTORS_CJ_H +#define CONVERTORS_CJ_H #include -#include #include #include #include #include "koala-types.h" +#include "interop-logging.h" #define KOALA_INTEROP_EXPORT extern "C" @@ -792,6 +793,22 @@ KOALA_INTEROP_EXPORT InteropTypeConverter::InteropType name( \ return makeResult(impl_##name(ctx, p0, p1, p2, p3)); \ } +#define KOALA_INTEROP_CTX_5(name, Ret, P0, P1, P2, P3, P4) \ +KOALA_INTEROP_EXPORT InteropTypeConverter::InteropType name( \ + InteropTypeConverter::InteropType _p0, \ + InteropTypeConverter::InteropType _p1, \ + InteropTypeConverter::InteropType _p2, \ + InteropTypeConverter::InteropType _p3, \ + InteropTypeConverter::InteropType _p4) { \ + KOALA_MAYBE_LOG(name) \ + P0 p0 = getArgument(_p0); \ + P1 p1 = getArgument(_p1); \ + P2 p2 = getArgument(_p2); \ + P3 p3 = getArgument(_p3); \ + P4 p4 = getArgument(_p4); \ + KVMContext ctx = (KVMContext)0; \ + return makeResult(impl_##name(ctx, p0, p1, p2, p3, p4)); \ +} #define KOALA_INTEROP_CALL_INT(venv, id, length, args) \ { \ @@ -862,14 +879,65 @@ KOALA_INTEROP_EXPORT void name(InteropTypeConverter::InteropType _p0, \ impl_##name(nullptr, p0, p1, p2, p3, p4); \ } + #define KOALA_INTEROP_DIRECT_0(name, Ret) \ + KOALA_INTEROP_0(name, Ret) +#define KOALA_INTEROP_DIRECT_1(name, Ret, P0) \ + KOALA_INTEROP_1(name, Ret, P0) +#define KOALA_INTEROP_DIRECT_2(name, Ret, P0, P1) \ + KOALA_INTEROP_2(name, Ret, P0, P1) +#define KOALA_INTEROP_DIRECT_3(name, Ret, P0, P1, P2) \ + KOALA_INTEROP_3(name, Ret, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_4(name, Ret, P0, P1, P2, P3) \ + KOALA_INTEROP_4(name, Ret, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_5(name, Ret, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_5(name, Ret, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_6(name, Ret, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_6(name, Ret, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) +#define KOALA_INTEROP_DIRECT_V0(name) \ + KOALA_INTEROP_V0(name) +#define KOALA_INTEROP_DIRECT_V1(name, P0) \ + KOALA_INTEROP_V1(name, P0) +#define KOALA_INTEROP_DIRECT_V2(name, P0, P1) \ + KOALA_INTEROP_V2(name, P0, P1) +#define KOALA_INTEROP_DIRECT_V3(name, P0, P1, P2) \ + KOALA_INTEROP_V3(name, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_V4(name, P0, P1, P2, P3) \ + KOALA_INTEROP_V4(name, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_V5(name, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_V5(name, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_V6(name, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_V6(name, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_V7(name, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_V7(name, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) + #define KOALA_INTEROP_THROW(vmContext, object, ...) \ do { \ - /* TODO: implement*/ assert(false); \ + /* TODO: implement*/ ASSERT(false); \ return __VA_ARGS__; \ } while (0) #define KOALA_INTEROP_THROW_STRING(vmContext, message, ...) \ do { \ - /* TODO: implement*/ assert(false); \ + /* TODO: implement*/ ASSERT(false); \ return __VA_ARGS__; \ } while (0) + +#endif // CONVERTORS_CJ_H \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/common-interop.cc b/koala-wrapper/koalaui/interop/src/cpp/common-interop.cc index ec6572c6d..ca9d1979e 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/common-interop.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/common-interop.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,6 +16,10 @@ #include #include +#ifndef KOALA_INTEROP_MEM_ANALYZER +#include +#endif + #ifdef KOALA_INTEROP_MODULE #undef KOALA_INTEROP_MODULE #endif @@ -25,6 +29,14 @@ #include "interop-logging.h" #include "dynamic-loader.h" +#ifdef KOALA_FOREIGN_NAPI +#ifndef KOALA_FOREIGN_NAPI_OHOS +#include +#else +#include +#include +#endif +#endif #if KOALA_INTEROP_PROFILER #include "profiler.h" @@ -35,6 +47,10 @@ InteropProfiler* InteropProfiler::_instance = nullptr; using std::string; +#ifndef KOALA_INTEROP_MEM_ANALYZER +static std::atomic mallocCounter{0}; +#endif + #ifdef KOALA_NAPI // Callback dispatcher MOVED to convertors-napi.cc. // Let's keep platform-specific parts of the code together @@ -88,6 +104,8 @@ void getKoalaEtsNapiCallbackDispatcher(ets_class* clazz, ets_method* method) { } #endif + +// TODO: move callback dispetchers to convertors-.cc. #ifdef KOALA_JNI #include "jni.h" static struct { @@ -127,7 +145,13 @@ KOALA_INTEROP_1(StringLength, KInt, KNativePointer) void impl_StringData(KNativePointer ptr, KByte* bytes, KUInt size) { string* s = reinterpret_cast(ptr); - if (s) memcpy(bytes, s->c_str(), size); + if (s) { + #ifdef __STDC_LIB_EXT1__ + memcpy_s(bytes, size, s->c_str(), size); + #else + memcpy(bytes, s->c_str(), size); + #endif + } } KOALA_INTEROP_V3(StringData, KNativePointer, KByte*, KUInt) @@ -148,11 +172,11 @@ KNativePointer impl_StringMake(const KStringPtr& str) { KOALA_INTEROP_1(StringMake, KNativePointer, KStringPtr) // For slow runtimes w/o fast encoders. -KInt impl_ManagedStringWrite(const KStringPtr& string, KByte* buffer, KInt offset) { - memcpy(buffer + offset, string.c_str(), string.length() + 1); +KInt impl_ManagedStringWrite(const KStringPtr& string, KSerializerBuffer buffer, KInt offset) { + memcpy((uint8_t*)buffer + offset, string.c_str(), string.length() + 1); return string.length() + 1; } -KOALA_INTEROP_3(ManagedStringWrite, KInt, KStringPtr, KByte*, KInt) +KOALA_INTEROP_3(ManagedStringWrite, KInt, KStringPtr, KSerializerBuffer, KInt) void stringFinalizer(string* ptr) { delete ptr; @@ -184,35 +208,6 @@ inline KUInt unpackUInt(const KByte* bytes) { return (bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24)); } -std::vector makeStringVector(KStringArray strArray) { - if (strArray == nullptr) { - return std::vector(0); - } - KUInt arraySize = unpackUInt(strArray); - std::vector res(arraySize); - size_t offset = sizeof(KUInt); - for (KUInt i = 0; i < arraySize; ++i) { - int len = unpackUInt(strArray + offset); - res[i].assign((const char*)(strArray + offset + sizeof(KUInt)), len); - offset += len + sizeof(KUInt); - } - return res; -} - -std::vector makeStringVector(KNativePointerArray arr, KInt length) { - if (arr == nullptr) { - return std::vector(0); - } else { - std::vector res(length); - char** strings = reinterpret_cast(arr); - for (KInt i = 0; i < length; ++i) { - const char* str = reinterpret_cast(strings[i]); - res[i].assign(str); - } - return res; - } -} - KNativePointer impl_GetGroupedLog(KInt index) { return new std::string(GetDefaultLogger()->getGroupedLog(index)); } @@ -247,6 +242,7 @@ KOALA_INTEROP_V1(PrintGroupedLog, KInt) int32_t callCallback(KVMContext context, int32_t methodId, uint8_t* argsData, int32_t argsLength) { #if KOALA_USE_NODE_VM || KOALA_USE_HZ_VM || KOALA_USE_PANDA_VM || KOALA_USE_JAVA_VM || KOALA_CJ KOALA_INTEROP_CALL_INT(context, methodId, argsLength, argsData); + return 0; #else return 0; #endif @@ -256,11 +252,12 @@ struct ForeignVMContext { KVMContext vmContext; int32_t (*callSync)(KVMContext vmContext, int32_t callback, uint8_t* data, int32_t length); }; -typedef KInt (*LoadVirtualMachine_t)(KInt vmKind, const char* classPath, const char* libraryPath, const struct ForeignVMContext* foreignVM); +typedef KInt (*LoadVirtualMachine_t)(KInt vmKind, const char* bootFiles, const char* userFiles, const char* libraryPath, const struct ForeignVMContext* foreignVM); typedef KNativePointer (*StartApplication_t)(const char* appUrl, const char* appParams); typedef KBoolean (*RunApplication_t)(const KInt arg0, const KInt arg1); typedef const char* (*EmitEvent_t)(const KInt type, const KInt target, const KInt arg0, const KInt arg1); typedef void (*RestartWith_t)(const char* page); +typedef const char* (*LoadView_t)(const char* className, const char* params); void* getImpl(const char* path, const char* name) { static void* lib = nullptr; @@ -278,12 +275,12 @@ void* getImpl(const char* path, const char* name) { return findSymbol(lib, name); } -KInt impl_LoadVirtualMachine(KVMContext vmContext, KInt vmKind, const KStringPtr& classPath, const KStringPtr& libraryPath) { +KInt impl_LoadVirtualMachine(KVMContext vmContext, KInt vmKind, const KStringPtr& bootFiles, const KStringPtr& userFiles, const KStringPtr& libraryPath) { const char* envClassPath = std::getenv("PANDA_CLASS_PATH"); if (envClassPath) { LOGI("CLASS PATH updated from env var PANDA_CLASS_PATH, %" LOG_PUBLIC "s", envClassPath); } - const char* appClassPath = envClassPath ? envClassPath : classPath.c_str(); + const char* bootFilesPath = envClassPath ? envClassPath : bootFiles.c_str(); const char* nativeLibPath = envClassPath ? envClassPath : libraryPath.c_str(); static LoadVirtualMachine_t impl = nullptr; @@ -292,9 +289,9 @@ KInt impl_LoadVirtualMachine(KVMContext vmContext, KInt vmKind, const KStringPtr const ForeignVMContext foreignVM = { vmContext, &callCallback }; - return impl(vmKind, appClassPath, nativeLibPath, &foreignVM); + return impl(vmKind, bootFilesPath, userFiles.c_str(), nativeLibPath, &foreignVM); } -KOALA_INTEROP_CTX_3(LoadVirtualMachine, KInt, KInt, KStringPtr, KStringPtr) +KOALA_INTEROP_CTX_4(LoadVirtualMachine, KInt, KInt, KStringPtr, KStringPtr, KStringPtr) KNativePointer impl_StartApplication(const KStringPtr& appUrl, const KStringPtr& appParams) { static StartApplication_t impl = nullptr; @@ -327,29 +324,86 @@ void impl_RestartWith(const KStringPtr& page) { } KOALA_INTEROP_V1(RestartWith, KStringPtr) +#ifdef KOALA_ANI +KStringPtr impl_LoadView(const KStringPtr& className, const KStringPtr& params) { + static LoadView_t impl = nullptr; + if (!impl) impl = reinterpret_cast(getImpl(nullptr, "LoadView")); + const char* result = impl(className.c_str(), params.c_str()); + return KStringPtr(result, strlen(result), true); +} +KOALA_INTEROP_2(LoadView, KStringPtr, KStringPtr, KStringPtr) +#endif // KOALA_ANI + +KNativePointer impl_Malloc(KLong length) { + const auto ptr = static_cast(malloc(length)); + if (ptr == nullptr) { + INTEROP_FATAL("Memory allocation failed!"); + } +#ifndef KOALA_INTEROP_MEM_ANALYZER + mallocCounter.fetch_add(1, std::memory_order_release); +#endif + return ptr; +} +KOALA_INTEROP_DIRECT_1(Malloc, KNativePointer, KLong) + +void impl_Free(KNativePointer data) { + if (data) { + free(data); +#ifndef KOALA_INTEROP_MEM_ANALYZER + if (mallocCounter.fetch_sub(1, std::memory_order_release) == 0) { + INTEROP_FATAL("Double-free detected!"); + } +#endif + } +} +KOALA_INTEROP_DIRECT_V1(Free, KNativePointer) + +KInt impl_ReadByte(KNativePointer data, KLong index, KLong length) { + if (index >= length) INTEROP_FATAL("impl_ReadByte: index %lld is equal or greater than length %lld", (long long)index, (long long) length); + uint8_t* ptr = reinterpret_cast(data); + return ptr[index]; +} +KOALA_INTEROP_DIRECT_3(ReadByte, KInt, KNativePointer, KLong, KLong) + +void impl_WriteByte(KNativePointer data, KInt index, KLong length, KInt value) { + if (index >= length) INTEROP_FATAL("impl_WriteByte: index %lld is equal or greater than length %lld", (long long)index, (long long) length); + uint8_t* ptr = reinterpret_cast(data); + ptr[index] = value; +} +KOALA_INTEROP_DIRECT_V4(WriteByte, KNativePointer, KLong, KLong, KInt) + +void impl_CopyArray(KNativePointer data, KLong length, KByte* array) { + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data, length, array, length); + #else + memcpy(data, array, length); + #endif +} +KOALA_INTEROP_V3(CopyArray, KNativePointer, KLong, KByte*) + static Callback_Caller_t g_callbackCaller = nullptr; void setCallbackCaller(Callback_Caller_t callbackCaller) { g_callbackCaller = callbackCaller; } -void impl_CallCallback(KInt callbackKind, KByte* args, KInt argsSize) { +void impl_CallCallback(KInt callbackKind, KSerializerBuffer args, KInt argsSize) { if (g_callbackCaller) { g_callbackCaller(callbackKind, args, argsSize); } } -KOALA_INTEROP_V3(CallCallback, KInt, KByte*, KInt) +KOALA_INTEROP_V3(CallCallback, KInt, KSerializerBuffer, KInt) static Callback_Caller_Sync_t g_callbackCallerSync = nullptr; void setCallbackCallerSync(Callback_Caller_Sync_t callbackCallerSync) { g_callbackCallerSync = callbackCallerSync; } -void impl_CallCallbackSync(KVMContext vmContext, KInt callbackKind, KByte* args, KInt argsSize) { +void impl_CallCallbackSync(KVMContext vmContext, KInt callbackKind, KSerializerBuffer args, KInt argsSize) { if (g_callbackCallerSync) { g_callbackCallerSync(vmContext, callbackKind, args, argsSize); } } -KOALA_INTEROP_CTX_V3(CallCallbackSync, KInt, KByte*, KInt) +KOALA_INTEROP_CTX_V3(CallCallbackSync, KInt, KSerializerBuffer, KInt) void impl_CallCallbackResourceHolder(KNativePointer holder, KInt resourceId) { reinterpret_cast(holder)(resourceId); @@ -372,8 +426,28 @@ KInt impl_CallForeignVM(KNativePointer foreignContextRaw, KInt function, KByte* } KOALA_INTEROP_4(CallForeignVM, KInt, KNativePointer, KInt, KByte*, KInt) +#ifdef KOALA_FOREIGN_NAPI +KVMContext g_foreignVMContext = nullptr; +#endif +void impl_SetForeignVMContext(KNativePointer foreignVMContextRaw) { +#ifdef KOALA_FOREIGN_NAPI + if (foreignVMContextRaw == nullptr) { + g_foreignVMContext = nullptr; + } else { + auto foreignContext = (const ForeignVMContext*)foreignVMContextRaw; + g_foreignVMContext = foreignContext->vmContext; + } +#endif + + /* supress unused private fields */ + (void)foreignVMContextRaw; +} +KOALA_INTEROP_V1(SetForeignVMContext, KNativePointer) + +#ifndef __QUOTE + #define __QUOTE(x) #x +#endif -#define __QUOTE(x) #x #define QUOTE(x) __QUOTE(x) void impl_NativeLog(const KStringPtr& str) { @@ -386,20 +460,23 @@ void impl_NativeLog(const KStringPtr& str) { } KOALA_INTEROP_V1(NativeLog, KStringPtr) - - void resolveDeferred(KVMDeferred* deferred, uint8_t* argsData, int32_t argsLength) { #ifdef KOALA_NAPI auto status = napi_call_threadsafe_function((napi_threadsafe_function)deferred->handler, deferred, napi_tsfn_nonblocking); if (status != napi_ok) LOGE("cannot call thread-safe function; status=%d", status); - napi_release_threadsafe_function((napi_threadsafe_function)deferred->handler, napi_tsfn_release); + if (deferred->handler) { + napi_release_threadsafe_function((napi_threadsafe_function)deferred->handler, napi_tsfn_release); + deferred->handler = nullptr; + } #endif } void rejectDeferred(KVMDeferred* deferred, const char* message) { #ifdef KOALA_NAPI - napi_release_threadsafe_function((napi_threadsafe_function)deferred->handler, napi_tsfn_release); - delete deferred; + if (deferred->handler) { + napi_release_threadsafe_function((napi_threadsafe_function)deferred->handler, napi_tsfn_release); + deferred->handler = nullptr; + } #endif } @@ -442,28 +519,205 @@ KVMDeferred* CreateDeferred(KVMContext vmContext, KVMObjectHandle* promiseHandle return deferred; } -#if defined(KOALA_ETS_NAPI) || defined(KOALA_NAPI) || defined(KOALA_JNI) || defined(KOALA_CJ) +class KoalaWork { +protected: + InteropVMContext vmContext; +#ifdef KOALA_FOREIGN_NAPI + KVMContext foreignVMContext; +#endif + void* vmWork; + void* handle; + void (*execute)(void* handle); + void (*complete)(void* handle); +public: + KoalaWork(InteropVMContext vmContext, + InteropNativePointer handle, + void (*execute)(InteropNativePointer handle), + void (*complete)(InteropNativePointer handle)); + void Queue(); + void Execute(); + void Cancel(); + void Complete(); +}; +static void DoQueue(void* handle) { + ((KoalaWork*)handle)->Queue(); +} +static void DoCancel(void* handle) { + ((KoalaWork*)handle)->Cancel(); +} + +InteropAsyncWork koalaCreateWork( + InteropVMContext vmContext, + InteropNativePointer handle, + void (*execute)(InteropNativePointer handle), + void (*complete)(InteropNativePointer handle) +) { + return { + new KoalaWork(vmContext, handle, execute, complete), + DoQueue, + DoCancel, + }; +} + +const InteropAsyncWorker* GetAsyncWorker() { + static InteropAsyncWorker worker = { + koalaCreateWork + }; + return &worker; +} + +#if defined(KOALA_NAPI) +static void DoExecute(napi_env env, void* handle) { + ((KoalaWork*)handle)->Execute(); +} +static void DoComplete(napi_env env, napi_status status, void* handle) { + ((KoalaWork*)handle)->Complete(); +} +KoalaWork::KoalaWork(InteropVMContext vmContext, + InteropNativePointer handle, + void (*execute)(InteropNativePointer handle), + void (*complete)(InteropNativePointer handle) +): vmContext(vmContext), handle(handle), execute(execute), complete(complete) { + napi_env env = (napi_env)vmContext; + napi_value resourceName = nullptr; + napi_create_string_utf8(env, "KoalaAsyncOperation", NAPI_AUTO_LENGTH, &resourceName); + napi_create_async_work(env, nullptr, resourceName, DoExecute, DoComplete, this, (napi_async_work*)&vmWork); + /* supress unused private fields */ + (void)vmContext; + (void)vmWork; +} +void KoalaWork::Queue() { + napi_env env = (napi_env)vmContext; + napi_queue_async_work(env, (napi_async_work)vmWork); +} +void KoalaWork::Execute() { + execute(handle); +} +void KoalaWork::Cancel() { + napi_env env = (napi_env)vmContext; + napi_cancel_async_work(env, (napi_async_work)vmWork); +} +void KoalaWork::Complete() { + complete(handle); + delete this; +} +#else +#ifdef KOALA_FOREIGN_NAPI +static void DoExecute(napi_env env, void* handle) { + ((KoalaWork*)handle)->Execute(); +} +static void DoComplete(napi_env env, napi_status status, void* handle) { + ((KoalaWork*)handle)->Complete(); +} +#endif +KoalaWork::KoalaWork(InteropVMContext vmContext, + InteropNativePointer handle, + void (*execute)(InteropNativePointer handle), + void (*complete)(InteropNativePointer handle) +): vmContext(vmContext), handle(handle), execute(execute), complete(complete) { +#ifdef KOALA_FOREIGN_NAPI + if (g_foreignVMContext == nullptr) + INTEROP_FATAL("Can not launch async work while foreign VM context is not available. Please ensure you have called SetForeignVMContext"); + foreignVMContext = g_foreignVMContext; + napi_env env = (napi_env)foreignVMContext; + napi_value resourceName = nullptr; + napi_create_string_utf8(env, "KoalaAsyncOperation", NAPI_AUTO_LENGTH, &resourceName); + napi_create_async_work(env, nullptr, resourceName, DoExecute, DoComplete, this, (napi_async_work*)&vmWork); +#endif + /* supress unused private fields */ + (void)vmContext; + (void)vmWork; +} +void KoalaWork::Queue() { +#ifdef KOALA_FOREIGN_NAPI + napi_env env = (napi_env)foreignVMContext; + napi_queue_async_work(env, (napi_async_work)vmWork); +#else + Execute(); + Complete(); +#endif +} +void KoalaWork::Execute() { + execute(handle); +} +void KoalaWork::Cancel() { +#ifdef KOALA_FOREIGN_NAPI + napi_env env = (napi_env)foreignVMContext; + napi_cancel_async_work(env, (napi_async_work)vmWork); +#else + INTEROP_FATAL("Cancelling async work is disabled for any VM except of Node"); +#endif +} +void KoalaWork::Complete() { + complete(handle); + delete this; +} +#endif + + +#if defined(KOALA_ETS_NAPI) || defined(KOALA_ANI) +KStringPtr impl_Utf8ToString(KVMContext vmContext, KNativePointer data, KInt offset, KInt length) { + KStringPtr result((const char*)data + offset, length, false); + return result; +} +KOALA_INTEROP_CTX_3(Utf8ToString, KStringPtr, KNativePointer, KInt, KInt) +#elif defined(KOALA_NAPI) || defined(KOALA_JNI) || defined(KOALA_CJ) // Allocate, so CTX versions. KStringPtr impl_Utf8ToString(KVMContext vmContext, KByte* data, KInt offset, KInt length) { KStringPtr result((const char*)(data + offset), length, false); return result; } KOALA_INTEROP_CTX_3(Utf8ToString, KStringPtr, KByte*, KInt, KInt) +#endif + +#if defined(KOALA_NAPI) || defined(KOALA_ANI) +KStringPtr impl_RawUtf8ToString(KVMContext vmContext, KNativePointer data) { + auto string = (const char*)data; + KStringPtr result(string, strlen(string), false); + return result; +} +KOALA_INTEROP_CTX_1(RawUtf8ToString, KStringPtr, KNativePointer) +#endif +#if defined(KOALA_NAPI) || defined(KOALA_JNI) || defined(KOALA_CJ) || defined(KOALA_ETS_NAPI) || defined(KOALA_ANI) KStringPtr impl_StdStringToString(KVMContext vmContext, KNativePointer stringPtr) { std::string* string = reinterpret_cast(stringPtr); KStringPtr result(string->c_str(), string->size(), false); return result; } KOALA_INTEROP_CTX_1(StdStringToString, KStringPtr, KNativePointer) -#endif -#if defined(KOALA_JNI) || defined(KOALA_NAPI) || defined(KOALA_CJ) KInteropReturnBuffer impl_RawReturnData(KVMContext vmContext, KInt v1, KInt v2) { void* data = new int8_t[v1]; - memset(data, v2, v1); + #ifdef __STDC_LIB_EXT1__ + memset_s(data, v1, v2, v1); + #else + memset(data, v2, v1); + #endif KInteropReturnBuffer buffer = { v1, data, [](KNativePointer ptr, KInt) { delete[] (int8_t*)ptr; }}; return buffer; } KOALA_INTEROP_CTX_2(RawReturnData, KInteropReturnBuffer, KInt, KInt) + +KInteropNumber impl_IncrementNumber(KInteropNumber number) { + if (number.tag == 102) + number.i32++; + else + number.f32 += 1.f; + return number; +} +KOALA_INTEROP_1(IncrementNumber, KInteropNumber, KInteropNumber) + +void impl_ReportMemLeaks() { +#ifndef KOALA_INTEROP_MEM_ANALYZER + const auto count = mallocCounter.load(std::memory_order_acquire); + if (count > 0) { + fprintf(stderr, "Memory leaks detected: %d blocks\n", count); + } else { + fprintf(stderr, "No memory leaks\n"); + } #endif +} +KOALA_INTEROP_V0(ReportMemLeaks) + +#endif \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/common-interop.h b/koala-wrapper/koalaui/interop/src/cpp/common-interop.h index abc8ebfd0..bbbb3db53 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/common-interop.h +++ b/koala-wrapper/koalaui/interop/src/cpp/common-interop.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -40,15 +40,19 @@ #define KOALA_MAYBE_LOG(name) #endif -typedef void (*Callback_Caller_t)(KInt callbackKind, KByte* argsData, KInt argsLength); -typedef void (*Callback_Caller_Sync_t)(KVMContext vmContext, KInt callbackKind, KByte* argsData, KInt argsLength); -void setCallbackCaller(Callback_Caller_t caller); -void setCallbackCallerSync(Callback_Caller_Sync_t callerSync); +#ifdef KOALA_WINDOWS +#define DLL_EXPORT __declspec(dllexport) +#else +#define DLL_EXPORT __attribute__ ((visibility ("default"))) +#endif -KVMDeferred* CreateDeferred(KVMContext context, KVMObjectHandle* promise); +typedef void (*Callback_Caller_t)(KInt callbackKind, KSerializerBuffer argsData, KInt argsLength); +typedef void (*Callback_Caller_Sync_t)(KVMContext vmContext, KInt callbackKind, KSerializerBuffer argsData, KInt argsLength); +extern "C" DLL_EXPORT void setCallbackCaller(Callback_Caller_t caller); +extern "C" DLL_EXPORT void setCallbackCallerSync(Callback_Caller_Sync_t callerSync); -std::vector makeStringVector(KStringArray strArray); -std::vector makeStringVector(KNativePointerArray arr, KInt size); +extern "C" DLL_EXPORT KVMDeferred* CreateDeferred(KVMContext context, KVMObjectHandle* promise); +extern "C" DLL_EXPORT const InteropAsyncWorker* GetAsyncWorker(); #if KOALA_USE_NODE_VM || KOALA_USE_HZ_VM #include "convertors-napi.h" diff --git a/koala-wrapper/koalaui/interop/src/cpp/crashdump.h b/koala-wrapper/koalaui/interop/src/cpp/crashdump.h index 7d1bac040..128f7ba61 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/crashdump.h +++ b/koala-wrapper/koalaui/interop/src/cpp/crashdump.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/cpp/dynamic-loader.h b/koala-wrapper/koalaui/interop/src/cpp/dynamic-loader.h index f354a4f25..cfc912b9c 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/dynamic-loader.h +++ b/koala-wrapper/koalaui/interop/src/cpp/dynamic-loader.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -28,7 +28,11 @@ inline void* loadLibrary(const std::string& libPath) { inline const char* libraryError() { static char error[256]; - snprintf(error, sizeof error, "error %lu", GetLastError()); + #ifdef __STDC_LIB_EXT1__ + snprintf_s(error, sizeof error, "error %lu", GetLastError()); + #else + snprintf(error, sizeof error, "error %lu", GetLastError()); + #endif return error; } diff --git a/koala-wrapper/koalaui/interop/src/cpp/ets/convertors-ets.cc b/koala-wrapper/koalaui/interop/src/cpp/ets/convertors-ets.cc index 450804338..e7db9799d 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/ets/convertors-ets.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/ets/convertors-ets.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,7 +20,7 @@ #include "interop-types.h" static const char* callCallbackFromNative = "callCallbackFromNative"; -static const char* callCallbackFromNativeSig = "I[BI:I"; +static const char* callCallbackFromNativeSig = "IJI:I"; static const char* FAST_NATIVE_PREFIX = "#F$"; @@ -38,7 +38,6 @@ static bool registerNatives(ets_env *env, const ets_class clazz, const std::vect if (registerByOne) { result &= env->RegisterNatives(clazz, &method, 1) >= 0; if (env->ErrorCheck()) { - //env->ErrorDescribe(); env->ErrorClear(); } } @@ -56,10 +55,10 @@ bool registerAllModules(ets_env *env) { auto moduleNames = EtsExports::getInstance()->getModules(); for (auto it = moduleNames.begin(); it != moduleNames.end(); ++it) { - std::string classpath = EtsExports::getInstance()->getClasspath(*it); - ets_class nativeModule = env->FindClass(classpath.c_str()); + std::string className = EtsExports::getInstance()->getClasspath(*it); + ets_class nativeModule = env->FindClass(className.c_str()); if (nativeModule == nullptr) { - LOGE("Cannot find managed class %s", classpath.c_str()); + LOGE("Cannot find managed class %s", className.c_str()); continue; } if (!registerNatives(env, nativeModule, EtsExports::getInstance()->getMethods(*it))) { @@ -71,6 +70,7 @@ bool registerAllModules(ets_env *env) { } extern "C" ETS_EXPORT ets_int ETS_CALL EtsNapiOnLoad(ets_env *env) { + LOGE("Use ETSNAPI") if (!registerAllModules(env)) { LOGE("Failed to register ets modules"); return ETS_ERR; @@ -129,12 +129,12 @@ void EtsExports::setClasspath(const char* module, const char *classpath) { } } -static std::map g_defaultClasspaths = { - {"InteropNativeModule", "@koalaui/interop/InteropNativeModule/InteropNativeModule"}, +static std::map g_defaultClasspaths = { + {"InteropNativeModule", "#koalaui/interop/InteropNativeModule/InteropNativeModule"}, // todo leave just InteropNativeModule, define others via KOALA_ETS_INTEROP_MODULE_CLASSPATH - {"TestNativeModule", "@koalaui/arkts-arkui/generated/arkts/TestNativeModule/TestNativeModule"}, - {"ArkUINativeModule", "@koalaui/arkts-arkui/generated/arkts/ArkUINativeModule/ArkUINativeModule"}, - {"ArkUIGeneratedNativeModule", "@koalaui/arkts-arkui/generated/arkts/ArkUIGeneratedNativeModule/ArkUIGeneratedNativeModule"}, + {"TestNativeModule", "@ohos/arkui/generated/arkts/TestNativeModule/TestNativeModule"}, + {"ArkUINativeModule", "@ohos/arkui/generated/arkts/ArkUINativeModule/ArkUINativeModule"}, + {"ArkUIGeneratedNativeModule", "@ohos/arkui/generated/arkts/ArkUIGeneratedNativeModule/ArkUIGeneratedNativeModule"}, }; const std::string& EtsExports::getClasspath(const std::string& module) { auto it = classpaths.find(module); diff --git a/koala-wrapper/koalaui/interop/src/cpp/ets/convertors-ets.h b/koala-wrapper/koalaui/interop/src/cpp/ets/convertors-ets.h index c03b5af27..4d3ed1516 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/ets/convertors-ets.h +++ b/koala-wrapper/koalaui/interop/src/cpp/ets/convertors-ets.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,11 +13,11 @@ * limitations under the License. */ -#pragma once +#ifndef CONVERTORS_ETS_H +#define CONVERTORS_ETS_H #ifdef KOALA_ETS_NAPI -#include #include #include #include @@ -31,11 +31,102 @@ template struct InteropTypeConverter { using InteropType = T; - static T convertFrom(EtsEnv* env, InteropType value) { return value; } - static InteropType convertTo(EtsEnv* env, T value) { return value; } + static T convertFrom(EtsEnv* env, InteropType value) = delete; + static InteropType convertTo(EtsEnv* env, T value) = delete; static void release(EtsEnv* env, InteropType value, T converted) {} }; +template<> +struct InteropTypeConverter { + using InteropType = ets_boolean; + static KBoolean convertFrom(EtsEnv* env, InteropType value) { return value; } + static InteropType convertTo(EtsEnv* env, KBoolean value) { return value; } + static void release(EtsEnv* env, InteropType value, KBoolean converted) {} +}; + + +template<> +struct InteropTypeConverter { + using InteropType = ets_int; + static KInt convertFrom(EtsEnv* env, InteropType value) { return value; } + static InteropType convertTo(EtsEnv* env, KInt value) { return value; } + static void release(EtsEnv* env, InteropType value, KInt converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ets_int; + static KUInt convertFrom(EtsEnv* env, InteropType value) { return value; } + static InteropType convertTo(EtsEnv* env, KUInt value) { return value; } + static void release(EtsEnv* env, InteropType value, KUInt converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ets_byte; + static KByte convertFrom(EtsEnv* env, InteropType value) { return value; } + static InteropType convertTo(EtsEnv* env, KByte value) { return value; } + static void release(EtsEnv* env, InteropType value, KByte converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ets_float; + static KFloat convertFrom(EtsEnv* env, InteropType value) { return value; } + static InteropType convertTo(EtsEnv* env, InteropFloat32 value) { return value; } + static void release(EtsEnv* env, InteropType value, KFloat converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ets_long; + static KSerializerBuffer convertFrom(EtsEnv* env, InteropType value) { + return reinterpret_cast(static_cast(value)); + } + static InteropType convertTo(EtsEnv* env, KSerializerBuffer value) = delete; + static void release(EtsEnv* env, InteropType value, KSerializerBuffer converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ets_object; + static KVMObjectHandle convertFrom(EtsEnv* env, InteropType value) { + return reinterpret_cast(value); + } + static InteropType convertTo(EtsEnv* env, KVMObjectHandle value) { + return reinterpret_cast(value); + } + static void release(EtsEnv* env, InteropType value, KVMObjectHandle converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ets_byteArray; + static KInteropBuffer convertFrom(EtsEnv* env, InteropType value) { + if (!value) return KInteropBuffer(); + KInteropBuffer result; + result.data = (KByte*)env->PinByteArray(value); + result.length = env->GetArrayLength(value); + return result; + } + static InteropType convertTo(EtsEnv* env, KInteropBuffer value) { + int bufferLength = value.length; + ets_byteArray array = env->NewByteArray(bufferLength); + KByte* data = (KByte*)env->PinByteArray(array); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data, bufferLength, (KByte*)value.data, bufferLength); + #else + memcpy(data, (KByte*)value.data, bufferLength); + #endif + env->UnpinByteArray(array); + value.dispose(value.resourceId); + return array; + } + static void release(EtsEnv* env, InteropType value, KInteropBuffer converted) { + env->UnpinByteArray(value); + } +}; + template<> struct InteropTypeConverter { using InteropType = ets_string; @@ -65,11 +156,36 @@ struct InteropTypeConverter { static void release(EtsEnv* env, InteropType value, KNativePointer converted) {} }; +template<> +struct InteropTypeConverter { + using InteropType = ets_long; + static KLong convertFrom(EtsEnv* env, InteropType value) { + return value; + } + static InteropType convertTo(EtsEnv* env, KLong value) { + return value; + } + static void release(EtsEnv* env, InteropType value, KLong converted) {} +}; + +template<> +struct InteropTypeConverter { + using InteropType = ets_long; + static KULong convertFrom(EtsEnv* env, InteropType value) { + return static_cast(value); + } + static InteropType convertTo(EtsEnv* env, KULong value) { + return static_cast(value); + } + static void release(EtsEnv* env, InteropType value, KULong converted) {} +}; + + template<> struct InteropTypeConverter { using InteropType = ets_intArray; static KInt* convertFrom(EtsEnv* env, InteropType value) { - if (!value) return nullptr; + if (!value) return nullptr; return env->PinIntArray(value); } static InteropType convertTo(EtsEnv* env, KInt* value) = delete; @@ -91,6 +207,26 @@ struct InteropTypeConverter { } }; +template<> +struct InteropTypeConverter { + using InteropType = ets_byteArray; + static KInteropReturnBuffer convertFrom(EtsEnv* env, InteropType value) = delete; + static InteropType convertTo(EtsEnv* env, KInteropReturnBuffer value) { + int bufferLength = value.length; + ets_byteArray array = env->NewByteArray(bufferLength); + KByte* data = (KByte*)env->PinByteArray(array); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data, bufferLength, (KByte*)value.data, bufferLength); + #else + memcpy(data, (KByte*)value.data, bufferLength); + #endif + env->UnpinByteArray(array); + value.dispose(value.data, bufferLength); + return array; + }; + static void release(EtsEnv* env, InteropType value, KInteropReturnBuffer converted) {} +}; + template<> struct InteropTypeConverter { using InteropType = ets_byteArray; @@ -112,8 +248,7 @@ template <> struct InteropTypeConverter { static InteropType convertTo(EtsEnv *env, KInteropNumber value) { return value.asDouble(); } - static void release(EtsEnv *env, InteropType value, - KInteropNumber converted) {} + static void release(EtsEnv *env, InteropType value, KInteropNumber converted) {} }; template<> @@ -124,7 +259,7 @@ struct InteropTypeConverter { const static ets_class int_class = reinterpret_cast(env->NewGlobalRef(env->FindClass("std/core/Int"))); const static ets_class string_class = reinterpret_cast(env->NewGlobalRef(env->FindClass("std/core/String"))); const static ets_class resource_class = reinterpret_cast( - env->NewGlobalRef(env->FindClass("@koalaui/arkts-arkui/generated/ArkResourceInterfaces/Resource"))); + env->NewGlobalRef(env->FindClass("@ohos/arkui/generated/resource/Resource"))); if (env->IsInstanceOf(value, double_class)) { const static ets_method double_p = env->Getp_method(double_class, "unboxed", ":D"); @@ -134,7 +269,7 @@ struct InteropTypeConverter { return KLength{ 1, (KFloat)env->CallIntMethod(value, int_p), 1, 0 }; } else if (env->IsInstanceOf(value, string_class)) { KStringPtr ptr = InteropTypeConverter::convertFrom(env, reinterpret_cast(value)); - KLength length = { 0 }; + KLength length { 0 }; parseKLength(ptr, &length); length.type = 2; length.resource = 0; @@ -165,6 +300,44 @@ inline void releaseArgument(EtsEnv* env, typename InteropTypeConverter::In InteropTypeConverter::release(env, arg, data); } +template +struct DirectInteropTypeConverter { + using InteropType = T; + static T convertFrom(InteropType value) { return value; } + static InteropType convertTo(T value) { return value; } +}; + +template<> +struct DirectInteropTypeConverter { + using InteropType = ets_long; + static KNativePointer convertFrom(InteropType value) { + return reinterpret_cast(value); + } + static InteropType convertTo(KNativePointer value) { + return reinterpret_cast(value); + } +}; + +template<> +struct DirectInteropTypeConverter { + using InteropType = ets_long; + static KSerializerBuffer convertFrom(InteropType value) { + return reinterpret_cast(static_cast(value)); + } + static InteropType convertTo(KSerializerBuffer value) = delete; +}; + +template <> +struct DirectInteropTypeConverter { + using InteropType = ets_double; + static KInteropNumber convertFrom(InteropType value) { + return KInteropNumber::fromDouble(value); + } + static InteropType convertTo(KInteropNumber value) { + return value.asDouble(); + } +}; + #define ETS_SLOW_NATIVE_FLAG 1 class EtsExports { @@ -1199,6 +1372,30 @@ MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2, ETS_SL } \ MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3, ETS_SLOW_NATIVE_FLAG) +#define KOALA_INTEROP_CTX_5(name, Ret, P0, P1, P2, P3, P4) \ + InteropTypeConverter::InteropType Ark_##name(EtsEnv *env, ets_class clazz, \ + InteropTypeConverter::InteropType _p0, \ + InteropTypeConverter::InteropType _p1, \ + InteropTypeConverter::InteropType _p2, \ + InteropTypeConverter::InteropType _p3, \ + InteropTypeConverter::InteropType _p4) { \ + KOALA_MAYBE_LOG(name) \ + P0 p0 = getArgument(env, _p0); \ + P1 p1 = getArgument(env, _p1); \ + P2 p2 = getArgument(env, _p2); \ + P3 p3 = getArgument(env, _p3); \ + P4 p4 = getArgument(env, _p4); \ + KVMContext ctx = (KVMContext)env; \ + auto rv = makeResult(env, impl_##name(ctx, p0, p1, p2, p3, p4)); \ + releaseArgument(env, _p0, p0); \ + releaseArgument(env, _p1, p1); \ + releaseArgument(env, _p2, p2); \ + releaseArgument(env, _p3, p3); \ + releaseArgument(env, _p4, p4); \ + return rv; \ + } \ +MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4, ETS_SLOW_NATIVE_FLAG) + #define KOALA_INTEROP_CTX_V0(name) \ void Ark_##name(EtsEnv *env, ets_class clazz) { \ KOALA_MAYBE_LOG(name) \ @@ -1292,6 +1489,307 @@ MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void|" #P0 "|" #P1 "|" #P2 "|" #P3, } \ MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4, ETS_SLOW_NATIVE_FLAG) +#define KOALA_INTEROP_DIRECT_0(name, Ret) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name()); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret, 0) +#define KOALA_INTEROP_DIRECT_1(name, Ret, P0) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0, 0) +#define KOALA_INTEROP_DIRECT_2(name, Ret, P0, P1) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1, 0) +#define KOALA_INTEROP_DIRECT_3(name, Ret, P0, P1, P2) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2, 0) +#define KOALA_INTEROP_DIRECT_4(name, Ret, P0, P1, P2, P3) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3, 0) +#define KOALA_INTEROP_DIRECT_5(name, Ret, P0, P1, P2, P3, P4) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4, 0) +#define KOALA_INTEROP_DIRECT_6(name, Ret, P0, P1, P2, P3, P4, P5) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5, 0) +#define KOALA_INTEROP_DIRECT_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6, 0) +#define KOALA_INTEROP_DIRECT_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7, 0) +#define KOALA_INTEROP_DIRECT_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8, 0) +#define KOALA_INTEROP_DIRECT_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8, \ + InteropTypeConverter::InteropType p9 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8), DirectInteropTypeConverter::convertFrom(p9))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8 "|" #P9, 0) +#define KOALA_INTEROP_DIRECT_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + inline InteropTypeConverter::InteropType Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8, \ + InteropTypeConverter::InteropType p9, \ + InteropTypeConverter::InteropType p10 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + return DirectInteropTypeConverter::convertTo(impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8), DirectInteropTypeConverter::convertFrom(p9), DirectInteropTypeConverter::convertFrom(p10))); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8 "|" #P9 "|" #P10, 0) +#define KOALA_INTEROP_DIRECT_V0(name) \ + inline void Ark_##name( \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void", 0) +#define KOALA_INTEROP_DIRECT_V1(name, P0) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0, 0) +#define KOALA_INTEROP_DIRECT_V2(name, P0, P1) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1, 0) +#define KOALA_INTEROP_DIRECT_V3(name, P0, P1, P2) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2, 0) +#define KOALA_INTEROP_DIRECT_V4(name, P0, P1, P2, P3) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3, 0) +#define KOALA_INTEROP_DIRECT_V5(name, P0, P1, P2, P3, P4) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4, 0) +#define KOALA_INTEROP_DIRECT_V6(name, P0, P1, P2, P3, P4, P5) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5, 0) +#define KOALA_INTEROP_DIRECT_V7(name, P0, P1, P2, P3, P4, P5, P6) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6, 0) +#define KOALA_INTEROP_DIRECT_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7, 0) +#define KOALA_INTEROP_DIRECT_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8, 0) +#define KOALA_INTEROP_DIRECT_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8, \ + InteropTypeConverter::InteropType p9 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8), DirectInteropTypeConverter::convertFrom(p9)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8 "|" #P9, 0) +#define KOALA_INTEROP_DIRECT_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + inline void Ark_##name( \ + InteropTypeConverter::InteropType p0, \ + InteropTypeConverter::InteropType p1, \ + InteropTypeConverter::InteropType p2, \ + InteropTypeConverter::InteropType p3, \ + InteropTypeConverter::InteropType p4, \ + InteropTypeConverter::InteropType p5, \ + InteropTypeConverter::InteropType p6, \ + InteropTypeConverter::InteropType p7, \ + InteropTypeConverter::InteropType p8, \ + InteropTypeConverter::InteropType p9, \ + InteropTypeConverter::InteropType p10 \ + ) { \ + KOALA_MAYBE_LOG(name) \ + impl_##name(DirectInteropTypeConverter::convertFrom(p0), DirectInteropTypeConverter::convertFrom(p1), DirectInteropTypeConverter::convertFrom(p2), DirectInteropTypeConverter::convertFrom(p3), DirectInteropTypeConverter::convertFrom(p4), DirectInteropTypeConverter::convertFrom(p5), DirectInteropTypeConverter::convertFrom(p6), DirectInteropTypeConverter::convertFrom(p7), DirectInteropTypeConverter::convertFrom(p8), DirectInteropTypeConverter::convertFrom(p9), DirectInteropTypeConverter::convertFrom(p10)); \ + } \ + MAKE_ETS_EXPORT(KOALA_INTEROP_MODULE, name, "void" "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4 "|" #P5 "|" #P6 "|" #P7 "|" #P8 "|" #P9 "|" #P10, 0) + bool setKoalaEtsNapiCallbackDispatcher( EtsEnv* etsEnv, ets_class clazz, @@ -1307,10 +1805,7 @@ void getKoalaEtsNapiCallbackDispatcher(ets_class* clazz, ets_method* method); getKoalaEtsNapiCallbackDispatcher(&clazz, &method); \ EtsEnv* etsEnv = reinterpret_cast(vmContext); \ etsEnv->PushLocalFrame(1); \ - ets_byteArray args_ets = etsEnv->NewByteArray(length); \ - etsEnv->SetByteArrayRegion(args_ets, 0, length, reinterpret_cast(args)); \ - etsEnv->CallStaticIntMethod(clazz, method, id, args_ets, length); \ - etsEnv->GetByteArrayRegion(args_ets, 0, length, reinterpret_cast(args)); \ + etsEnv->CallStaticIntMethod(clazz, method, id, args, length); \ etsEnv->PopLocalFrame(nullptr); \ } @@ -1320,11 +1815,8 @@ void getKoalaEtsNapiCallbackDispatcher(ets_class* clazz, ets_method* method); ets_method method = nullptr; \ getKoalaEtsNapiCallbackDispatcher(&clazz, &method); \ EtsEnv* etsEnv = reinterpret_cast(venv); \ - etsEnv->PushLocalFrame(1); \ - ets_byteArray args_ets = etsEnv->NewByteArray(length); \ - etsEnv->SetByteArrayRegion(args_ets, 0, length, reinterpret_cast(args)); \ - int32_t rv = etsEnv->CallStaticIntMethod(clazz, method, id, args_ets, length); \ - etsEnv->GetByteArrayRegion(args_ets, 0, length, reinterpret_cast(args)); \ + etsEnv->PushLocalFrame(1); \ + int32_t rv = etsEnv->CallStaticIntMethod(clazz, method, id, args, length); \ etsEnv->PopLocalFrame(nullptr); \ return rv; \ } @@ -1347,3 +1839,5 @@ void getKoalaEtsNapiCallbackDispatcher(ets_class* clazz, ets_method* method); } while (0) #endif // KOALA_ETS_NAPI + +#endif // CONVERTORS_ETS_H \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/ets/etsapi.h b/koala-wrapper/koalaui/interop/src/cpp/ets/etsapi.h index 15868ee90..41641c97e 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/ets/etsapi.h +++ b/koala-wrapper/koalaui/interop/src/cpp/ets/etsapi.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/cpp/interop-logging.cc b/koala-wrapper/koalaui/interop/src/cpp/interop-logging.cc index 073878547..2d2b11af7 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/interop-logging.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/interop-logging.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,6 +14,7 @@ */ #include #include +#include #include "interop-logging.h" @@ -27,7 +28,7 @@ struct Log { std::vector groupedLogs; void startGroupedLog(int index) { - if (index >= (int)groupedLogs.size()) { + if (index >= static_cast(groupedLogs.size())) { groupedLogs.resize(index + 1); for (int i = 0; i <= index; i++) { if (!groupedLogs[i]) groupedLogs[i] = new Log(); @@ -38,27 +39,27 @@ void startGroupedLog(int index) { } void stopGroupedLog(int index) { - if (index < (int)groupedLogs.size()) { + if (index < static_cast(groupedLogs.size())) { groupedLogs[index]->isActive = false; } } void appendGroupedLog(int index, const char* str) { - if (index < (int)groupedLogs.size()) { + if (index < static_cast(groupedLogs.size())) { groupedLogs[index]->log.append(str); } } const char* getGroupedLog(int index) { - if (index < (int)groupedLogs.size()) { - auto result = groupedLogs[index]->log.c_str(); + if (index < static_cast(groupedLogs.size())) { + const char* result = groupedLogs[index]->log.c_str(); return result; } return ""; } int needGroupedLog(int index) { - if (index < (int)groupedLogs.size()) { + if (index < static_cast(groupedLogs.size())) { return groupedLogs[index]->isActive; } return 0; @@ -76,4 +77,18 @@ const GroupLogger defaultInstance = { const GroupLogger* GetDefaultLogger() { return &defaultInstance; +} + +extern "C" [[noreturn]] void InteropLogFatal(const char* format, ...) { + va_list args; + va_start(args, format); + char buffer[4096]; + #ifdef __STDC_LIB_EXT1__ + vsnprintf_s(buffer, sizeof(buffer) - 1, format, args); + #else + vsnprintf(buffer, sizeof(buffer) - 1, format, args); + #endif + LOGE("FATAL: %s", buffer); + va_end(args); + abort(); } \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/interop-logging.h b/koala-wrapper/koalaui/interop/src/cpp/interop-logging.h index 4d1b7bc0f..61b490699 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/interop-logging.h +++ b/koala-wrapper/koalaui/interop/src/cpp/interop-logging.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,8 +15,15 @@ #ifndef _INTEROP_LGGING_H #define _INTEROP_LGGING_H -#include -#include +#ifdef __cplusplus + #include + #include + #include +#else + #include + #include + #include +#endif #if defined(KOALA_OHOS) #include "oh_sk_log.h" @@ -37,6 +44,10 @@ #define INTEROP_API_EXPORT __attribute__((visibility("default"))) #endif +#ifndef ASSERT + #define ASSERT(expression) assert(expression) +#endif + // Grouped logs. Keep consistent with type in ServiceGroupLogger typedef struct GroupLogger { void (*startGroupedLog)(int kind); @@ -46,6 +57,6 @@ typedef struct GroupLogger { int (*needGroupedLog)(int kind); } GroupLogger; -const GroupLogger* GetDefaultLogger(); +extern "C" INTEROP_API_EXPORT const GroupLogger* GetDefaultLogger(); #endif // _INTEROP_LOGGING_H \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/interop-types.h b/koala-wrapper/koalaui/interop/src/cpp/interop-types.h index 4c5c26187..6f10e60b8 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/interop-types.h +++ b/koala-wrapper/koalaui/interop/src/cpp/interop-types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -11,14 +11,22 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ +*/ #ifndef _INTEROP_TYPES_H_ #define _INTEROP_TYPES_H_ -#include +#ifdef __cplusplus + #include +#else + #include +#endif -#define INTEROP_FATAL(msg, ...) do { fprintf(stderr, msg "\n", ##__VA_ARGS__); abort(); } while (0) +#ifdef __cplusplus +extern "C" [[noreturn]] +#endif +void InteropLogFatal(const char* format, ...); +#define INTEROP_FATAL(msg, ...) do { InteropLogFatal(msg, ##__VA_ARGS__); } while (0) typedef enum InteropTag { @@ -142,4 +150,24 @@ typedef struct InteropBuffer { InteropInt64 length; } InteropBuffer; +typedef struct InteropAsyncWork { + InteropNativePointer workId; + void (*queue)(InteropNativePointer workId); + void (*cancel)(InteropNativePointer workId); +} InteropAsyncWork; + +typedef struct InteropAsyncWorker { + InteropAsyncWork (*createWork)( + InteropVMContext context, + InteropNativePointer handle, + void (*execute)(InteropNativePointer handle), + void (*complete)(InteropNativePointer handle) + ); +} InteropAsyncWorker; +typedef const InteropAsyncWorker* InteropAsyncWorkerPtr; + +typedef struct InteropObject { + InteropCallbackResource resource; +} InteropObject; + #endif // _INTEROP_TYPES_H_ diff --git a/koala-wrapper/koalaui/interop/src/cpp/jni/convertors-jni.cc b/koala-wrapper/koalaui/interop/src/cpp/jni/convertors-jni.cc index 782f2c2e3..683625b09 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/jni/convertors-jni.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/jni/convertors-jni.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/cpp/jni/convertors-jni.h b/koala-wrapper/koalaui/interop/src/cpp/jni/convertors-jni.h index 2ebefafe7..bfcacbb55 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/jni/convertors-jni.h +++ b/koala-wrapper/koalaui/interop/src/cpp/jni/convertors-jni.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,12 +13,12 @@ * limitations under the License. */ -#pragma once +#ifndef CONVERTORS_JNI_H +#define CONVERTORS_JNI_H #ifdef KOALA_JNI #include -#include #include #include @@ -99,7 +99,9 @@ struct InteropTypeConverter { env->GetStringUTFRegion(value, 0, env->GetStringLength(value), result.data()); return result; } - static InteropType convertTo(JNIEnv* env, KStringPtr value) = delete; + static InteropType convertTo(JNIEnv* env, KStringPtr value) { + return env->NewStringUTF(value.c_str()); + } static inline void release(JNIEnv* env, InteropType value, const KStringPtr& converted) { } }; @@ -145,9 +147,14 @@ struct SlowInteropTypeConverter { return result; } static InteropType convertTo(JNIEnv* env, KInteropBuffer value) { - jarray result = env->NewByteArray(value.length); + int bufferLength = value.length; + jarray result = env->NewByteArray(bufferLength); void* data = env->GetPrimitiveArrayCritical(result, nullptr); - memcpy(data, value.data, value.length); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data, bufferLength, value.data, bufferLength); + #else + memcpy(data, value.data, bufferLength); + #endif env->ReleasePrimitiveArrayCritical(result, data, 0); return result; } @@ -161,11 +168,16 @@ struct SlowInteropTypeConverter { using InteropType = jarray; static inline KInteropReturnBuffer convertFrom(JNIEnv* env, InteropType value) = delete; static InteropType convertTo(JNIEnv* env, KInteropReturnBuffer value) { - jarray result = env->NewByteArray(value.length); + int bufferLength = value.length; + jarray result = env->NewByteArray(bufferLength); void* data = env->GetPrimitiveArrayCritical(result, nullptr); - memcpy(data, value.data, value.length); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(data, bufferLength, value.data, bufferLength); + #else + memcpy(data, value.data, bufferLength); + #endif env->ReleasePrimitiveArrayCritical(result, data, 0); - value.dispose(value.data, value.length); + value.dispose(value.data, bufferLength); return result; } static inline void release(JNIEnv* env, InteropType value, const KInteropReturnBuffer& converted) = delete; @@ -295,7 +307,7 @@ template<> struct InteropTypeConverter { using InteropType = jstring; static KLength convertFrom(JNIEnv* env, InteropType value) { - KLength result = { 0 }; + KLength result { 0 }; if (value == nullptr) { result.type = -1; // ARK_RUNTIME_UNEXPECTED @@ -1315,6 +1327,30 @@ MAKE_JNI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2) } \ MAKE_JNI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3) +#define KOALA_INTEROP_CTX_5(name, Ret, P0, P1, P2, P3, P4) \ + KOALA_JNI_CALL(SlowInteropTypeConverter::InteropType) Java_org_##name(JNIEnv* env, jclass instance, \ + SlowInteropTypeConverter::InteropType _p0, \ + SlowInteropTypeConverter::InteropType _p1, \ + SlowInteropTypeConverter::InteropType _p2, \ + SlowInteropTypeConverter::InteropType _p3, \ + SlowInteropTypeConverter::InteropType _p4) { \ + KOALA_MAYBE_LOG(name) \ + P0 p0 = getArgument(env, _p0); \ + P1 p1 = getArgument(env, _p1); \ + P2 p2 = getArgument(env, _p2); \ + P3 p3 = getArgument(env, _p3); \ + P4 p4 = getArgument(env, _p4); \ + KVMContext ctx = (KVMContext)env; \ + auto rv = SlowInteropTypeConverter::convertTo(env, impl_##name(ctx, p0, p1, p2, p3, p4)); \ + releaseArgument(env, _p0, p0); \ + releaseArgument(env, _p1, p1); \ + releaseArgument(env, _p2, p2); \ + releaseArgument(env, _p3, p3); \ + releaseArgument(env, _p4, p4); \ + return rv; \ +} \ +MAKE_JNI_EXPORT(KOALA_INTEROP_MODULE, name, #Ret "|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4) + #define KOALA_INTEROP_CTX_V0(name) \ KOALA_JNI_CALL(void) Java_org_##name(JNIEnv* env, jclass instance) { \ KOALA_MAYBE_LOG(name) \ @@ -1408,6 +1444,55 @@ MAKE_JNI_EXPORT(KOALA_INTEROP_MODULE, name, "void|" #P0 "|" #P1 "|" #P2 "|" #P3) } \ MAKE_JNI_EXPORT(KOALA_INTEROP_MODULE, name, "void|" #P0 "|" #P1 "|" #P2 "|" #P3 "|" #P4) +#define KOALA_INTEROP_DIRECT_0(name, Ret) \ + KOALA_INTEROP_0(name, Ret) +#define KOALA_INTEROP_DIRECT_1(name, Ret, P0) \ + KOALA_INTEROP_1(name, Ret, P0) +#define KOALA_INTEROP_DIRECT_2(name, Ret, P0, P1) \ + KOALA_INTEROP_2(name, Ret, P0, P1) +#define KOALA_INTEROP_DIRECT_3(name, Ret, P0, P1, P2) \ + KOALA_INTEROP_3(name, Ret, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_4(name, Ret, P0, P1, P2, P3) \ + KOALA_INTEROP_4(name, Ret, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_5(name, Ret, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_5(name, Ret, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_6(name, Ret, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_6(name, Ret, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) +#define KOALA_INTEROP_DIRECT_V0(name) \ + KOALA_INTEROP_V0(name) +#define KOALA_INTEROP_DIRECT_V1(name, P0) \ + KOALA_INTEROP_V1(name, P0) +#define KOALA_INTEROP_DIRECT_V2(name, P0, P1) \ + KOALA_INTEROP_V2(name, P0, P1) +#define KOALA_INTEROP_DIRECT_V3(name, P0, P1, P2) \ + KOALA_INTEROP_V3(name, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_V4(name, P0, P1, P2, P3) \ + KOALA_INTEROP_V4(name, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_V5(name, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_V5(name, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_V6(name, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_V6(name, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_V7(name, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_V7(name, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) + bool setKoalaJniCallbackDispatcher( JNIEnv* env, jclass clazz, @@ -1463,3 +1548,5 @@ void getKoalaJniCallbackDispatcher(jclass* clazz, jmethodID* method); } while (0) #endif // KOALA_JNI_CALL + +#endif // CONVERTORS_JNI_H \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/jsc/convertors-jsc.cc b/koala-wrapper/koalaui/interop/src/cpp/jsc/convertors-jsc.cc index b1edbde65..46d142249 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/jsc/convertors-jsc.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/jsc/convertors-jsc.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,11 +16,12 @@ #include #include <_types/_uint32_t.h> #include <_types/_uint8_t.h> -#include #include #include "convertors-jsc.h" +#include "interop-logging.h" + // See https://github.com/BabylonJS/BabylonNative/blob/master/Dependencies/napi/napi-direct/source/js_native_api_javascriptcore.cc // for convertors logic. @@ -59,7 +60,7 @@ int32_t getInt32(JSContextRef context, JSValueRef value) { return 0; } if (JSValueIsUndefined(context, value)) { - assert(false); + ASSERT(false); return 0; } double result = JSValueToNumber(context, value, &exception); @@ -72,7 +73,7 @@ uint32_t getUInt32(JSContextRef context, JSValueRef value) { return 0; } if (JSValueIsUndefined(context, value)) { - assert(false); + ASSERT(false); return 0; } double result = JSValueToNumber(context, value, &exception); @@ -85,7 +86,7 @@ uint8_t getUInt8(JSContextRef context, JSValueRef value) { return 0; } if (JSValueIsUndefined(context, value)) { - assert(false); + ASSERT(false); return 0; } double result = JSValueToNumber(context, value, &exception); @@ -145,7 +146,11 @@ static JSValueRef u64ToBigInt(JSContextRef context, uint64_t value) { bigint = JSObjectCallAsFunction(context, bigIntFromParts, nullptr, 2, parts, nullptr); #else char buffer[128] = {0}; - std::snprintf(buffer, sizeof(buffer) - 1, "%zun", (size_t) value); + #ifdef __STDC_LIB_EXT1__ + std::snprintf_s(buffer, sizeof(buffer) - 1, "%zun", static_cast(value)); + #else + std::snprintf(buffer, sizeof(buffer) - 1, "%zun", static_cast(value)); + #endif JSStringRef script = JSStringCreateWithUTF8CString(buffer); bigint = JSEvaluateScript(context, script, nullptr, nullptr, 0, nullptr); JSStringRelease(script); @@ -158,10 +163,10 @@ static uint64_t bigIntToU64(JSContextRef ctx, JSValueRef value) { JSStringRef strRef = JSValueToStringCopy(ctx, value, nullptr); size_t len = JSStringGetUTF8CString(strRef, buf, sizeof(buf)); JSStringRelease(strRef); - assert(len < sizeof(buf)); + ASSERT(len < sizeof(buf)); char* suf; uint64_t numValue = std::strtoull(buf, &suf, 10); - assert(*suf == '\0'); + ASSERT(*suf == '\0'); return numValue; } @@ -175,8 +180,8 @@ KNativePointerArray getPointerElements(JSContextRef context, JSValueRef value) { return nullptr; } - assert(JSValueIsObject(context, value)); - assert(JSValueGetTypedArrayType(context, value, nullptr) == kJSTypedArrayTypeBigUint64Array); + ASSERT(JSValueIsObject(context, value)); + ASSERT(JSValueGetTypedArrayType(context, value, nullptr) == kJSTypedArrayTypeBigUint64Array); JSObjectRef typedArray = JSValueToObject(context, value, nullptr); return reinterpret_cast(JSObjectGetTypedArrayBytesPtr(context, typedArray, nullptr)); @@ -188,7 +193,7 @@ KFloat getFloat(JSContextRef context, JSValueRef value) { return 0; } if (JSValueIsUndefined(context, value)) { - assert(false); + ASSERT(false); return 0; } double result = JSValueToNumber(context, value, &exception); @@ -201,7 +206,7 @@ KShort getShort(JSContextRef context, JSValueRef value) { return 0; } if (JSValueIsUndefined(context, value)) { - assert(false); + ASSERT(false); return 0; } double result = JSValueToNumber(context, value, &exception); @@ -214,7 +219,7 @@ KUShort getUShort(JSContextRef context, JSValueRef value) { return 0; } if (JSValueIsUndefined(context, value)) { - assert(false); + ASSERT(false); return 0; } double result = JSValueToNumber(context, value, &exception); diff --git a/koala-wrapper/koalaui/interop/src/cpp/jsc/convertors-jsc.h b/koala-wrapper/koalaui/interop/src/cpp/jsc/convertors-jsc.h index b100dff7d..9f7d577ca 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/jsc/convertors-jsc.h +++ b/koala-wrapper/koalaui/interop/src/cpp/jsc/convertors-jsc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,8 @@ * limitations under the License. */ -#pragma once +#ifndef CONVERTORS_JSC_H +#define CONVERTORS_JSC_H #if defined(linux) #include // For IDE completion @@ -25,9 +26,8 @@ #include #include -#include - #include "koala-types.h" +#include "interop-logging.h" template inline ElemType* getTypedElements(JSContextRef context, const JSValueRef arguments) { @@ -35,7 +35,7 @@ inline ElemType* getTypedElements(JSContextRef context, const JSValueRef argumen return nullptr; } if (JSValueIsUndefined(context, arguments)) { - assert(false); + ASSERT(false); return nullptr; } JSValueRef exception {}; @@ -46,7 +46,7 @@ inline ElemType* getTypedElements(JSContextRef context, const JSValueRef argumen template inline ElemType* getTypedElements(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getTypedElements(context, arguments[index]); } @@ -74,85 +74,85 @@ inline Type getArgument(JSContextRef context, size_t argumentCount, const JSValu template <> inline int32_t getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getInt32(context, arguments[index]); } template <> inline uint32_t getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getUInt32(context, arguments[index]); } template <> inline uint8_t getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getUInt8(context, arguments[index]); } template <> inline KNativePointer getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getPointer(context, arguments[index]); } template <> inline KFloat getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getFloat(context, arguments[index]); } template <> inline KStringPtr getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getString(context, arguments[index]); } template <> inline KBoolean getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getBoolean(context, arguments[index]); } template <> inline KInt* getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getInt32Elements(context, arguments[index]); } template <> inline float* getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getFloat32Elements(context, arguments[index]); } template <> inline KByte* getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getByteElements(context, arguments[index]); } template <> inline KStringArray getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getKStringArray(context, arguments[index]); } template <> inline KUShort* getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getUShortElements(context, arguments[index]); } template <> inline KNativePointerArray getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getPointerElements(context, arguments[index]); } template <> inline KShort* getArgument(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], int index) { - assert(index < argumentCount); + ASSERT(index < argumentCount); return getShortElements(context, arguments[index]); } @@ -709,14 +709,65 @@ void InitExports(JSGlobalContextRef globalContext); } \ MAKE_JSC_EXPORT(name) + #define KOALA_INTEROP_DIRECT_0(name, Ret) \ + KOALA_INTEROP_0(name, Ret) +#define KOALA_INTEROP_DIRECT_1(name, Ret, P0) \ + KOALA_INTEROP_1(name, Ret, P0) +#define KOALA_INTEROP_DIRECT_2(name, Ret, P0, P1) \ + KOALA_INTEROP_2(name, Ret, P0, P1) +#define KOALA_INTEROP_DIRECT_3(name, Ret, P0, P1, P2) \ + KOALA_INTEROP_3(name, Ret, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_4(name, Ret, P0, P1, P2, P3) \ + KOALA_INTEROP_4(name, Ret, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_5(name, Ret, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_5(name, Ret, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_6(name, Ret, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_6(name, Ret, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) +#define KOALA_INTEROP_DIRECT_V0(name) \ + KOALA_INTEROP_V0(name) +#define KOALA_INTEROP_DIRECT_V1(name, P0) \ + KOALA_INTEROP_V1(name, P0) +#define KOALA_INTEROP_DIRECT_V2(name, P0, P1) \ + KOALA_INTEROP_V2(name, P0, P1) +#define KOALA_INTEROP_DIRECT_V3(name, P0, P1, P2) \ + KOALA_INTEROP_V3(name, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_V4(name, P0, P1, P2, P3) \ + KOALA_INTEROP_V4(name, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_V5(name, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_V5(name, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_V6(name, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_V6(name, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_V7(name, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_V7(name, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) + #define KOALA_INTEROP_THROW(vmContext, object, ...) \ do { \ - /* TODO: implement*/ assert(false); \ + /* TODO: implement*/ ASSERT(false); \ return __VA_ARGS__; \ } while (0) #define KOALA_INTEROP_THROW_STRING(vmContext, message, ...) \ do { \ - assert(false); /* TODO: implement*/ \ + ASSERT(false); /* TODO: implement*/ \ return __VA_ARGS__; \ } while (0) + +#endif // CONVERTORS_JSC_H \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/napi/convertors-napi.cc b/koala-wrapper/koalaui/interop/src/cpp/napi/convertors-napi.cc index 1bb1fc9b5..9dcadd339 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/napi/convertors-napi.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/napi/convertors-napi.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,10 +18,7 @@ #include #include "interop-logging.h" - -#ifdef KOALA_INTEROP_MODULE #undef KOALA_INTEROP_MODULE -#endif #define KOALA_INTEROP_MODULE InteropNativeModule #include "convertors-napi.h" @@ -116,7 +113,7 @@ KStringPtr getString(napi_env env, napi_value value) { return result; } -KNativePointer getPointer(napi_env env, napi_value value) { +KNativePointer getPointerSlow(napi_env env, napi_value value) { napi_valuetype valueType = getValueTypeChecked(env, value); if (valueType == napi_valuetype::napi_external) { KNativePointer result = nullptr; @@ -142,19 +139,29 @@ KNativePointer getPointer(napi_env env, napi_value value) { } KLong getInt64(napi_env env, napi_value value) { - if (getValueTypeChecked(env, value) != napi_valuetype::napi_bigint) { - napi_throw_error(env, nullptr, "cannot be coerced to int64"); - return -1; + if (getValueTypeChecked(env, value) == napi_valuetype::napi_number) { + int64_t result = 0; + if (napi_get_value_int64(env, value, &result) != napi_ok) { + napi_throw_error(env, nullptr, "cannot be coerced to int64"); + return -1; + } + return static_cast(result); } - - bool isWithinRange = true; - int64_t ptr64 = 0; - napi_get_value_bigint_int64(env, value, &ptr64, &isWithinRange); - if (!isWithinRange) { - napi_throw_error(env, nullptr, "cannot be coerced to int64, value is too large"); - return -1; + if (getValueTypeChecked(env, value) == napi_valuetype::napi_bigint) { + bool isWithinRange = true; + int64_t ptr64 = 0; + if (napi_get_value_bigint_int64(env, value, &ptr64, &isWithinRange) != napi_ok) { + napi_throw_error(env, nullptr, "cannot be coerced to int64"); + return -1; + } + if (!isWithinRange) { + napi_throw_error(env, nullptr, "cannot be coerced to int64, value is too large"); + return -1; + } + return static_cast(ptr64); } - return static_cast(ptr64); + napi_throw_error(env, nullptr, "cannot be coerced to int64"); + return -1; } KULong getUInt64(napi_env env, napi_value value) { @@ -170,7 +177,7 @@ KULong getUInt64(napi_env env, napi_value value) { napi_throw_error(env, nullptr, "cannot be coerced to uint64, value is too large"); return -1; } - return static_cast(ptr64); + return static_cast(ptr64); } napi_value makeString(napi_env env, const KStringPtr& value) { @@ -363,7 +370,7 @@ ModuleRegisterCallback ProvideModuleRegisterCallback(ModuleRegisterCallback valu static constexpr bool splitModules = true; static napi_value InitModule(napi_env env, napi_value exports) { - LOG("InitModule: " QUOTE(INTEROP_LIBRARY_NAME) "\n"); + // LOG("InitModule: " QUOTE(INTEROP_LIBRARY_NAME)); Exports* inst = Exports::getInstance(); napi_status status; napi_value target = exports; diff --git a/koala-wrapper/koalaui/interop/src/cpp/napi/convertors-napi.h b/koala-wrapper/koalaui/interop/src/cpp/napi/convertors-napi.h index 720d423f1..1bee3f69e 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/napi/convertors-napi.h +++ b/koala-wrapper/koalaui/interop/src/cpp/napi/convertors-napi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -55,20 +55,45 @@ inline void releaseArgument(napi_env env, typename InteropTypeConverter::I InteropTypeConverter::release(env, arg, data); } + +napi_value makeString(napi_env env, KStringPtr value); +napi_value makeString(napi_env env, const std::string& value); +napi_value makeBoolean(napi_env env, KBoolean value); +napi_value makeInt32(napi_env env, int32_t value); +napi_value makeUInt32(napi_env env, uint32_t value); +napi_value makeInt64(napi_env env, int64_t value); +napi_value makeUInt64(napi_env env, uint64_t value); +napi_value makeFloat32(napi_env env, float value); +napi_value makePointer(napi_env env, void* value); +napi_value makeVoid(napi_env env); + +void* getPointerSlow(napi_env env, napi_value value); + +inline void* getPointer(napi_env env, napi_value value) { + bool isWithinRange = true; + uint64_t ptrU64 = 0; + napi_status status = napi_get_value_bigint_uint64(env, value, &ptrU64, &isWithinRange); + if (status != 0 || !isWithinRange) + return getPointerSlow(env, value); + else + return reinterpret_cast(ptrU64); +} +void* getSerializerBufferPointer(napi_env env, napi_value value); + template<> struct InteropTypeConverter { using InteropType = napi_value; static KInteropBuffer convertFrom(napi_env env, InteropType value) { - KInteropBuffer result = { 0 }; + KInteropBuffer result {}; bool isArrayBuffer = false; napi_is_arraybuffer(env, value, &isArrayBuffer); if (isArrayBuffer) { - napi_get_arraybuffer_info(env, value, &result.data, (size_t*)&result.length); + napi_get_arraybuffer_info(env, value, &result.data, reinterpret_cast(&result.length)); } else { bool isDataView = false; napi_is_dataview(env, value, &isDataView); if (isDataView) { - napi_get_dataview_info(env, value, (size_t*)&result.length, &result.data, nullptr, nullptr); + napi_get_dataview_info(env, value, reinterpret_cast(&result.length), &result.data, nullptr, nullptr); } } return result; @@ -133,6 +158,18 @@ struct InteropTypeConverter { static void release(napi_env env, InteropType value, KInteropNumber converted) {} }; +template<> +struct InteropTypeConverter { + using InteropType = napi_value; + static KSerializerBuffer convertFrom(napi_env env, InteropType value) { + return (KSerializerBuffer)getSerializerBufferPointer(env, value); // TODO we are receiving Uint8Array from the native side + } + static InteropType convertTo(napi_env env, KSerializerBuffer value) { + return makePointer(env, value); + } + static void release(napi_env env, InteropType value, KSerializerBuffer converted) {} +}; + template<> struct InteropTypeConverter { using InteropType = napi_value; @@ -168,21 +205,24 @@ struct InteropTypeConverter { }; -#define KOALA_INTEROP_THROW(vmcontext, object, ...) \ +#define KOALA_INTEROP_THROW(vmContext, object, ...) \ do { \ - napi_env env = (napi_env)vmcontext; \ + napi_env env = (napi_env)vmContext; \ napi_handle_scope scope = nullptr; \ napi_open_handle_scope(env, &scope); \ - napi_throw((napi_env)vmcontext, object); \ + napi_throw(env, object); \ napi_close_handle_scope(env, scope); \ return __VA_ARGS__; \ } while (0) #define KOALA_INTEROP_THROW_STRING(vmContext, message, ...) \ do { \ - napi_value value; \ - napi_create_string_utf8((napi_env)vmContext, message, strlen(message), &value); \ - KOALA_INTEROP_THROW(vmContext, value, __VA_ARGS__); \ + napi_env env = (napi_env)vmContext; \ + napi_handle_scope scope = nullptr; \ + napi_open_handle_scope(env, &scope); \ + napi_throw_error(env, nullptr, message); \ + napi_close_handle_scope(env, scope); \ + return __VA_ARGS__; \ } while (0) #define NAPI_ASSERT_INDEX(info, index, result) \ @@ -364,6 +404,10 @@ inline KNativePointer* getPointerElements(const CallbackInfo& info, int index) { return getTypedElements(info, index); } +inline void* getSerializerBufferPointer(napi_env env, napi_value value) { + return getTypedElements(env, value); +} + KInt getInt32(napi_env env, napi_value value); inline int32_t getInt32(const CallbackInfo& info, int index) { NAPI_ASSERT_INDEX(info, index, 0); @@ -389,7 +433,6 @@ inline KStringPtr getString(const CallbackInfo& info, int index) { NAPI_ASSERT_INDEX(info, index, KStringPtr()); return getString(info.Env(), info[index]); } -void* getPointer(napi_env env, napi_value value); inline void* getPointer(const CallbackInfo& info, int index) { NAPI_ASSERT_INDEX(info, index, nullptr); return getPointer(info.Env(), info[index]); @@ -409,6 +452,12 @@ inline KBoolean getBoolean(const CallbackInfo& info, int index) { NAPI_ASSERT_INDEX(info, index, false); return getBoolean(info.Env(), info[index]); } +// TODO should we keep supporting conversion to and from raw JS object values? +// napi_value getObject(napi_env env, napi_value value); +// inline napi_value getObject(const CallbackInfo& info, int index) { +// NAPI_ASSERT_INDEX(info, index, info.Env().Global()); +// return getObject(info.Env(), info[index]); +// } template inline Type getArgument(const CallbackInfo& info, int index) = delete; @@ -434,9 +483,15 @@ inline KInteropNumber getArgument(const CallbackInfo& info, int return getArgument(info.Env(), info[index]); } +template <> +inline KSerializerBuffer getArgument(const CallbackInfo& info, int index) { + NAPI_ASSERT_INDEX(info, index, nullptr); + return getArgument(info.Env(), info[index]); +} + template <> inline KLength getArgument(const CallbackInfo& info, int index) { - KLength result = { 0 }; + KLength result { 0 }; NAPI_ASSERT_INDEX(info, index, result); auto value = info[index]; napi_valuetype type; @@ -479,7 +534,7 @@ inline KLength getArgument(const CallbackInfo& info, int index) { template <> inline KInteropBuffer getArgument(const CallbackInfo& info, int index) { - NAPI_ASSERT_INDEX(info, index, { 0 }); + NAPI_ASSERT_INDEX(info, index, {}); return getArgument((napi_env)info.Env(), (napi_value)info[index]); } @@ -513,11 +568,6 @@ inline KNativePointerArray getArgument(const CallbackInfo& return getPointerElements(info, index); } -// template <> -// inline napi_value getArgument(const CallbackInfo& info, int index) { -// return getObject(info, index); -// } - template <> inline uint8_t* getArgument(const CallbackInfo& info, int index) { return getUInt8Elements(info, index); @@ -563,18 +613,6 @@ inline KStringPtr getArgument(const CallbackInfo& info, int index) { return getString(info, index); } -napi_value makeString(napi_env env, KStringPtr value); -napi_value makeString(napi_env env, const std::string& value); -napi_value makeBoolean(napi_env env, KBoolean value); -napi_value makeInt32(napi_env env, int32_t value); -napi_value makeUInt32(napi_env env, uint32_t value); -napi_value makeInt64(napi_env env, int32_t value); -napi_value makeUInt64(napi_env env, uint32_t value); -napi_value makeFloat32(napi_env env, float value); -napi_value makePointer(napi_env env, void* value); -napi_value makeVoid(napi_env env); -// napi_value makeObject(napi_env env, napi_value object); - inline napi_value makeVoid(const CallbackInfo& info) { return makeVoid(info.Env()); } @@ -1227,6 +1265,20 @@ public: } \ MAKE_NODE_EXPORT(KOALA_INTEROP_MODULE, name) +#define KOALA_INTEROP_CTX_5(name, Ret, P0, P1, P2, P3, P4) \ + napi_value Node_##name(napi_env env, napi_callback_info cbinfo) { \ + KOALA_MAYBE_LOG(name) \ + CallbackInfo info(env, cbinfo); \ + KVMContext ctx = reinterpret_cast((napi_env)info.Env()); \ + P0 p0 = getArgument(info, 0); \ + P1 p1 = getArgument(info, 1); \ + P2 p2 = getArgument(info, 2); \ + P3 p3 = getArgument(info, 3); \ + P4 p4 = getArgument(info, 4); \ + return makeResult(info, impl_##name(ctx, p0, p1, p2, p3, p4)); \ + } \ + MAKE_NODE_EXPORT(KOALA_INTEROP_MODULE, name) + #define KOALA_INTEROP_CTX_V0(name) \ napi_value Node_##name(napi_env env, napi_callback_info cbinfo) { \ KOALA_MAYBE_LOG(name) \ @@ -1318,6 +1370,55 @@ public: } \ } while (0) + #define KOALA_INTEROP_DIRECT_0(name, Ret) \ + KOALA_INTEROP_0(name, Ret) +#define KOALA_INTEROP_DIRECT_1(name, Ret, P0) \ + KOALA_INTEROP_1(name, Ret, P0) +#define KOALA_INTEROP_DIRECT_2(name, Ret, P0, P1) \ + KOALA_INTEROP_2(name, Ret, P0, P1) +#define KOALA_INTEROP_DIRECT_3(name, Ret, P0, P1, P2) \ + KOALA_INTEROP_3(name, Ret, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_4(name, Ret, P0, P1, P2, P3) \ + KOALA_INTEROP_4(name, Ret, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_5(name, Ret, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_5(name, Ret, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_6(name, Ret, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_6(name, Ret, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) +#define KOALA_INTEROP_DIRECT_V0(name) \ + KOALA_INTEROP_V0(name) +#define KOALA_INTEROP_DIRECT_V1(name, P0) \ + KOALA_INTEROP_V1(name, P0) +#define KOALA_INTEROP_DIRECT_V2(name, P0, P1) \ + KOALA_INTEROP_V2(name, P0, P1) +#define KOALA_INTEROP_DIRECT_V3(name, P0, P1, P2) \ + KOALA_INTEROP_V3(name, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_V4(name, P0, P1, P2, P3) \ + KOALA_INTEROP_V4(name, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_V5(name, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_V5(name, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_V6(name, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_V6(name, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_V7(name, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_V7(name, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) + napi_value getKoalaNapiCallbackDispatcher(napi_env env); // TODO: can/shall we cache bridge reference? diff --git a/koala-wrapper/koalaui/interop/src/cpp/napi/win-dynamic-node.cc b/koala-wrapper/koalaui/interop/src/cpp/napi/win-dynamic-node.cc index 6ec8fcc34..6709d3c34 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/napi/win-dynamic-node.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/napi/win-dynamic-node.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,8 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include -#include + +#ifdef __cplusplus + #include + #include +#else + #include + #include +#endif + #include #include "node_api.h" @@ -85,10 +92,12 @@ op(napi_call_threadsafe_function) \ op(napi_is_dataview) \ op(napi_is_arraybuffer) \ - op(napi_get_dataview_info)\ - op(napi_get_boolean)\ - op(napi_create_uint32)\ - op(napi_create_bigint_int64)\ + op(napi_get_dataview_info) \ + op(napi_get_value_int64) \ + op(napi_get_boolean) \ + op(napi_create_uint32) \ + op(napi_create_bigint_int64) \ + op(napi_cancel_async_work) \ #define DECL_NAPI_IMPL(fn_name, ...) decltype(&fn_name) p_##fn_name; @@ -467,38 +476,6 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_create_int32(napi_env env, return p_napi_create_int32(env, value, result); } -NAPI_EXTERN napi_status NAPI_CDECL napi_get_boolean(napi_env env, - int32_t value, - napi_value* result) -{ -LoadNapiFunctions(); -return p_napi_create_int32(env, value, result); -} - -NAPI_EXTERN napi_status NAPI_CDECL napi_get_boolean(napi_env env, - bool value, - napi_value* result) -{ -LoadNapiFunctions(); -return p_napi_get_boolean(env, value, result); -} - -NAPI_EXTERN napi_status NAPI_CDECL napi_create_uint32(napi_env env, - uint32_t value, - napi_value* result) -{ - LoadNapiFunctions(); -return p_napi_create_uint32(env, value, result); -} - -NAPI_EXTERN napi_status NAPI_CDECL napi_create_bigint_int64(napi_env env, - int64_t value, - napi_value* result) -{ - LoadNapiFunctions(); - return p_napi_create_bigint_int64(env, value, result); -} - NAPI_EXTERN napi_status NAPI_CDECL napi_create_external_arraybuffer( napi_env env, void* external_data, @@ -670,3 +647,42 @@ napi_set_named_property(napi_env env, LoadNapiFunctions(); return p_napi_set_named_property(env, object, utf8name, value); } + +NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_int64(napi_env env, + napi_value value, + int64_t* result) +{ + LoadNapiFunctions(); + return p_napi_get_value_int64(env, value, result); +} + +NAPI_EXTERN napi_status NAPI_CDECL napi_get_boolean(napi_env env, + bool value, + napi_value* result) +{ +LoadNapiFunctions(); +return p_napi_get_boolean(env, value, result); +} + +NAPI_EXTERN napi_status NAPI_CDECL napi_create_uint32(napi_env env, + uint32_t value, + napi_value* result) +{ +LoadNapiFunctions(); +return p_napi_create_uint32(env, value, result); +} + +NAPI_EXTERN napi_status NAPI_CDECL napi_create_bigint_int64(napi_env env, + int64_t value, + napi_value* result) +{ + LoadNapiFunctions(); + return p_napi_create_bigint_int64(env, value, result); +} + +NAPI_EXTERN napi_status NAPI_CDECL napi_cancel_async_work(napi_env env, + napi_async_work work) +{ + LoadNapiFunctions(); + return p_napi_cancel_async_work(env, work); +} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/ohos/oh_sk_log.cc b/koala-wrapper/koalaui/interop/src/cpp/ohos/oh_sk_log.cc index 6aa01fe5e..edd37006b 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/ohos/oh_sk_log.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/ohos/oh_sk_log.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -24,9 +24,13 @@ static const char* KOALAUI_OHOS_LOG_ROOT = "/data/storage/el2/base/files/logs"; -#define APPLY_LOG_FILE_PATTERN(buf, t, ms, pid) \ - sprintf(buf, "%s/%d_%d_%d_%ld.pid%d.log", \ - KOALAUI_OHOS_LOG_ROOT, t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, ms.tv_sec, pid) +#define APPLY_LOG_FILE_PATTERN(buf, bufLen, t, ms, pid) \ + #ifdef __STDC_LIB_EXT1__ \ + sprintf_s(buf, bufLen, "%s/%d_%d_%d_%lld.pid%d.log", \ + #else \ + sprintf(buf, "%s/%d_%d_%d_%lld.pid%d.log", \ + #endif \ + KOALAUI_OHOS_LOG_ROOT, (t).tm_year + 1900, (t).tm_mon + 1, (t).tm_mday, (ms).tv_sec, pid) const char* oh_sk_log_type_str(oh_sk_log_type type) { switch (type) { @@ -46,15 +50,16 @@ void oh_sk_file_log(oh_sk_log_type type, const char* msg, ...) { static char* path = nullptr; if (!path) { - path = new char[strlen(KOALAUI_OHOS_LOG_ROOT) + 100]; - APPLY_LOG_FILE_PATTERN(path, lt, ms, getpid()); + size_t len = strlen(KOALAUI_OHOS_LOG_ROOT) + 100; + path = new char[len]; + APPLY_LOG_FILE_PATTERN(path, len, lt, ms, getpid()); mkdir(KOALAUI_OHOS_LOG_ROOT, 0777); } std::unique_ptr file(fopen(path, "a"), fclose); if (!file) return; - fprintf(file.get(), "%02d-%02d %02d:%02d:%02d.%03ld %s koala: ", + fprintf(file.get(), "%02d-%02d %02d:%02d:%02d.%03lld %s koala: ", lt.tm_mon + 1, lt.tm_mday, lt.tm_hour, lt.tm_min, lt.tm_sec, ms.tv_usec / 1000, oh_sk_log_type_str(type)); diff --git a/koala-wrapper/koalaui/interop/src/cpp/ohos/oh_sk_log.h b/koala-wrapper/koalaui/interop/src/cpp/ohos/oh_sk_log.h index 961e2c0f1..b268d0c46 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/ohos/oh_sk_log.h +++ b/koala-wrapper/koalaui/interop/src/cpp/ohos/oh_sk_log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,8 @@ * limitations under the License. */ -#pragma once +#ifndef OH_SK_LOG_H +#define OH_SK_LOG_H #include @@ -55,3 +56,5 @@ const char* oh_sk_log_type_str(oh_sk_log_type type); #define OH_SK_LOG_FATAL_A(msg, ...) OH_LOG_Print(LOG_APP, LOG_FATAL, 0xFF00, "Koala", msg, ##__VA_ARGS__) #endif + +#endif // OH_SK_LOG_H \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/cpp/profiler.h b/koala-wrapper/koalaui/interop/src/cpp/profiler.h index a3b9da38c..ac82fe74e 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/profiler.h +++ b/koala-wrapper/koalaui/interop/src/cpp/profiler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -68,7 +68,11 @@ class InteropProfiler { auto ns = a.second.time; auto count = a.second.count; char buffer[1024]; - snprintf(buffer, sizeof buffer, "for %s[%lld]: %.01f%% (%lld)\n", a.first.c_str(), (long long)count, (double)ns / total * 100.0, (long long)ns); + #ifdef __STDC_LIB_EXT1__ + snprintf_s(buffer, sizeof buffer, "for %s[%lld]: %.01f%% (%lld)\n", a.first.c_str(), (long long)count, (double)ns / total * 100.0, (long long)ns); + #else + snprintf(buffer, sizeof buffer, "for %s[%lld]: %.01f%% (%lld)\n", a.first.c_str(), (long long)count, (double)ns / total * 100.0, (long long)ns); + #endif result += buffer; }); return result; diff --git a/koala-wrapper/koalaui/interop/src/cpp/tracer.h b/koala-wrapper/koalaui/interop/src/cpp/tracer.h index f3b7ad20b..e3ac0397f 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/tracer.h +++ b/koala-wrapper/koalaui/interop/src/cpp/tracer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -11,7 +11,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ +*/ #ifndef _KOALA_TRACER_ #define _KOALA_TRACER_ diff --git a/koala-wrapper/koalaui/interop/src/cpp/types/koala-types.h b/koala-wrapper/koalaui/interop/src/cpp/types/koala-types.h index 2c5e88754..024bfa8af 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/types/koala-types.h +++ b/koala-wrapper/koalaui/interop/src/cpp/types/koala-types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,6 +21,26 @@ #include #include +#include "interop-types.h" + +#ifdef _MSC_VER +#define KOALA_EXECUTE(name, code) \ + static void __init_##name() { \ + code; \ + } \ + namespace { \ + struct __Init_##name { \ + __Init_##name() { __init_##name(); } \ + } __Init_##name##_v; \ + } +#else +#define KOALA_EXECUTE(name, code) \ + __attribute__((constructor)) \ + static void __init_jni_##name() { \ + code; \ + } +#endif + struct KStringPtrImpl { KStringPtrImpl(const char* str) : _value(nullptr), _owned(true) { int len = str ? strlen(str) : 0; @@ -34,6 +54,8 @@ struct KStringPtrImpl { KStringPtrImpl(const KStringPtrImpl& other) = delete; KStringPtrImpl& operator=(const KStringPtrImpl& other) = delete; + KStringPtrImpl(InteropString value): KStringPtrImpl(value.chars, value.length, true) {} + KStringPtrImpl(KStringPtrImpl&& other) { this->_value = other.release(); this->_owned = other._owned; @@ -66,7 +88,11 @@ struct KStringPtrImpl { if (data) { if (_owned) { _value = reinterpret_cast(malloc(len + 1)); - memcpy(_value, data, len); + #ifdef __STDC_LIB_EXT1__ + memcpy_s(_value, len, data, len); + #else + memcpy(_value, data, len); + #endif _value[len] = 0; } else { _value = const_cast(data); @@ -95,49 +121,99 @@ struct KInteropNumber { int32_t i32; float f32; }; + KInteropNumber() { + this->tag = 0; + this->i32 = 0; + } + KInteropNumber(int32_t value) { + this->tag = INTEROP_TAG_INT32; + this->i32 = value; + } + KInteropNumber(float value) { + this->tag = INTEROP_TAG_FLOAT32; + this->f32 = value; + } + KInteropNumber(InteropNumber value) { + this->tag = value.tag; + this->i32 = value.i32; + } + InteropNumber toCType() { + InteropNumber result; + result.tag = this->tag; + result.i32 = this->i32; + return result; + } static inline KInteropNumber fromDouble(double value) { - KInteropNumber result = { 0 }; + KInteropNumber result; // TODO: boundary check if (value == std::floor(value)) { - result.tag = 102; // ARK_TAG_INT32 - result.i32 = (int)value; + result.tag = INTEROP_TAG_INT32; + result.i32 = static_cast(value); } else { - result.tag = 103; // ARK_TAG_FLOAT32 + result.tag = INTEROP_TAG_FLOAT32; result.f32 = (float)value; } return result; } inline double asDouble() { - if (tag == 102) // ARK_TAG_INT32 + if (tag == INTEROP_TAG_INT32) return (double)i32; else return (double)f32; } + inline int32_t asInt32() { + if (tag == INTEROP_TAG_INT32) + return i32; + else + return (int32_t)f32; + } }; -typedef int8_t KBoolean; -typedef uint8_t KByte; +typedef InteropBoolean KBoolean; +typedef InteropUInt8 KByte; typedef int16_t KChar; typedef int16_t KShort; typedef uint16_t KUShort; -typedef int32_t KInt; -typedef uint32_t KUInt; -typedef float KFloat; -typedef int64_t KLong; -typedef uint64_t KULong; -typedef double KDouble; -typedef void* KNativePointer; +typedef InteropInt32 KInt; +typedef InteropUInt32 KUInt; +typedef InteropInt64 KLong; +typedef InteropUInt64 KULong; +typedef InteropFloat32 KFloat; +typedef InteropFloat64 KDouble; +typedef InteropNativePointer KNativePointer; typedef KStringPtrImpl KStringPtr; -typedef float* KFloatArray; + +typedef KFloat* KFloatArray; typedef const uint8_t* KStringArray; -typedef void** KNativePointerArray; +typedef KNativePointer* KNativePointerArray; + +struct KSerializerBufferOpaque { + explicit operator KByte* () { + return reinterpret_cast(this); + } +}; +typedef KSerializerBufferOpaque* KSerializerBuffer; struct KInteropBuffer { + + KInteropBuffer(KLong len = 0, KNativePointer ptr = nullptr, KInt resId = 0, void (*dis)(KInt) = nullptr) + : length(len), data(ptr), resourceId(resId), dispose(dis) {} + + /** + * Takes ownership of given InteropBuffer + */ + KInteropBuffer(InteropBuffer value) { + length = value.length; + data = value.data; + resourceId = value.resource.resourceId; + dispose = value.resource.release; + } + KLong length; KNativePointer data; KInt resourceId; - void (*dispose)(KInt /* resourceId for now */); + void (*dispose)( KInt /* resourceId for now */); }; struct KInteropReturnBuffer { @@ -151,6 +227,14 @@ struct KLength { KFloat value; KInt unit; KInt resource; + InteropLength toCType() { + InteropLength result; + result.type = this->type; + result.value = this->value; + result.unit = this->unit; + result.resource = this->resource; + return result; + } }; inline void parseKLength(const KStringPtrImpl &string, KLength *result) @@ -192,18 +276,26 @@ inline void parseKLength(const KStringPtrImpl &string, KLength *result) } } -struct _KVMContext; -typedef _KVMContext *KVMContext; +typedef _InteropVMContext *KVMContext; // BEWARE: this MUST never be used in user code, only in very rare service code. struct _KVMObject; typedef _KVMObject *KVMObjectHandle; typedef struct KVMDeferred { - void* handler; - void* context; - void (*resolve)(KVMDeferred* thiz, uint8_t* data, int32_t length); - void (*reject)(KVMDeferred* thiz, const char* message); + + KVMDeferred() {} + KVMDeferred(InteropDeferred value) { + handler = value.handler; + context = value.context; + resolve = reinterpret_cast(value.resolve); + reject = reinterpret_cast(value.reject); + } + + void* handler; + void* context; + void (*resolve)(KVMDeferred* thiz, uint8_t* data, int32_t length); + void (*reject)(KVMDeferred* thiz, const char* message); } KVMDeferred; template T* ptr(KNativePointer ptr) { diff --git a/koala-wrapper/koalaui/interop/src/cpp/types/signatures.cc b/koala-wrapper/koalaui/interop/src/cpp/types/signatures.cc index 7f556adaf..71e4bab17 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/types/signatures.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/types/signatures.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,8 +13,14 @@ * limitations under the License. */ -#include "stdio.h" -#include +#ifdef __cplusplus + #include + #include +#else + #include + #include +#endif + #include #include "signatures.h" @@ -22,15 +28,15 @@ // For types with the same name on ets and jni #define KOALA_INTEROP_TYPEDEF(func, lang, CPP_TYPE, SIG_TYPE, CODE_TYPE) \ - if (std::strcmp(func, "sigType") == 0) if (type == CPP_TYPE) return SIG_TYPE; \ - if (std::strcmp(func, "codeType") == 0) if (type == CPP_TYPE) return CODE_TYPE; + if (std::strcmp(func, "sigType") == 0) if (type == (CPP_TYPE)) return SIG_TYPE; \ + if (std::strcmp(func, "codeType") == 0) if (type == (CPP_TYPE)) return CODE_TYPE; // For types with distinct names on ets and jni #define KOALA_INTEROP_TYPEDEF_LS(func, lang, CPP_TYPE, ETS_SIG_TYPE, ETS_CODE_TYPE, JNI_SIG_TYPE, JNI_CODE_TYPE) \ - if (std::strcmp(func, "sigType") == 0 && std::strcmp(lang, "ets") == 0) if (type == CPP_TYPE) return ETS_SIG_TYPE; \ - if (std::strcmp(func, "codeType") == 0 && std::strcmp(lang, "ets") == 0) if (type == CPP_TYPE) return ETS_CODE_TYPE; \ - if (std::strcmp(func, "sigType") == 0 && std::strcmp(lang, "jni") == 0) if (type == CPP_TYPE) return JNI_SIG_TYPE; \ - if (std::strcmp(func, "codeType") == 0 && std::strcmp(lang, "jni") == 0) if (type == CPP_TYPE) return JNI_CODE_TYPE; + if (std::strcmp(func, "sigType") == 0 && std::strcmp(lang, "ets") == 0) if (type == (CPP_TYPE)) return ETS_SIG_TYPE; \ + if (std::strcmp(func, "codeType") == 0 && std::strcmp(lang, "ets") == 0) if (type == (CPP_TYPE)) return ETS_CODE_TYPE; \ + if (std::strcmp(func, "sigType") == 0 && std::strcmp(lang, "jni") == 0) if (type == (CPP_TYPE)) return JNI_SIG_TYPE; \ + if (std::strcmp(func, "codeType") == 0 && std::strcmp(lang, "jni") == 0) if (type == (CPP_TYPE)) return JNI_CODE_TYPE; #define KOALA_INTEROP_TYPEDEFS(func, lang) \ KOALA_INTEROP_TYPEDEF(func, lang, "void", "V", "void") \ @@ -42,11 +48,13 @@ KOALA_INTEROP_TYPEDEF(func, lang, "int", "I", "int") \ KOALA_INTEROP_TYPEDEF(func, lang, "KInt", "I", "int") \ KOALA_INTEROP_TYPEDEF(func, lang, "KUInt", "I", "int") \ + KOALA_INTEROP_TYPEDEF(func, lang, "KLong", "J", "long") \ KOALA_INTEROP_TYPEDEF(func, lang, "OH_Int32", "I", "int") \ KOALA_INTEROP_TYPEDEF(func, lang, "OH_Int64", "J", "long") \ KOALA_INTEROP_TYPEDEF(func, lang, "Ark_Int32", "I", "int") \ KOALA_INTEROP_TYPEDEF(func, lang, "Ark_Int64", "J", "long") \ KOALA_INTEROP_TYPEDEF(func, lang, "KNativePointer", "J", "long") \ + KOALA_INTEROP_TYPEDEF(func, lang, "KSerializerBuffer", "J", "long") \ KOALA_INTEROP_TYPEDEF(func, lang, "Ark_NativePointer", "J", "long") \ KOALA_INTEROP_TYPEDEF(func, lang, "OH_NativePointer", "J", "long") \ KOALA_INTEROP_TYPEDEF(func, lang, "float", "F", "float") \ @@ -107,7 +115,7 @@ std::string convertType(const char* name, const char* koalaType) { #if KOALA_USE_PANDA_VM - for (int i = 1; i < (int)tokens.size(); i++) + for (int i = 1; i < static_cast(tokens.size()); i++) { result.append(sigType(tokens[i])); } @@ -117,7 +125,7 @@ std::string convertType(const char* name, const char* koalaType) { #elif KOALA_USE_JAVA_VM result.append("("); - for (int i = 1; i < (int)tokens.size(); i++) + for (int i = 1; i < static_cast(tokens.size()); i++) { result.append(sigType(tokens[i])); } @@ -129,24 +137,24 @@ std::string convertType(const char* name, const char* koalaType) { #ifdef KOALA_BUILD_FOR_SIGNATURES #ifdef KOALA_USE_PANDA_VM std::string params; - for (int i = 1; i < (int)tokens.size(); i++) + for (int i = 1; i < static_cast(tokens.size()); i++) { params.append("arg"); params.append(std::to_string(i)); params.append(": "); params.append(codeType(tokens[i])); - if (i < (int)(tokens.size() - 1)) + if (i < static_cast(tokens.size() - 1)) params.append(", "); } fprintf(stderr, " static native %s(%s): %s;\n", name, params.c_str(), codeType(tokens[0]).c_str()); #elif KOALA_USE_JAVA_VM std::string params; - for (int i = 1; i < (int)tokens.size(); i++) + for (int i = 1; i < static_cast(tokens.size()); i++) { params.append(codeType(tokens[i])); params.append(" arg"); params.append(std::to_string(i)); - if (i < (int)(tokens.size() - 1)) + if (i < static_cast(tokens.size() - 1)) params.append(", "); } fprintf(stderr, " public static native %s %s(%s);\n", codeType(tokens[0]).c_str(), name, params.c_str()); diff --git a/koala-wrapper/koalaui/interop/src/cpp/types/signatures.h b/koala-wrapper/koalaui/interop/src/cpp/types/signatures.h index 48a76f3d8..05ddf1cc8 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/types/signatures.h +++ b/koala-wrapper/koalaui/interop/src/cpp/types/signatures.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/cpp/vmloader.cc b/koala-wrapper/koalaui/interop/src/cpp/vmloader.cc index 995d2623c..9efbfeff3 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/vmloader.cc +++ b/koala-wrapper/koalaui/interop/src/cpp/vmloader.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,9 +13,11 @@ * limitations under the License. */ +#include #include +#include #include -#include +#include #include "interop-logging.h" #include "dynamic-loader.h" @@ -31,6 +33,10 @@ #include "etsapi.h" #endif +#ifdef KOALA_ANI +#include "ani.h" +#endif + #if defined(KOALA_LINUX) || defined(KOALA_MACOS) || defined(KOALA_OHOS) #include "sys/stat.h" #include "dirent.h" @@ -49,13 +55,21 @@ #define SYSTEM_ARK_STDLIB_PATH "/system/etc/etsstdlib.abc" #endif -void traverseDir(std::string root, std::vector& paths, int depth = 0); +#ifndef KOALA_USE_PANDA_VM +#ifdef KOALA_ANI +#define KOALA_USE_PANDA_VM 1 +#endif +#ifdef KOALA_ETS_NAPI +#define KOALA_USE_PANDA_VM 1 +#endif +#endif + +void traverseDir(const std::string& root, std::vector& paths, std::string suffix, const std::vector& fallbackPaths = {}); struct VMLibInfo { const char* sdkPath; const char* platform; const char* lib; - const char* createVM; }; #ifdef KOALA_JNI @@ -69,12 +83,11 @@ const VMLibInfo javaVMLib = { #error "Unknown platform" #endif , - "jvm", - "JNI_CreateJavaVM", + "jvm" }; #endif -#ifdef KOALA_ETS_NAPI +#if defined(KOALA_ETS_NAPI) || defined(KOALA_ANI) const VMLibInfo pandaVMLib = { // sdkPath #if defined(KOALA_OHOS) @@ -112,10 +125,6 @@ const VMLibInfo pandaVMLib = { // lib "arkruntime" - , - - // createVM - "ETS_CreateVM" }; #endif @@ -128,6 +137,7 @@ struct VMInitArgs { #define JAVA_VM_KIND 1 #define PANDA_VM_KIND 2 #define ES2PANDA_KIND 3 +#define PANDA_ANI_VM_KIND 4 struct ForeignVMContext { void* currentVMContext; @@ -141,13 +151,14 @@ struct VMEntry { void* enter; void* emitEvent; void* restartWith; + void* loadView; ForeignVMContext foreignVMContext; + std::string userFilesAbcPaths; }; VMEntry g_vmEntry = {}; typedef int (*createVM_t)(void** pVM, void** pEnv, void* vmInitArgs); -typedef int (*getVMs_t)(void** pVM, int32_t bufLen, int32_t* nVMs); #ifdef KOALA_WINDOWS #define DLL_EXPORT __declspec(dllexport) @@ -160,22 +171,139 @@ int loadES2Panda(const char* appClassPath, const char* appLibPath) { return 0; } -static int ArkMobileLog(int id, int level, const char *component, const char *fmt, const char *msg) { - LOGE("ArkMobileLog: %" LOG_PUBLIC "s", msg); +#ifdef KOALA_ETS_NAPI +namespace { + +enum PandaLog2MobileLog : int { + UNKNOWN = 0, + DEFAULT, + VERBOSE, + DEBUG, + INFO, + WARN, + ERROR, + FATAL, + SILENT, +}; + +int ArkMobileLog(int id, int level, const char *component, const char *fmt, const char *msg) +{ + switch (level) { + case PandaLog2MobileLog::DEFAULT: + case PandaLog2MobileLog::VERBOSE: + case PandaLog2MobileLog::DEBUG: + case PandaLog2MobileLog::INFO: + case PandaLog2MobileLog::SILENT: + LOGI("ArkRuntime [%" LOG_PUBLIC "s]: %" LOG_PUBLIC "s", component, msg); + break; + case PandaLog2MobileLog::UNKNOWN: + case PandaLog2MobileLog::WARN: + case PandaLog2MobileLog::ERROR: + case PandaLog2MobileLog::FATAL: + default: + LOGE("ArkRuntime [%" LOG_PUBLIC "s]: %" LOG_PUBLIC "s", component, msg); + break; + } return 0; } -extern "C" DLL_EXPORT KInt LoadVirtualMachine(KInt vmKind, const char* appClassPath, const char* appLibPath, const ForeignVMContext* foreignVMContext) { +} +#endif + +#ifdef KOALA_ANI + +static void AniMobileLog([[maybe_unused]] FILE *stream, int level, + const char *component, const char *msg) +{ + switch (level) { + case ANI_LOGLEVEL_INFO: + case ANI_LOGLEVEL_DEBUG: + LOGI("ArkRuntime [%" LOG_PUBLIC "s]: %" LOG_PUBLIC "s", component, msg); + break; + case ANI_LOGLEVEL_FATAL: + case ANI_LOGLEVEL_ERROR: + case ANI_LOGLEVEL_WARNING: + default: + LOGE("ArkRuntime [%" LOG_PUBLIC "s]: %" LOG_PUBLIC "s", component, msg); + break; + } +} + +static std::string makeClasspath(const std::vector& files) +{ + std::stringstream stream; + for (size_t index = 0, end = files.size(); index < end; ++index) { + if (index > 0) { + stream << ':'; + } + stream << files[index]; + } + return stream.str(); +} + +static std::pair GetBootAndAppPandaFiles(const VMLibInfo* thisVM, const char* bootFilesPath, const char* userFilesPath) +{ + std::vector bootFiles; +#if USE_SYSTEM_ARKVM + bootFiles.push_back(SYSTEM_ARK_STDLIB_PATH); +#elif defined(KOALA_OHOS) + bootFiles.push_back(std::string(OHOS_USER_LIBS) + "/etsstdlib.abc"); +#elif defined(KOALA_LINUX) || defined(KOALA_MACOS) || defined(KOALA_WINDOWS) + bootFiles.push_back(std::string(thisVM->sdkPath) + "/ets/etsstdlib.abc"); +#endif + +#if defined(KOALA_OHOS) + traverseDir("/system/framework", bootFiles, ".abc", { + "etsstdlib_bootabc" + }); +#endif + + std::vector userFiles; + traverseDir(userFilesPath, userFiles, ".abc"); + std::sort(userFiles.begin(), userFiles.end()); + + traverseDir(bootFilesPath, bootFiles, ".abc"); + std::sort(bootFiles.begin(), bootFiles.end()); + + if (bootFiles.empty() || userFiles.empty()) + return {"",""}; + + return { makeClasspath(bootFiles), makeClasspath(userFiles) }; +} + +static std::string GetAOTFiles(const char* appClassPath) +{ + std::vector files; + traverseDir(std::string(appClassPath), files, ".an"); + return makeClasspath(files); +} + +static bool ResetErrorIfExists(ani_env *env) +{ + ani_boolean hasError = ANI_FALSE; + env->ExistUnhandledError(&hasError); + if (hasError == ANI_TRUE) { + env->DescribeError(); + env->ResetError(); + return true; + } + return false; +} + +#endif + +extern "C" DLL_EXPORT KInt LoadVirtualMachine(KInt vmKind, const char* bootFilesDir, const char* userFilesDir, const char* appLibPath, const ForeignVMContext* foreignVMContext) +{ if (vmKind == ES2PANDA_KIND) { - return loadES2Panda(appClassPath, appLibPath); + return loadES2Panda(bootFilesDir, appLibPath); } const VMLibInfo* thisVM = #ifdef KOALA_JNI (vmKind == JAVA_VM_KIND) ? &javaVMLib : #endif - #ifdef KOALA_ETS_NAPI - (vmKind == PANDA_VM_KIND) ? &pandaVMLib : + #if defined(KOALA_ETS_NAPI) || defined(KOALA_ANI) + (vmKind == PANDA_VM_KIND || vmKind == PANDA_ANI_VM_KIND) ? &pandaVMLib : #endif nullptr; @@ -184,7 +312,7 @@ extern "C" DLL_EXPORT KInt LoadVirtualMachine(KInt vmKind, const char* appClassP return -1; } - LOGI("Starting VM %" LOG_PUBLIC "d with classpath=%" LOG_PUBLIC "s native=%" LOG_PUBLIC "s", vmKind, appClassPath, appLibPath); + LOGI("Starting VM %" LOG_PUBLIC "d with bootFilesDir=%" LOG_PUBLIC "s bootFilesDir=%" LOG_PUBLIC "s native=%" LOG_PUBLIC "s", vmKind, bootFilesDir, userFilesDir, appLibPath); std::string libPath = #if USE_SYSTEM_ARKVM @@ -203,27 +331,24 @@ extern "C" DLL_EXPORT KInt LoadVirtualMachine(KInt vmKind, const char* appClassP return -1; } - createVM_t createVM = (createVM_t)findSymbol(handle, thisVM->createVM); - getVMs_t getVMs = (getVMs_t)findSymbol(handle, "ETS_GetCreatedVMs"); - - if (!createVM) { - LOGE("Cannot find %" LOG_PUBLIC "s\n", thisVM->createVM); - return -1; - } - void* vm = nullptr; void* env = nullptr; - int32_t nVMs = 0; int result = 0; #ifdef KOALA_JNI if (vmKind == JAVA_VM_KIND) { + typedef int (*createVM_t)(void** pVM, void** pEnv, void* vmInitArgs); + createVM_t createVM = (createVM_t)findSymbol(handle, "JNI_CreateJavaVM"); + if (!createVM) { + LOGE("Cannot find %" LOG_PUBLIC "s\n", "JNI_CreateJavaVM"); + return -1; + } JavaVMInitArgs javaVMArgs; javaVMArgs.version = JNI_VERSION_10; javaVMArgs.ignoreUnrecognized = false; std::vector javaVMOptions; javaVMOptions = { - {(char*)strdup((std::string("-Djava.class.path=") + appClassPath).c_str())}, + {(char*)strdup((std::string("-Djava.class.path=") + bootFilesDir).c_str())}, {(char*)strdup((std::string("-Djava.library.path=") + appLibPath).c_str())}, }; javaVMArgs.nOptions = javaVMOptions.size(); @@ -233,14 +358,69 @@ extern "C" DLL_EXPORT KInt LoadVirtualMachine(KInt vmKind, const char* appClassP } #endif -#ifdef KOALA_ETS_NAPI +#if defined(KOALA_ANI) + if (vmKind == PANDA_ANI_VM_KIND) { + g_vmEntry.vmKind = vmKind; + + uint32_t version = ANI_VERSION_1; + size_t nVMs = 0; + typedef int (*getVMs_t)(void** pVM, size_t bufLen, size_t* nVMs); + typedef int (*createVM_t)(const void* args, uint32_t version, void** pVM); + createVM_t createVM = (createVM_t)findSymbol(handle, "ANI_CreateVM"); + getVMs_t getVMs = (getVMs_t)findSymbol(handle, "ANI_GetCreatedVMs"); + result = getVMs ? getVMs(&vm, 1, &nVMs) : 0; + if (nVMs == 0 && result == 0) { + std::vector pandaVMOptions; + + auto [bootFiles, userFiles] = GetBootAndAppPandaFiles(thisVM, bootFilesDir, userFilesDir); + LOGI("ANI: user abc-files \"%" LOG_PUBLIC "s\" from %" LOG_PUBLIC "s", userFiles.c_str(), userFilesDir); + g_vmEntry.userFilesAbcPaths = std::move(userFiles); + + bootFiles = "--ext:--boot-panda-files=" + bootFiles; + LOGI("ANI boot-panda-files option: \"%" LOG_PUBLIC "s\"", bootFiles.c_str()); + pandaVMOptions.push_back({bootFiles.c_str(), nullptr}); + + auto aotFiles = GetAOTFiles(bootFilesDir); + if (!aotFiles.empty()) { + LOGI("ANI AOT files: \"%" LOG_PUBLIC "s\"", aotFiles.c_str()); + aotFiles = "--ext:--aot-files=" + aotFiles; + pandaVMOptions.push_back({aotFiles.c_str(), nullptr}); + } + + pandaVMOptions.push_back({"--ext:--gc-trigger-type=heap-trigger", nullptr}); + std::string nativeLibraryPathOption = + std::string("--ext:--native-library-path=") + appLibPath; + pandaVMOptions.push_back({nativeLibraryPathOption.c_str(), nullptr}); + pandaVMOptions.push_back({"--ext:--verification-mode=on-the-fly", nullptr}); + pandaVMOptions.push_back({"--ext:--compiler-enable-jit=true", nullptr}); + pandaVMOptions.push_back({"--logger", reinterpret_cast(AniMobileLog)}); + pandaVMOptions.push_back({"--ext:--enable-an", nullptr}); + ani_options optionsPtr = {pandaVMOptions.size(), pandaVMOptions.data()}; + + result = createVM(&optionsPtr, version, &vm); + } + + if (result == 0) { + ani_vm* vmInstance = (ani_vm*)vm; + ani_env* pEnv = nullptr; + result = vmInstance->GetEnv(version, &pEnv); + env = static_cast(pEnv); + } + } +#endif /* KOALA_ANI */ + +// For now we use ETS API for VM startup and entry. +#if defined(KOALA_ETS_NAPI) if (vmKind == PANDA_VM_KIND) { EtsVMInitArgs pandaVMArgs; pandaVMArgs.version = ETS_NAPI_VERSION_1_0; std::vector etsVMOptions; std::vector files; - traverseDir(std::string(appClassPath), files); + traverseDir(std::string(bootFilesDir), files, ".abc"); std::sort(files.begin(), files.end()); + std::vector files_aot; + traverseDir(std::string(bootFilesDir), files_aot, ".an"); + std::sort(files_aot.begin(), files_aot.end()); etsVMOptions = { #if USE_SYSTEM_ARKVM {EtsOptionType::ETS_BOOT_FILE, SYSTEM_ARK_STDLIB_PATH}, @@ -251,29 +431,45 @@ extern "C" DLL_EXPORT KInt LoadVirtualMachine(KInt vmKind, const char* appClassP {EtsOptionType::ETS_BOOT_FILE, (char*)strdup((std::string(thisVM->sdkPath) + "/ets/etsstdlib.abc").c_str())}, #endif }; + std::string all_files; for (const std::string& path : files) { etsVMOptions.push_back({EtsOptionType::ETS_BOOT_FILE, (char*)strdup(path.c_str())}); + if (all_files.size() > 0) all_files.append(":"); + all_files.append(path); + } + LOGI("Using ETSNAPI: classpath \"%" LOG_PUBLIC "s\" from %" LOG_PUBLIC "s", all_files.c_str(), bootFilesDir); + std::string all_files_aot; + for (const std::string& path : files_aot) { + etsVMOptions.push_back({EtsOptionType::ETS_AOT_FILE, (char*)strdup(path.c_str())}); + if (all_files_aot.size() > 0) all_files_aot.append(":"); + all_files_aot.append(path); } + LOGI("ETSNAPI classpath (aot) \"%" LOG_PUBLIC "s\" from %" LOG_PUBLIC "s", all_files_aot.c_str(), bootFilesDir); + etsVMOptions.push_back({EtsOptionType::ETS_GC_TRIGGER_TYPE, "heap-trigger"}); etsVMOptions.push_back({EtsOptionType::ETS_NATIVE_LIBRARY_PATH, (char*)strdup(std::string(appLibPath).c_str())}); etsVMOptions.push_back({EtsOptionType::ETS_VERIFICATION_MODE, "on-the-fly"}); - etsVMOptions.push_back({EtsOptionType::ETS_NO_JIT, nullptr}); + etsVMOptions.push_back({EtsOptionType::ETS_JIT, nullptr}); etsVMOptions.push_back({EtsOptionType::ETS_MOBILE_LOG, (void*)ArkMobileLog}); etsVMOptions.push_back({EtsOptionType::ETS_AOT, nullptr}); - // etsVMOptions.push_back({EtsOptionType::ETS_LOG_LEVEL, "info"}); pandaVMArgs.nOptions = etsVMOptions.size(); pandaVMArgs.options = etsVMOptions.data(); - g_vmEntry.vmKind = PANDA_VM_KIND; + g_vmEntry.vmKind = vmKind; + int32_t nVMs = 0; + typedef int (*createVM_t)(void** pVM, void** pEnv, void* vmInitArgs); + typedef int (*getVMs_t)(void** pVM, int32_t bufLen, int32_t* nVMs); + createVM_t createVM = (createVM_t)findSymbol(handle, "ETS_CreateVM"); + getVMs_t getVMs = (getVMs_t)findSymbol(handle, "ETS_GetCreatedVMs"); result = getVMs ? getVMs(&vm, 1, &nVMs) : 0; if (nVMs != 0) { __EtsVM* vmInstance = (__EtsVM*)vm; EtsEnv* pEnv = nullptr; vmInstance->GetEnv(&pEnv, ETS_NAPI_VERSION_1_0); env = static_cast(pEnv); + } else { result = createVM(&vm, &env, &pandaVMArgs); } - } #endif @@ -298,6 +494,8 @@ struct AppInfo { const char* emitEventMethodSig; const char* restartWithMethodName; const char* restartWithMethodSig; + const char* loadViewMethodName; + const char* loadViewMethodSig; }; #ifdef KOALA_JNI @@ -311,45 +509,85 @@ const AppInfo javaAppInfo = { "(IIJ)Z", "emitEvent", "(IIII)Ljava/lang/String;", + "UNUSED", + "()V" }; #endif #ifdef KOALA_ETS_NAPI const AppInfo pandaAppInfo = { - "@koalaui/arkts-arkui/Application/Application", + "@ohos/arkui/Application/Application", "createApplication", - "Lstd/core/String;Lstd/core/String;Z:L@koalaui/arkts-arkui/Application/Application;", + "Lstd/core/String;Lstd/core/String;ZI:L@ohos/arkui/Application/Application;", "start", - ":J", + "J:J", "enter", "IIJ:Z", "emitEvent", "IIII:Lstd/core/String;", + "UNUSED", + "I:I" }; const AppInfo harnessAppInfo = { - "@koalaui/ets-harness/src/EtsHarnessApplication/EtsHarnessApplication", + "@koalaui/ets-harness/src/EtsHarnessApplication/EtsHarnessApplication", + "createApplication", + "Lstd/core/String;Lstd/core/String;ZI:L@koalaui/ets-harness/src/EtsHarnessApplication/EtsHarnessApplication;", + "start", + "J:J", + "enter", + "IIJ:Z", + "emitEvent", + "IIII:Lstd/core/String;", + "restartWith", + "Lstd/core/String;:V", + }; +#endif +#ifdef KOALA_ANI +const AppInfo harnessAniAppInfo = { + "L@koalaui/ets-harness/src/EtsHarnessApplication/EtsHarnessApplication;", "createApplication", - "Lstd/core/String;Lstd/core/String;Z:L@koalaui/ets-harness/src/EtsHarnessApplication/EtsHarnessApplication;", + "Lstd/core/String;Lstd/core/String;Lstd/core/String;ZI:L@koalaui/ets-harness/src/EtsHarnessApplication/EtsHarnessApplication;", "start", - ":J", + "J:J", "enter", - "II:Z", + "IIJ:Z", "emitEvent", "IIII:Lstd/core/String;", "restartWith", - "Lstd/core/String;:V" + "Lstd/core/String;:V", + "UNUSED", + "I:I" +}; +const AppInfo aniAppInfo = { + "L@ohos/arkui/Application/Application;", + "createApplication", + "Lstd/core/String;Lstd/core/String;Lstd/core/String;ZI:L@ohos/arkui/Application/Application;", + "start", + "J:J", + "enter", + "IIJ:Z", + "emitEvent", + "IIII:Lstd/core/String;", + "UNUSED", + "I:I", + "loadView", + "Lstd/core/String;Lstd/core/String;:Lstd/core/String;", }; #endif -extern "C" DLL_EXPORT KNativePointer StartApplication(const char* appUrl, const char* appParams) { +extern "C" DLL_EXPORT KNativePointer StartApplication(const char* appUrl, const char* appParams) +{ const auto isTestEnv = std::string(appUrl) == "EtsHarness"; const AppInfo* appInfo = #ifdef KOALA_JNI (g_vmEntry.vmKind == JAVA_VM_KIND) ? &javaAppInfo : #endif - #ifdef KOALA_ETS_NAPI + #if defined(KOALA_ETS_NAPI) (g_vmEntry.vmKind == PANDA_VM_KIND) ? isTestEnv ? &harnessAppInfo : &pandaAppInfo : #endif + #if defined(KOALA_ANI) + (g_vmEntry.vmKind == PANDA_ANI_VM_KIND) ? isTestEnv ? &harnessAniAppInfo : &aniAppInfo : + #endif nullptr; if (!appInfo) { @@ -358,7 +596,6 @@ extern "C" DLL_EXPORT KNativePointer StartApplication(const char* appUrl, const } LOGI("Starting application %" LOG_PUBLIC "s with params %" LOG_PUBLIC "s", appUrl, appParams); - #ifdef KOALA_JNI if (g_vmEntry.vmKind == JAVA_VM_KIND) { JNIEnv* jEnv = (JNIEnv*)(g_vmEntry.env); @@ -393,12 +630,16 @@ extern "C" DLL_EXPORT KNativePointer StartApplication(const char* appUrl, const app, start)); } #endif -#ifdef KOALA_ETS_NAPI +#if defined(KOALA_ETS_NAPI) if (g_vmEntry.vmKind == PANDA_VM_KIND) { EtsEnv* etsEnv = (EtsEnv*)g_vmEntry.env; ets_class appClass = etsEnv->FindClass(appInfo->className); if (!appClass) { LOGE("Cannot load main class %" LOG_PUBLIC "s\n", appInfo->className); + if (etsEnv->ErrorCheck()) { + etsEnv->ErrorDescribe(); + etsEnv->ErrorClear(); + } return nullptr; } ets_method create = etsEnv->GetStaticp_method(appClass, appInfo->createMethodName, appInfo->createMethodSig); @@ -410,21 +651,19 @@ extern "C" DLL_EXPORT KNativePointer StartApplication(const char* appUrl, const } return nullptr; } -#if defined (KOALA_OHOS_ARM64) - auto useNativeLog = true; -#else auto useNativeLog = false; -#endif auto app = etsEnv->NewGlobalRef(etsEnv->CallStaticObjectMethod( appClass, create, etsEnv->NewStringUTF(appUrl), etsEnv->NewStringUTF(appParams), - useNativeLog + useNativeLog, + g_vmEntry.vmKind )); if (!app) { LOGE("createApplication returned null"); if (etsEnv->ErrorCheck()) { etsEnv->ErrorDescribe(); etsEnv->ErrorClear(); + return nullptr; } return nullptr; } @@ -439,6 +678,11 @@ extern "C" DLL_EXPORT KNativePointer StartApplication(const char* appUrl, const } return nullptr; } + if (etsEnv->ErrorCheck()) { + etsEnv->ErrorDescribe(); + etsEnv->ErrorClear(); + return nullptr; + } g_vmEntry.emitEvent = (void*)(etsEnv->Getp_method(appClass, appInfo->emitEventMethodName, appInfo->emitEventMethodSig)); if (!g_vmEntry.emitEvent) { LOGE("Cannot find enter emitEvent %" LOG_PUBLIC "s", appInfo->emitEventMethodSig); @@ -460,7 +704,119 @@ extern "C" DLL_EXPORT KNativePointer StartApplication(const char* appUrl, const } } // TODO: pass app entry point! - return reinterpret_cast(etsEnv->CallLongMethod((ets_object)(app), start)); + return reinterpret_cast(etsEnv->CallLongMethod((ets_object)(app), start, &g_vmEntry.foreignVMContext)); + } +#endif +#if defined(KOALA_ANI) + if (g_vmEntry.vmKind == PANDA_ANI_VM_KIND) { + auto *env = reinterpret_cast(g_vmEntry.env); + + ani_class appClass {}; + auto status = env->FindClass(appInfo->className, &appClass); + if (status != ANI_OK) { + LOGE("Cannot load main class %" LOG_PUBLIC "s\n", appInfo->className); + ResetErrorIfExists(env); + return nullptr; + } + ani_static_method create {}; + status = env->Class_FindStaticMethod(appClass, appInfo->createMethodName, appInfo->createMethodSig, &create); + if (status != ANI_OK) { + LOGE("Cannot find create method %" LOG_PUBLIC "s\n", appInfo->createMethodName); + ResetErrorIfExists(env); + return nullptr; + } + + ani_boolean useNativeLog = ANI_FALSE; + ani_string appUrlString {}; + status = env->String_NewUTF8(appUrl, strlen(appUrl), &appUrlString); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return nullptr; + } + + ani_string userPandaFilesPathString {}; + status = env->String_NewUTF8(g_vmEntry.userFilesAbcPaths.c_str(), g_vmEntry.userFilesAbcPaths.size(), &userPandaFilesPathString); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return nullptr; + } + + ani_string appParamsString {}; + status = env->String_NewUTF8(appParams, strlen(appParams), &appParamsString); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return nullptr; + } + + ani_ref appInstance {}; + status = env->Class_CallStaticMethod_Ref(appClass, create, &appInstance, appUrlString, userPandaFilesPathString, appParamsString, + useNativeLog, static_cast(g_vmEntry.vmKind)); + if (status != ANI_OK) { + LOGE("createApplication returned null"); + ResetErrorIfExists(env); + return nullptr; + } + ani_ref app {}; + status = env->GlobalReference_Create(appInstance, &app); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return nullptr; + } + g_vmEntry.app = (void*)app; + + ani_method start {}; + status = env->Class_FindMethod(appClass, appInfo->startMethodName, appInfo->startMethodSig, &start); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return nullptr; + } + ani_method enter {}; + status = env->Class_FindMethod(appClass, appInfo->enterMethodName, nullptr, &enter); + if (status != ANI_OK) { + LOGE("Cannot find `enter` method %" LOG_PUBLIC "s", appInfo->enterMethodName); + ResetErrorIfExists(env); + return nullptr; + } + g_vmEntry.enter = reinterpret_cast(enter); + ani_method emitEvent {}; + status = env->Class_FindMethod(appClass, appInfo->emitEventMethodName, appInfo->emitEventMethodSig, &emitEvent); + if (status != ANI_OK) { + LOGE("Cannot find `emitEvent` method %" LOG_PUBLIC "s", appInfo->emitEventMethodSig); + ResetErrorIfExists(env); + return nullptr; + } + g_vmEntry.emitEvent = reinterpret_cast(emitEvent); + ani_method loadView {}; + status = env->Class_FindMethod(appClass, appInfo->loadViewMethodName, appInfo->loadViewMethodSig, &loadView); + if (status != ANI_OK) { + LOGE("Cannot find `%" LOG_PUBLIC "s` method %" LOG_PUBLIC "s", + appInfo->loadViewMethodName, appInfo->loadViewMethodSig); + ResetErrorIfExists(env); + return nullptr; + } + g_vmEntry.loadView = reinterpret_cast(loadView); + + if (isTestEnv) { + ani_method restartWith {}; + status = env->Class_FindMethod(appClass, appInfo->restartWithMethodName, appInfo->restartWithMethodSig, &restartWith); + if (status != ANI_OK) { + LOGE("Cannot find `restartWith` method sig=%" LOG_PUBLIC "s", appInfo->restartWithMethodSig); + ResetErrorIfExists(env); + return nullptr; + } + g_vmEntry.restartWith = reinterpret_cast(restartWith); + } + + ani_long ptr = 0; + // TODO: pass app entry point! + status = env->Object_CallMethod_Long(static_cast(appInstance), start, &ptr, + reinterpret_cast(&g_vmEntry.foreignVMContext)); + if (status != ANI_OK) { + LOGE("Cannot start application"); + ResetErrorIfExists(env); + return nullptr; + } + return reinterpret_cast(ptr); } #endif return nullptr; @@ -484,7 +840,7 @@ extern "C" DLL_EXPORT KBoolean RunApplication(const KInt arg0, const KInt arg1) return result; } #endif -#ifdef KOALA_ETS_NAPI +#if defined(KOALA_ETS_NAPI) if (g_vmEntry.vmKind == PANDA_VM_KIND) { EtsEnv* etsEnv = (EtsEnv*)(g_vmEntry.env); if (!g_vmEntry.enter) { @@ -505,11 +861,32 @@ extern "C" DLL_EXPORT KBoolean RunApplication(const KInt arg0, const KInt arg1) } return result; } - #endif +#endif +#if defined(KOALA_ANI) + if (g_vmEntry.vmKind == PANDA_ANI_VM_KIND) { + ani_env* env = reinterpret_cast(g_vmEntry.env); + if (g_vmEntry.enter == nullptr) { + LOGE("Cannot find enter method"); + return -1; + } + ani_boolean result = ANI_FALSE; + auto status = env->Object_CallMethod_Boolean(reinterpret_cast(g_vmEntry.app), + reinterpret_cast(g_vmEntry.enter), &result, + static_cast(arg0), static_cast(arg1), + reinterpret_cast(&g_vmEntry.foreignVMContext)); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return ANI_FALSE; + } + return result; + } +#endif + return 1; } -extern "C" DLL_EXPORT const char* EmitEvent(const KInt type, const KInt target, const KInt arg0, const KInt arg1) { +extern "C" DLL_EXPORT const char* EmitEvent(const KInt type, const KInt target, const KInt arg0, const KInt arg1) +{ #ifdef KOALA_JNI if (g_vmEntry.vmKind == JAVA_VM_KIND) { JNIEnv* jEnv = (JNIEnv*)(g_vmEntry.env); @@ -533,7 +910,8 @@ extern "C" DLL_EXPORT const char* EmitEvent(const KInt type, const KInt target, return result; } #endif -#ifdef KOALA_ETS_NAPI + +#if defined(KOALA_ETS_NAPI) if (g_vmEntry.vmKind == PANDA_VM_KIND) { EtsEnv* etsEnv = (EtsEnv*)(g_vmEntry.env); if (!g_vmEntry.emitEvent) { @@ -556,11 +934,51 @@ extern "C" DLL_EXPORT const char* EmitEvent(const KInt type, const KInt target, const char *result = etsEnv->GetStringUTFChars(rv, 0); return result; } - #endif +#endif +#if defined(KOALA_ANI) + if (g_vmEntry.vmKind == PANDA_ANI_VM_KIND) { + ani_env *env = reinterpret_cast(g_vmEntry.env); + if (g_vmEntry.emitEvent == nullptr) { + LOGE("Cannot find emitEvent method"); + return "-1"; + } + ani_ref result {}; + auto status = env->Object_CallMethod_Ref(reinterpret_cast(g_vmEntry.app), + reinterpret_cast(g_vmEntry.emitEvent), + &result, + static_cast(type), + static_cast(target), + static_cast(arg0), + static_cast(arg1)); + if (status != ANI_OK) { + LOGE("Calling emitEvent() method gave an error"); + ResetErrorIfExists(env); + return "-1"; + } + + auto str = static_cast(result); + ani_size sz = 0; + status = env->String_GetUTF8Size(str, &sz); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return "-1"; + } + auto buffer = new char[sz + 1]; + ani_size writtenChars = 0; + status = env->String_GetUTF8(str, buffer, sz + 1, &writtenChars); + if (status != ANI_OK || writtenChars != sz) { + delete [] buffer; + ResetErrorIfExists(env); + return "-1"; + } + return buffer; + } +#endif return "-1"; } -extern "C" DLL_EXPORT void RestartWith(const char* page) { +extern "C" DLL_EXPORT void RestartWith(const char* page) +{ #ifdef KOALA_JNI if (g_vmEntry.vmKind == JAVA_VM_KIND) { JNIEnv* jEnv = (JNIEnv*)(g_vmEntry.env); @@ -579,7 +997,7 @@ extern "C" DLL_EXPORT void RestartWith(const char* page) { } } #endif -#ifdef KOALA_ETS_NAPI +#if defined(KOALA_ETS_NAPI) if (g_vmEntry.vmKind == PANDA_VM_KIND) { EtsEnv* etsEnv = (EtsEnv*)(g_vmEntry.env); if (!g_vmEntry.restartWith) { @@ -597,42 +1015,100 @@ extern "C" DLL_EXPORT void RestartWith(const char* page) { etsEnv->ErrorClear(); } } - #endif +#endif +#if defined(KOALA_ANI) + if (g_vmEntry.vmKind == PANDA_ANI_VM_KIND) { + ani_env *env = reinterpret_cast(g_vmEntry.env); + if (!g_vmEntry.restartWith) { + LOGE("Cannot find restartWith method"); + return; + } + ani_string pageString {}; + auto status = env->String_NewUTF8(page, strlen(page), &pageString); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return; + } + status = env->Object_CallMethod_Void(reinterpret_cast(g_vmEntry.app), + reinterpret_cast(g_vmEntry.restartWith), pageString); + if (status != ANI_OK) { + LOGE("Calling restartWith() method gave an error"); + ResetErrorIfExists(env); + } + } +#endif +} + +extern "C" DLL_EXPORT const char* LoadView(const char* className, const char* params) +{ +#if defined(KOALA_ANI) + if (g_vmEntry.vmKind == PANDA_ANI_VM_KIND) { + ani_env *env = reinterpret_cast(g_vmEntry.env); + if (!g_vmEntry.loadView) { + return strdup("Cannot find loadView() method"); + } + ani_string classNameString {}; + auto status = env->String_NewUTF8(className, strlen(className), &classNameString); + if (status != ANI_OK) { + return strdup("Cannot make ANI string"); + } + ani_string paramsString {}; + status = env->String_NewUTF8(params, strlen(params), ¶msString); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return strdup("Cannot make ANI string"); + } + ani_string resultString = nullptr; + status = env->Object_CallMethod_Ref(reinterpret_cast(g_vmEntry.app), + reinterpret_cast(g_vmEntry.loadView), + (ani_ref*)&resultString, + classNameString, paramsString); + if (status != ANI_OK) { + ResetErrorIfExists(env); + return strdup("Calling laodView() method gave an error"); + } + ani_size resultStringLength = 0; + status = env->String_GetUTF8Size(resultString, &resultStringLength); + char* resultChars = (char*)malloc(resultStringLength); + status = env->String_GetUTF8(resultString, resultChars, resultStringLength, &resultStringLength); + return resultChars; + } +#endif + return strdup("Unsupported"); +} + +namespace fs = std::filesystem; + +bool ends_with(std::string str, std::string suffix) +{ + return str.size() >= suffix.size() && str.compare(str.size()-suffix.size(), suffix.size(), suffix) == 0; } -void traverseDir(std::string root, std::vector& paths, int depth) { - if (depth >= 50) { +void traverseDir(const std::string& root, std::vector& paths, std::string suffix, const std::vector& fallbackPaths) +{ + #ifdef KOALA_OHOS_ARM32 + // selinux prohibits any access to "/system/framework" + if (root == "/system/framework") { + for (auto path: fallbackPaths) { + paths.push_back(root + "/" + path + suffix); + } return; } -#if defined(KOALA_LINUX) || defined(KOALA_MACOS) || defined(KOALA_OHOS) - std::string suffix = ".abc"; - #if defined(KOALA_OHOS) - suffix += ".so"; #endif - DIR* directory = opendir(root.c_str()); - if (!directory) { + + if (!fs::exists(root)) { LOGE("Cannot open dir %" LOG_PUBLIC "s\n", root.c_str()); return; } - struct dirent* ent = NULL; - struct stat statbuf; - LOGI("Searching for *%" LOG_PUBLIC "s in %" LOG_PUBLIC "s\n", suffix.c_str(), root.c_str()); - while ((ent = readdir(directory)) != nullptr) { - std::string filename = std::string(ent->d_name); - if (filename == "." || filename == "..") { - continue; - } - std::string filepath = root + "/" + filename; - int rv = stat(filepath.c_str(), &statbuf); - if (rv < 0) continue; - if (filepath.size() >= suffix.size() && filepath.substr(filepath.size() - suffix.size()) == suffix && (statbuf.st_mode & S_IFMT) == S_IFREG) { - paths.push_back(filepath); - } - if ((statbuf.st_mode & S_IFMT) == S_IFDIR) { - traverseDir(filepath, paths, depth + 1); + #if defined(KOALA_OHOS) + suffix += ".so"; + #endif + + LOGI("Searching in %" LOG_PUBLIC "s\n", root.c_str()); + for (auto &file : fs::recursive_directory_iterator(root)) { + if (ends_with(file.path().string(), suffix) && fs::is_regular_file(file)) { + paths.push_back(file.path().string()); } } - closedir(directory); -#endif } diff --git a/koala-wrapper/koalaui/interop/src/cpp/wasm/convertors-wasm.h b/koala-wrapper/koalaui/interop/src/cpp/wasm/convertors-wasm.h index eea97a98e..9ff14e376 100644 --- a/koala-wrapper/koalaui/interop/src/cpp/wasm/convertors-wasm.h +++ b/koala-wrapper/koalaui/interop/src/cpp/wasm/convertors-wasm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,14 +13,16 @@ * limitations under the License. */ -#pragma once +#ifndef CONVERTORS_WASM_H +#define CONVERTORS_WASM_H #include "koala-types.h" -#include #include #define KOALA_INTEROP_EXPORT EMSCRIPTEN_KEEPALIVE extern "C" +#include "interop-logging.h" + template struct InteropTypeConverter { using InteropType = T; @@ -765,14 +767,65 @@ KOALA_INTEROP_EXPORT void name( \ impl_##name(nullptr, p0, p1, p2, p3); \ } +#define KOALA_INTEROP_DIRECT_0(name, Ret) \ + KOALA_INTEROP_0(name, Ret) +#define KOALA_INTEROP_DIRECT_1(name, Ret, P0) \ + KOALA_INTEROP_1(name, Ret, P0) +#define KOALA_INTEROP_DIRECT_2(name, Ret, P0, P1) \ + KOALA_INTEROP_2(name, Ret, P0, P1) +#define KOALA_INTEROP_DIRECT_3(name, Ret, P0, P1, P2) \ + KOALA_INTEROP_3(name, Ret, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_4(name, Ret, P0, P1, P2, P3) \ + KOALA_INTEROP_4(name, Ret, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_5(name, Ret, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_5(name, Ret, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_6(name, Ret, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_6(name, Ret, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_7(name, Ret, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_8(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_9(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_10(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_11(name, Ret, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) +#define KOALA_INTEROP_DIRECT_V0(name) \ + KOALA_INTEROP_V0(name) +#define KOALA_INTEROP_DIRECT_V1(name, P0) \ + KOALA_INTEROP_V1(name, P0) +#define KOALA_INTEROP_DIRECT_V2(name, P0, P1) \ + KOALA_INTEROP_V2(name, P0, P1) +#define KOALA_INTEROP_DIRECT_V3(name, P0, P1, P2) \ + KOALA_INTEROP_V3(name, P0, P1, P2) +#define KOALA_INTEROP_DIRECT_V4(name, P0, P1, P2, P3) \ + KOALA_INTEROP_V4(name, P0, P1, P2, P3) +#define KOALA_INTEROP_DIRECT_V5(name, P0, P1, P2, P3, P4) \ + KOALA_INTEROP_V5(name, P0, P1, P2, P3, P4) +#define KOALA_INTEROP_DIRECT_V6(name, P0, P1, P2, P3, P4, P5) \ + KOALA_INTEROP_V6(name, P0, P1, P2, P3, P4, P5) +#define KOALA_INTEROP_DIRECT_V7(name, P0, P1, P2, P3, P4, P5, P6) \ + KOALA_INTEROP_V7(name, P0, P1, P2, P3, P4, P5, P6) +#define KOALA_INTEROP_DIRECT_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) \ + KOALA_INTEROP_V8(name, P0, P1, P2, P3, P4, P5, P6, P7) +#define KOALA_INTEROP_DIRECT_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) \ + KOALA_INTEROP_V9(name, P0, P1, P2, P3, P4, P5, P6, P7, P8) +#define KOALA_INTEROP_DIRECT_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) \ + KOALA_INTEROP_V10(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9) +#define KOALA_INTEROP_DIRECT_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) \ + KOALA_INTEROP_V11(name, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) + #define KOALA_INTEROP_THROW(vmContext, object, ...) \ do { \ - assert(false); /* TODO: implement*/ \ + ASSERT(false); /* TODO: implement*/ \ return __VA_ARGS__; \ } while (0) #define KOALA_INTEROP_THROW_STRING(vmContext, message, ...) \ do { \ - assert(false); /* TODO: implement*/ \ + ASSERT(false); /* TODO: implement*/ \ return __VA_ARGS__; \ } while (0) + +#endif // CONVERTORS_WASM_H \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/interop/DeserializerBase.ts b/koala-wrapper/koalaui/interop/src/interop/DeserializerBase.ts index af06948a3..8a8537d68 100644 --- a/koala-wrapper/koalaui/interop/src/interop/DeserializerBase.ts +++ b/koala-wrapper/koalaui/interop/src/interop/DeserializerBase.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,10 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { CustomTextDecoder, float32, int32, int64 } from "@koalaui/common" +import { CustomTextDecoder, float32, int32, int64 } from "#koalaui/common" import { Tags, CallbackResource } from "./SerializerBase"; -import { pointer } from "./InteropTypes" -import { InteropNativeModule } from "./InteropNativeModule" +import { pointer, KUint8ArrayPtr, KSerializerBuffer } from "./InteropTypes" +import { NativeBuffer } from "./NativeBuffer"; +import { ResourceHolder } from "../arkts/ResourceManager"; export class DeserializerBase { private position = 0 @@ -37,8 +38,13 @@ export class DeserializerBase { } } - constructor(buffer: ArrayBuffer, length: int32) { - this.buffer = buffer + constructor(buffer: ArrayBuffer|KSerializerBuffer|KUint8ArrayPtr, length: int32) { + if (typeof buffer != 'object') + throw new Error('Must be used only with ArrayBuffer') + if (buffer && ("buffer" in buffer)) { + buffer = buffer.buffer as ArrayBuffer + } + this.buffer = buffer as ArrayBuffer this.length = length this.view = new DataView(this.buffer) } @@ -51,7 +57,11 @@ export class DeserializerBase { return factory(args, length); } - asArray(position?: number, length?: number): Uint8Array { + asBuffer(position?: int32, length?: int32): KSerializerBuffer { + return new Uint8Array(this.buffer, position, length) + } + + asArray(position?: int32, length?: int32): Uint8Array { return new Uint8Array(this.buffer, position, length) } @@ -144,7 +154,7 @@ export class DeserializerBase { return undefined } - readNumber(): number | undefined { + readNumber(): int32 | undefined { const tag = this.readInt8() switch (tag) { case Tags.UNDEFINED: @@ -166,6 +176,10 @@ export class DeserializerBase { release: this.readPointer(), } } + readObject():any { + const resource = this.readCallbackResource() + return ResourceHolder.instance().get(resource.resourceId) + } static lengthUnitFromInt(unit: int32): string { let suffix: string @@ -187,12 +201,12 @@ export class DeserializerBase { } return suffix } - readBuffer(): ArrayBuffer { + readBuffer(): NativeBuffer { const resource = this.readCallbackResource() const data = this.readPointer() const length = this.readInt64() - return InteropNativeModule._MaterializeBuffer(data, length, resource.resourceId, resource.hold, resource.release) + return NativeBuffer.wrap(data, length, resource.resourceId, resource.hold, resource.release) } } diff --git a/koala-wrapper/koalaui/interop/src/interop/Finalizable.ts b/koala-wrapper/koalaui/interop/src/interop/Finalizable.ts index dc0e8a980..24f90b6a6 100644 --- a/koala-wrapper/koalaui/interop/src/interop/Finalizable.ts +++ b/koala-wrapper/koalaui/interop/src/interop/Finalizable.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,8 +13,8 @@ * limitations under the License. */ -import { Wrapper, nullptr, isNullPtr } from "./Wrapper" -import { finalizerRegister, finalizerUnregister, Thunk } from "@koalaui/common" +import { Wrapper, nullptr } from "./Wrapper" +import { finalizerRegister, finalizerUnregister, Thunk } from "#koalaui/common" import { InteropNativeModule } from "./InteropNativeModule" import { pointer } from "./InteropTypes" @@ -30,7 +30,7 @@ export class NativeThunk implements Thunk { } clean() { - if (!isNullPtr(this.obj)) { + if (this.obj != nullptr) { this.destroyNative(this.obj, this.finalizer) } this.obj = nullptr @@ -75,7 +75,7 @@ export class Finalizable extends Wrapper { } close() { - if (isNullPtr(this.ptr)) { + if (this.ptr == nullptr) { throw new Error(`Closing a closed object: ` + this.toString()) } else if (this.cleaner == null) { throw new Error(`No thunk assigned to ` + this.toString()) diff --git a/koala-wrapper/koalaui/interop/src/interop/InteropNativeModule.ts b/koala-wrapper/koalaui/interop/src/interop/InteropNativeModule.ts index b3677da97..1545b6526 100644 --- a/koala-wrapper/koalaui/interop/src/interop/InteropNativeModule.ts +++ b/koala-wrapper/koalaui/interop/src/interop/InteropNativeModule.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -11,10 +11,10 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ +*/ -import { int32 } from "@koalaui/common"; -import { KPointer, KStringPtr, KUint8ArrayPtr } from "./InteropTypes"; +import { int32, int64 } from "#koalaui/common"; +import { KPointer, KSerializerBuffer, KStringPtr, KUint8ArrayPtr } from "./InteropTypes"; import { loadNativeModuleLibrary } from "./loadLibraries"; export class InteropNativeModule { @@ -27,6 +27,7 @@ export class InteropNativeModule { public static _AppendGroupedLog(index: int32, message: string): void { throw "method not loaded" } public static _PrintGroupedLog(index: int32): void { throw "method not loaded" } public static _GetStringFinalizer(): KPointer { throw "method not loaded" } + public static _IncrementNumber(value: number): number { throw "method not loaded" } public static _InvokeFinalizer(ptr1: KPointer, ptr2: KPointer): void { throw "method not loaded" } public static _GetPtrVectorElement(ptr1: KPointer, arg: int32): KPointer { throw "method not loaded" } public static _StringLength(ptr1: KPointer): int32 { throw "method not loaded" } @@ -35,23 +36,26 @@ export class InteropNativeModule { public static _GetPtrVectorSize(ptr1: KPointer): int32 { throw "method not loaded" } public static _ManagedStringWrite(str1: string, arr: Uint8Array, arg: int32): int32 { throw "method not loaded" } public static _NativeLog(str1: string): void { throw "method not loaded" } - public static _Utf8ToString(data: KUint8ArrayPtr, offset: int32, length: int32): string { throw "method not loaded" } + public static _Utf8ToString(data: KSerializerBuffer, offset: int32, length: int32): string { throw "method not loaded" } public static _StdStringToString(cstring: KPointer): string { throw "method not loaded" } - public static _CheckCallbackEvent(buffer: KUint8ArrayPtr, bufferLength: int32): int32 { throw "method not loaded" } + public static _CheckCallbackEvent(buffer: KSerializerBuffer, bufferLength: int32): int32 { throw "method not loaded" } public static _HoldCallbackResource(resourceId: int32): void { throw "method not loaded" } public static _ReleaseCallbackResource(resourceId: int32): void { throw "method not loaded" } - public static _CallCallback(callbackKind: int32, args: Uint8Array, argsSize: int32): void { throw "method not loaded" } - public static _CallCallbackSync(callbackKind: int32, args: Uint8Array, argsSize: int32): void { throw "method not loaded" } + public static _CallCallback(callbackKind: int32, args: KSerializerBuffer, argsSize: int32): void { throw "method not loaded" } + public static _CallCallbackSync(callbackKind: int32, args: KSerializerBuffer, argsSize: int32): void { throw "method not loaded" } public static _CallCallbackResourceHolder(holder: KPointer, resourceId: int32): void { throw "method not loaded" } public static _CallCallbackResourceReleaser(releaser: KPointer, resourceId: int32): void { throw "method not loaded" } - public static _MaterializeBuffer(data: KPointer, length: int32, resourceId: int32, hold: KPointer, release: KPointer): ArrayBuffer { throw "method not loaded" } + public static _MaterializeBuffer(data: KPointer, length: bigint, resourceId: int32, hold: KPointer, release: KPointer): ArrayBuffer { throw "method not loaded" } public static _GetNativeBufferPointer(data: ArrayBuffer): KPointer { throw "method not loaded" } - public static _LoadVirtualMachine(arg0: int32, arg1: string, arg2: string): int32 { throw "method not loaded" } + public static _LoadVirtualMachine(arg0: int32, arg1: string, arg2: string, arg3: string): int32 { throw "method not loaded" } public static _RunApplication(arg0: int32, arg1: int32): number { throw "method not loaded" } public static _StartApplication(appUrl: string, appParams: string): KPointer { throw "method not loaded" } - public static _EmitEvent(eventType: int32, target: int32, arg0: int32, arg1: int32): void { throw "method not loaded" } - public static _CallForeignVM(foreignContext: KPointer, kind: int32, args: Uint8Array, argsSize: int32): int32 { throw "method not loaded" } + public static _EmitEvent(eventType: int32, target: int32, arg0: int32, arg1: int32): string { throw "method not loaded" } + public static _CallForeignVM(foreignContext: KPointer, kind: int32, args: KSerializerBuffer, argsSize: int32): int32 { throw "method not loaded" } + public static _SetForeignVMContext(context: KPointer): void { throw "method not loaded" } + public static _ReadByte(data: KPointer, index: int32, length: bigint): int32 { throw "method not loaded" } + public static _WriteByte(data: KPointer, index: int32, length: bigint, value: int32): void { throw "method not loaded" } } export function loadInteropNativeModule() { diff --git a/koala-wrapper/koalaui/interop/src/interop/InteropOps.ts b/koala-wrapper/koalaui/interop/src/interop/InteropOps.ts index 71d84f0a4..43ffb4700 100644 --- a/koala-wrapper/koalaui/interop/src/interop/InteropOps.ts +++ b/koala-wrapper/koalaui/interop/src/interop/InteropOps.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ -import { int32 } from "@koalaui/common" +import { int32 } from "#koalaui/common" import { withStringResult } from "./Platform" import { KInt, KStringPtr, KUint8ArrayPtr, pointer } from "./InteropTypes" diff --git a/koala-wrapper/koalaui/interop/src/interop/InteropTypes.ts b/koala-wrapper/koalaui/interop/src/interop/InteropTypes.ts index 7373008e6..26d3e8a13 100644 --- a/koala-wrapper/koalaui/interop/src/interop/InteropTypes.ts +++ b/koala-wrapper/koalaui/interop/src/interop/InteropTypes.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { int32, int64, float32, float64 } from "@koalaui/common" +import { int32, int64, float32, float64 } from "#koalaui/common" export type KStringPtr = int32 | string | null export type KStringArrayPtr = int32 | Uint8Array | null @@ -28,4 +28,5 @@ export type KBoolean = int32 export type KPointer = number | bigint export type pointer = KPointer export type KNativePointer = KPointer -export type KInteropReturnBuffer = Uint8Array \ No newline at end of file +export type KInteropReturnBuffer = Uint8Array +export type KSerializerBuffer = KUint8ArrayPtr \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/interop/MaterializedBase.ts b/koala-wrapper/koalaui/interop/src/interop/MaterializedBase.ts index c1aa09b05..51135fbaa 100644 --- a/koala-wrapper/koalaui/interop/src/interop/MaterializedBase.ts +++ b/koala-wrapper/koalaui/interop/src/interop/MaterializedBase.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/interop/NativeBuffer.ts b/koala-wrapper/koalaui/interop/src/interop/NativeBuffer.ts index d3b23d72e..a623c987d 100644 --- a/koala-wrapper/koalaui/interop/src/interop/NativeBuffer.ts +++ b/koala-wrapper/koalaui/interop/src/interop/NativeBuffer.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,18 +14,20 @@ */ import { pointer } from './InteropTypes' -import { int32, int64 } from '@koalaui/common' +import { int32, int64 } from '#koalaui/common' +import { InteropNativeModule } from "./InteropNativeModule" // stub wrapper for KInteropBuffer -export class NativeBuffer extends ArrayBuffer { - public data:pointer = 0 +// export type NativeBuffer = ArrayBuffer + +export class NativeBuffer { + public data: pointer = 0 public length: int64 = 0 public resourceId: int32 = 0 - public hold:pointer = 0 + public hold: pointer = 0 public release: pointer = 0 - constructor(data:pointer, length: int64, resourceId: int32, hold:pointer, release: pointer) { - super(length) + constructor(data: pointer, length: int64, resourceId: int32, hold: pointer, release: pointer) { this.data = data this.length = length this.resourceId = resourceId @@ -33,7 +35,15 @@ export class NativeBuffer extends ArrayBuffer { this.release = release } - static wrap(data:pointer, length: int64, resourceId: int32, hold:pointer, release: pointer): NativeBuffer { + public readByte(index: int64): int32 { + return InteropNativeModule._ReadByte(this.data, index, BigInt(this.length)) + } + + public writeByte(index: int64, value: int32): void { + InteropNativeModule._WriteByte(this.data, index, BigInt(this.length), value) + } + + static wrap(data: pointer, length: int64, resourceId: int32, hold: pointer, release: pointer): NativeBuffer { return new NativeBuffer(data, length, resourceId, hold, release) } -} +} \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/interop/NativeString.ts b/koala-wrapper/koalaui/interop/src/interop/NativeString.ts index 8e04674be..3e7affc56 100644 --- a/koala-wrapper/koalaui/interop/src/interop/NativeString.ts +++ b/koala-wrapper/koalaui/interop/src/interop/NativeString.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/interop/Platform.ts b/koala-wrapper/koalaui/interop/src/interop/Platform.ts index fb74d312c..ecad750b5 100644 --- a/koala-wrapper/koalaui/interop/src/interop/Platform.ts +++ b/koala-wrapper/koalaui/interop/src/interop/Platform.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ -import { int32 } from "@koalaui/common" +import { int32 } from "#koalaui/common" import { isNullPtr, nullptr, Wrapper } from "./Wrapper" import { decodeToString } from "#common/wrappers/arrays" import { setCallbackRegistry } from "#common/wrappers/Callback" diff --git a/koala-wrapper/koalaui/interop/src/interop/SerializerBase.ts b/koala-wrapper/koalaui/interop/src/interop/SerializerBase.ts index c1df42d43..18af3b1b6 100644 --- a/koala-wrapper/koalaui/interop/src/interop/SerializerBase.ts +++ b/koala-wrapper/koalaui/interop/src/interop/SerializerBase.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,11 +12,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { float32, int32, int64 } from "@koalaui/common" -import { pointer, KPointer } from "./InteropTypes" +import { float32, int32, int64 } from "#koalaui/common" +import { pointer, KPointer, KSerializerBuffer } from "./InteropTypes" import { wrapCallback } from "./InteropOps" import { InteropNativeModule } from "./InteropNativeModule" import { ResourceHolder, ResourceId } from "../arkts/ResourceManager" +import { MaterializedBase } from "./MaterializedBase" +import { nullptr } from "./Wrapper" +import { NativeBuffer } from "./NativeBuffer" // imports required interfaces (now generation is disabled) // import { Resource } from "@arkoala/arkui" @@ -65,14 +68,6 @@ export function runtimeType(value: any): int32 { throw new Error(`bug: ${value} is ${type}`) } -export function isResource(value: unknown): boolean { - return value !== undefined - && typeof value === 'object' - && value !== null - && value.hasOwnProperty("bundleName") - && value.hasOwnProperty("moduleName") -} - // Poor man's instanceof, fails on subclasses export function isInstanceOf(className: string, value: object | undefined): boolean { return value?.constructor.name === className @@ -85,9 +80,11 @@ export function registerCallback(value: object|undefined): int32 { }) } -export function registerMaterialized(value: object|undefined): number { - // TODO: fix me! - return 42 +export function toPeerPtr(value: object): KPointer { + if (value.hasOwnProperty("peer")) + return unsafeCast(value).getPeer()?.ptr ?? nullptr + else + throw new Error("Value is not a MaterializedBase instance") } export interface CallbackResource { @@ -127,12 +124,18 @@ export class SerializerBase { this.releaseResources() this.position = 0 } - asArray(): Uint8Array { + asBuffer(): KSerializerBuffer { return new Uint8Array(this.buffer) } length(): int32 { return this.position } + getByte(offset: int32): int32 { + return this.view.getUint8(offset) as int32 + } + toArray(): Uint8Array { + return new Uint8Array(this.buffer.slice(0, this.currentPosition())) + } currentPosition(): int32 { return this.position } private checkCapacity(value: int32) { @@ -145,6 +148,7 @@ export class SerializerBase { const resizedSize = Math.max(minSize, Math.round(3 * buffSize / 2)) let resizedBuffer = new ArrayBuffer(resizedSize) // TODO: can we grow without new? + // TODO: check the status of ArrayBuffer.transfer function implementation in STS new Uint8Array(resizedBuffer).set(new Uint8Array(this.buffer)) this.buffer = resizedBuffer this.view = new DataView(resizedBuffer) @@ -162,7 +166,7 @@ export class SerializerBase { return resourceId } holdAndWriteCallbackForPromiseVoid(hold: KPointer = 0, release: KPointer = 0, call: KPointer = 0, callSync = 0): [Promise, ResourceId] { - let resourceId: ResourceId + let resourceId: ResourceId = 0 const promise = new Promise((resolve, reject) => { const callback = (err: string[]|undefined) => { if (err !== undefined) @@ -175,7 +179,7 @@ export class SerializerBase { return [promise, resourceId] } holdAndWriteCallbackForPromise(hold: KPointer = 0, release: KPointer = 0, call: KPointer = 0): [Promise, ResourceId] { - let resourceId: ResourceId + let resourceId: ResourceId = 0 const promise = new Promise((resolve, reject) => { const callback = (value: T|undefined, err: string[]|undefined) => { if (err !== undefined) @@ -192,6 +196,14 @@ export class SerializerBase { this.writePointer(resource.hold) this.writePointer(resource.release) } + holdAndWriteObject(obj:any, hold: KPointer = 0, release: KPointer = 0): ResourceId { + const resourceId = ResourceHolder.instance().registerAndHold(obj) + this.heldResources.push(resourceId) + this.writeInt32(resourceId) + this.writePointer(hold) + this.writePointer(release) + return resourceId + } private releaseResources() { for (const resourceId of this.heldResources) InteropNativeModule._ReleaseCallbackResource(resourceId) @@ -267,16 +279,14 @@ export class SerializerBase { this.view.setInt32(this.position, encodedLength, true) this.position += encodedLength + 4 } - writeBuffer(buffer: ArrayBuffer) { - const resourceId = ResourceHolder.instance().registerAndHold(buffer) + writeBuffer(buffer: NativeBuffer) { this.writeCallbackResource({ - resourceId, - hold: 0, - release: 0 + resourceId: buffer.resourceId, + hold: buffer.hold, + release: buffer.release, }) - const ptr = InteropNativeModule._GetNativeBufferPointer(buffer) - this.writePointer(ptr) - this.writeInt64(buffer.byteLength) + this.writePointer(buffer.data) + this.writeInt64(buffer.length) } } diff --git a/koala-wrapper/koalaui/interop/src/interop/Wrapper.ts b/koala-wrapper/koalaui/interop/src/interop/Wrapper.ts index 4b7dbc124..9d537a57f 100644 --- a/koala-wrapper/koalaui/interop/src/interop/Wrapper.ts +++ b/koala-wrapper/koalaui/interop/src/interop/Wrapper.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,7 +14,7 @@ */ import { ptrToString, nullptr, isSamePtr } from "#common/wrappers/Wrapper" -import { className } from "@koalaui/common" +import { className } from "#koalaui/common" import { KPointer } from "./InteropTypes" export { isNullPtr, nullptr, ptrToBits, bitsToPtr, isSamePtr, ptrToString } from "#common/wrappers/Wrapper" diff --git a/koala-wrapper/koalaui/interop/src/interop/arrays.ts b/koala-wrapper/koalaui/interop/src/interop/arrays.ts index 2699de10b..1336f18e1 100644 --- a/koala-wrapper/koalaui/interop/src/interop/arrays.ts +++ b/koala-wrapper/koalaui/interop/src/interop/arrays.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ -import { int32 } from "@koalaui/common" +import { int32 } from "#koalaui/common" export enum Access { READ = 1, // 1 << 0, diff --git a/koala-wrapper/koalaui/interop/src/interop/buffer.ts b/koala-wrapper/koalaui/interop/src/interop/buffer.ts index 5bf60ad3e..0393ff27f 100644 --- a/koala-wrapper/koalaui/interop/src/interop/buffer.ts +++ b/koala-wrapper/koalaui/interop/src/interop/buffer.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -11,26 +11,29 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ +*/ +import { int32 } from "#koalaui/common" + +// todo can be removed if passing ArrayBuffer type through interop is possible export class KBuffer { private readonly _buffer: Uint8Array public get buffer(): ArrayBuffer { return this._buffer } - public get length(): number { + public get length(): int32 { return this._buffer.length } - constructor(length: number) { + constructor(length: int32) { this._buffer = new Uint8Array(length) } - set(index: number, value: number): void { + set(index: int32, value: int32): void { this._buffer[index] = value } - get(index: number): number { + get(index: int32): int32 { return this._buffer[index] } } \ No newline at end of file diff --git a/koala-wrapper/koalaui/interop/src/interop/index.ts b/koala-wrapper/koalaui/interop/src/interop/index.ts index 5966b160a..44281dead 100644 --- a/koala-wrapper/koalaui/interop/src/interop/index.ts +++ b/koala-wrapper/koalaui/interop/src/interop/index.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -68,7 +68,7 @@ export * from "./buffer" export * from "../arkts/ResourceManager" export * from "./NativeBuffer" export { InteropNativeModule, loadInteropNativeModule } from "./InteropNativeModule" -export { SerializerBase, RuntimeType, Tags, runtimeType, CallbackResource, unsafeCast, isResource, isInstanceOf } from "./SerializerBase" +export { SerializerBase, RuntimeType, Tags, runtimeType, CallbackResource, unsafeCast, isInstanceOf, toPeerPtr } from "./SerializerBase" export { DeserializerBase } from "./DeserializerBase" export { loadNativeModuleLibrary, loadNativeLibrary, registerNativeModuleLibraryName } from "./loadLibraries" export * from "./MaterializedBase" diff --git a/koala-wrapper/koalaui/interop/src/interop/java/CallbackRecord.java b/koala-wrapper/koalaui/interop/src/interop/java/CallbackRecord.java index 4c866822d..2292705a6 100644 --- a/koala-wrapper/koalaui/interop/src/interop/java/CallbackRecord.java +++ b/koala-wrapper/koalaui/interop/src/interop/java/CallbackRecord.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/interop/java/CallbackRegistry.java b/koala-wrapper/koalaui/interop/src/interop/java/CallbackRegistry.java index 59dceae85..2fb731539 100644 --- a/koala-wrapper/koalaui/interop/src/interop/java/CallbackRegistry.java +++ b/koala-wrapper/koalaui/interop/src/interop/java/CallbackRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -40,15 +40,15 @@ class CallbackRegistry { } public static Integer wrap(CallbackType callback) { - Integer id = CallbackRegistry.id++; - CallbackRegistry.callbacks.put(id, new CallbackRecord(callback, true)); - return id; + Integer callbackId = CallbackRegistry.id++; + CallbackRegistry.callbacks.put(callbackId, new CallbackRecord(callback, true)); + return callbackId; } public static Integer wrap(CallbackType callback, boolean autoDisposable) { - Integer id = CallbackRegistry.id++; - CallbackRegistry.callbacks.put(id, new CallbackRecord(callback, autoDisposable)); - return id; + Integer callbackId = CallbackRegistry.id++; + CallbackRegistry.callbacks.put(callbackId, new CallbackRecord(callback, autoDisposable)); + return callbackId; } public static int call(Integer id, byte[] args, int length) { diff --git a/koala-wrapper/koalaui/interop/src/interop/java/CallbackTests.java b/koala-wrapper/koalaui/interop/src/interop/java/CallbackTests.java index 04573b937..a5aa880e4 100644 --- a/koala-wrapper/koalaui/interop/src/interop/java/CallbackTests.java +++ b/koala-wrapper/koalaui/interop/src/interop/java/CallbackTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/interop/java/CallbackType.java b/koala-wrapper/koalaui/interop/src/interop/java/CallbackType.java index 188faacd2..952cd3d39 100644 --- a/koala-wrapper/koalaui/interop/src/interop/java/CallbackType.java +++ b/koala-wrapper/koalaui/interop/src/interop/java/CallbackType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/interop/loadLibraries.ts b/koala-wrapper/koalaui/interop/src/interop/loadLibraries.ts index 79c8bdd9c..53e01c485 100644 --- a/koala-wrapper/koalaui/interop/src/interop/loadLibraries.ts +++ b/koala-wrapper/koalaui/interop/src/interop/loadLibraries.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/interop/nullable.ts b/koala-wrapper/koalaui/interop/src/interop/nullable.ts index 546eb9cab..1a1875e25 100644 --- a/koala-wrapper/koalaui/interop/src/interop/nullable.ts +++ b/koala-wrapper/koalaui/interop/src/interop/nullable.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/kotlin/DeserializerBase.kt b/koala-wrapper/koalaui/interop/src/kotlin/DeserializerBase.kt new file mode 100644 index 000000000..fcf2c2f84 --- /dev/null +++ b/koala-wrapper/koalaui/interop/src/kotlin/DeserializerBase.kt @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package interop + +public open class DeserializerBase { + private var position: Int = 0 + var length: Int = 96 // make private + var buffer: pointer // make private + + constructor(buffer: ULong, length: Int) { + this.buffer = buffer + this.length = length + } + constructor(buffer: Array, length: Int) { + this.buffer = InteropNativeModule._Malloc(length.toLong()) + for (i in 0..length) { + DeserializerBase.writeu8(this.buffer, i, length, buffer[i]) + } + this.length = length + } + + companion object { + private fun writeu8(buffer: pointer, offset: Int, length: Int, value: UByte): Unit { + InteropNativeModule._WriteByte(buffer, offset, length, value.toInt()) + } + private fun readu8(buffer: pointer, offset: Int, length: Int): Int { + return InteropNativeModule._ReadByte(buffer, offset, length) + } + } + + public fun asBuffer(): pointer { + return this.buffer + } + + public fun currentPosition(): Int { + return this.position + } + + public fun resetCurrentPosition(): Unit { + this.position = 0 + } + + private fun checkCapacity(value: Int) { + if (value > this.length) { + throw Exception("${value} is less than remaining buffer length") + } + } + + public fun readInt8(): Byte { + this.checkCapacity(1) + var res = DeserializerBase.readu8(this.buffer, this.position, this.length) + this.position += 1 + return res.toByte() + } + + public fun readInt32(): Int { + this.checkCapacity(4) + var result: Int = 0 + for (i in 0..3) { + result = result or (DeserializerBase.readu8(this.buffer, this.position + i, this.length) shl (8 * i)) + } + this.position += 4 + return result + } + + public fun readInt64(): Long { + this.checkCapacity(8) + var result: Long = 0 + for (i in 0..7) { + result = result or (DeserializerBase.readu8(this.buffer, this.position + i, this.length).toLong() shl (8 * i)) + } + this.position += 8 + return result + } + + public fun readPointer(): KPointer { + this.checkCapacity(8) + var result: ULong = 0uL + for (i in 0..7) { + result = result or (DeserializerBase.readu8(this.buffer, this.position + i, this.length).toULong() shl (8 * i)) + } + this.position += 8 + return result + } + + public fun readFloat32(): Float { + this.checkCapacity(4) + var result: Int = 0 + for (i in 0..3) { + result = result or (DeserializerBase.readu8(this.buffer, this.position + i, this.length).toInt() shl (8 * i)) + } + this.position += 4 + return Float.fromBits(result) + } + public fun readFloat64(): Double { + this.checkCapacity(8) + var result: Long = 0 + for (i in 0..7) { + result = result or (DeserializerBase.readu8(this.buffer, this.position + i, this.length).toLong() shl (8 * i)) + } + this.position += 8 + return Double.fromBits(result) + } + + public fun readBoolean(): Boolean { + var byteVal = DeserializerBase.readu8(this.buffer, this.position, this.length) + this.position += 1 + return byteVal == 1 + } + + public fun readString(): String { + val length = this.readInt32() + this.checkCapacity(length) + // read without null-terminated byte + val value = InteropNativeModule._Utf8ToString(this.buffer, this.position, length) + this.position += length + return value + } + + public fun readCustomObject(kind: String): Object { + throw Exception("readCustomObject") + } + + public fun readObject(): Any { + val resource = this.readCallbackResource() + return ResourceHolder.instance() // .get(resource.resourceId) + } + + public fun readBuffer(): UIntArray { + return UIntArray(0) + } + + public fun readFunction(): Any { + return 0 + } + + public fun readNumber(): Number { + val tag = this.readInt8().toInt() + if (tag == Tag.UNDEFINED.value) { + throw Exception("Read number can't return undefined.") + } else if (tag == Tag.INT32.value) { + return this.readInt32() + } else if (tag == Tag.FLOAT32.value) { + return this.readFloat32() + } else { + throw Exception("Unknown number tag: ${tag}") + } + } + + public fun readCallbackResource(): CallbackResource { + return object: CallbackResource { + override var resourceId = this@DeserializerBase.readInt32() + override var hold = this@DeserializerBase.readPointer() + override var release = this@DeserializerBase.readPointer() + } + } +} diff --git a/koala-wrapper/koalaui/interop/src/arkts/buffer.sts b/koala-wrapper/koalaui/interop/src/kotlin/InteropNativeModule.kt similarity index 44% rename from koala-wrapper/koalaui/interop/src/arkts/buffer.sts rename to koala-wrapper/koalaui/interop/src/kotlin/InteropNativeModule.kt index d808bdc82..63630f9ff 100644 --- a/koala-wrapper/koalaui/interop/src/arkts/buffer.sts +++ b/koala-wrapper/koalaui/interop/src/kotlin/InteropNativeModule.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,31 +12,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package interop -import { int8 } from "@koalaui/common" - -export class KBuffer { - private readonly _buffer: byte[] - public get buffer(): byte[] { - return this._buffer - } - public get length(): int { - return this._buffer.length - } - - constructor(length: int) { - this._buffer = new byte[length] - } - - constructor(buffer: byte[]) { - this._buffer = buffer - } - - set(index: int, value: int8): void { - this._buffer[index] = value as byte - } - - get(index: int): byte { - return this._buffer[index] +public class InteropNativeModule { + companion object { + public fun _Malloc(length: Long): KPointer { + return nullptr + } + fun _Free(data: KPointer) { + + } + public fun _ReadByte(data: KPointer, index: Int, length: Int): Int { + return 0 + } + public fun _WriteByte(data: KPointer, index: Int, length: Int, value: Int) { + } + public fun _ManagedStringWrite(str1: String, arr: pointer, arg: Int): Int { + return 0 + } + public fun _Utf8ToString(data: KPointer, offset: Int, length: Int): String { + return "" + } } } \ No newline at end of file diff --git a/koala-wrapper/koalaui/compat/src/arkts/prop-deep-copy.ts b/koala-wrapper/koalaui/interop/src/kotlin/InteropTypes.kt similarity index 59% rename from koala-wrapper/koalaui/compat/src/arkts/prop-deep-copy.ts rename to koala-wrapper/koalaui/interop/src/kotlin/InteropTypes.kt index 25ec18c81..ae93fa277 100644 --- a/koala-wrapper/koalaui/compat/src/arkts/prop-deep-copy.ts +++ b/koala-wrapper/koalaui/interop/src/kotlin/InteropTypes.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,13 +12,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package interop -/* - When decorating variables of complex types, - @Prop makes a deep copy, during which all types, - except primitive types, Map, Set, Date, and Array, will be lost. - */ - -export function propDeepCopy(sourceObject: T): T { - return sourceObject -} +public typealias KPointer = ULong +public typealias KFloat = Float +public typealias pointer = KPointer +public typealias KInt = Int +public typealias KLong = Long +public typealias KStringPtr = String +public typealias ArrayBuffer = Array +public typealias KSerializerBuffer = pointer +public val nullptr: ULong = 0uL diff --git a/koala-wrapper/koalaui/common/src/LifecycleEvent.ts b/koala-wrapper/koalaui/interop/src/kotlin/MaterializedBase.kt similarity index 45% rename from koala-wrapper/koalaui/common/src/LifecycleEvent.ts rename to koala-wrapper/koalaui/interop/src/kotlin/MaterializedBase.kt index aa67f2312..5b0e49429 100644 --- a/koala-wrapper/koalaui/common/src/LifecycleEvent.ts +++ b/koala-wrapper/koalaui/interop/src/kotlin/MaterializedBase.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,23 +12,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package interop -export enum LifecycleEventKind { - SHOW_FRAME, - HIDE_FRAME, - CLOSE_FRAME, - ON_APPEAR, - ON_DISAPPEAR, - SHOW_COMPONENT, - HIDE_COMPONENT, - BACK, - FOCUS_FRAME, - UNFOCUS_FRAME -} +public open class Finalizable(var ptr: KPointer, var finalizer: KPointer) {} -export class LifecycleEvent { - kind: LifecycleEventKind - constructor(kind: LifecycleEventKind) { - this.kind = kind - } -} \ No newline at end of file +public interface MaterializedBase { + public fun getPeer(): Finalizable? + public companion object { + public fun toPeerPtr(value: Any): KPointer + { + if (value is MaterializedBase) { + val peer = value.getPeer() + if (peer != null) { + return peer.ptr + } else { + return nullptr + } + } else { + throw Exception("Value is not a MaterializedBase instance!") + } + } + } +} diff --git a/koala-wrapper/koalaui/interop/src/kotlin/ResourceManager.kt b/koala-wrapper/koalaui/interop/src/kotlin/ResourceManager.kt new file mode 100644 index 000000000..75e8461ed --- /dev/null +++ b/koala-wrapper/koalaui/interop/src/kotlin/ResourceManager.kt @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package interop + +public typealias ResourceId = Int + +class ResourceInfo(var resource: Any, var holdersCount: Int ) {} + +public class ResourceHolder { + private var resources: HashMap = HashMap() + + companion object { + private var nextResourceId: ResourceId = 100 + private var _instance: ResourceHolder? = null + public fun instance(): ResourceHolder { + if (ResourceHolder._instance == null) { + return ResourceHolder._instance!! + } else { + return ResourceHolder() + } + } + public fun hold(resourceId: ResourceId) { + val resource = instance().resources.get(resourceId) + if (resource != null) { + resource.holdersCount++ + } else { + throw Exception("Resource ${resourceId} does not exists, can not hold") + } + } + + public fun release(resourceId: ResourceId) { + val resource = instance().resources.get(resourceId) + if (resource != null) { + resource.holdersCount-- + if (resource.holdersCount <= 0) { + instance().resources.remove(resourceId) + } + } else { + throw Exception("Resource ${resourceId} does not exists, can not hold") + } + } + + public fun registerAndHold(resource: Any): ResourceId { + ResourceHolder.nextResourceId += 1 + val resourceId = ResourceHolder.nextResourceId + instance().resources.put(resourceId, ResourceInfo(resource, resourceId)) + return resourceId + } + + public fun get(resourceId: ResourceId): Any { + val resource = instance().resources.get(resourceId) + if (resource != null) { + return resource.resource + } else { + throw Exception("Resource ${resourceId} does not exists") + } + } + } +} diff --git a/koala-wrapper/koalaui/interop/src/kotlin/SerializerBase.kt b/koala-wrapper/koalaui/interop/src/kotlin/SerializerBase.kt new file mode 100644 index 000000000..d066f080e --- /dev/null +++ b/koala-wrapper/koalaui/interop/src/kotlin/SerializerBase.kt @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package interop + +import java.nio.ByteBuffer +import java.nio.ByteOrder +import kotlin.math.roundToInt +import java.util.Date + +public enum class RuntimeType(val value: Int) { + UNEXPECTED(-1), + NUMBER(1), + STRING(2), + OBJECT(3), + BOOLEAN(4), + UNDEFINED(5), + BIGINT(6), + FUNCTION(7), + SYMBOL(8), + MATERIALIZED(9); +} + +public interface Disposable { + fun dispose() +} + +public interface CallbackResource { + val resourceId: Int + val hold: KPointer + val release: KPointer +} + +public abstract class CustomSerializer(private val supported: List) { + var next: CustomSerializer? = null + + fun supports(kind: String): Boolean { + return supported.contains(kind) + } + abstract fun serialize(serializer: SerializerBase, value: Any, kind: String) +} + +public class DateSerializer : CustomSerializer(listOf("Date")) { + override fun serialize(serializer: SerializerBase, value: Any, kind: String) { + serializer.writeString((value as Date).toInstant().toString()) + } +} + +public open class SerializerBase { + private var position: Int = 0 + private var _buffer: KSerializerBuffer + private var _length: Int + + private var customSerializers: CustomSerializer? = DateSerializer() + + fun registerCustomSerializer(serializer: CustomSerializer) { + if (customSerializers == null) { + customSerializers = serializer + } else { + var current = customSerializers + while (current?.next != null) { + current = current.next + } + current?.next = serializer + } + } + + constructor() { + var length = 96 + this._buffer = InteropNativeModule._Malloc(length.toLong()) + this._length = length + } + + companion object { + private fun writeu8(_buffer: pointer, offset: Int, length: Int, value: Int): Unit { + InteropNativeModule._WriteByte(_buffer, offset, length, value) + } + private fun readu8(_buffer: pointer, offset: Int, length: Int): Int { + return InteropNativeModule._ReadByte(_buffer, offset, length) + } + } + + private fun checkCapacity(value: Int) { + if (value < 1) { + var buffSize = this._length + if (this.position > buffSize - value) { + val minSize = this.position + value + val resizedSize = maxOf(minSize, (3.0 * buffSize / 2.0).roundToInt()) + val resizedBuffer = InteropNativeModule._Malloc(resizedSize.toLong()) + val oldBuffer = this._buffer + for (i in 0..this.position) { + SerializerBase.writeu8(resizedBuffer, i, resizedSize, SerializerBase.readu8(oldBuffer, i, this.position)); + } + this._buffer = resizedBuffer + this._length = resizedSize + InteropNativeModule._Free(oldBuffer) + } + } + } + + fun asBuffer(): KSerializerBuffer { + return this._buffer + } + + fun writeString(value: String) { + this.checkCapacity(4 + value.length * 4 + 1) // length, data + val encodedLength = InteropNativeModule._ManagedStringWrite(value, this.asBuffer(), this.position + 4) + this.writeInt32(encodedLength) + this.position += encodedLength + } + + fun writeInt8(value: Byte) { + checkCapacity(1) + SerializerBase.writeu8(this._buffer, this.position, this._length, value.toInt()) + position += 1 + } + fun writeInt8(value: Int) { + checkCapacity(1) + SerializerBase.writeu8(this._buffer, this.position, this._length, value) + position += 1 + } + + fun writeInt32(value: Int) { + checkCapacity(4) + val arr = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(value).array() + for (i in 0..3) { + SerializerBase.writeu8(this._buffer, this.position, this._length, arr[i].toInt()) + } + position += 4 + } + fun writeInt32(value: Long) { + checkCapacity(4) + val arr = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(value.toInt()).array() + for (i in 0..3) { + SerializerBase.writeu8(this._buffer, this.position, this._length, arr[i].toInt()) + } + position += 4 + } + + fun writeInt64(value: Long) { + checkCapacity(8) + val arr = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(value).array() + for (i in 0..7) { + SerializerBase.writeu8(this._buffer, this.position, this._length, arr[i].toInt()) + } + position += 8 + } + + fun writeFloat32(value: Float) { + checkCapacity(4) + val arr = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(value).array() + for (i in 0..3) { + SerializerBase.writeu8(this._buffer, this.position, this._length, arr[i].toInt()) + } + position += 4 + } + + fun writeBoolean(value: Boolean) { + checkCapacity(1) + SerializerBase.writeu8(this._buffer, this.position, this._length, if(value) 1 else 0) + position += 1 + } + + fun writeTag(tag: Tag) { + this.checkCapacity(1) + SerializerBase.writeu8(this._buffer, this.position, this._length, tag.value) + this.position++ + } + + fun writeNumber(value: Number?) { + if (value == null) { + writeTag(Tag.UNDEFINED) + return + } + if (value.toDouble() == value.toInt().toDouble()) { + writeTag(Tag.INT32) + writeInt32(value.toInt()) + } else { + writeTag(Tag.FLOAT32) + writeFloat32(value.toFloat()) + } + } + + fun writeCustomObject(kind: String, value: Any) { + var current = customSerializers + while (current != null) { + if (current.supports(kind)) { + current.serialize(this, value, kind) + return + } + current = current.next + } + writeTag(Tag.UNDEFINED) + } +} diff --git a/koala-wrapper/koalaui/compat/src/arkts/utils.ts b/koala-wrapper/koalaui/interop/src/kotlin/Tag.kt similarity index 71% rename from koala-wrapper/koalaui/compat/src/arkts/utils.ts rename to koala-wrapper/koalaui/interop/src/kotlin/Tag.kt index 45c74d2e4..f7212ffe2 100644 --- a/koala-wrapper/koalaui/compat/src/arkts/utils.ts +++ b/koala-wrapper/koalaui/interop/src/kotlin/Tag.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,7 +12,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package interop -export function unsafeCast(value: Object): T { - return value as T +public enum class Tag(val value: Int) { + UNDEFINED(101), + INT32(102), + FLOAT32(103), + STRING(104), + LENGTH(105), + RESOURCE(106), + OBJECT(107); } diff --git a/koala-wrapper/koalaui/interop/src/napi/wrappers/Callback.ts b/koala-wrapper/koalaui/interop/src/napi/wrappers/Callback.ts index 4d9193a13..5af4ae26b 100644 --- a/koala-wrapper/koalaui/interop/src/napi/wrappers/Callback.ts +++ b/koala-wrapper/koalaui/interop/src/napi/wrappers/Callback.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/napi/wrappers/Wrapper.ts b/koala-wrapper/koalaui/interop/src/napi/wrappers/Wrapper.ts index 0f688601b..c968bf35c 100644 --- a/koala-wrapper/koalaui/interop/src/napi/wrappers/Wrapper.ts +++ b/koala-wrapper/koalaui/interop/src/napi/wrappers/Wrapper.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ -import { int32 } from "@koalaui/common" +import { int32 } from "#koalaui/common" import { KPointer } from "../../interop/InteropTypes" export const nullptr = BigInt(0) diff --git a/koala-wrapper/koalaui/interop/src/napi/wrappers/arrays.ts b/koala-wrapper/koalaui/interop/src/napi/wrappers/arrays.ts index 36cefa696..6c2c7288c 100644 --- a/koala-wrapper/koalaui/interop/src/napi/wrappers/arrays.ts +++ b/koala-wrapper/koalaui/interop/src/napi/wrappers/arrays.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ -import { CustomTextDecoder, CustomTextEncoder } from "@koalaui/common" +import { CustomTextDecoder, CustomTextEncoder } from "#koalaui/common" import { Access, Exec, ExecWithLength, PtrArray, TypedArray } from "../../interop/arrays" import { nullptr } from "./Wrapper" import { Wrapper } from "../../interop/Wrapper" diff --git a/koala-wrapper/koalaui/interop/src/wasm/wrappers/Callback.ts b/koala-wrapper/koalaui/interop/src/wasm/wrappers/Callback.ts index 5f4de87e8..abc939bca 100644 --- a/koala-wrapper/koalaui/interop/src/wasm/wrappers/Callback.ts +++ b/koala-wrapper/koalaui/interop/src/wasm/wrappers/Callback.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/koala-wrapper/koalaui/interop/src/wasm/wrappers/Wrapper.ts b/koala-wrapper/koalaui/interop/src/wasm/wrappers/Wrapper.ts index 52c2a1a58..5bfcf747d 100644 --- a/koala-wrapper/koalaui/interop/src/wasm/wrappers/Wrapper.ts +++ b/koala-wrapper/koalaui/interop/src/wasm/wrappers/Wrapper.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ -import { int32 } from "@koalaui/common" +import { int32 } from "#koalaui/common" import { KPointer } from "../../interop/InteropTypes" export const nullptr: number = 0 diff --git a/koala-wrapper/koalaui/interop/src/wasm/wrappers/arrays.ts b/koala-wrapper/koalaui/interop/src/wasm/wrappers/arrays.ts index 9aa189d07..c4bfcd37e 100644 --- a/koala-wrapper/koalaui/interop/src/wasm/wrappers/arrays.ts +++ b/koala-wrapper/koalaui/interop/src/wasm/wrappers/arrays.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ -import { CustomTextEncoder, CustomTextDecoder, int32 } from "@koalaui/common" +import { CustomTextEncoder, CustomTextDecoder, int32 } from "#koalaui/common" import { KPointer } from "../../interop/InteropTypes" import { Wrapper } from "../../interop/Wrapper" -- Gitee