1/* 2 * Copyright (c) 2024-2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { KInt, KLong, KBoolean, KFloat, KUInt, KStringPtr, KPointer, KNativePointer, KInt32ArrayPtr, KUint8ArrayPtr, KFloat32ArrayPtr, pointer, KInteropReturnBuffer, KSerializerBuffer, loadNativeModuleLibrary, NativeBuffer } from "@koalaui/interop" 17import { int32, int64, float32 } from "@koalaui/common" 18 19export class ArkUINativeModule { 20 static { 21 loadNativeModuleLibrary("ArkUINativeModule") 22 } 23 @ani.unsafe.Direct 24 native static _CreateNode(node_t: int32, arg0: int32, arg1: int32): KPointer 25 @ani.unsafe.Direct 26 native static _GetNodeFinalizer(): KPointer 27 @ani.unsafe.Direct 28 native static _GetNodeByViewStack(): KPointer 29 @ani.unsafe.Direct 30 native static _DisposeNode(ptr0: KPointer): void 31 @ani.unsafe.Direct 32 native static _DumpTreeNode(ptr0: KPointer): void 33 @ani.unsafe.Direct 34 native static _AddChild(ptr1: KPointer, ptr2: KPointer): int32 35 @ani.unsafe.Direct 36 native static _RemoveChild(ptr0: KPointer, ptr2: KPointer): void 37 @ani.unsafe.Direct 38 native static _InsertChildAfter(ptr0: KPointer, ptr1: KPointer, ptr2: KPointer): int32 39 @ani.unsafe.Direct 40 native static _InsertChildBefore(ptr0: KPointer, ptr1: KPointer, ptr2: KPointer): int32 41 @ani.unsafe.Direct 42 native static _InsertChildAt(ptr0: KPointer, ptr1: KPointer, arg: int32): int32 43 @ani.unsafe.Direct 44 native static _ApplyModifierFinish(ptr0: KPointer): void 45 @ani.unsafe.Direct 46 native static _MarkDirty(ptr0: KPointer, arg: int32): void 47 @ani.unsafe.Direct 48 native static _IsBuilderNode(ptr0: KPointer): boolean 49 @ani.unsafe.Direct 50 native static _ConvertLengthMetricsUnit(arg0: float32, arg1: int32, arg2: int32): float32 51 @ani.unsafe.Direct 52 native static _SetCustomCallback(ptr0: KPointer, arg: int32): void 53 native static _MeasureLayoutAndDraw(ptr0: KPointer): void 54 native static _MeasureNode(ptr0: KPointer, arr: KFloat32ArrayPtr): int32 55 @ani.unsafe.Quick 56 native static _LayoutNode(ptr0: KPointer, arr: KFloat32ArrayPtr): int32 57 native static _DrawNode(ptr0: KPointer, arr: KFloat32ArrayPtr): int32 58 @ani.unsafe.Direct 59 native static _SetMeasureWidth(ptr0: KPointer, arg: int32): void 60 @ani.unsafe.Direct 61 native static _GetMeasureWidth(ptr0: KPointer): int32 62 @ani.unsafe.Direct 63 native static _SetMeasureHeight(ptr0: KPointer, arg: int32): void 64 @ani.unsafe.Direct 65 native static _GetMeasureHeight(ptr0: KPointer): int32 66 @ani.unsafe.Direct 67 native static _SetX(ptr0: KPointer, arg: int32): void 68 @ani.unsafe.Direct 69 native static _GetX(ptr0: KPointer): int32 70 @ani.unsafe.Direct 71 native static _SetY(ptr0: KPointer, arg: int32): void 72 @ani.unsafe.Direct 73 native static _GetY(ptr0: KPointer): int32 74 @ani.unsafe.Direct 75 native static _SetAlignment(ptr0: KPointer, arg: int32): void 76 @ani.unsafe.Direct 77 native static _GetAlignment(ptr0: KPointer): int32 78 @ani.unsafe.Direct 79 native static _IndexerChecker(ptr0: KPointer): int32 80 @ani.unsafe.Direct 81 native static _SetRangeUpdater(ptr0: KPointer, arg: int32): void 82 @ani.unsafe.Direct 83 native static _SetLazyItemIndexer(ptr0: KPointer, arg: int32): void 84 @ani.unsafe.Direct 85 native static _GetPipelineContext(ptr0: KPointer): KPointer 86 @ani.unsafe.Quick 87 native static _VSyncAwait(pipeline: KPointer): Object 88 @ani.unsafe.Direct 89 native static _SetVsyncCallback(pipeline: KPointer): void 90 @ani.unsafe.Direct 91 native static _UnblockVsyncWait(pipeline: KPointer): void 92 @ani.unsafe.Direct 93 native static _SetChildTotalCount(ptr0: KPointer, arg: int32): void 94 @ani.unsafe.Quick 95 native static _ShowCrash(message: string): void 96 @ani.unsafe.Quick 97 native static _StartPerf(str1: string): void 98 @ani.unsafe.Quick 99 native static _EndPerf(str1: string): void 100 @ani.unsafe.Direct 101 native static _DumpPerf(arg: int32): KPointer 102 @ani.unsafe.Direct 103 native static _CheckCallbackEvent(buffer: KSerializerBuffer, bufferLength: int32): int32 104 @ani.unsafe.Direct 105 native static _HoldCallbackResource(resourceId: int32): void 106 @ani.unsafe.Direct 107 native static _ReleaseCallbackResource(resourceId: int32): void 108 native static _LoadUserView(userClass: string, params: string): Object 109} 110