From 7d9165624ddd51cf4240117cf65df388641d3730 Mon Sep 17 00:00:00 2001 From: yalixie Date: Fri, 6 Dec 2024 17:40:52 +0300 Subject: [PATCH 1/3] Signed-off-by: yalixie Fix CustomComponent Fix ExampleComponents Fix ArkIndicatorcomponentPeer Fixes in tsconfig --- arkoala/arkui-common/src/index.ts | 2 +- ...ndicatorComponentControllerMaterialized.ts | 110 ++++++++++++++++++ .../src/peers/ArkIndicatorcomponentPeer.ts | 106 +++++++++++++++++ .../src/ExampleComponents.ts | 41 +++---- arkoala/tests/src/ets-tests/tsconfig.json | 2 +- arkoala/tests/tsconfig-test.json | 8 +- 6 files changed, 235 insertions(+), 34 deletions(-) create mode 100644 arkoala/arkui/src/ArkIndicatorComponentControllerMaterialized.ts create mode 100644 arkoala/arkui/src/peers/ArkIndicatorcomponentPeer.ts diff --git a/arkoala/arkui-common/src/index.ts b/arkoala/arkui-common/src/index.ts index 3ec695986..d4616773c 100644 --- a/arkoala/arkui-common/src/index.ts +++ b/arkoala/arkui-common/src/index.ts @@ -1 +1 @@ -export * from "#arkcompat/index" +export * from "#arkcompat" diff --git a/arkoala/arkui/src/ArkIndicatorComponentControllerMaterialized.ts b/arkoala/arkui/src/ArkIndicatorComponentControllerMaterialized.ts new file mode 100644 index 000000000..45110a049 --- /dev/null +++ b/arkoala/arkui/src/ArkIndicatorComponentControllerMaterialized.ts @@ -0,0 +1,110 @@ +/* + * 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. + */ + + +// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! + + +import { Finalizable } from "./Finalizable" +import { MaterializedBase } from "./MaterializedBase" +import { nativeModule } from "@koalaui/arkoala" +import { Serializer } from "./peers/Serializer" +import { isResource, isInstanceOf, runtimeType, RuntimeType, SerializerBase } from "./peers/SerializerBase" +import { unsafeCast } from "./shared/generated-utils" +import { registerCallback } from "./peers/SerializerBase" +import { wrapCallback } from "@koalaui/interop" +import { Deserializer, createDeserializer } from "./peers/Deserializer" +import { CallbackKind } from "./peers/CallbackKind" + + +import { + int32, + float32 +} from "@koalaui/common" +import { + KInt, + KBoolean, + KFloat, + KUInt, + KStringPtr, + KPointer, + KNativePointer, + KInt32ArrayPtr, + KUint8ArrayPtr, + KFloat32ArrayPtr, + pointer +} from "@koalaui/interop" + + +export class IndicatorComponentController implements MaterializedBase { + peer?: Finalizable + getPeer(): Finalizable | undefined { + return this.peer + } + static construct(ptr: KPointer): IndicatorComponentController { + const objIndicatorComponentController: IndicatorComponentController = new IndicatorComponentController() + objIndicatorComponentController.peer = new Finalizable(ptr, IndicatorComponentController.getFinalizer()) + return objIndicatorComponentController + } + static ctor(): KPointer { + const retval = nativeModule()._IndicatorComponentController_ctor() + return retval + } + constructor() { + { + const ctorPtr: KPointer = IndicatorComponentController.ctor() + this.peer = new Finalizable(ctorPtr, IndicatorComponentController.getFinalizer()) + } + } + static getFinalizer(): KPointer { + return nativeModule()._IndicatorComponentController_getFinalizer() + } + showNext(): void { + this?.showNext_serialize() + } + showPrevious(): void { + this?.showPrevious_serialize() + } + changeIndex(index: number, useAnimation?: boolean): void { + const index_casted = index as (number) + const useAnimation_casted = useAnimation as (boolean | undefined) + this?.changeIndex_serialize(index_casted, useAnimation_casted) + } + private showNext_serialize(): void { + nativeModule()._IndicatorComponentController_showNext(this.peer!.ptr) + } + private showPrevious_serialize(): void { + nativeModule()._IndicatorComponentController_showPrevious(this.peer!.ptr) + } + private changeIndex_serialize(index: number, useAnimation?: boolean): void { + const thisSerializer: Serializer = Serializer.hold() + let useAnimation_type: int32 = RuntimeType.UNDEFINED + useAnimation_type = runtimeType(useAnimation) + thisSerializer.writeInt8(useAnimation_type) + if ((RuntimeType.UNDEFINED) != (useAnimation_type)) { + const useAnimation_value = useAnimation! + thisSerializer.writeBoolean(useAnimation_value) + } + nativeModule()._IndicatorComponentController_changeIndex(this.peer!.ptr, index, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } +} +export class IndicatorComponentControllerInternal { + public static fromPtr(ptr: KPointer): IndicatorComponentController { + const obj: IndicatorComponentController = new IndicatorComponentController() + obj.peer = new Finalizable(ptr, IndicatorComponentController.getFinalizer()) + return obj + } +} diff --git a/arkoala/arkui/src/peers/ArkIndicatorcomponentPeer.ts b/arkoala/arkui/src/peers/ArkIndicatorcomponentPeer.ts new file mode 100644 index 000000000..56c2423f2 --- /dev/null +++ b/arkoala/arkui/src/peers/ArkIndicatorcomponentPeer.ts @@ -0,0 +1,106 @@ +/* + * 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. + */ + + +// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! + +import { int32 } from "@koalaui/common" +import { nullptr, KPointer, KInt, KBoolean, KStringPtr } from "@koalaui/interop" +import { isResource, isInstanceOf, runtimeType, RuntimeType } from "./SerializerBase" +import { Serializer } from "./Serializer" +import { ArkUINodeType } from "./ArkUINodeType" +import { ComponentBase } from "../ComponentBase" +import { PeerNode } from "../PeerNode" +import { nativeModule } from "@koalaui/arkoala" +import { ArkCommonMethodPeer, ArkCommonMethodAttributes } from "./ArkCommonPeer" +import { GestureName, GestureComponent, unsafeCast } from "./../shared/generated-utils" +import { CallbackKind } from "./CallbackKind" +import { registerCallback } from "./SerializerBase" +import { wrapCallback } from "@koalaui/interop" +import { Deserializer, createDeserializer } from "./Deserializer" +import { MaterializedBase } from "./../MaterializedBase" +import { DotIndicator } from "./../ArkDotIndicatorBuilder" +import { DigitIndicator } from "./../ArkDigitIndicatorBuilder" +import { SubTabBarStyle } from "./../ArkSubTabBarStyleBuilder" +import { BottomTabBarStyle } from "./../ArkBottomTabBarStyleBuilder" +export class ArkIndicatorComponentPeer extends ArkCommonMethodPeer { + + protected constructor(nodeType: ArkUINodeType, flags: int32 = 0, name: string = "") { + super(nodeType, flags, name) + } + public static create(nodeType: ArkUINodeType, component?: ComponentBase, flags: int32 = 0): ArkIndicatorComponentPeer { + const _peer = new ArkIndicatorComponentPeer(nodeType, flags, "IndicatorComponent") + component?.setPeer(_peer) + return _peer + } + setIndicatorComponentOptionsAttribute(controller?: IndicatorComponentController): void { + const thisSerializer: Serializer = Serializer.hold() + let controller_type: int32 = RuntimeType.UNDEFINED + controller_type = runtimeType(controller) + thisSerializer.writeInt8(controller_type) + if ((RuntimeType.UNDEFINED) != (controller_type)) { + const controller_value = controller! + thisSerializer.writeIndicatorComponentController(controller_value) + } + nativeModule()._IndicatorComponentInterface_setIndicatorComponentOptions(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + initialIndexAttribute(value: number): void { + nativeModule()._IndicatorComponentAttribute_initialIndex(this.peer.ptr, value) + } + countAttribute(value: number): void { + nativeModule()._IndicatorComponentAttribute_count(this.peer.ptr, value) + } + styleAttribute(value: DotIndicator | DigitIndicator): void { + const thisSerializer: Serializer = Serializer.hold() + let value_type: int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + if (((RuntimeType.OBJECT) == (value_type)) && (value instanceof DotIndicator)) { + thisSerializer.writeInt8(0) + const value_0 = unsafeCast(value) + thisSerializer.writeDotIndicator(value_0) + } + else if (((RuntimeType.OBJECT) == (value_type)) && (value instanceof DigitIndicator)) { + thisSerializer.writeInt8(1) + const value_1 = unsafeCast(value) + thisSerializer.writeDigitIndicator(value_1) + } + nativeModule()._IndicatorComponentAttribute_style(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + loopAttribute(value: boolean): void { + nativeModule()._IndicatorComponentAttribute_loop(this.peer.ptr, +value) + } + verticalAttribute(value: boolean): void { + nativeModule()._IndicatorComponentAttribute_vertical(this.peer.ptr, +value) + } + onChangeAttribute(value: ((index: number) => void)): void { + const thisSerializer: Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + nativeModule()._IndicatorComponentAttribute_onChange(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + applyAttributes(attributes: T): void { + super.applyAttributes(attributes) + } +} +export interface ArkIndicatorComponentAttributes extends ArkCommonMethodAttributes { + initialIndex?: number + count?: number + style?: DotIndicator | DigitIndicator + loop?: boolean + vertical?: boolean + onChange?: ((index: number) => void) +} diff --git a/arkoala/extension-component/src/ExampleComponents.ts b/arkoala/extension-component/src/ExampleComponents.ts index 831c0e9e9..737034dc7 100644 --- a/arkoala/extension-component/src/ExampleComponents.ts +++ b/arkoala/extension-component/src/ExampleComponents.ts @@ -27,20 +27,14 @@ class ExampleNode extends ArkCommonMethodPeer { protected _x: int32 = 0 protected _y: int32 = 0 - public static create(component?: ComponentBase, flags: int32 = 0): ExampleNode { - // TODO: check this node creation - /** - * const _peerPtr = nativeModule()._CommonMethod_construct(0, flags) - */ - const _peerPtr = nativeModule()._CreateNode(ArkUINodeType.CustomNode, 0, 0) - const _peer = new ExampleNode(_peerPtr, "Example") - component?.setPeer(_peer) - return _peer + protected constructor(nodeType: ArkUINodeType, flags: int32 = 0, name: string = "") { + super(nodeType, flags, name) } - protected constructor(peerPtr: KPointer, name: string = "", flags: int32 = 0) { - super(peerPtr, name, 0); - this.markDirty(DirtyFlags.Geometry | DirtyFlags.Visual) + public static create(nodeType: ArkUINodeType, component?: ComponentBase, flags: int32 = 0): ExampleNode { + const _peer = new ExampleNode(nodeType, flags, "ExampleNode") + component?.setPeer(_peer) + return _peer } onMeasure(args: Float32Array): int32 { @@ -210,7 +204,7 @@ export function ExampleComponent(style: Partial) { const receiver = remember(() => { return new ExampleComponent_Component() }) - NodeAttach(() => ExampleNode.create(receiver), (node: ExampleNode) => { + NodeAttach(() => ExampleNode.create(ArkUINodeType.CustomNode, receiver), (node: ExampleNode) => { if (style.width !== undefined) node.width = style.width if (style.height !== undefined) node.height = style.height if (style.color !== undefined) node.color = style.color @@ -221,22 +215,15 @@ export function ExampleComponent(style: Partial) { class BoxNode extends ExampleNode { private _gap: int32 = 1 - public static create(component?: ComponentBase, flags: int32 = 0): BoxNode { - // TODO: check this node creation - /** - * const _peerPtr = nativeModule()._CommonMethod_construct(0, flags) - */ - const _peerPtr = nativeModule()._CreateNode(ArkUINodeType.CustomNode, 0, 0) - const _peer = new BoxNode(_peerPtr, "BoxNode") + protected constructor(nodeType: ArkUINodeType, flags: int32 = 0, name: string = "") { + super(nodeType, flags, name) + } + public static create(nodeType: ArkUINodeType, component?: ComponentBase, flags: int32 = 0): BoxNode { + const _peer = new BoxNode(ArkUINodeType.CustomNode, flags, "BoxNode") component?.setPeer(_peer) return _peer } - protected constructor(peerPtr: KPointer, name: string = "", flags: int32 = 0) { - super(peerPtr, name, 0); - this.markDirty(DirtyFlags.Geometry | DirtyFlags.Visual) - } - set gap(gap: int32) { if (gap != this._gap) { this._gap = gap @@ -320,7 +307,7 @@ export function Box( const receiver = remember(() => { return new BoxNode_Component() }) - NodeAttach(() => BoxNode.create(receiver), (node: BoxNode) => { + NodeAttach(() => BoxNode.create(ArkUINodeType.CustomNode, receiver), (node: BoxNode) => { if (style.width !== undefined) node.width = style.width if (style.height !== undefined) node.height = style.height if (style.color !== undefined) node.color = style.color @@ -375,5 +362,5 @@ export function OutlinedButton( /** @memo */ content?: () => void, ) { - Attach(() => OutlinedButtonPeer.create(), options, content) + Attach(() => OutlinedButtonPeer.create(ArkUINodeType.CustomNode), options, content) } diff --git a/arkoala/tests/src/ets-tests/tsconfig.json b/arkoala/tests/src/ets-tests/tsconfig.json index b4efa4630..30026954b 100644 --- a/arkoala/tests/src/ets-tests/tsconfig.json +++ b/arkoala/tests/src/ets-tests/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@koalaui/arkui-common/config/tsconfig.base.json", + "extends": "../../../arkui-common/config/tsconfig.base.json", "exclude": ["node_modules", "js_output", "dependencies", "pages/Progress.test.ets", "pages/Marquee.test.ets"], "include": ["./**/*.ets"], "compilerOptions": { diff --git a/arkoala/tests/tsconfig-test.json b/arkoala/tests/tsconfig-test.json index 22648b914..7b1b26381 100644 --- a/arkoala/tests/tsconfig-test.json +++ b/arkoala/tests/tsconfig-test.json @@ -24,9 +24,7 @@ } }, "files": [ - "../arkui-common/interface_sdk-js/api/@internal/component/ets/index-full.d.ts", - "../arkui-common/interface_sdk-js/api/@internal/component/ets/koala-extensions.d.ts", - "../arkui-common/interface_sdk-js/api/@internal/ets/global.d.ts" + "../arkui/types/index-full.d.ts" ], "exclude": [ "node_modules", "build", "dist", "lib", "app" @@ -35,9 +33,9 @@ "src/index.test.ts", "generated/ets-test/**/*" ], "references": [ - { "path": "../../incremental/compiler-plugin" }, + { "path": "../../arkoala/arkui" }, { "path": "../../incremental/runtime" }, { "path": "../../arkoala/framework" }, - { "path": "../../arkoala/arkui" } + { "path": "../../incremental/compiler-plugin" } ] } -- Gitee From 0c9ac481d47ca6ac3bee6f4956017b7b52b63b45 Mon Sep 17 00:00:00 2001 From: yalixie Date: Mon, 9 Dec 2024 13:31:30 +0300 Subject: [PATCH 2/3] Remove IndicatorComponent Signed-off-by: yalixie --- ...ndicatorComponentControllerMaterialized.ts | 110 ------------------ .../src/peers/ArkIndicatorcomponentPeer.ts | 106 ----------------- 2 files changed, 216 deletions(-) delete mode 100644 arkoala/arkui/src/ArkIndicatorComponentControllerMaterialized.ts delete mode 100644 arkoala/arkui/src/peers/ArkIndicatorcomponentPeer.ts diff --git a/arkoala/arkui/src/ArkIndicatorComponentControllerMaterialized.ts b/arkoala/arkui/src/ArkIndicatorComponentControllerMaterialized.ts deleted file mode 100644 index 45110a049..000000000 --- a/arkoala/arkui/src/ArkIndicatorComponentControllerMaterialized.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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. - */ - - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - - -import { Finalizable } from "./Finalizable" -import { MaterializedBase } from "./MaterializedBase" -import { nativeModule } from "@koalaui/arkoala" -import { Serializer } from "./peers/Serializer" -import { isResource, isInstanceOf, runtimeType, RuntimeType, SerializerBase } from "./peers/SerializerBase" -import { unsafeCast } from "./shared/generated-utils" -import { registerCallback } from "./peers/SerializerBase" -import { wrapCallback } from "@koalaui/interop" -import { Deserializer, createDeserializer } from "./peers/Deserializer" -import { CallbackKind } from "./peers/CallbackKind" - - -import { - int32, - float32 -} from "@koalaui/common" -import { - KInt, - KBoolean, - KFloat, - KUInt, - KStringPtr, - KPointer, - KNativePointer, - KInt32ArrayPtr, - KUint8ArrayPtr, - KFloat32ArrayPtr, - pointer -} from "@koalaui/interop" - - -export class IndicatorComponentController implements MaterializedBase { - peer?: Finalizable - getPeer(): Finalizable | undefined { - return this.peer - } - static construct(ptr: KPointer): IndicatorComponentController { - const objIndicatorComponentController: IndicatorComponentController = new IndicatorComponentController() - objIndicatorComponentController.peer = new Finalizable(ptr, IndicatorComponentController.getFinalizer()) - return objIndicatorComponentController - } - static ctor(): KPointer { - const retval = nativeModule()._IndicatorComponentController_ctor() - return retval - } - constructor() { - { - const ctorPtr: KPointer = IndicatorComponentController.ctor() - this.peer = new Finalizable(ctorPtr, IndicatorComponentController.getFinalizer()) - } - } - static getFinalizer(): KPointer { - return nativeModule()._IndicatorComponentController_getFinalizer() - } - showNext(): void { - this?.showNext_serialize() - } - showPrevious(): void { - this?.showPrevious_serialize() - } - changeIndex(index: number, useAnimation?: boolean): void { - const index_casted = index as (number) - const useAnimation_casted = useAnimation as (boolean | undefined) - this?.changeIndex_serialize(index_casted, useAnimation_casted) - } - private showNext_serialize(): void { - nativeModule()._IndicatorComponentController_showNext(this.peer!.ptr) - } - private showPrevious_serialize(): void { - nativeModule()._IndicatorComponentController_showPrevious(this.peer!.ptr) - } - private changeIndex_serialize(index: number, useAnimation?: boolean): void { - const thisSerializer: Serializer = Serializer.hold() - let useAnimation_type: int32 = RuntimeType.UNDEFINED - useAnimation_type = runtimeType(useAnimation) - thisSerializer.writeInt8(useAnimation_type) - if ((RuntimeType.UNDEFINED) != (useAnimation_type)) { - const useAnimation_value = useAnimation! - thisSerializer.writeBoolean(useAnimation_value) - } - nativeModule()._IndicatorComponentController_changeIndex(this.peer!.ptr, index, thisSerializer.asArray(), thisSerializer.length()) - thisSerializer.release() - } -} -export class IndicatorComponentControllerInternal { - public static fromPtr(ptr: KPointer): IndicatorComponentController { - const obj: IndicatorComponentController = new IndicatorComponentController() - obj.peer = new Finalizable(ptr, IndicatorComponentController.getFinalizer()) - return obj - } -} diff --git a/arkoala/arkui/src/peers/ArkIndicatorcomponentPeer.ts b/arkoala/arkui/src/peers/ArkIndicatorcomponentPeer.ts deleted file mode 100644 index 56c2423f2..000000000 --- a/arkoala/arkui/src/peers/ArkIndicatorcomponentPeer.ts +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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. - */ - - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - -import { int32 } from "@koalaui/common" -import { nullptr, KPointer, KInt, KBoolean, KStringPtr } from "@koalaui/interop" -import { isResource, isInstanceOf, runtimeType, RuntimeType } from "./SerializerBase" -import { Serializer } from "./Serializer" -import { ArkUINodeType } from "./ArkUINodeType" -import { ComponentBase } from "../ComponentBase" -import { PeerNode } from "../PeerNode" -import { nativeModule } from "@koalaui/arkoala" -import { ArkCommonMethodPeer, ArkCommonMethodAttributes } from "./ArkCommonPeer" -import { GestureName, GestureComponent, unsafeCast } from "./../shared/generated-utils" -import { CallbackKind } from "./CallbackKind" -import { registerCallback } from "./SerializerBase" -import { wrapCallback } from "@koalaui/interop" -import { Deserializer, createDeserializer } from "./Deserializer" -import { MaterializedBase } from "./../MaterializedBase" -import { DotIndicator } from "./../ArkDotIndicatorBuilder" -import { DigitIndicator } from "./../ArkDigitIndicatorBuilder" -import { SubTabBarStyle } from "./../ArkSubTabBarStyleBuilder" -import { BottomTabBarStyle } from "./../ArkBottomTabBarStyleBuilder" -export class ArkIndicatorComponentPeer extends ArkCommonMethodPeer { - - protected constructor(nodeType: ArkUINodeType, flags: int32 = 0, name: string = "") { - super(nodeType, flags, name) - } - public static create(nodeType: ArkUINodeType, component?: ComponentBase, flags: int32 = 0): ArkIndicatorComponentPeer { - const _peer = new ArkIndicatorComponentPeer(nodeType, flags, "IndicatorComponent") - component?.setPeer(_peer) - return _peer - } - setIndicatorComponentOptionsAttribute(controller?: IndicatorComponentController): void { - const thisSerializer: Serializer = Serializer.hold() - let controller_type: int32 = RuntimeType.UNDEFINED - controller_type = runtimeType(controller) - thisSerializer.writeInt8(controller_type) - if ((RuntimeType.UNDEFINED) != (controller_type)) { - const controller_value = controller! - thisSerializer.writeIndicatorComponentController(controller_value) - } - nativeModule()._IndicatorComponentInterface_setIndicatorComponentOptions(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) - thisSerializer.release() - } - initialIndexAttribute(value: number): void { - nativeModule()._IndicatorComponentAttribute_initialIndex(this.peer.ptr, value) - } - countAttribute(value: number): void { - nativeModule()._IndicatorComponentAttribute_count(this.peer.ptr, value) - } - styleAttribute(value: DotIndicator | DigitIndicator): void { - const thisSerializer: Serializer = Serializer.hold() - let value_type: int32 = RuntimeType.UNDEFINED - value_type = runtimeType(value) - if (((RuntimeType.OBJECT) == (value_type)) && (value instanceof DotIndicator)) { - thisSerializer.writeInt8(0) - const value_0 = unsafeCast(value) - thisSerializer.writeDotIndicator(value_0) - } - else if (((RuntimeType.OBJECT) == (value_type)) && (value instanceof DigitIndicator)) { - thisSerializer.writeInt8(1) - const value_1 = unsafeCast(value) - thisSerializer.writeDigitIndicator(value_1) - } - nativeModule()._IndicatorComponentAttribute_style(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) - thisSerializer.release() - } - loopAttribute(value: boolean): void { - nativeModule()._IndicatorComponentAttribute_loop(this.peer.ptr, +value) - } - verticalAttribute(value: boolean): void { - nativeModule()._IndicatorComponentAttribute_vertical(this.peer.ptr, +value) - } - onChangeAttribute(value: ((index: number) => void)): void { - const thisSerializer: Serializer = Serializer.hold() - thisSerializer.holdAndWriteCallback(value) - nativeModule()._IndicatorComponentAttribute_onChange(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) - thisSerializer.release() - } - applyAttributes(attributes: T): void { - super.applyAttributes(attributes) - } -} -export interface ArkIndicatorComponentAttributes extends ArkCommonMethodAttributes { - initialIndex?: number - count?: number - style?: DotIndicator | DigitIndicator - loop?: boolean - vertical?: boolean - onChange?: ((index: number) => void) -} -- Gitee From 02f07522e4613fc04742f51ed5c8a1aa515b0b64 Mon Sep 17 00:00:00 2001 From: yalixie Date: Tue, 10 Dec 2024 16:03:27 +0300 Subject: [PATCH 3/3] Trigger build Signed-off-by: yalixie -- Gitee