From 8e2224b742853bddeb18d31d104db1918554a279 Mon Sep 17 00:00:00 2001 From: ZhongNing Date: Thu, 10 Jul 2025 21:02:10 +0800 Subject: [PATCH] Add for NoDeprecatedApi Issue:https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICLJ79 Test scenarios: new Require Signed-off-by: ZhongNing --- ets2panda/linter/package.json | 7 +- ets2panda/linter/rule-config.json | 7 +- ets2panda/linter/src/lib/CookBookMsg.ts | 1 + ets2panda/linter/src/lib/FaultAttrs.ts | 1 + ets2panda/linter/src/lib/FaultDesc.ts | 1 + ets2panda/linter/src/lib/Problems.ts | 1 + ets2panda/linter/src/lib/TypeScriptLinter.ts | 508 +- .../linter/src/lib/autofixes/Autofixer.ts | 88 + .../src/lib/data/DeprecatedApiList.json | 10369 ++++++++++++++++ ets2panda/linter/src/lib/utils/TsUtils.ts | 9 +- .../lib/utils/consts/DeprecateWhiteList.ts | 27 + .../src/lib/utils/consts/DeprecatedApi.ts | 66 + ets2panda/linter/test/deprecatedapi/Back.ets | 33 + .../test/deprecatedapi/Back.ets.args.json | 19 + .../test/deprecatedapi/Back.ets.arkts2.json | 88 + .../linter/test/deprecatedapi/Back.ets.json | 17 + .../linter/test/deprecatedapi/Baseline.ets | 45 + .../test/deprecatedapi/Baseline.ets.args.json | 19 + .../deprecatedapi/Baseline.ets.arkts2.json | 288 + .../test/deprecatedapi/Baseline.ets.json | 28 + .../linter/test/deprecatedapi/COMPONENT.ets | 42 + .../deprecatedapi/COMPONENT.ets.args.json | 19 + .../deprecatedapi/COMPONENT.ets.arkts2.json | 188 + .../test/deprecatedapi/COMPONENT.ets.json | 17 + .../test/deprecatedapi/CROSS_DEVICE.ets | 32 + .../deprecatedapi/CROSS_DEVICE.ets.args.json | 19 + .../CROSS_DEVICE.ets.arkts2.json | 98 + .../test/deprecatedapi/CROSS_DEVICE.ets.json | 17 + .../linter/test/deprecatedapi/DeleteProp.ets | 17 + .../deprecatedapi/DeleteProp.ets.args.json | 19 + .../deprecatedapi/DeleteProp.ets.arkts2.json | 17 + .../test/deprecatedapi/DeleteProp.ets.json | 17 + .../EnableAlertBeforeBackPageOptions_api.ets | 30 + ...ertBeforeBackPageOptions_api.ets.args.json | 19 + ...tBeforeBackPageOptions_api.ets.arkts2.json | 28 + ...bleAlertBeforeBackPageOptions_api.ets.json | 17 + ets2panda/linter/test/deprecatedapi/Link.ets | 18 + .../test/deprecatedapi/Link.ets.args.json | 19 + .../test/deprecatedapi/Link.ets.arkts2.json | 38 + .../linter/test/deprecatedapi/Link.ets.json | 17 + .../test/deprecatedapi/NavigationType.ets | 47 + .../NavigationType.ets.args.json | 19 + .../NavigationType.ets.arkts2.json | 148 + .../deprecatedapi/NavigationType.ets.json | 17 + ets2panda/linter/test/deprecatedapi/Push.ets | 33 + .../test/deprecatedapi/Push.ets.args.json | 19 + .../test/deprecatedapi/Push.ets.arkts2.json | 88 + .../linter/test/deprecatedapi/Push.ets.json | 17 + .../linter/test/deprecatedapi/Replace.ets | 34 + .../test/deprecatedapi/Replace.ets.args.json | 19 + .../deprecatedapi/Replace.ets.arkts2.json | 88 + .../test/deprecatedapi/Replace.ets.json | 17 + ets2panda/linter/test/deprecatedapi/SM.ets | 29 + .../test/deprecatedapi/SM.ets.args.json | 19 + .../test/deprecatedapi/SM.ets.arkts2.json | 128 + .../linter/test/deprecatedapi/SM.ets.json | 17 + .../linter/test/deprecatedapi/SetAndLink.ets | 18 + .../deprecatedapi/SetAndLink.ets.args.json | 19 + .../deprecatedapi/SetAndLink.ets.arkts2.json | 48 + .../test/deprecatedapi/SetAndLink.ets.json | 17 + .../deprecatedapi/SizeType.ets.arkts2.json | 198 + .../test/deprecatedapi/SizeType.ets.json | 17 + .../linter/test/deprecatedapi/UIContext.ets | 39 + .../test/deprecatedapi/UIContext.ets.json | 38 + .../test/deprecatedapi/ability_component.ets | 36 + .../ability_component.ets.args.json | 19 + .../ability_component.ets.arkts2.json | 58 + .../deprecatedapi/ability_component.ets.json | 17 + .../test/deprecatedapi/action_sheet.ets | 77 + .../deprecatedapi/action_sheet.ets.args.json | 19 + .../action_sheet.ets.arkts2.json | 168 + .../test/deprecatedapi/action_sheet.ets.json | 17 + .../test/deprecatedapi/alert_dialog.ets | 54 + .../deprecatedapi/alert_dialog.ets.args.json | 19 + .../alert_dialog.ets.arkts2.json | 258 + .../test/deprecatedapi/alert_dialog.ets.json | 17 + .../test/deprecatedapi/alphabet_indexer.ets | 138 + .../alphabet_indexer.ets.args.json | 20 + .../alphabet_indexer.ets.arkts2.json | 548 + .../deprecatedapi/alphabet_indexer.ets.json | 17 + .../linter/test/deprecatedapi/animator.ets | 28 + .../test/deprecatedapi/animator.ets.args.json | 19 + .../deprecatedapi/animator.ets.arkts2.json | 68 + .../test/deprecatedapi/animator.ets.json | 17 + .../animatorResultOnrepeat_api.ets | 33 + .../animatorResultOnrepeat_api.ets.args.json | 19 + ...animatorResultOnrepeat_api.ets.arkts2.json | 48 + .../animatorResultOnrepeat_api.ets.json | 48 + .../deprecatedapi/appStorageIsMutable_api.ets | 26 + .../appStorageIsMutable_api.ets.args.json | 19 + .../appStorageIsMutable_api.ets.arkts2.json | 78 + .../appStorageIsMutable_api.ets.json | 17 + .../deprecatedapi/appscreenOnVisible_api.ets | 25 + .../appscreenOnVisible_api.ets.args.json | 19 + .../appscreenOnVisible_api.ets.arkts2.json | 38 + .../appscreenOnVisible_api.ets.json | 17 + .../backRouterOptionsUri_api.ets | 22 + .../backRouterOptionsUri_api.ets.args.json | 19 + .../backRouterOptionsUri_api.ets.arkts2.json | 17 + .../backRouterOptionsUri_api.ets.json | 17 + .../linter/test/deprecatedapi/buttons.ets | 37 + .../test/deprecatedapi/buttons.ets.args.json | 19 + .../deprecatedapi/buttons.ets.arkts2.json | 88 + .../test/deprecatedapi/buttons.ets.json | 38 + .../test/deprecatedapi/chip_group_api.ets | 42 + .../deprecatedapi/chip_group_api.ets.json | 28 + .../linter/test/deprecatedapi/common.ets | 71 + .../linter/test/deprecatedapi/common.ets.json | 38 + .../linter/test/deprecatedapi/common_api.ets | 139 + .../deprecatedapi/common_api.ets.args.json | 19 + .../deprecatedapi/common_api.ets.arkts2.json | 878 ++ .../test/deprecatedapi/common_api.ets.json | 17 + .../test/deprecatedapi/common_ts_ets_api.ets | 39 + .../common_ts_ets_api.ets.args.json | 19 + .../common_ts_ets_api.ets.arkts2.json | 98 + .../deprecatedapi/common_ts_ets_api.ets.json | 17 + .../test/deprecatedapi/common_ts_ets_api1.ets | 25 + .../common_ts_ets_api1.ets.args.json | 19 + .../common_ts_ets_api1.ets.arkts2.json | 198 + .../deprecatedapi/common_ts_ets_api1.ets.json | 28 + .../test/deprecatedapi/componentSnapshot.ets | 47 + .../deprecatedapi/componentSnapshot.ets.json | 17 + .../linter/test/deprecatedapi/curves.ets | 17 + .../linter/test/deprecatedapi/curves.ets.json | 17 + .../test/deprecatedapi/curvesInit_api.ets | 17 + .../curvesInit_api.ets.args.json | 19 + .../curvesInit_api.ets.arkts2.json | 28 + .../deprecatedapi/curvesInit_api.ets.json | 17 + .../linter/test/deprecatedapi/custom_api.ets | 28 + .../deprecatedapi/custom_api.ets.args.json | 19 + .../deprecatedapi/custom_api.ets.arkts2.json | 98 + .../test/deprecatedapi/custom_api.ets.json | 17 + .../linter/test/deprecatedapi/date_picker.ets | 40 + .../test/deprecatedapi/date_picker.ets.json | 17 + .../deprecated_api_common_utils.ets | 30 + .../deprecated_api_common_utils.ets.json | 17 + .../deprecatedapi/deprecated_api_font.ets | 46 + .../deprecated_api_font.ets.args.json | 19 + .../deprecated_api_font.ets.arkts2.json | 128 + .../deprecated_api_font.ets.json | 17 + .../deprecated_api_prompt_action.ets | 85 + .../deprecated_api_prompt_action.ets.json | 58 + .../deprecatedapi/deprecated_api_router.ets | 147 + .../deprecated_api_router.ets.args.json | 19 + .../deprecated_api_router.ets.arkts2.json | 218 + .../deprecated_api_router.ets.json | 128 + .../deprecated_api_time_picker.ets | 29 + .../deprecated_api_time_picker.ets.json | 17 + .../test/deprecatedapi/dragController.ets | 77 + .../deprecatedapi/dragController.ets.json | 38 + ets2panda/linter/test/deprecatedapi/enums.ets | 46 + .../linter/test/deprecatedapi/enums.ets.json | 17 + .../deprecatedapi/environmentEnvProp_api.ets | 24 + .../environmentEnvProp_api.ets.args.json | 19 + .../environmentEnvProp_api.ets.arkts2.json | 48 + .../environmentEnvProp_api.ets.json | 17 + .../test/deprecatedapi/foldable_api.ets | 28 + .../deprecatedapi/foldable_api.ets.args.json | 19 + .../foldable_api.ets.arkts2.json | 98 + .../test/deprecatedapi/foldable_api.ets.json | 17 + .../linter/test/deprecatedapi/getLength.ets | 22 + .../deprecatedapi/getLength.ets.args.json | 19 + .../deprecatedapi/getLength.ets.arkts2.json | 28 + .../test/deprecatedapi/getLength.ets.json | 28 + .../linter/test/deprecatedapi/getParams.ets | 17 + .../deprecatedapi/getParams.ets.args.json | 19 + .../deprecatedapi/getParams.ets.arkts2.json | 17 + .../test/deprecatedapi/getParams.ets.json | 17 + .../gridAttributeonScroll_api.ets | 34 + .../gridAttributeonScroll_api.ets.args.json | 19 + .../gridAttributeonScroll_api.ets.arkts2.json | 218 + .../gridAttributeonScroll_api.ets.json | 38 + .../gridContainerOptionsMargin_api.ets | 28 + ...idContainerOptionsMargin_api.ets.args.json | 19 + ...ContainerOptionsMargin_api.ets.arkts2.json | 128 + .../gridContainerOptionsMargin_api.ets.json | 17 + .../linter/test/deprecatedapi/gridItem.ets | 31 + .../test/deprecatedapi/gridItem.ets.args.json | 19 + .../deprecatedapi/gridItem.ets.arkts2.json | 88 + .../test/deprecatedapi/gridItem.ets.json | 17 + .../test/deprecatedapi/grid_container.ets | 67 + .../grid_container.ets.args.json | 19 + .../grid_container.ets.arkts2.json | 418 + .../deprecatedapi/grid_container.ets.json | 17 + .../test/deprecatedapi/image_animator.ets | 26 + .../deprecatedapi/image_animator.ets.json | 17 + .../linter/test/deprecatedapi/inspector.ets | 46 + .../test/deprecatedapi/inspector.ets.json | 17 + .../test/deprecatedapi/lazy_for_each.ets | 121 + .../test/deprecatedapi/lazy_for_each.ets.json | 17 + ets2panda/linter/test/deprecatedapi/list.ets | 39 + .../test/deprecatedapi/list.ets.args.json | 19 + .../test/deprecatedapi/list.ets.arkts2.json | 148 + .../linter/test/deprecatedapi/list.ets.json | 17 + .../test/deprecatedapi/listitem_api.ets | 35 + .../deprecatedapi/listitem_api.ets.args.json | 19 + .../listitem_api.ets.arkts2.json | 228 + .../test/deprecatedapi/listitem_api.ets.json | 17 + .../test/deprecatedapi/matrix4Rotate_api.ets | 34 + .../matrix4Rotate_api.ets.args.json | 19 + .../matrix4Rotate_api.ets.arkts2.json | 138 + .../deprecatedapi/matrix4Rotate_api.ets.json | 17 + .../linter/test/deprecatedapi/measure.ets | 40 + .../test/deprecatedapi/measure.ets.json | 17 + .../linter/test/deprecatedapi/mediaquery.ets | 51 + .../test/deprecatedapi/mediaquery.ets.json | 17 + .../linter/test/deprecatedapi/minibar_api.ets | 28 + .../deprecatedapi/minibar_api.ets.args.json | 19 + .../deprecatedapi/minibar_api.ets.arkts2.json | 98 + .../test/deprecatedapi/minibar_api.ets.json | 17 + .../linter/test/deprecatedapi/navigation.ets | 31 + .../test/deprecatedapi/navigation.ets.json | 17 + .../test/deprecatedapi/navigator_api.ets | 44 + .../deprecatedapi/navigator_api.ets.args.json | 19 + .../navigator_api.ets.arkts2.json | 238 + .../test/deprecatedapi/navigator_api.ets.json | 17 + .../test/deprecatedapi/navrouter_api.ets | 47 + .../deprecatedapi/navrouter_api.ets.args.json | 19 + .../navrouter_api.ets.arkts2.json | 428 + .../test/deprecatedapi/navrouter_api.ets.json | 17 + .../linter/test/deprecatedapi/node_api.ets | 24 + .../test/deprecatedapi/node_api.ets.args.json | 19 + .../deprecatedapi/node_api.ets.arkts2.json | 68 + .../test/deprecatedapi/node_api.ets.json | 17 + .../test/deprecatedapi/ohos_animator.ets | 30 + .../deprecatedapi/ohos_animator.ets.args.json | 19 + .../ohos_animator.ets.arkts2.json | 58 + .../test/deprecatedapi/ohos_animator.ets.json | 17 + .../linter/test/deprecatedapi/ohos_curves.ets | 23 + .../deprecatedapi/ohos_curves.ets.args.json | 19 + .../deprecatedapi/ohos_curves.ets.arkts2.json | 68 + .../test/deprecatedapi/ohos_curves.ets.json | 17 + .../test/deprecatedapi/ohos_matrix4.ets | 50 + .../deprecatedapi/ohos_matrix4.ets.args.json | 19 + .../ohos_matrix4.ets.arkts2.json | 238 + .../test/deprecatedapi/ohos_matrix4.ets.json | 48 + .../linter/test/deprecatedapi/ohos_prompt.ets | 130 + .../deprecatedapi/ohos_prompt.ets.args.json | 19 + .../deprecatedapi/ohos_prompt.ets.arkts2.json | 128 + .../test/deprecatedapi/ohos_prompt.ets.json | 98 + .../linter/test/deprecatedapi/ohos_router.ets | 35 + .../deprecatedapi/ohos_router.ets.args.json | 19 + .../deprecatedapi/ohos_router.ets.arkts2.json | 17 + .../test/deprecatedapi/ohos_router.ets.json | 17 + .../deprecatedapi/panelModePanelMode_api.ets | 41 + .../panelModePanelMode_api.ets.args.json | 19 + .../panelModePanelMode_api.ets.arkts2.json | 178 + .../panelModePanelMode_api.ets.json | 17 + .../persistentStoragePersistProps_api.ets | 18 + ...stentStoragePersistProps_api.ets.args.json | 19 + ...entStoragePersistProps_api.ets.arkts2.json | 38 + ...persistentStoragePersistProps_api.ets.json | 17 + .../linter/test/deprecatedapi/progress.ets | 36 + .../test/deprecatedapi/progress.ets.args.json | 19 + .../deprecatedapi/progress.ets.arkts2.json | 248 + .../test/deprecatedapi/progress.ets.json | 17 + .../linter/test/deprecatedapi/prompts_api.ets | 73 + .../deprecatedapi/prompts_api.ets.args.json | 19 + .../deprecatedapi/prompts_api.ets.arkts2.json | 248 + .../test/deprecatedapi/prompts_api.ets.json | 58 + .../linter/test/deprecatedapi/refresh.ets | 66 + .../test/deprecatedapi/refresh.ets.json | 17 + .../routerDisableAlertBeforeBackPage_api.ets | 53 + ...sableAlertBeforeBackPage_api.ets.args.json | 19 + ...bleAlertBeforeBackPage_api.ets.arkts2.json | 98 + ...terDisableAlertBeforeBackPage_api.ets.json | 28 + .../deprecatedapi/routerOptionsUri_api.ets | 22 + .../routerOptionsUri_api.ets.args.json | 19 + .../routerOptionsUri_api.ets.arkts2.json | 17 + .../routerOptionsUri_api.ets.json | 17 + .../test/deprecatedapi/routerPush_api.ets | 38 + .../routerPush_api.ets.args.json | 19 + .../routerPush_api.ets.arkts2.json | 58 + .../deprecatedapi/routerPush_api.ets.json | 17 + .../deprecatedapi/routerStateIndex_api.ets | 22 + .../routerStateIndex_api.ets.args.json | 19 + .../routerStateIndex_api.ets.arkts2.json | 28 + .../routerStateIndex_api.ets.json | 28 + .../linter/test/deprecatedapi/scroll_api.ets | 30 + .../deprecatedapi/scroll_api.ets.args.json | 19 + .../deprecatedapi/scroll_api.ets.arkts2.json | 88 + .../test/deprecatedapi/scroll_api.ets.json | 17 + .../deprecatedapi/sdk/api/@ohos.animator.d.ts | 72 + .../deprecatedapi/sdk/api/@ohos.curves.d.ts | 18 + .../deprecatedapi/sdk/api/@ohos.font.d.ts | 19 + .../deprecatedapi/sdk/api/@ohos.matrix4.d.ts | 20 + .../deprecatedapi/sdk/api/@ohos.prompt.d.ts | 58 + .../deprecatedapi/sdk/api/@ohos.router.d.ts | 23 + .../deprecatedapi/sdk/api/@system.app.d.ts | 20 + .../deprecatedapi/sdk/api/@system.prompt.d.ts | 17 + .../deprecatedapi/sdk/api/@system.router.d.ts | 37 + .../deprecatedapi/sdk/api/ChipGroup.d.ets | 17 + .../deprecatedapi/sdk/api/action_sheet.d.ts | 24 + .../deprecatedapi/sdk/api/alert_dialog.d.ts | 39 + .../test/deprecatedapi/sdk/api/common.d.ts | 31 + .../sdk/api/common_ts_ets_api.d.ts | 44 + .../test/deprecatedapi/sdk/api/enums.d.ts | 21 + .../test/deprecatedapi/sdk/api/grid.d.ts | 18 + .../deprecatedapi/sdk/api/grid_container.d.ts | 37 + .../test/deprecatedapi/sdk/api/list_item.d.ts | 31 + .../deprecatedapi/sdk/api/nav_router.d.ts | 38 + .../test/deprecatedapi/sdk/api/navigator.d.ts | 24 + .../test/deprecatedapi/sdk/api/panel.d.ts | 29 + .../test/deprecatedapi/sdk/api/scroll.d.ts | 32 + .../test/deprecatedapi/sdk/api/slider.d.ts | 18 + .../test/deprecatedapi/sdk/api/swiper.d.ts | 35 + .../deprecatedapi/setImageCacheCount_api.ets | 21 + .../setImageCacheCount_api.ets.args.json | 19 + .../setImageCacheCount_api.ets.arkts2.json | 38 + .../setImageCacheCount_api.ets.json | 17 + .../setImageFileCacheSize_api.ets | 21 + .../setImageFileCacheSize_api.ets.args.json | 19 + .../setImageFileCacheSize_api.ets.arkts2.json | 38 + .../setImageFileCacheSize_api.ets.json | 17 + .../setImageRawDataCacheSize_api.ets | 21 + ...setImageRawDataCacheSize_api.ets.args.json | 19 + ...tImageRawDataCacheSize_api.ets.arkts2.json | 38 + .../setImageRawDataCacheSize_api.ets.json | 17 + .../linter/test/deprecatedapi/shortName.ets | 19 + .../deprecatedapi/shortName.ets.args.json | 19 + .../deprecatedapi/shortName.ets.arkts2.json | 17 + .../test/deprecatedapi/shortName.ets.json | 17 + .../test/deprecatedapi/showActionMenu.ets | 52 + .../showActionMenu.ets.args.json | 19 + .../showActionMenu.ets.arkts2.json | 118 + .../deprecatedapi/showActionMenu.ets.json | 38 + .../test/deprecatedapi/showToast_api.ets | 22 + .../deprecatedapi/showToast_api.ets.args.json | 19 + .../showToast_api.ets.arkts2.json | 17 + .../test/deprecatedapi/showToast_api.ets.json | 17 + .../linter/test/deprecatedapi/sizeType.ets | 45 + .../test/deprecatedapi/sizeType.ets.args.json | 19 + .../deprecatedapi/sizeType.ets.arkts2.json | 248 + .../test/deprecatedapi/sizeType.ets.json | 17 + .../test/deprecatedapi/sizeTypeXS_api.ets | 28 + .../sizeTypeXS_api.ets.args.json | 19 + .../sizeTypeXS_api.ets.arkts2.json | 98 + .../deprecatedapi/sizeTypeXS_api.ets.json | 17 + .../linter/test/deprecatedapi/slider_api.ets | 30 + .../test/deprecatedapi/slider_api.ets.json | 17 + .../linter/test/deprecatedapi/swiper_api.ets | 52 + .../deprecatedapi/swiper_api.ets.args.json | 19 + .../deprecatedapi/swiper_api.ets.arkts2.json | 298 + .../test/deprecatedapi/swiper_api.ets.json | 28 + .../test/deprecatedapi/system_prompt.ets | 30 + .../deprecatedapi/system_prompt.ets.args.json | 19 + .../system_prompt.ets.arkts2.json | 38 + .../test/deprecatedapi/system_prompt.ets.json | 17 + .../test/deprecatedapi/system_router.ets | 103 + .../deprecatedapi/system_router.ets.args.json | 19 + .../system_router.ets.arkts2.json | 78 + .../test/deprecatedapi/system_router.ets.json | 48 + .../test/deprecatedapi/temporary_api.ets | 28 + .../deprecatedapi/temporary_api.ets.args.json | 19 + .../temporary_api.ets.arkts2.json | 98 + .../test/deprecatedapi/temporary_api.ets.json | 17 + .../linter/test/deprecatedapi/text_input.ets | 28 + .../test/deprecatedapi/text_input.ets.json | 17 + .../linter/test/deprecatedapi/text_picker.ets | 40 + .../test/deprecatedapi/text_picker.ets.json | 17 + .../test/deprecatedapi/wrap_content_api.ets | 28 + .../wrap_content_api.ets.args.json | 19 + .../wrap_content_api.ets.arkts2.json | 98 + .../deprecatedapi/wrap_content_api.ets.json | 17 + .../linter/test/deprecatedapi/xcomponent.ets | 34 + .../test/deprecatedapi/xcomponent.ets.json | 17 + .../test/main/undefined_check_calls.ets.json | 20 +- 367 files changed, 28808 insertions(+), 20 deletions(-) create mode 100644 ets2panda/linter/src/lib/data/DeprecatedApiList.json create mode 100644 ets2panda/linter/src/lib/utils/consts/DeprecateWhiteList.ts create mode 100644 ets2panda/linter/src/lib/utils/consts/DeprecatedApi.ts create mode 100755 ets2panda/linter/test/deprecatedapi/Back.ets create mode 100755 ets2panda/linter/test/deprecatedapi/Back.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/Back.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/Back.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/Baseline.ets create mode 100755 ets2panda/linter/test/deprecatedapi/Baseline.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/Baseline.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/Baseline.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/COMPONENT.ets create mode 100755 ets2panda/linter/test/deprecatedapi/COMPONENT.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/COMPONENT.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/COMPONENT.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets create mode 100755 ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/DeleteProp.ets create mode 100755 ets2panda/linter/test/deprecatedapi/DeleteProp.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/DeleteProp.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/DeleteProp.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/Link.ets create mode 100755 ets2panda/linter/test/deprecatedapi/Link.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/Link.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/Link.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/NavigationType.ets create mode 100755 ets2panda/linter/test/deprecatedapi/NavigationType.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/NavigationType.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/NavigationType.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/Push.ets create mode 100755 ets2panda/linter/test/deprecatedapi/Push.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/Push.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/Push.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/Replace.ets create mode 100755 ets2panda/linter/test/deprecatedapi/Replace.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/Replace.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/Replace.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/SM.ets create mode 100755 ets2panda/linter/test/deprecatedapi/SM.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/SM.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/SM.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/SetAndLink.ets create mode 100755 ets2panda/linter/test/deprecatedapi/SetAndLink.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/SetAndLink.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/SetAndLink.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/SizeType.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/SizeType.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/UIContext.ets create mode 100644 ets2panda/linter/test/deprecatedapi/UIContext.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/ability_component.ets create mode 100755 ets2panda/linter/test/deprecatedapi/ability_component.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/ability_component.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/ability_component.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/action_sheet.ets create mode 100644 ets2panda/linter/test/deprecatedapi/action_sheet.ets.args.json create mode 100644 ets2panda/linter/test/deprecatedapi/action_sheet.ets.arkts2.json create mode 100644 ets2panda/linter/test/deprecatedapi/action_sheet.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/alert_dialog.ets create mode 100644 ets2panda/linter/test/deprecatedapi/alert_dialog.ets.args.json create mode 100644 ets2panda/linter/test/deprecatedapi/alert_dialog.ets.arkts2.json create mode 100644 ets2panda/linter/test/deprecatedapi/alert_dialog.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets create mode 100755 ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/animator.ets create mode 100644 ets2panda/linter/test/deprecatedapi/animator.ets.args.json create mode 100644 ets2panda/linter/test/deprecatedapi/animator.ets.arkts2.json create mode 100644 ets2panda/linter/test/deprecatedapi/animator.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/buttons.ets create mode 100755 ets2panda/linter/test/deprecatedapi/buttons.ets.args.json create mode 100644 ets2panda/linter/test/deprecatedapi/buttons.ets.arkts2.json create mode 100644 ets2panda/linter/test/deprecatedapi/buttons.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/chip_group_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/chip_group_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/common.ets create mode 100644 ets2panda/linter/test/deprecatedapi/common.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/common_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/common_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/common_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/common_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets create mode 100644 ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.args.json create mode 100644 ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.arkts2.json create mode 100644 ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets create mode 100755 ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/componentSnapshot.ets create mode 100644 ets2panda/linter/test/deprecatedapi/componentSnapshot.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/curves.ets create mode 100644 ets2panda/linter/test/deprecatedapi/curves.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/curvesInit_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/custom_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/custom_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/custom_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/custom_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/date_picker.ets create mode 100644 ets2panda/linter/test/deprecatedapi/date_picker.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/deprecated_api_common_utils.ets create mode 100644 ets2panda/linter/test/deprecatedapi/deprecated_api_common_utils.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets create mode 100755 ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/deprecated_api_prompt_action.ets create mode 100644 ets2panda/linter/test/deprecatedapi/deprecated_api_prompt_action.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets create mode 100755 ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/deprecated_api_time_picker.ets create mode 100644 ets2panda/linter/test/deprecatedapi/deprecated_api_time_picker.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/dragController.ets create mode 100644 ets2panda/linter/test/deprecatedapi/dragController.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/enums.ets create mode 100644 ets2panda/linter/test/deprecatedapi/enums.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/foldable_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/foldable_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/foldable_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/foldable_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/getLength.ets create mode 100755 ets2panda/linter/test/deprecatedapi/getLength.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/getLength.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/getLength.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/getParams.ets create mode 100755 ets2panda/linter/test/deprecatedapi/getParams.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/getParams.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/getParams.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/gridItem.ets create mode 100755 ets2panda/linter/test/deprecatedapi/gridItem.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/gridItem.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/gridItem.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/grid_container.ets create mode 100755 ets2panda/linter/test/deprecatedapi/grid_container.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/grid_container.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/grid_container.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/image_animator.ets create mode 100644 ets2panda/linter/test/deprecatedapi/image_animator.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/inspector.ets create mode 100644 ets2panda/linter/test/deprecatedapi/inspector.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/lazy_for_each.ets create mode 100644 ets2panda/linter/test/deprecatedapi/lazy_for_each.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/list.ets create mode 100755 ets2panda/linter/test/deprecatedapi/list.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/list.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/list.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/listitem_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/listitem_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/listitem_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/listitem_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/measure.ets create mode 100644 ets2panda/linter/test/deprecatedapi/measure.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/mediaquery.ets create mode 100644 ets2panda/linter/test/deprecatedapi/mediaquery.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/minibar_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/minibar_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/minibar_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/minibar_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/navigation.ets create mode 100644 ets2panda/linter/test/deprecatedapi/navigation.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/navigator_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/navigator_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/navigator_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/navigator_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/navrouter_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/navrouter_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/navrouter_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/navrouter_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/node_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/node_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/node_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/node_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_animator.ets create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_animator.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_animator.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_animator.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_curves.ets create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_curves.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_curves.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_curves.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_prompt.ets create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_router.ets create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_router.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_router.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/ohos_router.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/progress.ets create mode 100755 ets2panda/linter/test/deprecatedapi/progress.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/progress.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/progress.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/prompts_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/prompts_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/prompts_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/prompts_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/refresh.ets create mode 100644 ets2panda/linter/test/deprecatedapi/refresh.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerPush_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/routerPush_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerPush_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerPush_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/scroll_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/scroll_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/scroll_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/scroll_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.animator.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.curves.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.font.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.matrix4.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.prompt.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.router.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/@system.app.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/@system.prompt.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/@system.router.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/ChipGroup.d.ets create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/action_sheet.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/alert_dialog.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/common.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/common_ts_ets_api.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/enums.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/grid.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/grid_container.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/list_item.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/nav_router.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/navigator.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/sdk/api/panel.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/scroll.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/slider.d.ts create mode 100644 ets2panda/linter/test/deprecatedapi/sdk/api/swiper.d.ts create mode 100755 ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/shortName.ets create mode 100755 ets2panda/linter/test/deprecatedapi/shortName.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/shortName.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/shortName.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/showActionMenu.ets create mode 100755 ets2panda/linter/test/deprecatedapi/showActionMenu.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/showActionMenu.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/showActionMenu.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/showToast_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/showToast_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/showToast_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/showToast_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/sizeType.ets create mode 100755 ets2panda/linter/test/deprecatedapi/sizeType.ets.args.json create mode 100644 ets2panda/linter/test/deprecatedapi/sizeType.ets.arkts2.json create mode 100644 ets2panda/linter/test/deprecatedapi/sizeType.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/slider_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/slider_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/swiper_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/swiper_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/swiper_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/swiper_api.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/system_prompt.ets create mode 100755 ets2panda/linter/test/deprecatedapi/system_prompt.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/system_prompt.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/system_prompt.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/system_router.ets create mode 100755 ets2panda/linter/test/deprecatedapi/system_router.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/system_router.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/system_router.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/temporary_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/temporary_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/temporary_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/temporary_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/text_input.ets create mode 100644 ets2panda/linter/test/deprecatedapi/text_input.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/text_picker.ets create mode 100644 ets2panda/linter/test/deprecatedapi/text_picker.ets.json create mode 100755 ets2panda/linter/test/deprecatedapi/wrap_content_api.ets create mode 100755 ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.args.json create mode 100755 ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.arkts2.json create mode 100755 ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.json create mode 100644 ets2panda/linter/test/deprecatedapi/xcomponent.ets create mode 100644 ets2panda/linter/test/deprecatedapi/xcomponent.ets.json diff --git a/ets2panda/linter/package.json b/ets2panda/linter/package.json index 79b9616cac..7a48f0aa05 100644 --- a/ets2panda/linter/package.json +++ b/ets2panda/linter/package.json @@ -20,11 +20,12 @@ "pack:linter": "rimraf bundle && mkdir bundle && npm pack && mv panda-tslinter-*.tgz bundle", "pretest": " npm run fix", "test": "npm run test_all && npm run test_ts_import_ets", - "test_all": "npm run testrunner -- -d test/main,test/rules,test/regression,test/extended_features,test/migration,test/ohmurl,test/interop,test/sdkwhite,test/concurrent,test/builtin", + "test_all": "npm run testrunner -- -d test/main,test/rules,test/regression,test/extended_features,test/migration,test/ohmurl,test/interop,test/sdkwhite,test/concurrent,test/builtin,test/deprecatedapi", "test_main": "npm run testrunner -- -d test/main", "test_ohmurl": "npm run testrunner -- -d test/ohmurl", "test_interop": "npm run testrunner -- -d test/interop", "test_sdk": "npm run testrunner -- -d test/sdkwhite", + "test_deprecatedapi": "npm run testrunner -- -d test/deprecatedapi", "test_concurrent": "npm run testrunner -- -d test/concurrent", "test_rules": "npm run testrunner -- -d test/rules", "test_regression": "npm run testrunner -- -d test/regression", @@ -36,7 +37,7 @@ "test_ts_import_ets": "npm run testrunner -- -d test/ts_import_ets/ts --sdk --interop-mode", "test_migration": "npm run testrunner -- -d test/migration", "testrunner": "npm run compile && node build/testRunner/TestRunner.js", - "update-tests": "node scripts/update-test-results.mjs test/main test/rules test/regression test/extended_features test/ts_import_ets/ts test/migration test/ohmurl test/interop test/sdkwhite test/concurrent test/builtin", + "update-tests": "node scripts/update-test-results.mjs test/main test/rules test/regression test/extended_features test/ts_import_ets/ts test/migration test/ohmurl test/interop test/sdkwhite test/concurrent test/builtin test/deprecatedapi", "eslint-check": "npx eslint .", "eslint-fix": "npm run eslint-check -- --fix", "prettier-fix": "npx prettier --write .", @@ -44,7 +45,7 @@ "coverage": "npm run coverage-prepare && npm run coverage-instrument && npm run coverage-test && npm run coverage-collect && npm run coverage-report", "coverage-prepare": "npm run build && node scripts/testRunner/coverage_prepare.js", "coverage-instrument": "nyc --compact false instrument build coverage/build_instrument", - "coverage-test": "node coverage/build_instrument/testRunner/TestRunner.js -d test/main,test/rules,test/regression,test/extended_features,test/migration,test/ohmurl,test/interop,test/sdkwhite,test/concurrent,test/builtin", + "coverage-test": "node coverage/build_instrument/testRunner/TestRunner.js -d test/main,test/rules,test/regression,test/extended_features,test/migration,test/ohmurl,test/interop,test/sdkwhite,test/concurrent,test/builtin,test/deprecatedapi", "coverage-collect": "node scripts/testRunner/coverage_collect.js", "coverage-report": "node scripts/testRunner/coverage_report.js" }, diff --git a/ets2panda/linter/rule-config.json b/ets2panda/linter/rule-config.json index 349cef2c45..0bb172368a 100644 --- a/ets2panda/linter/rule-config.json +++ b/ets2panda/linter/rule-config.json @@ -58,8 +58,8 @@ "arkts-numeric-bigint-compare", "arkts-only-support-decimal-bigint-literal", "arkts-unsupport-operator", - "arkts-no-duplicate-function-name", - "arkts-subclass-must-call-super-constructor-with-args" + "arkts-no-duplicate-function-name", + "arkts-subclass-must-call-super-constructor-with-args" ], "interop": [ "arkts-interop-js2s-inherit-js-class", @@ -116,7 +116,8 @@ "arkui-no-localbuilder-decorator", "arkui-statestyles-block-need-arrow-func", "arkui-repeat-disable-default-virtualscroll", - "arkui-wrapbuilder-require-arrow-func-generic" + "arkui-wrapbuilder-require-arrow-func-generic", + "arkui-no-deprecated-api" ], "builtin": [ "arkts-builtin-thisArgs", diff --git a/ets2panda/linter/src/lib/CookBookMsg.ts b/ets2panda/linter/src/lib/CookBookMsg.ts index ec41a079a8..e1c85804dd 100644 --- a/ets2panda/linter/src/lib/CookBookMsg.ts +++ b/ets2panda/linter/src/lib/CookBookMsg.ts @@ -389,6 +389,7 @@ cookBookTag[381] = 'The code block passed to stateStyles needs to be an arrow function (arkui-statestyles-block-need-arrow-func)'; cookBookTag[382] = 'Promiseconstructor only supports using resolve (undefined) (arkts-promise-with-void-type-need-undefined-as-resolve-arg)'; +cookBookTag[399] = 'ArkUI deprecated api check (arkui-no-deprecated-api)'; for (let i = 0; i <= cookBookTag.length; i++) { cookBookMsg[i] = ''; diff --git a/ets2panda/linter/src/lib/FaultAttrs.ts b/ets2panda/linter/src/lib/FaultAttrs.ts index 5c828160f3..14bc9b8f4b 100644 --- a/ets2panda/linter/src/lib/FaultAttrs.ts +++ b/ets2panda/linter/src/lib/FaultAttrs.ts @@ -269,3 +269,4 @@ faultsAttrs[FaultID.NondecimalBigint] = new FaultAttributes(377); faultsAttrs[FaultID.UnsupportOperator] = new FaultAttributes(378); faultsAttrs[FaultID.StateStylesBlockNeedArrowFunc] = new FaultAttributes(381); faultsAttrs[FaultID.PromiseVoidNeedResolveArg] = new FaultAttributes(382); +faultsAttrs[FaultID.NoDeprecatedApi] = new FaultAttributes(399); diff --git a/ets2panda/linter/src/lib/FaultDesc.ts b/ets2panda/linter/src/lib/FaultDesc.ts index ab3cde4719..f55dc3b3a1 100644 --- a/ets2panda/linter/src/lib/FaultDesc.ts +++ b/ets2panda/linter/src/lib/FaultDesc.ts @@ -258,3 +258,4 @@ faultDesc[FaultID.StateStylesBlockNeedArrowFunc] = 'StateStyles needs arrow func faultDesc[FaultID.PromiseVoidNeedResolveArg] = 'Promiseconstructor only supports using resolve (undefined)'; faultDesc[FaultID.RepeatDisableVirtualScroll] = '"Repeat" disable default "virtualScroll"'; faultDesc[FaultID.WrappedBuilderGenericNeedArrowFunc] = 'Generic of "WrappedBuilder" does not support parameter list'; +faultDesc[FaultID.NoDeprecatedApi] = 'ArkUI deprecated api check'; diff --git a/ets2panda/linter/src/lib/Problems.ts b/ets2panda/linter/src/lib/Problems.ts index fbe1bb1413..c39e5ac1c3 100644 --- a/ets2panda/linter/src/lib/Problems.ts +++ b/ets2panda/linter/src/lib/Problems.ts @@ -258,6 +258,7 @@ export enum FaultID { PromiseVoidNeedResolveArg, RepeatDisableVirtualScroll, WrappedBuilderGenericNeedArrowFunc, + NoDeprecatedApi, // this should always be last enum LAST_ID } diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index 17e696930b..2afb7d11fd 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -122,6 +122,8 @@ import type { ApiInfo, ApiListItem } from './utils/consts/SdkWhitelist'; import { ApiList, SdkProblem, SdkNameInfo } from './utils/consts/SdkWhitelist'; import * as apiWhiteList from './data/SdkWhitelist.json'; import * as builtinWhiteList from './data/BuiltinList.json'; +import * as deprecatedApiList from './data/DeprecatedApiList.json'; +import { DEPRECATE_CHECK_KEY, DEPRECATE_UNNAMED } from './utils/consts/DeprecateWhiteList'; import { BuiltinProblem, SYMBOL_ITERATOR, @@ -183,6 +185,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { static pathMap: Map>; static indexedTypeSet: Set; static globalApiInfo: Map>; + static deprecatedApiInfo: Set; static symbotIterSet: Set; static missingAttributeSet: Set; static literalAsPropertyNameTypeSet: Set; @@ -195,12 +198,14 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { TypeScriptLinter.nameSpaceFunctionCache = new Map>(); TypeScriptLinter.pathMap = new Map>(); TypeScriptLinter.globalApiInfo = new Map>(); + TypeScriptLinter.deprecatedApiInfo = new Set(); TypeScriptLinter.funcMap = new Map>>(); TypeScriptLinter.symbotIterSet = new Set(); TypeScriptLinter.missingAttributeSet = new Set(); TypeScriptLinter.initSdkWhitelist(); TypeScriptLinter.initSdkBuiltinInfo(); TypeScriptLinter.initBuiltinlist(); + TypeScriptLinter.initDeprecatedApiList(); } initSdkInfo(): void { @@ -320,6 +325,15 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } } + private static initDeprecatedApiList(): void { + const list: ApiList = new ApiList(deprecatedApiList); + if (list?.api_list?.length > 0) { + for (const item of list.api_list) { + this.deprecatedApiInfo.add(item); + } + } + } + private static addOrUpdateData(map: Map>, path: string, data: ApiInfo): void { let apiInfos = map.get(path); if (!apiInfos) { @@ -1314,6 +1328,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handleTaskPoolDeprecatedUsages(node as ts.PropertyAccessExpression); this.handleNoTuplesArraysForPropertyAccessExpression(node as ts.PropertyAccessExpression); this.handleUnsafeOptionalCallComparison(node as ts.PropertyAccessExpression); + this.handleNoDeprecatedApi(node as ts.PropertyAccessExpression); if (ts.isCallExpression(node.parent) && node === node.parent.expression) { return; } @@ -1627,6 +1642,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handlePropertyAssignmentForProp(node); this.handleQuotedHyphenPropsDeprecated(node); + this.handleNoDeprecatedApi(node); const propName = node.name; if (!propName || !(ts.isNumericLiteral(propName) || this.options.arkts2 && ts.isStringLiteral(propName))) { return; @@ -2605,6 +2621,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handleObjectLiteralAssignment(tsVarDecl); this.handlePropertyDescriptorInScenarios(tsVarDecl); this.handleSdkGlobalApi(tsVarDecl); + this.handleNoDeprecatedApi(tsVarDecl); } private checkTypeFromSdk(type: ts.TypeNode | undefined): void { @@ -3603,6 +3620,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handleSdkGlobalApi(tsMethodDecl); this.handleLimitedVoidFunction(tsMethodDecl); this.checkVoidLifecycleReturn(tsMethodDecl); + this.handleNoDeprecatedApi(tsMethodDecl); } private handleLimitedVoidFunction(node: ts.FunctionLikeDeclaration): void { @@ -5010,6 +5028,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handleSdkGlobalApi(tsCallExpr); this.handleObjectLiteralAssignmentToClass(tsCallExpr); this.checkRestrictedAPICall(tsCallExpr); + this.handleNoDeprecatedApi(tsCallExpr); } private handleCallExpressionForUI(node: ts.CallExpression): void { @@ -5681,7 +5700,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handleSharedArrayBuffer(tsNewExpr); this.handleSdkGlobalApi(tsNewExpr); this.checkCreatingPrimitiveTypes(tsNewExpr); - + this.handleNoDeprecatedApi(tsNewExpr); if (this.options.advancedClassChecks || this.options.arkts2) { const calleeExpr = tsNewExpr.expression; const calleeType = this.tsTypeChecker.getTypeAtLocation(calleeExpr); @@ -6059,7 +6078,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handleSdkGlobalApi(typeRef); this.handleSdkConstructorIface(typeRef); this.handleNodeForWrappedBuilder(typeRef); - + this.handleNoDeprecatedApi(typeRef); const isESValue = TsUtils.isEsValueType(typeRef); const isPossiblyValidContext = TsUtils.isEsValuePossiblyAllowed(typeRef); if (isESValue && !isPossiblyValidContext) { @@ -7753,6 +7772,9 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } else if (ts.isIdentifier(expr)) { this.fixJsImportExtendsClass(node.parent, expr); } + if (ts.isIdentifier(expr)) { + this.handleNoDeprecatedApi(expr); + } }); this.handleMissingSuperCallInExtendedClass(node); @@ -12133,4 +12155,486 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { private isTargetInterface(node: ts.Node, targetName: string): boolean { return ts.isIdentifier(node) && node.getText() === targetName && !this.isDeclarationInSameFile(node); } + + private handleNoDeprecatedApi( + node: + | ts.TypeReferenceNode + | ts.NewExpression + | ts.VariableDeclaration + | ts.PropertyDeclaration + | ts.ParameterDeclaration + | ts.CallExpression + | ts.BinaryExpression + | ts.ExpressionWithTypeArguments + | ts.Identifier + | ts.MethodDeclaration + | ts.PropertyAssignment + | ts.PropertyAccessExpression + ): void { + if (!this.options.arkts2) { + return; + } + switch (node.kind) { + case ts.SyntaxKind.TypeReference: + this.checkTypeReferenceForDeprecatedApi(node); + break; + case ts.SyntaxKind.Identifier: + this.checkHeritageClauseForDeprecatedApi(node); + break; + case ts.SyntaxKind.PropertyDeclaration: + this.checkPropertyDeclarationForDeprecatedApi(node); + break; + case ts.SyntaxKind.Parameter: + case ts.SyntaxKind.VariableDeclaration: + this.checkDeclarationForDeprecatedApi(node); + break; + case ts.SyntaxKind.MethodDeclaration: + this.checkMethodDeclarationForDeprecatedApi(node); + break; + case ts.SyntaxKind.PropertyAssignment: + this.checkPropertyAssignmentForDeprecatedApi(node); + break; + case ts.SyntaxKind.NewExpression: + case ts.SyntaxKind.CallExpression: + case ts.SyntaxKind.BinaryExpression: + case ts.SyntaxKind.PropertyAccessExpression: + this.handleNoDeprecatedApiForExpression(node); + break; + default: + } + } + + handleNoDeprecatedApiForExpression( + node: ts.NewExpression | ts.CallExpression | ts.BinaryExpression | ts.PropertyAccessExpression + ): void { + switch (node.kind) { + case ts.SyntaxKind.NewExpression: + this.checkNewExpressionForDeprecatedApi(node); + break; + case ts.SyntaxKind.CallExpression: + this.checkCallExpressionForDeprecatedApi(node); + break; + case ts.SyntaxKind.BinaryExpression: + this.checkBinaryExpressionForDeprecatedApi(node); + break; + case ts.SyntaxKind.PropertyAccessExpression: + this.checkPropertyAccessExpressionForDeprecatedApi(node); + break; + default: + } + } + + private checkTypeReferenceForDeprecatedApi(node: ts.TypeReferenceNode): void { + let typeName = node.typeName; + if (ts.isQualifiedName(node.typeName)) { + typeName = node.typeName.right; + } + const decl = this.tsUtils.getDeclarationNode(typeName); + if (decl && (ts.isInterfaceDeclaration(decl) || ts.isClassDeclaration(decl))) { + let parentName = decl.name ? decl.name.text : 'unnamed'; + if (ts.isQualifiedName(node.typeName)) { + parentName = node.typeName.getText(); + } + const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( + parentName, + undefined, + undefined, + path.basename(decl.getSourceFile().fileName + '') + ); + this.processApiNodeDeprecatedApi(typeName.getText(), typeName, deprecatedApiCheckMap); + } + } + + private checkNewExpressionForDeprecatedApi(node: ts.NewExpression): void { + const expression = node.expression; + if (ts.isIdentifier(expression)) { + const decl = this.tsUtils.getDeclarationNode(expression); + if (decl && ts.isClassDeclaration(decl)) { + const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( + decl.name?.text + '', + undefined, + undefined, + path.basename(decl.getSourceFile().fileName + '') + ); + this.processApiNodeDeprecatedApi(expression.text, expression, deprecatedApiCheckMap); + } + } + } + + private checkHeritageClauseForDeprecatedApi(node: ts.Identifier): void { + const decl = this.tsUtils.getDeclarationNode(node); + if (decl && ts.isInterfaceDeclaration(decl)) { + const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( + decl.name.text, + undefined, + undefined, + path.basename(decl.getSourceFile().fileName + '') + ); + this.processApiNodeDeprecatedApi(node.getText(), node, deprecatedApiCheckMap); + } + } + + private checkDeclarationForDeprecatedApi( + node: ts.VariableDeclaration | ts.PropertyDeclaration | ts.ParameterDeclaration + ): void { + const expression = node.initializer; + const getParaExcute = (expression: ts.Expression): void => { + if (expression && ts.isIdentifier(expression)) { + const funSymbol = this.tsUtils.trueSymbolAtLocation(expression); + const decl = TsUtils.getDeclaration(funSymbol); + const parName = this.tsUtils.getParentSymbolName(funSymbol); + if (decl && (ts.isFunctionLike(decl) || ts.isVariableDeclaration(decl))) { + const returnType = decl.type?.getText(); + const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( + parName === undefined ? DEPRECATE_UNNAMED : parName + '', + undefined, + returnType, + path.basename(decl.getSourceFile().fileName) + ); + this.processApiNodeDeprecatedApi(expression.text, expression, deprecatedApiCheckMap); + } + } + }; + + if (expression && ts.isIdentifier(expression)) { + getParaExcute(expression); + } else if (expression && ts.isObjectLiteralExpression(expression)) { + const properties = expression.properties; + for (const prop of properties) { + const propExpression = ts.isPropertyAssignment(prop) && prop.initializer; + if (propExpression && ts.isIdentifier(propExpression)) { + getParaExcute(propExpression); + } + } + } + } + + private checkCallExpressionForDeprecatedApi(node: ts.CallExpression): void { + let name: ts.Identifier | undefined; + if (ts.isIdentifier(node.expression)) { + name = node.expression; + } else if (ts.isPropertyAccessExpression(node.expression)) { + name = ts.isIdentifier(node.expression.name) ? node.expression.name : undefined; + } + if (!name) { + return; + } + let funSymbol = this.tsUtils.trueSymbolAtLocation(name); + if (!funSymbol && ts.isPropertyAccessExpression(node.expression)) { + funSymbol = this.tsTypeChecker.getSymbolAtLocation(node.expression.expression); + } + const decl = TsUtils.getDeclaration(funSymbol); + const parName = this.tsUtils.getParentSymbolName(funSymbol); + if (decl && (ts.isFunctionLike(decl) || ts.isVariableDeclaration(decl))) { + const returnType = decl.type?.getText() === undefined ? 'any' : decl.type?.getText() + ''; + const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( + parName === undefined ? DEPRECATE_UNNAMED : parName + '', + ts.isFunctionLike(decl) ? decl.parameters : undefined, + returnType, + path.basename(decl.getSourceFile().fileName) + ); + this.reportDeprecatedApi(node, name, deprecatedApiCheckMap); + } + this.checkSpecialApiForDeprecatedApi(node, name, decl); + } + + private reportDeprecatedApi( + node: ts.CallExpression, + name: ts.Identifier, + deprecatedApiCheckMap?: Map> + ): void { + const isMatched = this.isMatchedDeprecatedApi(name.text, deprecatedApiCheckMap); + if (isMatched) { + const autofix = this.autofixer?.fixDeprecatedApiForCallExpression(node); + if (autofix) { + this.interfacesNeedToImport.add('getUIContext'); + } + this.incrementCounters(name, FaultID.NoDeprecatedApi, autofix); + } + } + + private checkSpecialApiForDeprecatedApi( + node: ts.CallExpression, + name: ts.Identifier, + decl: ts.Declaration | undefined + ): void { + if (('mask' === name.getText() || 'clip' === name.getText()) && node.arguments.length === 1) { + const types = ['CircleAttribute', 'EllipseAttribute', ' PathAttribute', 'RectAttribute']; + const arg = node.arguments[0]; + const argType = this.tsTypeChecker.typeToString(this.tsTypeChecker.getTypeAtLocation(arg)); + if (types.includes(argType)) { + if (name.getText() === 'clip') { + const typeMapping = { + CircleAttribute: 'CircleShape', + EllipseAttribute: 'EllipseShape', + PathAttribute: 'PathShape', + RectAttribute: 'RectShape' + } as const; + + if (argType in typeMapping) { + this.interfacesNeedToImport.add(typeMapping[argType as keyof typeof typeMapping]); + } + + const autofix = this.autofixer?.fixSpecialDeprecatedApiForCallExpression(node, name); + this.incrementCounters(name, FaultID.NoDeprecatedApi, autofix); + return; + } + this.incrementCounters(name, FaultID.NoDeprecatedApi); + return; + } + } + if (decl?.parent && ts.isClassDeclaration(decl.parent) && 'onScroll' === name.getText()) { + let parentName = ''; + decl.parent.heritageClauses?.forEach((clause) => { + clause.types.forEach((type) => { + if (ts.isExpressionWithTypeArguments(type)) { + parentName = type.expression.getText(); + } + }); + }); + if (parentName === 'ScrollableCommonMethod') { + this.incrementCounters(name, FaultID.NoDeprecatedApi); + } + } + } + + private checkBinaryExpressionForDeprecatedApi(node: ts.BinaryExpression): void { + const expression = node.right; + if (ts.isIdentifier(expression)) { + this.processApiNodeDeprecatedApi(expression.text, expression); + } + } + + private checkMethodDeclarationForDeprecatedApi(node: ts.MethodDeclaration): void { + const expression = node.name; + if (!ts.isIdentifier(expression)) { + return; + } + if ( + (expression.getText() === 'onLayout' || expression.getText() === 'onMeasure') && + node.type?.getText() === 'void' && + node.parent && + ts.isStructDeclaration(node.parent) + ) { + const argsType = ['LayoutChild[]', 'ConstraintSizeOptions']; + const parameters = node.parameters; + if (parameters && parameters.length === 2) { + let paramMatch = true; + for (let i = 0; i < parameters.length; i++) { + if (this.tsTypeChecker.typeToString(this.tsTypeChecker.getTypeAtLocation(parameters[i])) !== argsType[i]) { + paramMatch = false; + break; + } + } + if (paramMatch) { + this.incrementCounters(expression, FaultID.NoDeprecatedApi); + return; + } + } + } + this.processApiNodeDeprecatedApi(expression.text, expression); + } + + private checkPropertyAssignmentForDeprecatedApi(node: ts.PropertyAssignment): void { + const expression = node.name; + const contextualType = this.tsTypeChecker.getContextualType(node.parent); + if (contextualType) { + this.processApiNodeDeprecatedApi( + expression.getText(), + expression, + TypeScriptLinter.getPropertyTypeForPropertyAssignment(node, contextualType) + ); + } + } + + private checkPropertyAccessExpressionForDeprecatedApi(node: ts.PropertyAccessExpression): void { + node.forEachChild((expression) => { + if (!ts.isIdentifier(expression)) { + return; + } + const funSymbol = this.tsUtils.trueSymbolAtLocation(expression); + const decl = TsUtils.getDeclaration(funSymbol); + let parName = this.tsUtils.getParentSymbolName(funSymbol); + if ( + decl && + (ts.isPropertyDeclaration(decl) || + ts.isPropertySignature(decl) || + ts.isEnumMember(decl) || + ts.isEnumDeclaration(decl)) && + decl.parent + ) { + let returnType: string | undefined = this.tsTypeChecker.typeToString( + this.tsTypeChecker.getTypeAtLocation(decl) + ); + if (ts.isPropertySignature(decl) && decl.type) { + returnType = decl.type.getText(); + } else if (ts.isEnumMember(decl)) { + returnType = TypeScriptLinter.getReturnTypeForEnumMember(decl); + } else if (!parName && ts.isEnumDeclaration(decl)) { + parName = decl.name.text; + returnType = undefined; + } + const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( + parName === undefined ? DEPRECATE_UNNAMED : parName + '', + undefined, + returnType, + path.basename(decl.getSourceFile().fileName) + ); + this.processApiNodeDeprecatedApi(expression.text, expression, deprecatedApiCheckMap); + } + }); + } + + private checkPropertyDeclarationForDeprecatedApi(node: ts.PropertyDeclaration): void { + const expression = node.name; + if (ts.isIdentifier(expression)) { + this.processApiNodeDeprecatedApi(expression.text, expression); + } + } + + private processApiNodeDeprecatedApi( + apiName: string, + errorNode: ts.Node, + deprecatedApiCheckMap?: Map>, + autofix?: Autofix[] + ): void { + const matchedApi = this.isMatchedDeprecatedApi(apiName, deprecatedApiCheckMap); + if (matchedApi) { + this.incrementCounters(errorNode, FaultID.NoDeprecatedApi, autofix); + } + } + + private isMatchedDeprecatedApi( + apiName: string, + deprecatedApiCheckMap?: Map> + ): boolean { + void this; + const setApiListItem = TypeScriptLinter.deprecatedApiInfo; + if (!setApiListItem || !deprecatedApiCheckMap) { + return false; + } + const apiNamesArr = [...setApiListItem]; + const matchedApi = apiNamesArr.some((apiInfoItem) => { + if (apiInfoItem.api_info.parent_api?.length <= 0) { + return false; + } + let isSameApi = apiInfoItem.api_info.api_name === apiName; + isSameApi &&= + apiInfoItem.api_info.parent_api[0].api_name === deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.PARENT_NAME); + isSameApi &&= + this.normalizeTypeString(apiInfoItem.api_info.method_return_type) === + this.normalizeTypeString(deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.RETURN_TYPE)); + const api_func_args = apiInfoItem.api_info.api_func_args; + const params = deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.PARAM_SET); + if (api_func_args && params) { + const isParametersEqual = TypeScriptLinter.areParametersEqualForDeprecated( + api_func_args, + params as ts.NodeArray + ); + isSameApi &&= isParametersEqual; + } + const fileName = deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.FILE_NAME) + ''; + const isSameFile = fileName.endsWith(path.basename(apiInfoItem.file_path)); + return isSameFile && isSameApi; + }); + return matchedApi; + } + + private static getPropertyTypeForPropertyAssignment( + propertyAssignment: ts.PropertyAssignment, + contextualType: ts.Type + ): Map> | undefined { + const propertyName = propertyAssignment.name.getText(); + if (contextualType.isUnion()) { + for (const type of contextualType.types) { + const deprecatedApiCheckMap = TypeScriptLinter.getPropertyInfoByContextualType(type, propertyName); + if (deprecatedApiCheckMap) { + return deprecatedApiCheckMap; + } + } + } + return TypeScriptLinter.getPropertyInfoByContextualType(contextualType, propertyName); + } + + private static getPropertyInfoByContextualType( + type: ts.Type, + propertyName: string + ): Map> | undefined { + const propertySymbol = type.getProperty(propertyName); + if (!propertySymbol) { + return undefined; + } + const propertyDecl = TsUtils.getDeclaration(propertySymbol); + let deprecatedApiCheckMap = new Map>(); + if (propertyDecl && ts.isPropertySignature(propertyDecl) && propertyDecl.type) { + deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( + type.getSymbol()?.name + '', + undefined, + propertyDecl.type.getText(), + path.basename(propertyDecl.getSourceFile().fileName + '') + ); + } + return deprecatedApiCheckMap; + } + + private static updateDeprecatedApiCheckMap( + parentName: string, + parames: ts.NodeArray | undefined, + returnType: string | undefined, + fileName: string + ): Map> { + const deprecatedApiCheckMap = new Map>(); + deprecatedApiCheckMap.set(DEPRECATE_CHECK_KEY.PARENT_NAME, parentName); + if (parames) { + deprecatedApiCheckMap.set(DEPRECATE_CHECK_KEY.PARAM_SET, parames); + } + if (returnType) { + deprecatedApiCheckMap.set(DEPRECATE_CHECK_KEY.RETURN_TYPE, returnType); + } + deprecatedApiCheckMap.set(DEPRECATE_CHECK_KEY.FILE_NAME, fileName); + return deprecatedApiCheckMap; + } + + private static getReturnTypeForEnumMember(node: ts.EnumMember): string { + const enumDecl = node.parent; + if (!enumDecl?.members || enumDecl.members.length === 0) { + return ''; + } + for (let i = 0; i < enumDecl.members.length; i++) { + if (enumDecl.members[i].name.getText() === node.name.getText()) { + return i + ''; + } + } + return ''; + } + + private normalizeTypeString( + typeStr: string | ts.NodeArray | undefined + ): string | ts.NodeArray | undefined { + void this; + if (typeof typeStr === 'string') { + return typeStr.replace(/\s+/g, ''); + } + return typeStr; + } + + private static areParametersEqualForDeprecated( + sdkFuncArgs: { name: string; type: string }[], + memberParams: ts.NodeArray + ): boolean { + const apiParamCout = sdkFuncArgs.length; + const memberParamCout = memberParams.length; + if (apiParamCout > memberParamCout && sdkFuncArgs[memberParamCout]) { + return false; + } + for (let i = 0; i < apiParamCout; i++) { + const typeName = memberParams[i]?.type?.getText(); + const newtypeName = typeName?.replace(/\s+/g, ''); + const sdkArgName = sdkFuncArgs[i].type.replace(/\s+/g, ''); + if (newtypeName !== sdkArgName) { + return false; + } + } + return true; + } } diff --git a/ets2panda/linter/src/lib/autofixes/Autofixer.ts b/ets2panda/linter/src/lib/autofixes/Autofixer.ts index df98eb0845..497e5341b9 100644 --- a/ets2panda/linter/src/lib/autofixes/Autofixer.ts +++ b/ets2panda/linter/src/lib/autofixes/Autofixer.ts @@ -63,6 +63,7 @@ import { } from '../utils/consts/InteropAPI'; import path from 'node:path'; import { isStdLibrarySymbol } from '../utils/functions/IsStdLibrary'; +import { propertyAccessReplacements, identifierReplacements } from '../utils/consts/DeprecatedApi'; const UNDEFINED_NAME = 'undefined'; @@ -5328,4 +5329,91 @@ export class Autofixer { this.printer.printNode(ts.EmitHint.Unspecified, newExpr, stmt.getSourceFile()); return [{ start: stmt.getEnd(), end: stmt.getEnd(), replacementText: text }]; } + + fixDeprecatedApiForCallExpression(callExpr: ts.CallExpression): Autofix[] | undefined { + const createUIContextAccess = (methodName: string): ts.Node => { + return ts.factory.createPropertyAccessExpression( + ts.factory.createCallExpression(ts.factory.createIdentifier('getUIContext'), undefined, []), + ts.factory.createIdentifier(methodName) + ); + }; + + if (ts.isPropertyAccessExpression(callExpr.expression)) { + const fullName = `${callExpr.expression.expression.getText()}.${callExpr.expression.name.getText()}`; + const methodName = propertyAccessReplacements.get(fullName); + if (methodName) { + const newExpression = createUIContextAccess(methodName); + const newText = this.printer.printNode(ts.EmitHint.Unspecified, newExpression, callExpr.getSourceFile()); + return [ + { + start: callExpr.expression.getStart(), + end: callExpr.expression.getEnd(), + replacementText: newText + } + ]; + } + } + + if (ts.isIdentifier(callExpr.expression)) { + const identifierText = callExpr.expression.getText(); + const methodName = identifierReplacements.get(identifierText); + + if (methodName) { + const newExpression = createUIContextAccess(methodName); + const newText = this.printer.printNode(ts.EmitHint.Unspecified, newExpression, callExpr.getSourceFile()); + return [ + { + start: callExpr.expression.getStart(), + end: callExpr.expression.getEnd(), + replacementText: newText + } + ]; + } + } + + return undefined; + } + + fixSpecialDeprecatedApiForCallExpression(callExpr: ts.CallExpression, name: ts.Identifier): Autofix[] | undefined { + if (name.getText() !== 'clip' || !ts.isNewExpression(callExpr.arguments[0])) { + return undefined; + } + + const shapeMap = { + Circle: 'CircleShape', + Path: 'PathShape', + Ellipse: 'EllipseShape', + Rect: 'RectShape' + } as const; + + const argsExpr = callExpr.arguments[0].arguments; + const constructorName = callExpr.arguments[0].expression.getText(); + + if ( + ts.isPropertyAccessExpression(callExpr.expression) && + callExpr.expression.name.text === 'clip' && + constructorName in shapeMap + ) { + const shapeType = shapeMap[constructorName as keyof typeof shapeMap]; + const newExpression = ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + callExpr.expression.expression, + ts.factory.createIdentifier('clipShape') + ), + undefined, + [ts.factory.createNewExpression(ts.factory.createIdentifier(shapeType), undefined, argsExpr)] + ); + + const newText = this.printer.printNode(ts.EmitHint.Unspecified, newExpression, callExpr.getSourceFile()); + return [ + { + start: callExpr.getStart(), + end: callExpr.getEnd(), + replacementText: newText + } + ]; + } + + return undefined; + } } diff --git a/ets2panda/linter/src/lib/data/DeprecatedApiList.json b/ets2panda/linter/src/lib/data/DeprecatedApiList.json new file mode 100644 index 0000000000..2c05b55d14 --- /dev/null +++ b/ets2panda/linter/src/lib/data/DeprecatedApiList.json @@ -0,0 +1,10369 @@ +{ + "api_list": [ + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "clip", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "CommonMethod", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "T" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "opacity", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "TransitionOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "type", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "TransitionOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "TransitionType" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.curves.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "cubicBezier", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "curves", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "x1", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "y1", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "x2", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "y2", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "string" + }, + "import_path": [ + "@ohos.curves", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "rotate", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "TransitionOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "RotateOptions" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "scale", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "TransitionOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "ScaleOptions" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "translate", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "TransitionOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "TranslateOptions" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigation.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "toolBar", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavigationAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "object | CustomBuilder", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "NavigationAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigation.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "subTitle", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavigationAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "NavigationAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "px2lpx", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "lpx2px", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "px2fp", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "fp2px", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "px2vp", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "vp2px", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getContext", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "component", + "type": "Object", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "Context" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/xcomponent.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "setXComponentSurfaceSize", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "XComponentController", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "{\n surfaceWidth: number;\n surfaceHeight: number;\n }", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/text_input.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onEditChanged", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "TextInputAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "(isEditing: boolean) => void", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "TextInputAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "screenY", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "TouchObject", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "screenX", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "TouchObject", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "screenY", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "MouseEvent", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "screenX", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "MouseEvent", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "screenY", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ClickEvent", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "screenX", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ClickEvent", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/image_animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "preDecode", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ImageAnimatorAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "ImageAnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/text_picker.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "show", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "TextPickerDialog", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "TextPickerDialogOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/text_picker.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onCancel", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "TextPickerAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "() => void", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "TextPickerAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/text_picker.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onAccept", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "TextPickerAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "(value: string, index: number) => void", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "TextPickerAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/date_picker.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "show", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DatePickerDialog", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "DatePickerDialogOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/date_picker.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onChange", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DatePickerDialogOptions", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "DatePickerResult", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "(value: DatePickerResult) => void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/date_picker.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onAccept", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DatePickerDialogOptions", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "DatePickerResult", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "(value: DatePickerResult) => void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/date_picker.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onChange", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DatePickerAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "(value: DatePickerResult)", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "DatePickerAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/lazy_for_each.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onDataChanged", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DataChangeListener", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/lazy_for_each.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onDataDeleted", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DataChangeListener", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/lazy_for_each.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onDataMoved", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DataChangeListener", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "from", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "to", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/lazy_for_each.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onDataAdded", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DataChangeListener", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.arkui.UIContext.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showActionMenu", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PromptAction", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "promptAction.ActionMenuOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "promptAction.ActionMenuSuccessResponse", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.arkui.UIContext", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/action_sheet.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "show", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ActionSheet", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "ActionSheetOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/alert_dialog.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "show", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AlertDialog", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/refresh.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "offset", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "RefreshOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "number | string" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/enums.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Center", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "Edge", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "1" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/enums.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Middle", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "Edge", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "5" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.arkui.componentSnapshot.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "createFromBuilder", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "componentSnapshot", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "builder", + "type": "CustomBuilder", + "is_optional": false, + "has_default": false + }, + { + "name": "delay", + "type": "number", + "is_optional": true, + "has_default": false + }, + { + "name": "checkImageStatus", + "type": "boolean", + "is_optional": true, + "has_default": false + }, + { + "name": "options", + "type": "SnapshotOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.arkui.componentSnapshot", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.arkui.componentSnapshot.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "createFromBuilder", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "componentSnapshot", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "builder", + "type": "CustomBuilder", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + }, + { + "name": "delay", + "type": "number", + "is_optional": true, + "has_default": false + }, + { + "name": "checkImageStatus", + "type": "boolean", + "is_optional": true, + "has_default": false + }, + { + "name": "options", + "type": "SnapshotOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.arkui.componentSnapshot", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.arkui.componentSnapshot.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "get", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "componentSnapshot", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "id", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "options", + "type": "SnapshotOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.arkui.componentSnapshot", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.arkui.componentSnapshot.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "get", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "componentSnapshot", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "id", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + }, + { + "name": "options", + "type": "SnapshotOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.arkui.componentSnapshot", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.measure.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "measureTextSize", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "MeasureText", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "MeasureOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "SizeOptions" + }, + "import_path": [ + "@ohos.measure", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.measure.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "measureText", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "MeasureText", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "MeasureOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "number" + }, + "import_path": [ + "@ohos.measure", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.arkui.dragController.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getDragPreview", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "dragController", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "DragPreview" + }, + "import_path": [ + "@ohos.arkui.dragController", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.arkui.dragController.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "createDragAction", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "dragController", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "customArray", + "type": "Array", + "is_optional": false, + "has_default": false + }, + { + "name": "dragInfo", + "type": "DragInfo", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "DragAction" + }, + "import_path": [ + "@ohos.arkui.dragController", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.arkui.dragController.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "executeDrag", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "dragController", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "custom", + "type": "CustomBuilder | DragItemInfo", + "is_optional": false, + "has_default": false + }, + { + "name": "dragInfo", + "type": "DragInfo", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.arkui.dragController", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.arkui.dragController.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "executeDrag", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "dragController", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "custom", + "type": "CustomBuilder | DragItemInfo", + "is_optional": false, + "has_default": false + }, + { + "name": "dragInfo", + "type": "DragInfo", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.arkui.dragController", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getShared", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "LocalStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "LocalStorage" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.arkui.inspector.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "createComponentObserver", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "inspector", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "id", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "ComponentObserver" + }, + "import_path": [ + "@ohos.arkui.inspector", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "create", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Animator", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "AnimatorOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorResult" + }, + "import_path": [ + "@ohos.animator", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.mediaquery.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "matchMediaSync", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "mediaquery", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "condition", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "MediaQueryListener" + }, + "import_path": [ + "@ohos.mediaquery", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.font.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getFontByName", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "font", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "fontName", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "FontInfo" + }, + "import_path": [ + "@ohos.font", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.font.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getSystemFontList", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "font", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "Array" + }, + "import_path": [ + "@ohos.font", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.font.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "registerFont", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "font", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "FontOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.font", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replaceNamedRoute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "NamedRouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "mode", + "type": "RouterMode", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replaceNamedRoute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "NamedRouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "mode", + "type": "RouterMode", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replaceNamedRoute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "NamedRouterOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replaceNamedRoute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "NamedRouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "pushNamedRoute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "NamedRouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "mode", + "type": "RouterMode", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "pushNamedRoute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "NamedRouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "mode", + "type": "RouterMode", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "pushNamedRoute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "NamedRouterOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "pushNamedRoute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "NamedRouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getParams", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "Object" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "hideAlertBeforeBackPage", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showAlertBeforeBackPage", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "EnableAlertOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getStateByUrl", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "url", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Array" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getStateByIndex", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "RouterState | undefined" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getState", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "RouterState" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getLength", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "string" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "clear", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "back", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "params", + "type": "Object", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "back", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replaceUrl", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "mode", + "type": "RouterMode", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replaceUrl", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "mode", + "type": "RouterMode", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replaceUrl", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replaceUrl", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "pushUrl", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "mode", + "type": "RouterMode", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "pushUrl", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "mode", + "type": "RouterMode", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "pushUrl", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "pushUrl", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/time_picker.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "show", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "TimePickerDialog", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "TimePickerDialogOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "animateTo", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "AnimateParam", + "is_optional": false, + "has_default": false + }, + { + "name": "event", + "type": "() => void", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.promptAction.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showActionMenu", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "promptAction", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ActionMenuOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.promptAction", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.promptAction.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showActionMenu", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "promptAction", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ActionMenuOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.promptAction", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.promptAction.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "closeCustomDialog", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "promptAction", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "dialogId", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.promptAction", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.promptAction.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "openCustomDialog", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "promptAction", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "CustomDialogOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.promptAction", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.promptAction.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showDialog", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "promptAction", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ShowDialogOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.promptAction", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.promptAction.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showDialog", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "promptAction", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ShowDialogOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.promptAction", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.promptAction.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showToast", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "promptAction", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ShowToastOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.promptAction", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.arkui.componentUtils.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getRectangleById", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "componentUtils", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "id", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "ComponentInfo" + }, + "import_path": [ + "@ohos.arkui.componentUtils", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "layout", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "LayoutChild", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "childLayoutInfo", + "type": "LayoutInfo", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "position", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutChild", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "Position" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "borderInfo", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutChild", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "LayoutBorderInfo" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "position", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutInfo", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "Position" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "measure", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "LayoutChild", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "childConstraint", + "type": "ConstraintSizeOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "id", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutChild", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "constraint", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutChild", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "ConstraintSizeOptions" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "name", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutChild", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "constraint", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutInfo", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "ConstraintSizeOptions" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "margin", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutBorderInfo", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "Margin" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "useSizeType", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "CommonMethod", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "{\n xs?: number | { span: number; offset: number; };\n sm?: number | { span: number; offset: number; };\n md?: number | { span: number; offset: number; };\n lg?: number | { span: number; offset: number; };\n }", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "T" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "padding", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutBorderInfo", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "Padding" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "borderWidth", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "LayoutBorderInfo", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "EdgeWidths" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "mask", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "CommonMethod", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute | ProgressMask", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "T" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onMeasure", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "CustomComponent", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "children", + "type": "Array", + "is_optional": false, + "has_default": false + }, + { + "name": "constraint", + "type": "ConstraintSizeOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onLayout", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "CustomComponent", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "children", + "type": "Array", + "is_optional": false, + "has_default": false + }, + { + "name": "constraint", + "type": "ConstraintSizeOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "placementOnTop", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "PopupOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "boolean" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onScroll", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ScrollableCommonMethod", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "(scrollOffset: number)", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "T" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "touchable", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "CommonMethod", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "boolean", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "T" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "maskColor", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "CustomPopupOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "Color | string | Resource | number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getX", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DragEvent", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getY", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DragEvent", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "LayoutChild", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "LayoutChild", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "LayoutInfo", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "LayoutInfo", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "LayoutBorderInfo", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "LayoutBorderInfo", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "TransitionOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "TransitionOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "gridOffset", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "CommonMethod", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "T" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "gridSpan", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "CommonMethod", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "T" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "indicatorStyle", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "SwiperAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "IndicatorStyle", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "SwiperAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "IndicatorStyle", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "IndicatorStyle", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "color", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "IndicatorStyle", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "ResourceColor" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "right", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "IndicatorStyle", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "Length" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "left", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "IndicatorStyle", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "Length" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AUTO_LINEAR", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "SwiperDisplayMode", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "3" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AutoLinear", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "SwiperDisplayMode", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "1" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "selectedColor", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "IndicatorStyle", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "ResourceColor" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "mask", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "IndicatorStyle", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "boolean" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "bottom", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "IndicatorStyle", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "Length" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "size", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "IndicatorStyle", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "Length" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Stretch", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "SwiperDisplayMode", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "0" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/swiper.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "top", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "IndicatorStyle", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "Length" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/scroll.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "scrollPage", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Scroller", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "{ next: boolean; direction: Axis }", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/scroll.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Free", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "ScrollDirection", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "2" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/scroll.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onScrollEnd", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ScrollAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "() => void", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "ScrollAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/scroll.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onScroll", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ScrollAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "(xOffset: number, yOffset: number) => void", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "ScrollAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/ui_extension_component.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onResult", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "UIExtensionComponentAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "import('../api/@ohos.base').Callback<{\n\n code: number;\n\n want: import('../api/@ohos.app.ability.Want').default;\n\n }>", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "UIExtensionComponentAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/ui_extension_component.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onRelease", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "UIExtensionComponentAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "import('../api/@ohos.base').Callback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "UIExtensionComponentAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/slider.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "minLabel", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "SliderAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "SliderAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/slider.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "maxLabel", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "SliderAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "SliderAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/list_item.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ListItemAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ListItemInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "string", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "ListItemAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/list_item.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "sticky", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ListItemAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Sticky", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "ListItemAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/list_item.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "editable", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ListItemAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "boolean | EditMode", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "ListItemAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/list_item.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Sticky", + "api_type": "EnumDeclaration", + "parent_api": [ + { + "api_name": "Sticky", + "api_type": "" + } + ], + "code_kind": 241, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/list_item.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "EditMode", + "api_type": "EnumDeclaration", + "parent_api": [ + { + "api_name": "EditMode", + "api_type": "" + } + ], + "code_kind": 241, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.arkui.advanced.ChipGroup.d.ets", + "api_info": { + "line": 1, + "problem": "", + "api_name": "suffixIcon", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ChipGroupItemOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "IconOptions" + }, + "import_path": [ + "@ohos.arkui.advanced.ChipGroup" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavRouterInstance", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "NavRouterAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavRouter", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "NavRouterInterface" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "mode", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavRouterAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "mode", + "type": "NavRouteMode", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "NavRouterAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onStateChange", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavRouterAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "(isActivated: boolean) => void", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "NavRouterAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavRouterAttribute", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "NavRouterAttribute", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "REPLACE", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "NavRouteMode", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "2" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PUSH", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "NavRouteMode", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "1" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PUSH_WITH_RECREATE", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "NavRouteMode", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "0" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavRouteMode", + "api_type": "EnumDeclaration", + "parent_api": [ + { + "api_name": "NavRouteMode", + "api_type": "" + } + ], + "code_kind": 241, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavRouterAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavRouterInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "RouteInfo", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "NavRouterAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavRouterAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavRouterInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "NavRouterAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavRouterInterface", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "NavRouterInterface", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "param", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "RouteInfo", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "unknown" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "name", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "RouteInfo", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/nav_router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "RouteInfo", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "RouteInfo", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavigatorInstance", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "NavigatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Navigator", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "NavigatorInterface" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "params", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavigatorAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "object", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "NavigatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "target", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavigatorAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "NavigatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "type", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavigatorAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "NavigationType", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "NavigatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "active", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavigatorAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "boolean", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "NavigatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavigatorAttribute", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "NavigatorAttribute", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavigatorAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavigatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "NavigatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavigatorAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "NavigatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "{ target: string; type: NavigationType }", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "NavigatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavigatorInterface", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "NavigatorInterface", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Replace", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "NavigationType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "2" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Back", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "NavigationType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "1" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Push", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "NavigationType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "0" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/navigator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NavigationType", + "api_type": "EnumDeclaration", + "parent_api": [ + { + "api_name": "NavigationType", + "api_type": "" + } + ], + "code_kind": 241, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "SizeType", + "api_type": "EnumDeclaration", + "parent_api": [ + { + "api_name": "SizeType", + "api_type": "" + } + ], + "code_kind": 241, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "GridContainer", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "GridContainerInterface" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "GridContainerInstance", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "GridContainerAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "GridContainerInterface", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "GridContainerInterface", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "GridContainerOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "GridContainerOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "GridContainerAttribute", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "GridContainerAttribute", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "index", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "prompt.ShowDialogSuccessResponse", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "number" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ParamsInterface", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string]: Object;\n}" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/matrix2d.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "rotate", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Matrix2D", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "rx", + "type": "number", + "is_optional": true, + "has_default": false + }, + { + "name": "ry", + "type": "number", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "Matrix2D" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/matrix2d.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "multiply", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Matrix2D", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "other", + "type": "Matrix2D", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "Matrix2D" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/list.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onScroll", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ListAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "(scrollOffset: number)", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "ListAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/xcomponent.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "XComponentAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "XComponentInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "{ id: string; type: string; libraryname: string; controller: XComponentController }", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "XComponentAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/enums.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "COMPONENT", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "XComponentType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "1" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/arkui/XComponentNode.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "changeRenderType", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "XComponentNode", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "type", + "type": "NodeRenderType", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "boolean" + }, + "import_path": [ + "@ohos.arkui.node", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/arkui/XComponentNode.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onDestroy", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "XComponentNode", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.arkui.node", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/arkui/XComponentNode.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onCreate", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "XComponentNode", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "Object", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.arkui.node", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/arkui/XComponentNode.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "constructor", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "XComponentNode", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "uiContext", + "type": "UIContext", + "is_optional": false, + "has_default": false + }, + { + "name": "options", + "type": "RenderOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "id", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "type", + "type": "XComponentType", + "is_optional": false, + "has_default": false + }, + { + "name": "libraryName", + "type": "string", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "string)" + }, + "import_path": [ + "@ohos.arkui.node", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/arkui/XComponentNode.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "XComponentNode", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "XComponentNode", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@ohos.arkui.node", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "GetShared", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "LocalStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "LocalStorage" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/enums.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "CROSS_DEVICE", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "CopyOptions", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "3" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "BackRouterOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "BackRouterOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "SetAndLink", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "defaultValue", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "SubscribedAbstractProperty" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Link", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/ability_component.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AbilityComponentInterface", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "AbilityComponentInterface", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/ability_component.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AbilityComponent", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "AbilityComponentInterface" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.app.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "requestFullWindow", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "App", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RequestFullWindowOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.app", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "enableAlertBeforeBackPage", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "EnableAlertBeforeBackPageOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "SM", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "SizeType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "2" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showDialog", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "prompt", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ShowDialogOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/list.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onItemDelete", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ListAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "(index: number)", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "ListAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/enums.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Baseline", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "Edge", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "3" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "sizeType", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "GridContainerOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "SizeType" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "DeleteProp", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PersistentStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "key", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/menu.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "fontSize", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "MenuAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Length", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "MenuAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.matrix4.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "invert", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "matrix4", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "Matrix4Transit" + }, + "import_path": [ + "@ohos.matrix4", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Button", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "prompt.Button", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/bundle/elementName.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "shortName", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ElementName", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "string" + }, + "import_path": [ + "elementName" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "buttons", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "prompt.ShowDialogOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "[Button, Button?, Button?]" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showActionMenu", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "prompt", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ActionMenuOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ActionMenuSuccessResponse", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "prompt.ActionMenuSuccessResponse", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showActionMenu", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "prompt", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ActionMenuOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Promise" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/ability_component.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AbilityComponentAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AbilityComponentInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "{want: import('../api/@ohos.app.ability.Want').default}", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AbilityComponentAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getLength", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "string" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ActionMenuOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "prompt.ActionMenuOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getParams", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "ParamsInterface" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "RouterOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "RouterOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/ability_component.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onConnect", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AbilityComponentAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "()", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "AbilityComponentAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "cancel", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DisableAlertBeforeBackPageOptions", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "errMsg", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "(errMsg: string) => void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "enableAlertBeforeBackPage", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "EnableAlertOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Set", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "newValue", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "boolean" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "params", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "BackRouterOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "Object" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.curves.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "steps", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "curves", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "count", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "end", + "type": "boolean", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "string" + }, + "import_path": [ + "@ohos.curves", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/gridItem.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "forceRebuild", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "GridItemAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "boolean", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "GridItemAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Keys", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "IterableIterator" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "bottom", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ShowToastOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "string | number" + }, + "import_path": [ + "@system.prompt" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "staticClear", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "boolean" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "LG", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "SizeType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "4" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Has", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "boolean" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.matrix4.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "scale", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "matrix4", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ScaleOption", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Matrix4Transit" + }, + "import_path": [ + "@ohos.matrix4", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showDialog", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "prompt", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ShowDialogOptions", + "is_optional": false, + "has_default": false + }, + { + "name": "callback", + "type": "AsyncCallback", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "duration", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ShowToastOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "number" + }, + "import_path": [ + "@system.prompt" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.matrix4.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "transformPoint", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "matrix4", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "[number, number]", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "[number, number]" + }, + "import_path": [ + "@ohos.matrix4", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "message", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ShowToastOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "@system.prompt" + ], + "is_global": false + }, + { + "file_path": "api/bundle/elementName.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "uri", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ElementName", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "string" + }, + "import_path": [ + "elementName" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ShowDialogOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "ShowDialogOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "message", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ShowToastOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "createAnimator", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Animator", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "AnimatorOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorResult" + }, + "import_path": [ + "@ohos.animator", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "SetAndProp", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "defaultValue", + "type": "S", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "SubscribedAbstractProperty" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/progress.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "style", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ProgressOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "ProgressStyle" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "index", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ActionMenuSuccessResponse", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "number" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "SetOrCreate", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "newValue", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getState", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "RouterState" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "columns", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "GridContainerOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "number | \"auto\"" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "cancel", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "EnableAlertBeforeBackPageOptions", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "errMsg", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "(errMsg: string) => void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "complete", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "EnableAlertBeforeBackPageOptions", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "() => void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "buttons", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ActionMenuOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "[Button, Button?, Button?, Button?, Button?, Button?]" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "color", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "Button", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PersistProp", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PersistentStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "key", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "defaultValue", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/list.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "editMode", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ListAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "boolean", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "ListAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replace", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "path", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "RouterState", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.curves.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "spring", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "curves", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "velocity", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "mass", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "stiffness", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "damping", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "string" + }, + "import_path": [ + "@ohos.curves", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "RouterState", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "RouterState", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "MD", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "SizeType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "3" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/bundle/elementName.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "abilityName", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ElementName", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "elementName" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/ability_component.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AbilityComponentAttribute", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "AbilityComponentAttribute", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "params", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "RouterOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "Object" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "name", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "RouterState", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "title", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ShowDialogOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "string" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "prompt", + "api_type": "NamespaceDeclaration", + "parent_api": [ + { + "api_name": "prompt", + "api_type": "NamespaceDeclaration" + } + ], + "code_kind": 237, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "success", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "EnableAlertBeforeBackPageOptions", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "errMsg", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "(errMsg: string) => void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "DisableAlertBeforeBackPageOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "DisableAlertBeforeBackPageOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Auto", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "SizeType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "0" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ShowToastOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "ShowToastOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@system.prompt" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/ability_component.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onDisconnect", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AbilityComponentAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "() => void", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "AbilityComponentAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "push", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ShowDialogSuccessResponse", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "ShowDialogSuccessResponse", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Prop", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "back", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "BackRouterOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "update", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorResult", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "AnimatorOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.animator", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.matrix4.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "combine", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "matrix4", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "Matrix4Transit", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Matrix4Transit" + }, + "import_path": [ + "@ohos.matrix4", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/alphabet_indexer.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onSelected", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AlphabetIndexerAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "(index: number) => void", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "AlphabetIndexerAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showToast", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "prompt", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ShowToastOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "disableAlertBeforeBackPage", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "disableAlertBeforeBackPage", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "DisableAlertBeforeBackPageOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "EnvProp", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Environment", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "key", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "value", + "type": "S", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "boolean" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "IsMutable", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "boolean" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "XS", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "SizeType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "1" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "EnableAlertBeforeBackPageOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "EnableAlertBeforeBackPageOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "complete", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DisableAlertBeforeBackPageOptions", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "() => void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "duration", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ShowToastOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "number" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Get", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "T | undefined" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Keys", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PersistentStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "Array" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "index", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "RouterState", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "number" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "text", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "prompt.Button", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/ability_component.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AbilityComponentInstance", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "AbilityComponentAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.matrix4.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "rotate", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "matrix4", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RotateOption", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Matrix4Transit" + }, + "import_path": [ + "@ohos.matrix4", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "success", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "DisableAlertBeforeBackPageOptions", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "errMsg", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "(errMsg: string) => void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "margin", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "GridContainerOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "number | string" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "GridContainerAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "GridContainerInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "GridContainerOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "GridContainerAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PersistProps", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PersistentStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "properties", + "type": "{\n key: string;\n defaultValue: any;\n }[]", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "bottom", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ShowToastOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "string | number" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Keys", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Environment", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "Array" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.matrix4.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "copy", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "matrix4", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "Matrix4Transit" + }, + "import_path": [ + "@ohos.matrix4", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "title", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "prompt.ActionMenuOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "string" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/grid_container.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "gutter", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "GridContainerOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "number | string" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/bundle/elementName.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "deviceId", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ElementName", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "string" + }, + "import_path": [ + "elementName" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "EnvProps", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Environment", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "props", + "type": "{\n key: string;\n defaultValue: any;\n }[]", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Clear", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "boolean" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "replace", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "clear", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "Router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "void" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "uri", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "BackRouterOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "string" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/rect.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "RectInStance", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "RectAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.curves.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "init", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "curves", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "curve", + "type": "Curve", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "string" + }, + "import_path": [ + "@ohos.curves", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.app.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "screenOnVisible", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "App", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "ScreenOnVisibleOptions", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.app", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Delete", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "propName", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "boolean" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/common_ts_ets_api.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Size", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AppStorage", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "number" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/bundle/elementName.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "bundleName", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ElementName", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "elementName" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "message", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "ShowDialogOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "string" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.matrix4.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "translate", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "matrix4", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "TranslateOption", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "Matrix4Transit" + }, + "import_path": [ + "@ohos.matrix4", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ShowToastOptions", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "prompt.ShowToastOptions", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@ohos.prompt", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "push", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "router", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "options", + "type": "RouterOptions", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@ohos.router", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Router", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "Router", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "uri", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "RouterOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/@system.router.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "message", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "EnableAlertBeforeBackPageOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "string" + }, + "import_path": [ + "@system.router" + ], + "is_global": false + }, + { + "file_path": "api/bundle/elementName.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ElementName", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "ElementName", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "elementName" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Mini", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "PanelMode", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "0" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PanelMode", + "api_type": "EnumDeclaration", + "parent_api": [ + { + "api_name": "PanelMode", + "api_type": "" + } + ], + "code_kind": 241, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Half", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "PanelMode", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "1" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Full", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "PanelMode", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "2" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/inspector.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getInspectorNodes", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "object" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onrepeat", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorResult", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "() => void" + }, + "import_path": [ + "@ohos.animator", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "oncancel", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorResult", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "() => void" + }, + "import_path": [ + "@ohos.animator", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onfinish", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorResult", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [], + "method_return_type": "() => void" + }, + "import_path": [ + "@ohos.animator", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onframe", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorResult", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "progress", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "(progress: number) => void" + }, + "import_path": [ + "@ohos.animator", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/grid.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onScroll", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "GridAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "(scrollOffset: number)", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "GridAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onChange", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "(width: number)", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PanelInstance", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Panel", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "PanelInterface" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onHeightChange", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "callback", + "type": "(value: number)", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showCloseIcon", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "boolean", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "backgroundMask", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "color", + "type": "ResourceColor", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "show", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "boolean", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "miniHeight", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number | string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "halfHeight", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number | string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "fullHeight", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number | string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "customHeight", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Dimension | PanelHeight", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "dragBar", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "boolean", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "type", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "PanelType", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "mode", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "PanelMode", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PanelAttribute", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "PanelAttribute", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PanelAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "PanelInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "show", + "type": "boolean", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "PanelAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PanelInterface", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "PanelInterface", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "WRAP_CONTENT", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "PanelHeight", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "0" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PanelHeight", + "api_type": "EnumDeclaration", + "parent_api": [ + { + "api_name": "PanelHeight", + "api_type": "" + } + ], + "code_kind": 241, + "api_optional": false + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "CUSTOM", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "PanelType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "3" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Temporary", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "PanelType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "2" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Foldable", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "PanelType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "1" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Minibar", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "PanelType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "0" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/panel.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "PanelType", + "api_type": "EnumDeclaration", + "parent_api": [ + { + "api_name": "PanelType", + "api_type": "" + } + ], + "code_kind": 241, + "api_optional": false + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/refresh.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "friction", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "RefreshOptions", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": true, + "method_return_type": "number | string" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/common/full/global.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "createLocalParticleAbility", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "name", + "type": "string", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/common/lite/global.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "createLocalParticleAbility", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "name", + "type": "string", + "is_optional": true, + "has_default": false + } + ], + "method_return_type": "any" + }, + "import_path": [ + "global" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/inspector.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "getInspectorNodeById", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "id", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "object" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AnimatorAttribute", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AnimatorAttribute", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "playMode", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "PlayMode", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AnimatorInterface", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "duration", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "motion", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "SpringMotion | FrictionMotion | ScrollMotion", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "delay", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onRepeat", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "()", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "state", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "AnimationStatus", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "iterations", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onPause", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "()", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onStart\n\n", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "()", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "curve\n", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorInterface", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Curve", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "Animator", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "AnimatorInterface" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "AnimatorInstance", + "api_type": "PropertySignature", + "parent_api": [ + { + "api_name": "unnamed", + "api_type": "" + } + ], + "code_kind": 156, + "api_optional": false, + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onFinish", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "() => void", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onCancel", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "()", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "fillMode", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "FillMode", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "onFrame", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "AnimatorAttribute", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "event", + "type": "(value: number)", + "is_optional": false, + "has_default": true + } + ], + "method_return_type": "AnimatorAttribute" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "constructor", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "ScrollMotion", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "position", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "velocity", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "min", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "max", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "prop", + "type": "SpringProp", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "SpringProp)" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "constructor", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "SpringMotion", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "start", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "end", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "velocity", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "prop", + "type": "SpringProp", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "SpringProp)" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "SpringProp", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "SpringProp", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "constructor", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "FrictionMotion", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "friction", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "position", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "velocity", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "number)" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts\n", + "api_info": { + "line": 1, + "problem": "", + "api_name": "FrictionMotion", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "FrictionMotion", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "SpringMotion", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "ScrollMotion", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "ScrollMotion", + "api_type": "ClassDeclaration", + "parent_api": [ + { + "api_name": "ScrollMotion", + "api_type": "ClassDeclaration" + } + ], + "code_kind": 239, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@internal/component/ets/animator.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "constructor", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "SpringProp", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "mass", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "stiffness", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "damping", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "number)" + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@system.prompt.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "showToast", + "api_type": "InterfaceDeclaration", + "parent_api": [ + { + "api_name": "Prompt", + "api_type": "" + } + ], + "code_kind": 240, + "api_optional": false, + "method_return_type": "" + }, + "import_path": [ + "@system.prompt" + ], + "is_global": false + }, + { + "file_path": "api/@system.app.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "setImageRawDataCacheSize", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "App", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.app", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.app.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "setImageCacheCount", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "App", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.app", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@system.app.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "setImageFileCacheSize", + "api_type": "MethodSignature", + "parent_api": [ + { + "api_name": "App", + "api_type": "" + } + ], + "code_kind": 173, + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "method_return_type": "void" + }, + "import_path": [ + "@system.app", + "@kit.ArkUI" + ], + "is_global": false + }, + { + "file_path": "api/@internal/component/ets/enums.d.ts", + "api_info": { + "line": 1, + "problem": "", + "api_name": "NODE", + "api_type": "EnumMember", + "parent_api": [ + { + "api_name": "XComponentType", + "api_type": "" + } + ], + "code_kind": 242, + "api_optional": false, + "method_return_type": "3" + }, + "import_path": [], + "is_global": true + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/src/lib/utils/TsUtils.ts b/ets2panda/linter/src/lib/utils/TsUtils.ts index 5b3fabffbf..917c7e605d 100644 --- a/ets2panda/linter/src/lib/utils/TsUtils.ts +++ b/ets2panda/linter/src/lib/utils/TsUtils.ts @@ -1361,13 +1361,18 @@ export class TsUtils { parentSymbolCache = new Map(); - getParentSymbolName(symbol: ts.Symbol): string | undefined { + getParentSymbolName(symbol: ts.Symbol | undefined): string | undefined { + if (!symbol) { + return undefined; + } const cached = this.parentSymbolCache.get(symbol); if (cached) { return cached; } - const name = this.tsTypeChecker.getFullyQualifiedName(symbol); + const fullName = this.tsTypeChecker.getFullyQualifiedName(symbol); + const match = fullName.match(/['"](.*)['"]\.(.*)/); + const name = match ? match[2] : fullName; const dotPosition = name.lastIndexOf('.'); const result = dotPosition === -1 ? undefined : name.substring(0, dotPosition); this.parentSymbolCache.set(symbol, result); diff --git a/ets2panda/linter/src/lib/utils/consts/DeprecateWhiteList.ts b/ets2panda/linter/src/lib/utils/consts/DeprecateWhiteList.ts new file mode 100644 index 0000000000..0cdf0e2aba --- /dev/null +++ b/ets2panda/linter/src/lib/utils/consts/DeprecateWhiteList.ts @@ -0,0 +1,27 @@ +/* + * 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 enum DeprecateProblem { + NoDeprecatedApi = 'NoDeprecatedApi' +} + +export enum DEPRECATE_CHECK_KEY { + PARENT_NAME = 'parentName', + PARAM_SET = 'parameters', + RETURN_TYPE = 'returnType', + FILE_NAME = 'fileName' +} + +export const DEPRECATE_UNNAMED = 'unnamed'; diff --git a/ets2panda/linter/src/lib/utils/consts/DeprecatedApi.ts b/ets2panda/linter/src/lib/utils/consts/DeprecatedApi.ts new file mode 100644 index 0000000000..fc29b7df09 --- /dev/null +++ b/ets2panda/linter/src/lib/utils/consts/DeprecatedApi.ts @@ -0,0 +1,66 @@ +/* + * 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 const propertyAccessReplacements = new Map([ + ['TextPickerDialog.show', 'showTextPickerDialog'], + ['DatePickerDialog.show', 'showDatePickerDialog'], + ['ActionSheet.show', 'showActionSheet'], + ['AlertDialog.show', 'showAlertDialog'], + ['componentSnapshot.createFromBuilder', 'getComponentSnapshot().createFromBuilder'], + ['componentSnapshot.get', 'getComponentSnapshot().get'], + ['MeasureText.measureTextSize', 'createMeasureText.measureTextSize'], + ['MeasureText.measureText', 'createMeasureText.measureText'], + ['dragController.getDragPreview', 'createDragController.getDragPreview'], + ['dragController.createDragAction', 'createDragController.createDragAction'], + ['dragController.executeDrag', 'createDragController.executeDrag'], + ['LocalStorage.getShared', 'getSharedLocalStorage'], + ['inspector.createComponentObserver', 'createInspector.createComponentObserver'], + ['Animator.create', 'createAnimator'], + ['mediaquery.matchMediaSync', 'createMediaQuery.matchMediaSync'], + ['componentUtils.getRectangleById', 'getComponentUtils().getRectangleById'], + ['promptAction.showToast', 'getPromptAction.showToast'], + ['promptAction.showDialog', 'getPromptAction.showDialog'], + ['promptAction.openCustomDialog', 'getPromptAction.openCustomDialog'], + ['promptAction.closeCustomDialog', 'getPromptAction.closeCustomDialog'], + ['promptAction.showActionMenu', 'getPromptAction.showActionMenu'], + ['TimePickerDialog.show', 'showTimePickerDialog'], + ['router.pushUrl', 'getRouter.pushUrl'], + ['router.replaceUrl', 'getRouter.replaceUrl'], + ['router.back', 'getRouter.back'], + ['router.clear', 'getRouter.clear'], + ['router.getLength', 'getRouter.getLength'], + ['router.getState', 'getRouter.getState'], + ['router.getStateByIndex', 'getRouter.getStateByIndex'], + ['router.getStateByUrl', 'getRouter.getStateByUrl'], + ['router.showAlertBeforeBackPage', 'getRouter.showAlertBeforeBackPage'], + ['router.hideAlertBeforeBackPage', 'getRouter.hideAlertBeforeBackPage'], + ['router.getParams', 'getRouter.getParams'], + ['router.pushNamedRoute', 'getRouter.pushNamedRoute'], + ['router.replaceNamedRoute', 'getRouter.replaceNamedRoute'], + ['font.registerFont', 'createFont.registerFont'], + ['font.getSystemFontList', 'createFont.getSystemFontList'], + ['font.getFontByName', 'createFont.getFontByName'] +]); + +export const identifierReplacements = new Map([ + ['px2lpx', 'px2lpx'], + ['lpx2px', 'lpx2px'], + ['px2fp', 'px2fp'], + ['fp2px', 'fp2px'], + ['px2vp', 'px2vp'], + ['vp2px', 'vp2px'], + ['getContext', 'getHostContext'], + ['animateTo', 'animateTo'] +]); diff --git a/ets2panda/linter/test/deprecatedapi/Back.ets b/ets2panda/linter/test/deprecatedapi/Back.ets new file mode 100755 index 0000000000..9f52ca7248 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Back.ets @@ -0,0 +1,33 @@ +/* + * 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 { NavigationType } from './sdk/api/navigator' + +@Entry +@Component +struct Index { + build() { + Column() { + Navigator() { + Text('Back') + .fontSize(20) + } + .target('pages/NewPage') + .type(NavigationType.Back) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Back.ets.args.json b/ets2panda/linter/test/deprecatedapi/Back.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Back.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Back.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/Back.ets.arkts2.json new file mode 100755 index 0000000000..953309bf51 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Back.ets.arkts2.json @@ -0,0 +1,88 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 24, + "column": 21, + "endLine": 24, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 5, + "endLine": 21, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 7, + "endLine": 22, + "endColumn": 16, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Navigator\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 9, + "endLine": 23, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 21, + "endLine": 31, + "endColumn": 30, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Back.ets.json b/ets2panda/linter/test/deprecatedapi/Back.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Back.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Baseline.ets b/ets2panda/linter/test/deprecatedapi/Baseline.ets new file mode 100755 index 0000000000..8890bc6380 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Baseline.ets @@ -0,0 +1,45 @@ +/* + * 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 { Edge } from './sdk/api/enums'; + +@Entry +@Component +struct ScrollExample { + scroller: Scroller = new Scroller(); + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .onScrollStop(() => { + const side1 = Edge.Baseline; + console.info('Scroll Stop'); + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Baseline.ets.args.json b/ets2panda/linter/test/deprecatedapi/Baseline.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Baseline.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Baseline.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/Baseline.ets.arkts2.json new file mode 100755 index 0000000000..650f2fd5a3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Baseline.ets.arkts2.json @@ -0,0 +1,288 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 28, + "endLine": 20, + "endColumn": 36, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 28, + "endLine": 21, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 31, + "endLine": 21, + "endColumn": 32, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 34, + "endLine": 21, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 37, + "endLine": 21, + "endColumn": 38, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 40, + "endLine": 21, + "endColumn": 41, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 43, + "endLine": 21, + "endColumn": 44, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 46, + "endLine": 21, + "endColumn": 47, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 49, + "endLine": 21, + "endColumn": 50, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 52, + "endLine": 21, + "endColumn": 53, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 55, + "endLine": 21, + "endColumn": 56, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 23, + "endLine": 30, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 29, + "endLine": 32, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 25, + "endLine": 33, + "endColumn": 27, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 30, + "endLine": 35, + "endColumn": 32, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 15, + "endLine": 40, + "endColumn": 36, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 13, + "endLine": 20, + "endColumn": 21, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Scroller\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 28, + "endLine": 20, + "endColumn": 36, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Scroller\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 5, + "endLine": 24, + "endColumn": 10, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Stack\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 27, + "endLine": 24, + "endColumn": 36, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Alignment\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 7, + "endLine": 25, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Scroll\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 9, + "endLine": 26, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 11, + "endLine": 27, + "endColumn": 18, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ForEach\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 13, + "endLine": 28, + "endColumn": 17, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 26, + "endLine": 34, + "endColumn": 35, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TextAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Baseline.ets.json b/ets2panda/linter/test/deprecatedapi/Baseline.ets.json new file mode 100755 index 0000000000..a8df15b58d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Baseline.ets.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 40, + "column": 15, + "endLine": 40, + "endColumn": 36, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/COMPONENT.ets b/ets2panda/linter/test/deprecatedapi/COMPONENT.ets new file mode 100755 index 0000000000..04819456ce --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/COMPONENT.ets @@ -0,0 +1,42 @@ +/* + * 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 { XComponentType } from './sdk/api/enums'; + +@Entry +@Component +struct Index { + @State isLock: boolean = true; + @State xc_width: number = 500; + @State xc_height: number = 700; + myXComponentController: XComponentController = new MyXComponentController(); + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + XComponent({ + id: "XComponent", + type: XComponentType.COMPONENT, + controller: this.myXComponentController + }) + .onLoad(() => { + let surfaceRotation: SurfaceRotationOptions = { lock: this.isLock }; + this.myXComponentController.setXComponentSurfaceRotation(surfaceRotation); + console.log("getXComponentSurfaceRotation lock = " + + this.myXComponentController.getXComponentSurfaceRotation().lock); + }) + .width(this.xc_width) + .height(this.xc_height) + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/COMPONENT.ets.args.json b/ets2panda/linter/test/deprecatedapi/COMPONENT.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/COMPONENT.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/COMPONENT.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/COMPONENT.ets.arkts2.json new file mode 100755 index 0000000000..a9c5682655 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/COMPONENT.ets.arkts2.json @@ -0,0 +1,188 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 21, + "column": 29, + "endLine": 21, + "endColumn": 32, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 30, + "endLine": 22, + "endColumn": 33, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 54, + "endLine": 23, + "endColumn": 76, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 30, + "endLine": 29, + "endColumn": 39, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 4, + "endLine": 21, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 4, + "endLine": 22, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 27, + "endLine": 23, + "endColumn": 47, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"XComponentController\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 5, + "endLine": 26, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Flex\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 23, + "endLine": 26, + "endColumn": 36, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexDirection\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 37, + "endLine": 26, + "endColumn": 43, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 57, + "endLine": 26, + "endColumn": 66, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ItemAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 91, + "endLine": 26, + "endColumn": 100, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 7, + "endLine": 27, + "endColumn": 17, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"XComponent\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 32, + "endLine": 33, + "endColumn": 54, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SurfaceRotationOptions\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/COMPONENT.ets.json b/ets2panda/linter/test/deprecatedapi/COMPONENT.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/COMPONENT.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets b/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets new file mode 100755 index 0000000000..24c939c273 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets @@ -0,0 +1,32 @@ +/* + * 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 { CopyOptions } from './sdk/api/enums'; + +@Component +struct child { + @Link customPopup: boolean + build() { + Column({ space: 10 }) { + Text('CROSS_DEVICE') + .copyOption(CopyOptions.CROSS_DEVICE) + .borderWidth(1) + .gesture(LongPressGesture({ repeat: true }) + .onActionEnd((event: GestureEvent) => { + this.customPopup = !this.customPopup + }) + ) + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.args.json b/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.arkts2.json new file mode 100755 index 0000000000..04f3aa0ea0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.arkts2.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 21, + "column": 21, + "endLine": 21, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 22, + "endLine": 24, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 4, + "endLine": 19, + "endColumn": 8, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Link\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 5, + "endLine": 21, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 7, + "endLine": 22, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 18, + "endLine": 25, + "endColumn": 34, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"LongPressGesture\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 32, + "endLine": 26, + "endColumn": 44, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"GestureEvent\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.json b/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/CROSS_DEVICE.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/DeleteProp.ets b/ets2panda/linter/test/deprecatedapi/DeleteProp.ets new file mode 100755 index 0000000000..b5530beaf7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/DeleteProp.ets @@ -0,0 +1,17 @@ +/* + * 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 { PersistentStorage } from './sdk/api/common_ts_ets_api'; + +PersistentStorage.DeleteProp('data1') \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/DeleteProp.ets.args.json b/ets2panda/linter/test/deprecatedapi/DeleteProp.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/DeleteProp.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/DeleteProp.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/DeleteProp.ets.arkts2.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/DeleteProp.ets.arkts2.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/DeleteProp.ets.json b/ets2panda/linter/test/deprecatedapi/DeleteProp.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/DeleteProp.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets b/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets new file mode 100755 index 0000000000..20a4233eb7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets @@ -0,0 +1,30 @@ +/* + * 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 router from './sdk/api/@system.router'; + +class L{ + enableAlertBeforeBackPage() { + router.enableAlertBeforeBackPage({ + message: 'Message Info', + success: ()=> { + console.log('success'); + }, + cancel: ()=> { + console.log('cancel'); + } + }); + } +} +export default new L() \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.arkts2.json new file mode 100755 index 0000000000..ad1e3864f5 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.arkts2.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 12, + "endLine": 19, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.json b/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/EnableAlertBeforeBackPageOptions_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Link.ets b/ets2panda/linter/test/deprecatedapi/Link.ets new file mode 100755 index 0000000000..9f9a1cbd12 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Link.ets @@ -0,0 +1,18 @@ +/* + * 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 { AppStorage } from './sdk/api/common_ts_ets_api'; + +AppStorage.setOrCreate('PropA', 47); +let link1: SubscribedAbstractProperty = AppStorage.Link('PropA'); \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Link.ets.args.json b/ets2panda/linter/test/deprecatedapi/Link.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Link.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Link.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/Link.ets.arkts2.json new file mode 100755 index 0000000000..b0b238ec95 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Link.ets.arkts2.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 33, + "endLine": 17, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 12, + "endLine": 18, + "endColumn": 38, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SubscribedAbstractProperty\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Link.ets.json b/ets2panda/linter/test/deprecatedapi/Link.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Link.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/NavigationType.ets b/ets2panda/linter/test/deprecatedapi/NavigationType.ets new file mode 100755 index 0000000000..8c49764146 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/NavigationType.ets @@ -0,0 +1,47 @@ +/* + * 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 { NavigationType } from './sdk/api/navigator' + +@Entry +@Component +struct Index { + build() { + Column() { + Navigator() { + Text('Replace') + .fontSize(20) + } + .target('pages/NewPage') + .type(NavigationType.Replace) + + Navigator() { + Text('Back') + .fontSize(20) + } + .target('pages/NewPage') + .type(NavigationType.Back) + + Navigator() { + Text('Push') + .fontSize(20) + } + .target('pages/NewPage') + .type(NavigationType.Push) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/NavigationType.ets.args.json b/ets2panda/linter/test/deprecatedapi/NavigationType.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/NavigationType.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/NavigationType.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/NavigationType.ets.arkts2.json new file mode 100755 index 0000000000..2300ab1d15 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/NavigationType.ets.arkts2.json @@ -0,0 +1,148 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 24, + "column": 21, + "endLine": 24, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 21, + "endLine": 31, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 21, + "endLine": 38, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 5, + "endLine": 21, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 7, + "endLine": 22, + "endColumn": 16, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Navigator\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 9, + "endLine": 23, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 7, + "endLine": 29, + "endColumn": 16, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Navigator\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 9, + "endLine": 30, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 7, + "endLine": 36, + "endColumn": 16, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Navigator\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 9, + "endLine": 37, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 21, + "endLine": 45, + "endColumn": 30, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/NavigationType.ets.json b/ets2panda/linter/test/deprecatedapi/NavigationType.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/NavigationType.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Push.ets b/ets2panda/linter/test/deprecatedapi/Push.ets new file mode 100755 index 0000000000..a357e4445b --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Push.ets @@ -0,0 +1,33 @@ +/* + * 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 { NavigationType } from './sdk/api/navigator' + +@Entry +@Component +struct Index { + build() { + Column() { + Navigator() { + Text('Push') + .fontSize(20) + } + .target('pages/NewPage') + .type(NavigationType.Push) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Push.ets.args.json b/ets2panda/linter/test/deprecatedapi/Push.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Push.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Push.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/Push.ets.arkts2.json new file mode 100755 index 0000000000..953309bf51 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Push.ets.arkts2.json @@ -0,0 +1,88 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 24, + "column": 21, + "endLine": 24, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 5, + "endLine": 21, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 7, + "endLine": 22, + "endColumn": 16, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Navigator\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 9, + "endLine": 23, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 21, + "endLine": 31, + "endColumn": 30, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Push.ets.json b/ets2panda/linter/test/deprecatedapi/Push.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Push.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Replace.ets b/ets2panda/linter/test/deprecatedapi/Replace.ets new file mode 100755 index 0000000000..c6ce7e7b51 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Replace.ets @@ -0,0 +1,34 @@ +/* + * 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 { NavigationType } from './sdk/api/navigator' + +@Entry +@Component +struct Index { + build() { + Column() { + Navigator() { + Text('Replace') + .fontSize(20) + } + .target('pages/NewPage') + .type(NavigationType.Replace) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Replace.ets.args.json b/ets2panda/linter/test/deprecatedapi/Replace.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Replace.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Replace.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/Replace.ets.arkts2.json new file mode 100755 index 0000000000..bab7d6fb70 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Replace.ets.arkts2.json @@ -0,0 +1,88 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 25, + "column": 21, + "endLine": 25, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 2, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 5, + "endLine": 22, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 16, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Navigator\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 9, + "endLine": 24, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 21, + "endLine": 32, + "endColumn": 30, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/Replace.ets.json b/ets2panda/linter/test/deprecatedapi/Replace.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/Replace.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SM.ets b/ets2panda/linter/test/deprecatedapi/SM.ets new file mode 100755 index 0000000000..22de541ee1 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SM.ets @@ -0,0 +1,29 @@ +/* + * 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 { SizeType } from './sdk/api/grid_container' + +@Entry +@Component +struct GridContainerExample { + @State sizeType: SizeType = SizeType.XS + + build() { + Column({ space: 5 }) { + Row() { + Button('SM').onClick(() => { this.sizeType = SizeType.SM }) + } + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SM.ets.args.json b/ets2panda/linter/test/deprecatedapi/SM.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SM.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SM.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/SM.ets.arkts2.json new file mode 100755 index 0000000000..a381e90b98 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SM.ets.arkts2.json @@ -0,0 +1,128 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 31, + "endLine": 20, + "endColumn": 39, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 40, + "endLine": 20, + "endColumn": 42, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 21, + "endLine": 23, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 54, + "endLine": 25, + "endColumn": 62, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 63, + "endLine": 25, + "endColumn": 65, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 5, + "endLine": 23, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 10, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 9, + "endLine": 25, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SM.ets.json b/ets2panda/linter/test/deprecatedapi/SM.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SM.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SetAndLink.ets b/ets2panda/linter/test/deprecatedapi/SetAndLink.ets new file mode 100755 index 0000000000..ebd4cd5e16 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SetAndLink.ets @@ -0,0 +1,18 @@ +/* + * 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 { AppStorage } from './sdk/api/common_ts_ets_api'; + +AppStorage.setOrCreate('PropA', 47); +let link1: SubscribedAbstractProperty = AppStorage.SetAndLink('PropB', 49); \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SetAndLink.ets.args.json b/ets2panda/linter/test/deprecatedapi/SetAndLink.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SetAndLink.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SetAndLink.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/SetAndLink.ets.arkts2.json new file mode 100755 index 0000000000..7bebb6545e --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SetAndLink.ets.arkts2.json @@ -0,0 +1,48 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 33, + "endLine": 17, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 80, + "endLine": 18, + "endColumn": 82, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 12, + "endLine": 18, + "endColumn": 38, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SubscribedAbstractProperty\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SetAndLink.ets.json b/ets2panda/linter/test/deprecatedapi/SetAndLink.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SetAndLink.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SizeType.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/SizeType.ets.arkts2.json new file mode 100755 index 0000000000..b0bd84bb5e --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SizeType.ets.arkts2.json @@ -0,0 +1,198 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 31, + "endLine": 20, + "endColumn": 39, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 21, + "endLine": 23, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 66, + "endLine": 24, + "endColumn": 67, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 29, + "endLine": 28, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 29, + "endLine": 32, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 29, + "endLine": 36, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 29, + "endLine": 40, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 35, + "endLine": 43, + "endColumn": 36, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 5, + "endLine": 23, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 7, + "endLine": 25, + "endColumn": 10, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 9, + "endLine": 26, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 9, + "endLine": 30, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 9, + "endLine": 34, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 9, + "endLine": 38, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/SizeType.ets.json b/ets2panda/linter/test/deprecatedapi/SizeType.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/SizeType.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/UIContext.ets b/ets2panda/linter/test/deprecatedapi/UIContext.ets new file mode 100644 index 0000000000..66787ce456 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/UIContext.ets @@ -0,0 +1,39 @@ +/* + * 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 { promptAction } from '@kit.ArkUI'; + +try { + promptAction.showActionMenu({ //error + title: 'Title Info', + buttons: [ + { + text: 'item1', + color: '#666666' + }, + { + text: 'item2', + color: '#000000' + }, + ] + }, (err, data) => { + if (err) { + console.info('showActionMenu err: ' + err); + return; + } + console.info('showActionMenu success callback, click button: ' + data.index); + }) +} catch (error) { +}; \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/UIContext.ets.json b/ets2panda/linter/test/deprecatedapi/UIContext.ets.json new file mode 100644 index 0000000000..f4da0d367f --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/UIContext.ets.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 31, + "column": 7, + "endLine": 31, + "endColumn": 10, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 12, + "endLine": 31, + "endColumn": 16, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ability_component.ets b/ets2panda/linter/test/deprecatedapi/ability_component.ets new file mode 100755 index 0000000000..ecc3810d1d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ability_component.ets @@ -0,0 +1,36 @@ +/* + * 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. + */ + +@Entry +@Component +struct MyComponent { + + build() { + Column() { + AbilityComponent({ // error + want: { + bundleName: '', + abilityName: '' + }, + }) + .onConnect(() => { // error + console.log('AbilityComponent connect') + }) + .onDisconnect(() => { // error + console.log('AbilityComponent disconnect') + }) + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ability_component.ets.args.json b/ets2panda/linter/test/deprecatedapi/ability_component.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ability_component.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/ability_component.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/ability_component.ets.arkts2.json new file mode 100755 index 0000000000..977dd1e591 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ability_component.ets.arkts2.json @@ -0,0 +1,58 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 16, + "column": 2, + "endLine": 16, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 5, + "endLine": 21, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 7, + "endLine": 22, + "endColumn": 23, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AbilityComponent\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ability_component.ets.json b/ets2panda/linter/test/deprecatedapi/ability_component.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ability_component.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/action_sheet.ets b/ets2panda/linter/test/deprecatedapi/action_sheet.ets new file mode 100644 index 0000000000..57437a6e3d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/action_sheet.ets @@ -0,0 +1,77 @@ +/* + * 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 { ActionSheet } from './sdk/api/action_sheet' + +@Entry +@Component +struct ActionSheetExample { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Button('Click to Show ActionSheet') + .onClick(() => { + ActionSheet.show({ //error + title: 'ActionSheet title', + subtitle: 'ActionSheet subtitle', + message: 'message', + autoCancel: true, + confirm: { + defaultFocus: true, + value: 'Confirm button', + action: () => { + console.info('Get Alert Dialog handled'); + } + }, + cancel: () => { + console.info('actionSheet canceled'); + }, + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + console.info("reason=" + JSON.stringify(dismissDialogAction.reason)) + console.info("dialog onWillDismiss"); + if (dismissDialogAction.reason === DismissReason.PRESS_BACK) { + dismissDialogAction.dismiss(); + } + if (dismissDialogAction.reason === DismissReason.TOUCH_OUTSIDE) { + dismissDialogAction.dismiss(); + } + }, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -10 }, + sheets: [ + { + title: 'apples', + action: () => { + console.info('apples'); + } + }, + { + title: 'bananas', + action: () => { + console.info('bananas'); + } + }, + { + title: 'pears', + action: () => { + console.info('pears'); + } + } + ] + }) + }) + }.width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/action_sheet.ets.args.json b/ets2panda/linter/test/deprecatedapi/action_sheet.ets.args.json new file mode 100644 index 0000000000..4acc088d1d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/action_sheet.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/action_sheet.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/action_sheet.ets.arkts2.json new file mode 100644 index 0000000000..0a473b82ff --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/action_sheet.ets.arkts2.json @@ -0,0 +1,168 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 25, + "column": 23, + "endLine": 25, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 27, + "endLine": 51, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 35, + "endLine": 51, + "endColumn": 37, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 2, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 5, + "endLine": 22, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Flex\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 23, + "endLine": 22, + "endColumn": 36, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexDirection\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 37, + "endLine": 22, + "endColumn": 43, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 57, + "endLine": 22, + "endColumn": 66, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ItemAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 91, + "endLine": 22, + "endColumn": 100, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 50, + "endLine": 40, + "endColumn": 69, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"DismissDialogAction\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 50, + "endLine": 43, + "endColumn": 63, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"DismissReason\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 50, + "endLine": 46, + "endColumn": 63, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"DismissReason\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 24, + "endLine": 50, + "endColumn": 39, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"DialogAlignment\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/action_sheet.ets.json b/ets2panda/linter/test/deprecatedapi/action_sheet.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/action_sheet.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/alert_dialog.ets b/ets2panda/linter/test/deprecatedapi/alert_dialog.ets new file mode 100644 index 0000000000..f6e0d243ff --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/alert_dialog.ets @@ -0,0 +1,54 @@ +/* + * 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 { AlertDialog } from './sdk/api/alert_dialog' + +@Entry +@Component +struct AlertDialogExample { + build() { + Column({ space: 5 }) { + Button('AlertDialog Set Duration') + .onClick(() => { + AlertDialog.show( //error + { + title: 'AlertDialog 1', + message: 'Set Animation Duration open 3 second, close 100ms', + autoCancel: true, + alignment: DialogAlignment.Top, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + transition: TransitionEffect.asymmetric(TransitionEffect.OPACITY + .animation({ duration: 3000, curve: Curve.Sharp }) + .combine(TransitionEffect.scale({ x: 1.5, y: 1.5 }).animation({ duration: 3000, curve: Curve.Sharp })), + TransitionEffect.OPACITY.animation({ duration: 100, curve: Curve.Smooth }) + .combine(TransitionEffect.scale({ x: 0.5, y: 0.5 }) + .animation({ duration: 100, curve: Curve.Smooth }))), + confirm: { + value: 'button', + action: () => { + console.info('Button-clicking callback'); + } + }, + cancel: () => { + console.info('Closed callbacks'); + } + } + ) + }) + .backgroundColor(0x317aff).height("88px") + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/alert_dialog.ets.args.json b/ets2panda/linter/test/deprecatedapi/alert_dialog.ets.args.json new file mode 100644 index 0000000000..4acc088d1d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/alert_dialog.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/alert_dialog.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/alert_dialog.ets.arkts2.json new file mode 100644 index 0000000000..4d05639b3c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/alert_dialog.ets.arkts2.json @@ -0,0 +1,258 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 22, + "column": 21, + "endLine": 22, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 23, + "endLine": 25, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 29, + "endLine": 31, + "endColumn": 30, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 37, + "endLine": 31, + "endColumn": 39, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 26, + "endLine": 32, + "endColumn": 27, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 40, + "endLine": 34, + "endColumn": 44, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 91, + "endLine": 35, + "endColumn": 95, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 64, + "endLine": 36, + "endColumn": 67, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 44, + "endLine": 38, + "endColumn": 47, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 35, + "endLine": 52, + "endColumn": 36, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 2, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 5, + "endLine": 22, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 26, + "endLine": 30, + "endColumn": 41, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"DialogAlignment\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 27, + "endLine": 33, + "endColumn": 43, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TransitionEffect\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 55, + "endLine": 33, + "endColumn": 71, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TransitionEffect\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 53, + "endLine": 34, + "endColumn": 58, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Curve\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 26, + "endLine": 35, + "endColumn": 42, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TransitionEffect\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 104, + "endLine": 35, + "endColumn": 109, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Curve\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 17, + "endLine": 36, + "endColumn": 33, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TransitionEffect\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 76, + "endLine": 36, + "endColumn": 81, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Curve\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 28, + "endLine": 37, + "endColumn": 44, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TransitionEffect\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 56, + "endLine": 38, + "endColumn": 61, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Curve\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/alert_dialog.ets.json b/ets2panda/linter/test/deprecatedapi/alert_dialog.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/alert_dialog.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets b/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets new file mode 100755 index 0000000000..7d19ba33f6 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets @@ -0,0 +1,138 @@ +/* + * 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. + */ + +@Entry +@Component +struct AlphabetIndexerSample { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State customBlurStyle: BlurStyle = BlurStyle.NONE; + + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('30%') + .height('100%') + + + Column() { + Column() { + Text('切换模糊材质: ') + .fontSize(24) + .fontColor(0xcccccc) + .width('100%') + Button('COMPONENT_REGULAR') + .margin('5vp') + .width(200) + .onClick(() => { + this.customBlurStyle = BlurStyle.COMPONENT_REGULAR; + }) + Button('BACKGROUND_THIN') + .margin('5vp') + .width(200) + .onClick(() => { + this.customBlurStyle = BlurStyle.BACKGROUND_THIN; + }) + }.height('20%') + + + Column() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .usingPopup(true) + .alignStyle(IndexerAlign.Left) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(this.customBlurStyle) + .popupTitleBackground(0xCCCCCC) + .onSelected((index: number) => { // error + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .height('80%') + } + .width('70%') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.args.json b/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.args.json new file mode 100755 index 0000000000..d2e3845018 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.args.json @@ -0,0 +1,20 @@ + +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.arkts2.json new file mode 100755 index 0000000000..0abecc7d64 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.arkts2.json @@ -0,0 +1,548 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 33, + "column": 23, + "endLine": 33, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 41, + "endLine": 33, + "endColumn": 42, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 27, + "endLine": 39, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 27, + "endLine": 50, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 61, + "column": 27, + "endLine": 61, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 72, + "column": 27, + "endLine": 72, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 25, + "endLine": 84, + "endColumn": 27, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 22, + "endLine": 89, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 95, + "column": 22, + "endLine": 95, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 103, + "column": 65, + "endLine": 103, + "endColumn": 66, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 106, + "column": 38, + "endLine": 106, + "endColumn": 40, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 107, + "column": 33, + "endLine": 107, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 111, + "column": 41, + "endLine": 111, + "endColumn": 46, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 114, + "column": 32, + "endLine": 114, + "endColumn": 37, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 116, + "column": 39, + "endLine": 116, + "endColumn": 44, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 118, + "column": 39, + "endLine": 118, + "endColumn": 44, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 120, + "column": 39, + "endLine": 120, + "endColumn": 44, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 123, + "column": 26, + "endLine": 123, + "endColumn": 28, + "problem": "NosparseArray", + "suggest": "", + "rule": "Sparse array is not supported in ArkTS1.2 (arkts-no-sparse-array)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 2, + "endLine": 16, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 4, + "endLine": 27, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 27, + "endLine": 27, + "endColumn": 36, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"BlurStyle\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 39, + "endLine": 27, + "endColumn": 48, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"BlurStyle\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 5, + "endLine": 31, + "endColumn": 10, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Stack\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 27, + "endLine": 31, + "endColumn": 36, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Alignment\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 7, + "endLine": 32, + "endColumn": 10, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 9, + "endLine": 33, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"List\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 11, + "endLine": 34, + "endColumn": 18, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ForEach\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 13, + "endLine": 35, + "endColumn": 21, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ListItem\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 15, + "endLine": 36, + "endColumn": 19, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 28, + "endLine": 40, + "endColumn": 37, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TextAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 11, + "endLine": 45, + "endColumn": 18, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ForEach\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 13, + "endLine": 46, + "endColumn": 21, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ListItem\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 15, + "endLine": 47, + "endColumn": 19, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 28, + "endLine": 51, + "endColumn": 37, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TextAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 11, + "endLine": 56, + "endColumn": 18, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ForEach\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 57, + "column": 13, + "endLine": 57, + "endColumn": 21, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ListItem\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 58, + "column": 15, + "endLine": 58, + "endColumn": 19, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 28, + "endLine": 62, + "endColumn": 37, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TextAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 11, + "endLine": 67, + "endColumn": 18, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ForEach\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 13, + "endLine": 68, + "endColumn": 21, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ListItem\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 15, + "endLine": 69, + "endColumn": 19, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 73, + "column": 28, + "endLine": 73, + "endColumn": 37, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TextAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 81, + "column": 9, + "endLine": 81, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 82, + "column": 11, + "endLine": 82, + "endColumn": 17, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 83, + "column": 13, + "endLine": 83, + "endColumn": 17, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 87, + "column": 13, + "endLine": 87, + "endColumn": 19, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 91, + "column": 40, + "endLine": 91, + "endColumn": 49, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"BlurStyle\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 93, + "column": 13, + "endLine": 93, + "endColumn": 19, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 97, + "column": 40, + "endLine": 97, + "endColumn": 49, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"BlurStyle\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 102, + "column": 11, + "endLine": 102, + "endColumn": 17, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 103, + "column": 13, + "endLine": 103, + "endColumn": 28, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AlphabetIndexer\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 105, + "column": 27, + "endLine": 105, + "endColumn": 39, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"IndexerAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.json b/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/alphabet_indexer.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/animator.ets b/ets2panda/linter/test/deprecatedapi/animator.ets new file mode 100644 index 0000000000..8368d9d9b9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/animator.ets @@ -0,0 +1,28 @@ +/* + * 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 { Animator as animator, AnimatorOptions } from './sdk/api/@ohos.animator'; + +let options: AnimatorOptions = { + duration: 1500, + easing: "friction", + delay: 0, + fill: "forwards", + direction: "normal", + iterations: 3, + begin: 200.0, + end: 400.0 +}; +animator.create(options); //error \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/animator.ets.args.json b/ets2panda/linter/test/deprecatedapi/animator.ets.args.json new file mode 100644 index 0000000000..4acc088d1d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/animator.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/animator.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/animator.ets.arkts2.json new file mode 100644 index 0000000000..acaa0c5600 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/animator.ets.arkts2.json @@ -0,0 +1,68 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 13, + "endLine": 19, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 10, + "endLine": 21, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 15, + "endLine": 24, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 10, + "endLine": 28, + "endColumn": 16, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 18, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Animator\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/animator.ets.json b/ets2panda/linter/test/deprecatedapi/animator.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/animator.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets b/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets new file mode 100755 index 0000000000..1d8f620a9d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets @@ -0,0 +1,33 @@ +/* + * 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 Animator as animator, AnimatorResult from './sdk/api/@ohos.animator'; + +let AnimatorResult: AnimatorResult | undefined = animator.create(options) + +AnimatorResult.onrepeat = () => { //error + console.info("onrepeat callback") +} + +AnimatorResult.oncancel = () => { //error + console.info("oncancel callback") +} + +AnimatorResult.onfinish = () => { //error + console.info("onfinish callback") +} + +AnimatorResult.onframe = (value) => { //error + console.info("onframe callback") +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.arkts2.json new file mode 100755 index 0000000000..438dabb8d3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.arkts2.json @@ -0,0 +1,48 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 15, + "column": 1, + "endLine": 15, + "endColumn": 20, + "problem": "ImportAssignment", + "suggest": "", + "rule": "\"require\" and \"import\" assignment are not supported (arkts-no-require)", + "severity": "ERROR" + }, + { + "line": 15, + "column": 21, + "endLine": 15, + "endColumn": 45, + "problem": "CommaOperator", + "suggest": "", + "rule": "The comma operator \",\" is supported only in \"for\" loops (arkts-no-comma-outside-loops)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 27, + "endLine": 31, + "endColumn": 32, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.json b/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.json new file mode 100755 index 0000000000..438dabb8d3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/animatorResultOnrepeat_api.ets.json @@ -0,0 +1,48 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 15, + "column": 1, + "endLine": 15, + "endColumn": 20, + "problem": "ImportAssignment", + "suggest": "", + "rule": "\"require\" and \"import\" assignment are not supported (arkts-no-require)", + "severity": "ERROR" + }, + { + "line": 15, + "column": 21, + "endLine": 15, + "endColumn": 45, + "problem": "CommaOperator", + "suggest": "", + "rule": "The comma operator \",\" is supported only in \"for\" loops (arkts-no-comma-outside-loops)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 27, + "endLine": 31, + "endColumn": 32, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets b/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets new file mode 100755 index 0000000000..2e73b25e23 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets @@ -0,0 +1,26 @@ +/* + * 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 { AppStorage } from './sdk/api/common_ts_ets_api'; + +AppStorage.SetOrCreate('PropA', 47); +let res: boolean = AppStorage.IsMutable('simpleProp'); //error + +let value: number = AppStorage.Get('PropA') as number; //error + +let res: boolean = AppStorage.Clear(); //error + +let value: boolean = AppStorage.Delete('PropA') as boolean; //error + +let value: number = AppStorage.Size(); //error \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.arkts2.json new file mode 100755 index 0000000000..1fc946dc8d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.arkts2.json @@ -0,0 +1,78 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 33, + "endLine": 17, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 31, + "endLine": 18, + "endColumn": 40, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 32, + "endLine": 20, + "endColumn": 35, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 31, + "endLine": 22, + "endColumn": 36, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 33, + "endLine": 24, + "endColumn": 39, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 32, + "endLine": 26, + "endColumn": 36, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.json b/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/appStorageIsMutable_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets b/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets new file mode 100755 index 0000000000..7ed0caf1a2 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets @@ -0,0 +1,25 @@ +/* + * 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 App from './sdk/api/@system.app'; +import { GridContainerInterface } from './sdk/api/grid_container'; + +export default class Req { + requestFullWindow() { + App.screenOnVisible({ + }); + } +} + +GridContainerInterface.GridContainerAttribute \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.arkts2.json new file mode 100755 index 0000000000..ab3b8aff13 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.arkts2.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 9, + "endLine": 20, + "endColumn": 24, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 24, + "endLine": 25, + "endColumn": 46, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"GridContainerAttribute\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.json b/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/appscreenOnVisible_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets b/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets new file mode 100755 index 0000000000..0a37728e9f --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets @@ -0,0 +1,22 @@ +/* + * 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 router from './sdk/api/@system.router'; + +class H{ + backToDetail() { + router.back({uri:'pages/detail/detail'}); + } +} +export default new H() \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.arkts2.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.arkts2.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.json b/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/backRouterOptionsUri_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/buttons.ets b/ets2panda/linter/test/deprecatedapi/buttons.ets new file mode 100755 index 0000000000..80574cbd32 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/buttons.ets @@ -0,0 +1,37 @@ +/* + * 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 prompt from './sdk/api/@ohos.prompt' + + +prompt.showDialog({ + title: 'showDialog Title Info', + message: 'Message Info', + buttons: [ + { + text: 'button1', + color: '#000000' + }, + { + text: 'button2', + color: '#000000' + } + ] +}, (err, data) => { + if (err) { + console.info('showDialog err: ' + err); + return; + } + console.info('showDialog success callback, click button: ' + data.index); +}); \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/buttons.ets.args.json b/ets2panda/linter/test/deprecatedapi/buttons.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/buttons.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/buttons.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/buttons.ets.arkts2.json new file mode 100644 index 0000000000..30ea0fb4ec --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/buttons.ets.arkts2.json @@ -0,0 +1,88 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 18, + "column": 8, + "endLine": 18, + "endColumn": 18, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 3, + "endLine": 19, + "endColumn": 8, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 3, + "endLine": 20, + "endColumn": 10, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 7, + "endLine": 28, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 5, + "endLine": 31, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 10, + "endLine": 31, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/buttons.ets.json b/ets2panda/linter/test/deprecatedapi/buttons.ets.json new file mode 100644 index 0000000000..9f3ebadfbb --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/buttons.ets.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 31, + "column": 5, + "endLine": 31, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 10, + "endLine": 31, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/chip_group_api.ets b/ets2panda/linter/test/deprecatedapi/chip_group_api.ets new file mode 100755 index 0000000000..ee4e8bf889 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/chip_group_api.ets @@ -0,0 +1,42 @@ +/* + * 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 {ChipGroupItemOptions} from './sdk/api/ChipGroup'; + +@Entry +struct Index { + build() { + Column() { + ChipGroup({ + items: [ + { + prefixIcon: { src: $r('app.media.icon') }, + label: { text: "操作块1" }, + .suffixIcon: { src: $r('sys.media.ohos_ic_public_cut') }, //error + allowClose: false + } + ] + }) + } + } +} +class Test implements ChipGroupItemOptions{ + suffixIcon?: IconOptions | undefined; + get(){ + return this.suffixIcon; + } + set(suffixIcon?: IconOptions | undefined){ + suffixIcon = { src: $r('sys.media.ohos_ic_public_cut') }; + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/chip_group_api.ets.json b/ets2panda/linter/test/deprecatedapi/chip_group_api.ets.json new file mode 100755 index 0000000000..0c1bacf603 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/chip_group_api.ets.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 36, + "column": 3, + "endLine": 36, + "endColumn": 6, + "problem": "LimitedReturnTypeInference", + "suggest": "", + "rule": "Function return type inference is limited (arkts-no-implicit-return-types)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common.ets b/ets2panda/linter/test/deprecatedapi/common.ets new file mode 100644 index 0000000000..12386489df --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common.ets @@ -0,0 +1,71 @@ +/* + * 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. + */ + +@Entry +@Component +struct ClipExample { + build() { + Column({ space: 15 }) { + Row() { + Image($r('app.media.testImg')) + .clip(new Circle({})) //error + + Button() + .transition({ + type: TransitionType.Insert, //error + opacity: 0, //error + translate: {x: 1}, //error + scale: {x: 1}, //error + rotate: {angle: 1} //error + }) + .onClick(() => { + let context: Context = getContext(this); //error + console.info("CacheDir:" + context.cacheDir); + }) + + Button('Touch').height(40).width(100) + .onTouch((event?: TouchEvent) => { + if (event) { + event.touches[0].screenX; //error + event.touches[0].screenY; //error + } + }) + .onClick((event?: ClickEvent) => { + if (event) { + event.screenX; //error + event.screenY; //error + } + }) + .onMouse((event: MouseEvent):void => { + if (event) { + event.screenX; //error + event.screenY; //error + } + }) + } + .borderRadius(20) + } + .width('100%') + .margin({ top: 15 }) + } +} + + +px2lpx(200); //error +lpx2px(200); //error +px2fp(200); //error +fp2px(200); //error +px2vp(200); //error +vp2px(200); //error \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common.ets.json b/ets2panda/linter/test/deprecatedapi/common.ets.json new file mode 100644 index 0000000000..f24a1d0316 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common.ets.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 41, + "column": 13, + "endLine": 41, + "endColumn": 29, + "problem": "PropertyAccessByIndex", + "suggest": "", + "rule": "Indexed access is not supported for fields (arkts-no-props-by-index)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 13, + "endLine": 42, + "endColumn": 29, + "problem": "PropertyAccessByIndex", + "suggest": "", + "rule": "Indexed access is not supported for fields (arkts-no-props-by-index)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_api.ets b/ets2panda/linter/test/deprecatedapi/common_api.ets new file mode 100755 index 0000000000..142187d98c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_api.ets @@ -0,0 +1,139 @@ +/* + * 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 {DragEvent,CustomPopupOptions} from './sdk/api/common'; +import {LayoutInfo,LayoutChild,LayoutBorderInfo,TransitionOptions} from './sdk/api/common'; + +function get(aa:number){ + const globalEvent : DragEvent = {} + return globalEvent.getX();//error +} +function onMeasure(selfLayoutInfo: LayoutInfo, borderInfo: Array, children: Array){//error + selfLayoutInfo as LayoutInfo;//error + typeof (borderInfo[0] as LayoutBorderInfo);//error +} + +class Test implements LayoutChild{//error + set(child:LayoutChild){//error + return child as LayoutInfo;//error + } +} +class Test2 extends Test implements LayoutBorderInfo,TransitionOptions{ //error + private layoutInfo: LayoutInfo|undefined = undefined;//error + get(option:Map){//error + option.set('',{}); + } +} + +@Entry +@Component +struct Example { + @State uri: string = ""; + @State blockArr: string[] = []; + @State handlePopup: boolean = false; + @State customPopup: boolean = false; + udKey: string = ''; + globalEvent : DragEvent = {} + + @State handlePopup: boolean = false + private scroller: Scroller = new Scroller(); + + aboutToAppear(): void { + animateTo({ // error + duration: 2000, + curve: Curve.EaseOut, + iterations: 3, + playMode: PlayMode.Normal, + onFinish: () => { + console.info('play end'); + } + }, () => { + }); + } + + onLayout(children: LayoutChild[], constraint: ConstraintSizeOptions): void {// error *2 + let layoutChild: LayoutChild = children[0];// error + layoutChild.constraint; // error + layoutChild.position; // error + layoutChild.name; // error + layoutChild.id; // error + layoutChild.borderInfo.borderWidth; // error *2 + layoutChild.borderInfo.padding; // error *2 + layoutChild.borderInfo.margin; // error *2 + layoutChild.layout({ position: { x: 0, y: 0 }, constraint: constraint }); // error *3 + layoutChild.measure(constraint); // error + } + + onMeasure(children: LayoutChild[], constraint: ConstraintSizeOptions): void {// error *2 + } + + // Popup builder + @Builder popupBuilder() { + Row({ space: 2 }) { + }.width(100).height(50).padding(5) + } + build() { + Column() { + Text('Image drag and drop') + .fontSize('30dp') + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { + Image($r('app.media.startIcon')) + .width(100) + .height(100) + .border({ width: 1 }) + .draggable(true) + .onDragStart((event:DragEvent) => { + typeof event.getX(); //error + (event as DragEvent).getY(); //error + console.log('',event.getY()); //error + }) + } + .margin({ bottom: this.globalEvent.getY() }) //error + Row() { + Column(){ + } + .border({width: 1}) + .height('90%') + .width('100%') + .onDrop((event?: DragEvent, extraParams?: string) => { + console.log("enter onDrop") + const x = event?.getX(); //error + const y = event?.getY(); //error + }, {disableDataPrefetch: true}) + } + .height("50%") + .width("90%") + .border({ width: 1 }) + + Button('PopupOptions') + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true// error + }) + .useSizeType({}) // error + + List({ space: 10, scroller: this.scroller }) + .onScroll((xOffset: number, scrollState: ScrollState): void => { // error + }) + .width('100%') + .height(90) + .touchable(true)// error + .mask(new CircleAttribute()) // error + } + } + onLayout(children: Array//error + , constraint: ConstraintSizeOptions) { + children[0].borderInfo as LayoutBorderInfo;//error + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/common_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/common_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/common_api.ets.arkts2.json new file mode 100755 index 0000000000..9eb4d655c3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_api.ets.arkts2.json @@ -0,0 +1,878 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 18, + "column": 1, + "endLine": 21, + "endColumn": 2, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 23, + "endLine": 19, + "endColumn": 32, + "problem": "DuplicateDeclNameFromSdk", + "suggest": "", + "rule": "API path have changed - please update your imports accordingly (sdk-no-decl-with-duplicate-name)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 22, + "endLine": 20, + "endColumn": 26, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 36, + "endLine": 22, + "endColumn": 46, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 66, + "endLine": 22, + "endColumn": 82, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 101, + "endLine": 22, + "endColumn": 112, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 21, + "endLine": 23, + "endColumn": 31, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 11, + "endLine": 24, + "endColumn": 24, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 28, + "endLine": 24, + "endColumn": 44, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 23, + "endLine": 27, + "endColumn": 34, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 13, + "endLine": 28, + "endColumn": 24, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 21, + "endLine": 29, + "endColumn": 31, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 38, + "endLine": 32, + "endColumn": 54, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 55, + "endLine": 32, + "endColumn": 72, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 23, + "endLine": 33, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 25, + "endLine": 34, + "endColumn": 42, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 17, + "endLine": 47, + "endColumn": 26, + "problem": "DuplicateDeclNameFromSdk", + "suggest": "", + "rule": "API path have changed - please update your imports accordingly (sdk-no-decl-with-duplicate-name)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 36, + "endLine": 50, + "endColumn": 44, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 17, + "endLine": 54, + "endColumn": 21, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 19, + "endLine": 56, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 3, + "endLine": 76, + "endColumn": 4, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 3, + "endLine": 65, + "endColumn": 11, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 22, + "endLine": 65, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 66, + "column": 22, + "endLine": 66, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 66, + "column": 36, + "endLine": 66, + "endColumn": 47, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 17, + "endLine": 68, + "endColumn": 25, + "problem": "SdkTypeQuery", + "suggest": "", + "rule": "Using typeof as a type is not allowed in this API (sdk-type-query)", + "severity": "ERROR" + }, + { + "line": 74, + "column": 41, + "endLine": 74, + "endColumn": 42, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 74, + "column": 47, + "endLine": 74, + "endColumn": 48, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 78, + "column": 3, + "endLine": 78, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 78, + "column": 23, + "endLine": 78, + "endColumn": 34, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 83, + "column": 18, + "endLine": 83, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 13, + "endLine": 84, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 25, + "endLine": 84, + "endColumn": 27, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 37, + "endLine": 84, + "endColumn": 38, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 92, + "column": 18, + "endLine": 92, + "endColumn": 21, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 93, + "column": 19, + "endLine": 93, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 94, + "column": 28, + "endLine": 94, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 96, + "column": 31, + "endLine": 96, + "endColumn": 40, + "problem": "DuplicateDeclNameFromSdk", + "suggest": "", + "rule": "API path have changed - please update your imports accordingly (sdk-no-decl-with-duplicate-name)", + "severity": "ERROR" + }, + { + "line": 97, + "column": 26, + "endLine": 97, + "endColumn": 30, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 34, + "endLine": 98, + "endColumn": 38, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 23, + "endLine": 98, + "endColumn": 32, + "problem": "DuplicateDeclNameFromSdk", + "suggest": "", + "rule": "API path have changed - please update your imports accordingly (sdk-no-decl-with-duplicate-name)", + "severity": "ERROR" + }, + { + "line": 99, + "column": 34, + "endLine": 99, + "endColumn": 38, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 102, + "column": 42, + "endLine": 102, + "endColumn": 46, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 106, + "column": 25, + "endLine": 106, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 109, + "column": 26, + "endLine": 109, + "endColumn": 35, + "problem": "DuplicateDeclNameFromSdk", + "suggest": "", + "rule": "API path have changed - please update your imports accordingly (sdk-no-decl-with-duplicate-name)", + "severity": "ERROR" + }, + { + "line": 111, + "column": 28, + "endLine": 111, + "endColumn": 32, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 112, + "column": 28, + "endLine": 112, + "endColumn": 32, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 24, + "endLine": 117, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 126, + "column": 21, + "endLine": 126, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 130, + "column": 15, + "endLine": 130, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 132, + "column": 17, + "endLine": 132, + "endColumn": 32, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 135, + "column": 3, + "endLine": 138, + "endColumn": 4, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 135, + "column": 28, + "endLine": 135, + "endColumn": 39, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 137, + "column": 5, + "endLine": 137, + "endColumn": 16, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 137, + "column": 31, + "endLine": 137, + "endColumn": 47, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 2, + "endLine": 39, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 2, + "endLine": 40, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 4, + "endLine": 42, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 4, + "endLine": 43, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 4, + "endLine": 44, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 4, + "endLine": 45, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 49, + "column": 4, + "endLine": 49, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 21, + "endLine": 50, + "endColumn": 29, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Scroller\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 36, + "endLine": 50, + "endColumn": 44, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Scroller\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 5, + "endLine": 53, + "endColumn": 14, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"animateTo\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 55, + "column": 14, + "endLine": 55, + "endColumn": 19, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Curve\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 57, + "column": 17, + "endLine": 57, + "endColumn": 25, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"PlayMode\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 49, + "endLine": 65, + "endColumn": 70, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ConstraintSizeOptions\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 78, + "column": 50, + "endLine": 78, + "endColumn": 71, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ConstraintSizeOptions\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 82, + "column": 4, + "endLine": 82, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Builder\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 83, + "column": 5, + "endLine": 83, + "endColumn": 8, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 87, + "column": 5, + "endLine": 87, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 88, + "column": 7, + "endLine": 88, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 90, + "column": 7, + "endLine": 90, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Flex\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 90, + "column": 25, + "endLine": 90, + "endColumn": 38, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexDirection\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 90, + "column": 39, + "endLine": 90, + "endColumn": 42, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 90, + "column": 56, + "endLine": 90, + "endColumn": 65, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ItemAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 90, + "column": 90, + "endLine": 90, + "endColumn": 99, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 91, + "column": 9, + "endLine": 91, + "endColumn": 14, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Image\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 103, + "column": 7, + "endLine": 103, + "endColumn": 10, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 104, + "column": 9, + "endLine": 104, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 119, + "column": 7, + "endLine": 119, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 126, + "column": 7, + "endLine": 126, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"List\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 127, + "column": 48, + "endLine": 127, + "endColumn": 59, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ScrollState\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 132, + "column": 17, + "endLine": 132, + "endColumn": 32, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"CircleAttribute\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 136, + "column": 19, + "endLine": 136, + "endColumn": 40, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ConstraintSizeOptions\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_api.ets.json b/ets2panda/linter/test/deprecatedapi/common_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets new file mode 100644 index 0000000000..1a4c1c4ff4 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets @@ -0,0 +1,39 @@ +/* + * 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 { LocalStorage } from './sdk/api/common_ts_ets_api' + +@Entry +@Component +struct SharedLocalStorage { + localStorage = LocalStorage.getShared(); //error + + build() { + Row() { + Column() { + Button("Change Local Storage to 47") + .onClick(() => { + this.localStorage?.setOrCreate("propA", 47); + }) + Button("Get Local Storage") + .onClick(() => { + console.info(`localStorage: ${this.localStorage?.get("propA")}`); + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.args.json new file mode 100644 index 0000000000..4acc088d1d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.arkts2.json new file mode 100644 index 0000000000..01ccb75666 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.arkts2.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 21, + "column": 31, + "endLine": 21, + "endColumn": 40, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 53, + "endLine": 28, + "endColumn": 55, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 2, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 5, + "endLine": 24, + "endColumn": 8, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 7, + "endLine": 25, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 9, + "endLine": 26, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 9, + "endLine": 30, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.json b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets new file mode 100755 index 0000000000..6ee8fd02c0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets @@ -0,0 +1,25 @@ +/* + * 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. + */ +AppStorage.Set("username", "John"); // error +console.log(AppStorage.get("username")); +let keys: IterableIterator = AppStorage.Keys(); // error +let simple = AppStorage.staticClear(); // error +AppStorage.setOrCreate('simpleProp', 121); +AppStorage.Has('simpleProp'); // error +AppStorage.setOrCreate('PropA', 47); +let prop: SubscribedAbstractProperty = AppStorage.SetAndProp('PropB', 49); // error +AppStorage.SetOrCreate('PropA', 47); // error +PersistentStorage.PersistProp('aProp', 47); // error +AppStorage.Prop("username"); // error \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.args.json b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.arkts2.json new file mode 100755 index 0000000000..c7ff7c846d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.arkts2.json @@ -0,0 +1,198 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 18, + "column": 5, + "endLine": 18, + "endColumn": 38, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 38, + "endLine": 19, + "endColumn": 41, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 33, + "endLine": 21, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 79, + "endLine": 22, + "endColumn": 81, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 33, + "endLine": 23, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 40, + "endLine": 24, + "endColumn": 42, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 15, + "column": 1, + "endLine": 15, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 13, + "endLine": 16, + "endColumn": 23, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 38, + "endLine": 17, + "endColumn": 48, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 14, + "endLine": 18, + "endColumn": 24, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 1, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 1, + "endLine": 20, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 1, + "endLine": 21, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 11, + "endLine": 22, + "endColumn": 37, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SubscribedAbstractProperty\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 48, + "endLine": 22, + "endColumn": 58, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 1, + "endLine": 23, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 1, + "endLine": 24, + "endColumn": 18, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"PersistentStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 1, + "endLine": 25, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"AppStorage\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.json b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.json new file mode 100755 index 0000000000..fd824bf65e --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/common_ts_ets_api1.ets.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 18, + "column": 5, + "endLine": 18, + "endColumn": 38, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/componentSnapshot.ets b/ets2panda/linter/test/deprecatedapi/componentSnapshot.ets new file mode 100644 index 0000000000..f049f9273b --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/componentSnapshot.ets @@ -0,0 +1,47 @@ +/* + * 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 { componentSnapshot } from '@kit.ArkUI'; + +@Entry +@Component +struct SnapshotExample { + @Builder + RandomBuilder() { + Flex() { + Text('Test menu') + .fontSize(20) + .width(100) + .height(50) + .textAlign(TextAlign.Center) + } + .width(100) + } + + build() { + Column() { + Button("click to generate UI snapshot") + .onClick(() => { + componentSnapshot.get("root", () => {}); //error + componentSnapshot.get("root"); //error + componentSnapshot.createFromBuilder(() => { this.RandomBuilder()}, () => {}); //error + componentSnapshot.createFromBuilder(() => { this.RandomBuilder()}); //error + }).margin(10) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/componentSnapshot.ets.json b/ets2panda/linter/test/deprecatedapi/componentSnapshot.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/componentSnapshot.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/curves.ets b/ets2panda/linter/test/deprecatedapi/curves.ets new file mode 100644 index 0000000000..c13a0cfce6 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/curves.ets @@ -0,0 +1,17 @@ +/* + * 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 { curves } from '@kit.ArkUI'; +curves.cubicBezier(0.1, 0.0, 0.1, 1.0);//error \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/curves.ets.json b/ets2panda/linter/test/deprecatedapi/curves.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/curves.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets b/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets new file mode 100755 index 0000000000..db08bd6b30 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets @@ -0,0 +1,17 @@ +/* + * 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 { curves } from './sdk/api/@ohos.curves'; + +curves.init() \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.arkts2.json new file mode 100755 index 0000000000..0a1fb129d6 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.arkts2.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 8, + "endLine": 17, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.json b/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/curvesInit_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/custom_api.ets b/ets2panda/linter/test/deprecatedapi/custom_api.ets new file mode 100755 index 0000000000..a809862de1 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/custom_api.ets @@ -0,0 +1,28 @@ +/* + * 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 {PanelType} from './sdk/api/panel' + +@@Entry +@Component +struct WrapContentPanelExample { + @State isVisible: boolean = true + build() { + Column() { + Panel(this.isVisible) + .type(PanelType.CUSTOM) // error + } + + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/custom_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/custom_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/custom_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/custom_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/custom_api.ets.arkts2.json new file mode 100755 index 0000000000..a57cc4ca00 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/custom_api.ets.arkts2.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 2, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 13, + "endLine": 24, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 23, + "endLine": 24, + "endColumn": 29, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 3, + "endLine": 17, + "endColumn": 8, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 5, + "endLine": 22, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Panel\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/deprecatedapi/custom_api.ets.json b/ets2panda/linter/test/deprecatedapi/custom_api.ets.json new file mode 100755 index 0000000000..9f305c86d7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/custom_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/date_picker.ets b/ets2panda/linter/test/deprecatedapi/date_picker.ets new file mode 100644 index 0000000000..c593765716 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/date_picker.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct DatePickerExample { + private selectedDate: Date = new Date('2021-08-08'); + + build() { + Column() { + Button("DatePickerDialog") + .margin(20) + .onClick(() => { + DatePickerDialog.show({ //error + onAccept: () => {}, //error + onChange: () => {} //error + }) //error + }) + + DatePicker({ + start: new Date('1970-1-1'), + end: new Date('2100-1-1'), + selected: this.selectedDate + }).onChange(() => {}) //error + + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/date_picker.ets.json b/ets2panda/linter/test/deprecatedapi/date_picker.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/date_picker.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_common_utils.ets b/ets2panda/linter/test/deprecatedapi/deprecated_api_common_utils.ets new file mode 100644 index 0000000000..700f35d0a8 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_common_utils.ets @@ -0,0 +1,30 @@ +/* + * 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 { componentUtils } from '@kit.ArkUI'; + +@Entry +@Component +struct CommonUtilsExample { + + aboutToAppear(): void { + let modePosition:componentUtils.ComponentInfo = componentUtils.getRectangleById("onClick"); // error + } + + build() { + Column() { + }.width('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_common_utils.ets.json b/ets2panda/linter/test/deprecatedapi/deprecated_api_common_utils.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_common_utils.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets b/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets new file mode 100755 index 0000000000..032b04c323 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets @@ -0,0 +1,46 @@ +/* + * 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 {font} from './sdk/api/@ohos.font'; + +@Entry +@Component +struct FontExample { + fontInfo2: font.FontInfo = font.getFontByName(''); // error + fontList: Array = new Array(); + + aboutToAppear(): void { + font.registerFont({ // error + familyName: 'mediumRawFile', + familySrc: $rawfile('font/medium.ttf') + }) + } + + build() { + Column() { + Button("getFontByName") + .onClick(() => { + this.fontInfo2 = font.getFontByName(''); // error + }) + Button("getSystemFontList") + .onClick(() => { + this.fontList = font.getSystemFontList(); // error + }) + Button("registerFont") + .onClick(() => { + font.registerFont({familyName: 'mediumRawFile', familySrc: $rawfile('font/medium.ttf')}); // error + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.args.json b/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.arkts2.json new file mode 100755 index 0000000000..d720ed0d48 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.arkts2.json @@ -0,0 +1,128 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 35, + "endLine": 20, + "endColumn": 48, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 10, + "endLine": 24, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 33, + "endLine": 34, + "endColumn": 46, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 32, + "endLine": 38, + "endColumn": 49, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 16, + "endLine": 42, + "endColumn": 28, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 5, + "endLine": 31, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 7, + "endLine": 32, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 7, + "endLine": 36, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 7, + "endLine": 40, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.json b/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_font.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_prompt_action.ets b/ets2panda/linter/test/deprecatedapi/deprecated_api_prompt_action.ets new file mode 100644 index 0000000000..c17f35ce66 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_prompt_action.ets @@ -0,0 +1,85 @@ +/* + * 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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct PromptActionExample { + + aboutToAppear(): void { + promptAction.showToast({ // error + message: 'Hello World', + duration: 2000 + }); + + promptAction.showDialog({ // error + title: 'Title Info', + message: 'Message Info', + buttons: [ + { + text: 'button1', + color: '#000000' + } + ], + }); + + promptAction.showDialog({ // error + title: 'showDialog Title Info', + message: 'Message Info', + buttons: [ + { + text: 'button1', + color: '#000000' + } + ] + }, (err, data) => { + }); + + promptAction.showActionMenu({ // error + title: 'showActionMenu Title Info', + buttons: [ + { + text: 'item1', + color: '#666666' + } + ] + }); + + promptAction.showActionMenu({ // error + title: 'Title Info', + buttons: [ + { + text: 'item1', + color: '#666666' + } + ] + }, (err, data) => { + }) + + promptAction.closeCustomDialog(1); // error + promptAction.openCustomDialog({ // error + builder: () => { + }, + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + } + }); + } + + build() { + Column() { + }.width('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_prompt_action.ets.json b/ets2panda/linter/test/deprecatedapi/deprecated_api_prompt_action.ets.json new file mode 100644 index 0000000000..2a8b234e1c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_prompt_action.ets.json @@ -0,0 +1,58 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 48, + "column": 9, + "endLine": 48, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 48, + "column": 14, + "endLine": 48, + "endColumn": 18, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 9, + "endLine": 69, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 14, + "endLine": 69, + "endColumn": 18, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets b/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets new file mode 100755 index 0000000000..a5ca89df3c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets @@ -0,0 +1,147 @@ +/* + * 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 router from './sdk/api/@system.router'; + +class L{ + enableAlertBeforeBackPage() { + router.enableAlertBeforeBackPage({ //error + message: 'Message Info', + success: ()=> { + console.log('success'); + }, + cancel: ()=> { + console.log('cancel'); + } + }); + } +} + +class RouterParams { + data1: string; + + constructor(str: string) { + this.data1 = str; + } +} + +@Entry +@Component +struct RouterExample { + + aboutToAppear(): void { + router.replaceNamedRoute({ // error + name: 'myPage', + params: new RouterParams('message') + }); + + router.replaceNamedRoute({ // error + name: 'myPage', + params: new RouterParams('message') + }, (err) => { + }); + + router.replaceNamedRoute({ // error + name: 'myPage', + params: new RouterParams('message') + }, router.RouterMode.Standard); + + router.replaceNamedRoute({ // error + name: 'myPage', + params: new RouterParams('message') + }, router.RouterMode.Standard, (err) => { + }); + + router.pushNamedRoute({ // error + name: 'myPage', + params: new RouterParams('message') + }); + + router.pushNamedRoute({ // error + name: 'myPage', + params: new RouterParams('message') + }, (err) => { + }) + + router.pushNamedRoute({ // error + name: 'myPage', + params: new RouterParams('message') + }, router.RouterMode.Standard); + + router.pushNamedRoute({ // error + name: 'myPage', + params: new RouterParams('message') + }, router.RouterMode.Standard, (err) => { + }) + + let obj = router.getParams(); // error + router.hideAlertBeforeBackPage(); // error + router.showAlertBeforeBackPage({ // error + message: 'Message Info' + }); + let options: Array = router.getStateByUrl('pages/index'); // error + let options1: router.RouterState | undefined = router.getStateByIndex(1); // error + let page = router.getState(); // error + let length = router.getLength(); // error + router.clear(); // error + router.back({ url: 'pages/detail' }); // error + router.back(1); // error + router.back(1, { info: 'From Home' }); // error + router.replaceUrl({ // error + url: 'pages/detail', + params: new RouterParams('message') + }); + router.replaceUrl({ // error + url: 'pages/detail', + params: new RouterParams('message') + }, (err) => { + }); + router.replaceUrl({ // error + url: 'pages/detail', + params: new RouterParams('message') + }, router.RouterMode.Standard); + router.replaceUrl({ // error + url: 'pages/detail', + params: new RouterParams('message') + }, router.RouterMode.Standard, (err) => { + }); + + router.pushUrl({ // error + url: 'pages/routerpage2', + params: {name: 'message', age: 1} + }); + + router.pushUrl({ // error + url: 'pages/routerpage2', + params: new RouterParams('message') + }, (err) => { + }); + + router.pushUrl({ // error + url: 'pages/routerpage2', + params: new RouterParams('message') + }, router.RouterMode.Standard); + + router.pushUrl({ // error + url: 'pages/routerpage2', + params: new RouterParams('message') + }, router.RouterMode.Standard, (err) => { + }) + } + + build() { + Column() { + }.width('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.args.json b/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.arkts2.json new file mode 100755 index 0000000000..5c30d62150 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.arkts2.json @@ -0,0 +1,218 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 12, + "endLine": 19, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 9, + "endLine": 52, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 37, + "endLine": 63, + "endColumn": 40, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 74, + "column": 9, + "endLine": 74, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 85, + "column": 37, + "endLine": 85, + "endColumn": 40, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 88, + "column": 9, + "endLine": 88, + "endColumn": 33, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 94, + "column": 75, + "endLine": 94, + "endColumn": 76, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 95, + "column": 9, + "endLine": 95, + "endColumn": 33, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 96, + "column": 9, + "endLine": 96, + "endColumn": 36, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 97, + "column": 12, + "endLine": 97, + "endColumn": 17, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 99, + "column": 17, + "endLine": 99, + "endColumn": 18, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 100, + "column": 17, + "endLine": 100, + "endColumn": 18, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 108, + "column": 9, + "endLine": 108, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 37, + "endLine": 117, + "endColumn": 40, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 122, + "column": 38, + "endLine": 122, + "endColumn": 39, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 128, + "column": 9, + "endLine": 128, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 139, + "column": 37, + "endLine": 139, + "endColumn": 40, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 2, + "endLine": 39, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 2, + "endLine": 40, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 144, + "column": 5, + "endLine": 144, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.json b/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.json new file mode 100755 index 0000000000..405836ab29 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_router.ets.json @@ -0,0 +1,128 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 52, + "column": 9, + "endLine": 52, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 37, + "endLine": 63, + "endColumn": 40, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 74, + "column": 9, + "endLine": 74, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 85, + "column": 37, + "endLine": 85, + "endColumn": 40, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 88, + "column": 9, + "endLine": 88, + "endColumn": 33, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 95, + "column": 9, + "endLine": 95, + "endColumn": 33, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 96, + "column": 9, + "endLine": 96, + "endColumn": 36, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 108, + "column": 9, + "endLine": 108, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 37, + "endLine": 117, + "endColumn": 40, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 128, + "column": 9, + "endLine": 128, + "endColumn": 12, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 139, + "column": 37, + "endLine": 139, + "endColumn": 40, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_time_picker.ets b/ets2panda/linter/test/deprecatedapi/deprecated_api_time_picker.ets new file mode 100644 index 0000000000..a1b1f08696 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_time_picker.ets @@ -0,0 +1,29 @@ +/* + * 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. + */ + +@Entry +@Component +struct TimePickerDialogExample { + + aboutToAppear(): void { + TimePickerDialog.show(); + TimePickerDialog.show({useMilitaryTime: true}); + } + + build() { + Column() { + }.width('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/deprecated_api_time_picker.ets.json b/ets2panda/linter/test/deprecatedapi/deprecated_api_time_picker.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/deprecated_api_time_picker.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/dragController.ets b/ets2panda/linter/test/deprecatedapi/dragController.ets new file mode 100644 index 0000000000..1fc9a633b8 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/dragController.ets @@ -0,0 +1,77 @@ +/* + * 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 { dragController } from "@kit.ArkUI"; +import { image } from '@kit.ImageKit'; + +@Entry +@Component +struct DragControllerPage { + @State pixmap: image.PixelMap | null = null + + @Builder + DraggingBuilder() { + Column() { + Text("DraggingBuilder") + .fontColor(Color.White) + .fontSize(12) + } + .width(100) + .height(100) + .backgroundColor(Color.Blue) + } + + @Builder + CustomDragView() { + Column() { + Text('Drag Me') + .fontSize(18) + .fontColor(Color.Black) + } + .width(100) + .height(50) + .backgroundColor(Color.White) + } + + private customBuilders: Array = [this.CustomDragView]; + + build() { + Column() { + Button('drag') + .margin(10) + .onDragEnter(() => { + dragController.getDragPreview(); //error + }) + .onTouch((event?: TouchEvent) => { + if (event) { + let dragInfo: dragController.DragInfo = { + pointerId: 0, + extraParams: '' + } + dragController.createDragAction(this.customBuilders, dragInfo); //error + + dragController.executeDrag(() => { //error + this.DraggingBuilder() + }, dragInfo, (err, eve) => { + }); + + dragController.executeDrag(() => { //error + this.DraggingBuilder() + }, dragInfo); + } + }) + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/dragController.ets.json b/ets2panda/linter/test/deprecatedapi/dragController.ets.json new file mode 100644 index 0000000000..fcedf46595 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/dragController.ets.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 67, + "column": 27, + "endLine": 67, + "endColumn": 30, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 32, + "endLine": 67, + "endColumn": 35, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/enums.ets b/ets2panda/linter/test/deprecatedapi/enums.ets new file mode 100644 index 0000000000..5135fbb18e --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/enums.ets @@ -0,0 +1,46 @@ +/* + * 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. + */ + +@Entry +@Component +struct ScrollExample { + scroller: Scroller = new Scroller(); + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + }, (item: string) => item) + }.width('100%') + } + + Button('back Center') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Center); //error + }) + .margin({ top: 160, left: 20 }) + Button('back Middle') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Middle); //error + }) + .margin({ top: 210, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/enums.ets.json b/ets2panda/linter/test/deprecatedapi/enums.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/enums.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets b/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets new file mode 100755 index 0000000000..ee528bd4ad --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets @@ -0,0 +1,24 @@ +/* + * 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 { Environment } from './sdk/api/common_ts_ets_api'; + +Environment.EnvProp('accessibilityEnabled', 'default'); //error + +let keys: Array = Environment.Keys(); //error + +Environment.EnvProps([{ key: 'accessibilityEnabled', defaultValue: 'default' }, { //error + key: 'languageCode', + defaultValue: 'en' +}, { key: 'prop', defaultValue: 'hhhh' }]); \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.arkts2.json new file mode 100755 index 0000000000..55aa23cb17 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.arkts2.json @@ -0,0 +1,48 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 13, + "endLine": 17, + "endColumn": 20, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 39, + "endLine": 19, + "endColumn": 43, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 13, + "endLine": 21, + "endColumn": 21, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.json b/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/environmentEnvProp_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/foldable_api.ets b/ets2panda/linter/test/deprecatedapi/foldable_api.ets new file mode 100755 index 0000000000..de997623bf --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/foldable_api.ets @@ -0,0 +1,28 @@ +/* + * 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 {PanelType} from './sdk/api/panel' + +@@Entry +@Component +struct WrapContentPanelExample { + @State isVisible: boolean = true + build() { + Column() { + Panel(this.isVisible) + .type(PanelType.Foldable) // error + } + + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/foldable_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/foldable_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/foldable_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/foldable_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/foldable_api.ets.arkts2.json new file mode 100755 index 0000000000..9ecb29181d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/foldable_api.ets.arkts2.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 2, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 13, + "endLine": 24, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 23, + "endLine": 24, + "endColumn": 31, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 3, + "endLine": 17, + "endColumn": 8, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 5, + "endLine": 22, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Panel\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/deprecatedapi/foldable_api.ets.json b/ets2panda/linter/test/deprecatedapi/foldable_api.ets.json new file mode 100755 index 0000000000..9f305c86d7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/foldable_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/getLength.ets b/ets2panda/linter/test/deprecatedapi/getLength.ets new file mode 100755 index 0000000000..897957626a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/getLength.ets @@ -0,0 +1,22 @@ +/* + * 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 router from './sdk/api/@system.router'; +class J{ + getLength() { + let size = router.getLength(); + console.log('pages stack size = ' + size); + } +} +export default new J() \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/getLength.ets.args.json b/ets2panda/linter/test/deprecatedapi/getLength.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/getLength.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/getLength.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/getLength.ets.arkts2.json new file mode 100755 index 0000000000..7c08a340f9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/getLength.ets.arkts2.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 18, + "column": 9, + "endLine": 18, + "endColumn": 34, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/getLength.ets.json b/ets2panda/linter/test/deprecatedapi/getLength.ets.json new file mode 100755 index 0000000000..7c08a340f9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/getLength.ets.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 18, + "column": 9, + "endLine": 18, + "endColumn": 34, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/getParams.ets b/ets2panda/linter/test/deprecatedapi/getParams.ets new file mode 100755 index 0000000000..69c220cec5 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/getParams.ets @@ -0,0 +1,17 @@ +/* + * 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 router from './sdk/api/@system.router'; + +let params: Object = router.getParams(); \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/getParams.ets.args.json b/ets2panda/linter/test/deprecatedapi/getParams.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/getParams.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/getParams.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/getParams.ets.arkts2.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/getParams.ets.arkts2.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/getParams.ets.json b/ets2panda/linter/test/deprecatedapi/getParams.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/getParams.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets b/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets new file mode 100755 index 0000000000..30d8bc150c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets @@ -0,0 +1,34 @@ +/* + * 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 { GridAttribute } from './sdk/api/grid'; + +@Entry +@Component +struct GridExample { + @State scrollPos: number = 0; + @State scrollStatus: string = 'IDLE'; + + build() { + Grid() { + ForEach([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], () => { + }) + } + .columnsTemplate('1fr 1fr 1fr') + .onScroll((offset, state) => { + this.scrollPos = offset; + this.scrollStatus = ScrollState[state]; + }) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.arkts2.json new file mode 100755 index 0000000000..950e9a126e --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.arkts2.json @@ -0,0 +1,218 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 30, + "endLine": 20, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 16, + "endLine": 25, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 19, + "endLine": 25, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 22, + "endLine": 25, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 25, + "endLine": 25, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 28, + "endLine": 25, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 31, + "endLine": 25, + "endColumn": 32, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 34, + "endLine": 25, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 37, + "endLine": 25, + "endColumn": 38, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 40, + "endLine": 25, + "endColumn": 41, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 43, + "endLine": 25, + "endColumn": 45, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 16, + "endLine": 29, + "endColumn": 22, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 24, + "endLine": 29, + "endColumn": 29, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 4, + "endLine": 21, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 5, + "endLine": 24, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Grid\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 7, + "endLine": 25, + "endColumn": 14, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ForEach\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 27, + "endLine": 31, + "endColumn": 38, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ScrollState\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.json b/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.json new file mode 100755 index 0000000000..847ccb380c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridAttributeonScroll_api.ets.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 29, + "column": 16, + "endLine": 29, + "endColumn": 22, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 24, + "endLine": 29, + "endColumn": 29, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets b/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets new file mode 100755 index 0000000000..57cca2901b --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets @@ -0,0 +1,28 @@ +/* + * 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 {GridContainerOptions} from './sdk/api/grid_container'; + +@Entry +@Component +struct GridContainerExample { + @State sizeType: SizeType = SizeType.XS + + build() { + Column({ space: 5 }) { + GridContainer({ columns: 12, sizeType: this.sizeType, gutter: 10, margin: 20 }) { + }.width('90%') + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.arkts2.json new file mode 100755 index 0000000000..7ad3a1e285 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.arkts2.json @@ -0,0 +1,128 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 23, + "column": 21, + "endLine": 23, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 32, + "endLine": 24, + "endColumn": 34, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 69, + "endLine": 24, + "endColumn": 71, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 81, + "endLine": 24, + "endColumn": 83, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 20, + "endLine": 20, + "endColumn": 28, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SizeType\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 31, + "endLine": 20, + "endColumn": 39, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SizeType\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 5, + "endLine": 23, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 20, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"GridContainer\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.json b/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridContainerOptionsMargin_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridItem.ets b/ets2panda/linter/test/deprecatedapi/gridItem.ets new file mode 100755 index 0000000000..d99fe0cef1 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridItem.ets @@ -0,0 +1,31 @@ +/* + * 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. + */ +@Entry +@Component +struct GridItemExample { + build() { + Column() { + Grid() { + GridItem() + .width('100%') + .height('100%') + .forceRebuild(false); // error + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .width('90%').height(300) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridItem.ets.args.json b/ets2panda/linter/test/deprecatedapi/gridItem.ets.args.json new file mode 100755 index 0000000000..aa0b62d6c8 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridItem.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridItem.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/gridItem.ets.arkts2.json new file mode 100755 index 0000000000..761a8db473 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridItem.ets.arkts2.json @@ -0,0 +1,88 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 28, + "column": 28, + "endLine": 28, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 35, + "endLine": 29, + "endColumn": 36, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 15, + "column": 2, + "endLine": 15, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 2, + "endLine": 16, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 5, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 7, + "endLine": 20, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Grid\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 9, + "endLine": 21, + "endColumn": 17, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"GridItem\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/gridItem.ets.json b/ets2panda/linter/test/deprecatedapi/gridItem.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/gridItem.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/grid_container.ets b/ets2panda/linter/test/deprecatedapi/grid_container.ets new file mode 100755 index 0000000000..c8d95d26ec --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/grid_container.ets @@ -0,0 +1,67 @@ +/* + * 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. + */ + +@Entry +@Component +struct GridContainerExample { + @State sizeType: SizeType = SizeType.MD // error + private options: GridContainerOptions = { + columns: 12, // error + sizeType: this.sizeType, // error + gutter: 10, // error + margin: 20 // error + } + + build() { + Column({ space: 5 }) { + GridContainer({ + columns: 12, + sizeType: this.sizeType, + gutter: 10, + margin: 20 + }) { + Row() { + Text('1') + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.width('90%') + + GridContainer(this.options) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.width('90%') + + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG // error + }).backgroundColor(0x317aff) + Button('Auto') + .onClick(() => { + this.sizeType = SizeType.Auto // error + }).backgroundColor(0x317aff) + } + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/grid_container.ets.args.json b/ets2panda/linter/test/deprecatedapi/grid_container.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/grid_container.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/grid_container.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/grid_container.ets.arkts2.json new file mode 100755 index 0000000000..903415585d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/grid_container.ets.arkts2.json @@ -0,0 +1,418 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 21, + "column": 14, + "endLine": 21, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 13, + "endLine": 23, + "endColumn": 15, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 13, + "endLine": 24, + "endColumn": 15, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 21, + "endLine": 28, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 18, + "endLine": 30, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 17, + "endLine": 32, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 17, + "endLine": 33, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 21, + "endLine": 37, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 27, + "endLine": 45, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 38, + "endLine": 45, + "endColumn": 39, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 27, + "endLine": 46, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 38, + "endLine": 46, + "endColumn": 39, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 27, + "endLine": 47, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 38, + "endLine": 47, + "endColumn": 39, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 48, + "column": 27, + "endLine": 48, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 48, + "column": 38, + "endLine": 48, + "endColumn": 39, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 21, + "endLine": 50, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 66, + "endLine": 54, + "endColumn": 67, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 35, + "endLine": 65, + "endColumn": 36, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 2, + "endLine": 16, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 4, + "endLine": 19, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 20, + "endLine": 19, + "endColumn": 28, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SizeType\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 31, + "endLine": 19, + "endColumn": 39, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SizeType\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 20, + "endLine": 20, + "endColumn": 40, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"GridContainerOptions\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 5, + "endLine": 28, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 7, + "endLine": 29, + "endColumn": 20, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"GridContainer\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 9, + "endLine": 35, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 11, + "endLine": 36, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 61, + "endLine": 37, + "endColumn": 70, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TextAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 7, + "endLine": 41, + "endColumn": 20, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"GridContainer\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 9, + "endLine": 42, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 11, + "endLine": 43, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 61, + "endLine": 50, + "endColumn": 70, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TextAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 7, + "endLine": 54, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 55, + "column": 7, + "endLine": 55, + "endColumn": 10, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 9, + "endLine": 56, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 58, + "column": 29, + "endLine": 58, + "endColumn": 37, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SizeType\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 60, + "column": 9, + "endLine": 60, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 29, + "endLine": 62, + "endColumn": 37, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"SizeType\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/grid_container.ets.json b/ets2panda/linter/test/deprecatedapi/grid_container.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/grid_container.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/image_animator.ets b/ets2panda/linter/test/deprecatedapi/image_animator.ets new file mode 100644 index 0000000000..91114d198f --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/image_animator.ets @@ -0,0 +1,26 @@ +/* + * 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. + */ + +@Entry +@Component +struct ImageAnimatorExample { + + build() { + Column({ space: 10 }) { + ImageAnimator() + .preDecode(0) //error + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/image_animator.ets.json b/ets2panda/linter/test/deprecatedapi/image_animator.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/image_animator.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/inspector.ets b/ets2panda/linter/test/deprecatedapi/inspector.ets new file mode 100644 index 0000000000..d041d776c5 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/inspector.ets @@ -0,0 +1,46 @@ +/* + * 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 inspector from '@ohos.arkui.inspector' + +@Entry +@Component +struct ImageExample { + build() { + Column() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start }) { + Row({ space: 5 }) { + Image($r('app.media.app_icon')) + .width(110) + .height(110) + .border({ width: 1 }) + .id('IMAGE_ID') + } + } + }.height(320).width(360).padding({ right: 10, top: 10 }) + } + + listener:inspector.ComponentObserver = inspector.createComponentObserver('IMAGE_ID') //error + + aboutToAppear() { + let onLayoutComplete:()=>void=():void=>{} + let onDrawComplete:()=>void=():void=>{} + let FuncLayout = onLayoutComplete // bind current js instance + let FuncDraw = onDrawComplete // bind current js instance + + this.listener.on('layout', FuncLayout) + this.listener.on('draw', FuncDraw) + } +} diff --git a/ets2panda/linter/test/deprecatedapi/inspector.ets.json b/ets2panda/linter/test/deprecatedapi/inspector.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/inspector.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/lazy_for_each.ets b/ets2panda/linter/test/deprecatedapi/lazy_for_each.ets new file mode 100644 index 0000000000..fbc16f8348 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/lazy_for_each.ets @@ -0,0 +1,121 @@ +/* + * 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. + */ + +class BasicDataSource implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdded(index); //error + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChanged(index); //error + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDeleted(index); //error + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMoved(from, to); //error + }) + } +} + +class MyDataSource extends BasicDataSource { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } +} + +@Entry +@Component +struct MyComponent { + private data: MyDataSource = new MyDataSource(); + + aboutToAppear() { + for (let i = 0; i <= 20; i++) { + this.data.pushData(`Hello ${i}`); + } + } + + build() { + List({ space: 3 }) { + LazyForEach(this.data, (item: string) => { + ListItem() { + Row() { + Text(item).fontSize(50) + .onAppear(() => { + console.info(`appear: ${item}`); + }) + }.margin({ left: 10, right: 10 }) + } + }, (item: string) => item) + }.cachedCount(5) + } +} diff --git a/ets2panda/linter/test/deprecatedapi/lazy_for_each.ets.json b/ets2panda/linter/test/deprecatedapi/lazy_for_each.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/lazy_for_each.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/list.ets b/ets2panda/linter/test/deprecatedapi/list.ets new file mode 100755 index 0000000000..914b230b10 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/list.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ +@Entry +@Component +struct ListExample { + build() { + Column() { + List({ space: 20, initialIndex: 0 }) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ + strokeWidth: 2, + color: 0xFFFFFF, + startMargin: 20, + endMargin: 20 + }) + .edgeEffect(EdgeEffect.Spring) + .editMode(false)// error + .width('90%') + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/list.ets.args.json b/ets2panda/linter/test/deprecatedapi/list.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/list.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/list.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/list.ets.arkts2.json new file mode 100755 index 0000000000..6ee23a6d2f --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/list.ets.arkts2.json @@ -0,0 +1,148 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 21, + "endLine": 20, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 39, + "endLine": 20, + "endColumn": 40, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 24, + "endLine": 25, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 24, + "endLine": 27, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 22, + "endLine": 28, + "endColumn": 24, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 21, + "endLine": 37, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 15, + "column": 2, + "endLine": 15, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 2, + "endLine": 16, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 5, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 7, + "endLine": 20, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"List\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 24, + "endLine": 21, + "endColumn": 28, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Axis\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 20, + "endLine": 22, + "endColumn": 28, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"BarState\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 21, + "endLine": 30, + "endColumn": 31, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"EdgeEffect\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/list.ets.json b/ets2panda/linter/test/deprecatedapi/list.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/list.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/listitem_api.ets b/ets2panda/linter/test/deprecatedapi/listitem_api.ets new file mode 100755 index 0000000000..1972648696 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/listitem_api.ets @@ -0,0 +1,35 @@ +/* + * 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 {ListItemAttribute,Sticky,EditMode} from './sdk/api/list_item'; + +@Entry +@Component +struct ListItemExample { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() + .sticky(Sticky.Normal) //error + .editable(true) //error + .editable(EditMode.Deletable); //error + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/listitem_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/listitem_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/listitem_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/listitem_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/listitem_api.ets.arkts2.json new file mode 100755 index 0000000000..433328bd56 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/listitem_api.ets.arkts2.json @@ -0,0 +1,228 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 28, + "endLine": 20, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 31, + "endLine": 20, + "endColumn": 32, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 34, + "endLine": 20, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 37, + "endLine": 20, + "endColumn": 38, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 40, + "endLine": 20, + "endColumn": 41, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 43, + "endLine": 20, + "endColumn": 44, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 46, + "endLine": 20, + "endColumn": 47, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 49, + "endLine": 20, + "endColumn": 50, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 52, + "endLine": 20, + "endColumn": 53, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 55, + "endLine": 20, + "endColumn": 56, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 21, + "endLine": 24, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 39, + "endLine": 24, + "endColumn": 40, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 21, + "endLine": 27, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 23, + "endLine": 29, + "endColumn": 31, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 5, + "endLine": 23, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"List\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 9, + "endLine": 25, + "endColumn": 16, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ForEach\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 11, + "endLine": 26, + "endColumn": 19, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ListItem\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 18, + "endLine": 32, + "endColumn": 26, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"BarState\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/listitem_api.ets.json b/ets2panda/linter/test/deprecatedapi/listitem_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/listitem_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets b/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets new file mode 100755 index 0000000000..28fe3c5414 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets @@ -0,0 +1,34 @@ +/* + * 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 { matrix4 } from './sdk/api/@ohos.matrix4'; + +@Entry +@Component +struct Test { + private matrix1 = matrix4.rotate({ // error + x: 1, + y: 1, + z: 2, + angle: 30 + }); + private matrix1 = matrix4.copy(); // error + + private matrix1 = matrix4.translate({ x: 100 }); // error + + build() { + Column() { + }.width("100%").margin({ top: 50 }) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.arkts2.json new file mode 100755 index 0000000000..c2f4de7b04 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.arkts2.json @@ -0,0 +1,138 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 29, + "endLine": 20, + "endColumn": 35, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 10, + "endLine": 21, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 10, + "endLine": 22, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 10, + "endLine": 23, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 14, + "endLine": 24, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 29, + "endLine": 26, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 29, + "endLine": 28, + "endColumn": 38, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 44, + "endLine": 28, + "endColumn": 47, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 35, + "endLine": 32, + "endColumn": 37, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 5, + "endLine": 31, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.json b/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/matrix4Rotate_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/measure.ets b/ets2panda/linter/test/deprecatedapi/measure.ets new file mode 100644 index 0000000000..bcde2d53ca --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/measure.ets @@ -0,0 +1,40 @@ +/* + * 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 { MeasureText } from '@kit.ArkUI'; + +@Entry +@Component +struct Index { + textSize: SizeOptions = MeasureText.measureTextSize({ //error + textContent: "Hello World", + fontSize: '50px' + }); + @State textWidth: number = MeasureText.measureText({ //error + textContent: "Hello World", + fontSize: '50px' + }); + + build() { + Row() { + Column() { + Text(`The width of 'Hello World': ${this.textSize.width}`) + Text(`The width of 'Hello World': ${this.textWidth}`) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/measure.ets.json b/ets2panda/linter/test/deprecatedapi/measure.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/measure.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/mediaquery.ets b/ets2panda/linter/test/deprecatedapi/mediaquery.ets new file mode 100644 index 0000000000..be7cc2c886 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/mediaquery.ets @@ -0,0 +1,51 @@ +/* + * 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 { mediaquery } from '@kit.ArkUI'; + +@Entry +@Component +struct MediaQueryExample { + @State color: string = '#DB7093' + @State text: string = 'Portrait' + listener: mediaquery.MediaQueryListener = mediaquery.matchMediaSync('(orientation: landscape)'); //error + + onPortrait(mediaQueryResult:mediaquery.MediaQueryResult) { + if (mediaQueryResult.matches) { + this.color = '#FFD700' + this.text = 'Landscape' + } else { + this.color = '#DB7093' + this.text = 'Portrait' + } + } + + aboutToAppear() { + let portraitFunc = (mediaQueryResult: mediaquery.MediaQueryResult): void => this.onPortrait(mediaQueryResult) + this.listener.on('change', portraitFunc); + } + + + aboutToDisappear() { + this.listener.off('change'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(this.text).fontSize(24).fontColor(this.color) + } + .width('100%').height('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/mediaquery.ets.json b/ets2panda/linter/test/deprecatedapi/mediaquery.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/mediaquery.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/minibar_api.ets b/ets2panda/linter/test/deprecatedapi/minibar_api.ets new file mode 100755 index 0000000000..2429a98b61 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/minibar_api.ets @@ -0,0 +1,28 @@ +/* + * 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 {PanelType} from './sdk/api/panel' + +@@Entry +@Component +struct WrapContentPanelExample { + @State isVisible: boolean = true + build() { + Column() { + Panel(this.isVisible) + .type(PanelType.Minibar) // error + } + + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/minibar_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/minibar_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/minibar_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/minibar_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/minibar_api.ets.arkts2.json new file mode 100755 index 0000000000..54931525a0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/minibar_api.ets.arkts2.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 2, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 13, + "endLine": 24, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 23, + "endLine": 24, + "endColumn": 30, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 3, + "endLine": 17, + "endColumn": 8, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 5, + "endLine": 22, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Panel\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/deprecatedapi/minibar_api.ets.json b/ets2panda/linter/test/deprecatedapi/minibar_api.ets.json new file mode 100755 index 0000000000..9f305c86d7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/minibar_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/navigation.ets b/ets2panda/linter/test/deprecatedapi/navigation.ets new file mode 100644 index 0000000000..244b22cd1a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navigation.ets @@ -0,0 +1,31 @@ +/* + * 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. + */ + +@Entry +@Component +struct NavigationExample { + build() { + Column({ space: 15 }) { + Row() { + Navigation() + .subTitle("test") //error + .toolBar() //error + } + .borderRadius(20) + } + .width('100%') + .margin({ top: 15 }) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/navigation.ets.json b/ets2panda/linter/test/deprecatedapi/navigation.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navigation.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/navigator_api.ets b/ets2panda/linter/test/deprecatedapi/navigator_api.ets new file mode 100644 index 0000000000..f0a513452e --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navigator_api.ets @@ -0,0 +1,44 @@ +/* + * 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 {NavigatorInstance,Navigator,NavigatorAttribute} from './sdk/api/navigator'; + +function aa(tt:NavigatorAttribute){//error + const a = new NavigatorAttribute() //error + typeof a.active(false);//error + return a as NavigatorAttribute;//error +} +@Entry +@Component +struct NavigatorExample { + @State active: boolean = false; + @State name: NameObject = { name: 'news' }; + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Start, + justifyContent: FlexAlign.SpaceBetween + }) { + Navigator({//error + target: 'pages/container/navigator/Detail', + type: NavigationType.Push + }).onClick(()=>{ + const attr = new NavigatorAttribute(); //error + attr.target('111')//error + }).params(new TextObject(this.name)) + NavigatorInstance.active(false);//error + }.height(150).width(350).padding(35); + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/navigator_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/navigator_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navigator_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/navigator_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/navigator_api.ets.arkts2.json new file mode 100755 index 0000000000..274a9bddd0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navigator_api.ets.arkts2.json @@ -0,0 +1,238 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 16, + "endLine": 17, + "endColumn": 34, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 18, + "endLine": 18, + "endColumn": 36, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 12, + "endLine": 19, + "endColumn": 18, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 15, + "endLine": 20, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 7, + "endLine": 34, + "endColumn": 16, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 26, + "endLine": 38, + "endColumn": 44, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 14, + "endLine": 39, + "endColumn": 20, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 21, + "endLine": 40, + "endColumn": 31, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 25, + "endLine": 41, + "endColumn": 31, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 14, + "endLine": 42, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 25, + "endLine": 42, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 38, + "endLine": 42, + "endColumn": 40, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 2, + "endLine": 22, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 2, + "endLine": 23, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 4, + "endLine": 25, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 4, + "endLine": 26, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 5, + "endLine": 29, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Flex\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 18, + "endLine": 30, + "endColumn": 31, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexDirection\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 32, + "endLine": 30, + "endColumn": 38, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 19, + "endLine": 31, + "endColumn": 28, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ItemAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 23, + "endLine": 32, + "endColumn": 32, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 15, + "endLine": 36, + "endColumn": 29, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"NavigationType\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/navigator_api.ets.json b/ets2panda/linter/test/deprecatedapi/navigator_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navigator_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/navrouter_api.ets b/ets2panda/linter/test/deprecatedapi/navrouter_api.ets new file mode 100644 index 0000000000..c3f4832417 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navrouter_api.ets @@ -0,0 +1,47 @@ +/* + * 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 {NavRouterInstance,NavRouter,NavRouterAttribute} from './sdk/api/nav_router'; +import {NavRouteMode,NavRouterInterface,RouteInfo} from './sdk/api/nav_router'; + +@Entry +@Component +struct NavRouterExample { + @State isActiveWLAN: boolean = false + @State isActiveBluetooth: boolean = false + + build() { + Navigation() { + NavRouter() //error + .mode(NavRouteMode.PUSH_WITH_RECREATE) //error*3 + NavRouter({name:'',param:undefined}) //error *3 + .mode(NavRouteMode.PUSH_WITH_RECREATE) //error*3 + .onStateChange((isActivated: boolean) => { //error + console.log(NavRouteMode.REPLACE+'') //error*2 + const attr = new NavRouterAttribute(); //error + attr.mode(NavRouteMode.PUSH); //error*3 + }) + NavRouterInstance.mode(NavRouteMode.REPLACE) //error*3 + } + } +} +class Test implements NavRouterInterface {//error + public (): NavRouterAttribute;//error + public (value: RouteInfo): NavRouterAttribute;//error *2 + public (value?: RouteInfo): NavRouterAttribute|void {//error*2 + const attribute: NavRouterAttribute|undefined = undefined;//error + } +} +interface Demo extends NavRouterInterface{//error +} diff --git a/ets2panda/linter/test/deprecatedapi/navrouter_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/navrouter_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navrouter_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/navrouter_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/navrouter_api.ets.arkts2.json new file mode 100755 index 0000000000..bbfdaf93fa --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navrouter_api.ets.arkts2.json @@ -0,0 +1,428 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 27, + "column": 10, + "endLine": 27, + "endColumn": 14, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 7, + "endLine": 26, + "endColumn": 16, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 15, + "endLine": 27, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 28, + "endLine": 27, + "endColumn": 46, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 10, + "endLine": 30, + "endColumn": 23, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 10, + "endLine": 29, + "endColumn": 14, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 7, + "endLine": 28, + "endColumn": 16, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 18, + "endLine": 28, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 26, + "endLine": 28, + "endColumn": 31, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 15, + "endLine": 29, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 28, + "endLine": 29, + "endColumn": 46, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 23, + "endLine": 31, + "endColumn": 35, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 36, + "endLine": 31, + "endColumn": 43, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 28, + "endLine": 32, + "endColumn": 46, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 16, + "endLine": 33, + "endColumn": 20, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 21, + "endLine": 33, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 34, + "endLine": 33, + "endColumn": 38, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 25, + "endLine": 35, + "endColumn": 29, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 30, + "endLine": 35, + "endColumn": 42, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 43, + "endLine": 35, + "endColumn": 50, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 23, + "endLine": 39, + "endColumn": 41, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 3, + "endLine": 40, + "endColumn": 9, + "problem": "InvalidIdentifier", + "suggest": "", + "rule": "This keyword cannot be used as identifiers (arkts-invalid-identifier)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 3, + "endLine": 40, + "endColumn": 33, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 14, + "endLine": 40, + "endColumn": 32, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 3, + "endLine": 41, + "endColumn": 9, + "problem": "InvalidIdentifier", + "suggest": "", + "rule": "This keyword cannot be used as identifiers (arkts-invalid-identifier)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 3, + "endLine": 41, + "endColumn": 49, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 18, + "endLine": 41, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 30, + "endLine": 41, + "endColumn": 48, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 3, + "endLine": 42, + "endColumn": 9, + "problem": "InvalidIdentifier", + "suggest": "", + "rule": "This keyword cannot be used as identifiers (arkts-invalid-identifier)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 3, + "endLine": 44, + "endColumn": 4, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 31, + "endLine": 42, + "endColumn": 54, + "problem": "LimitedVoidType", + "suggest": "", + "rule": "Type \"void\" has no instances.(arkts-limited-void-type)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 19, + "endLine": 42, + "endColumn": 28, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 50, + "endLine": 42, + "endColumn": 54, + "problem": "LimitedVoidType", + "suggest": "", + "rule": "Type \"void\" has no instances.(arkts-limited-void-type)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 31, + "endLine": 42, + "endColumn": 49, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 22, + "endLine": 43, + "endColumn": 40, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 24, + "endLine": 46, + "endColumn": 42, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 2, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 4, + "endLine": 21, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 4, + "endLine": 22, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 5, + "endLine": 25, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Navigation\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/navrouter_api.ets.json b/ets2panda/linter/test/deprecatedapi/navrouter_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/navrouter_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/node_api.ets b/ets2panda/linter/test/deprecatedapi/node_api.ets new file mode 100755 index 0000000000..5e1932af73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/node_api.ets @@ -0,0 +1,24 @@ +/* + * 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 {XComponentType} from './sdk/api/enums' +@Entry +@Component +struct XComponentNodeExample { + build() { + Column() { + XComponent(XComponentType.NODE) + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/node_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/node_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/node_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/node_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/node_api.ets.arkts2.json new file mode 100755 index 0000000000..e2ed9c2a93 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/node_api.ets.arkts2.json @@ -0,0 +1,68 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 21, + "column": 33, + "endLine": 21, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 2, + "endLine": 16, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 5, + "endLine": 20, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 7, + "endLine": 21, + "endColumn": 17, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"XComponent\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/deprecatedapi/node_api.ets.json b/ets2panda/linter/test/deprecatedapi/node_api.ets.json new file mode 100755 index 0000000000..9f305c86d7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/node_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/ohos_animator.ets b/ets2panda/linter/test/deprecatedapi/ohos_animator.ets new file mode 100755 index 0000000000..30544f0142 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_animator.ets @@ -0,0 +1,30 @@ +/* + * 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 { Animator as animator, AnimatorOptions, AnimatorResult } from '@kit.ArkUI'; + +let options: AnimatorOptions = { + duration: 1500, + easing: "friction", + delay: 0, + fill: "forwards", + direction: "normal", + iterations: 3, + begin: 200.0, + end: 400.0, +}; +this.animator = animator.createAnimator(options); // error +let animatorResult: AnimatorResult = animator.create(options); +animatorResult.update(options); // error diff --git a/ets2panda/linter/test/deprecatedapi/ohos_animator.ets.args.json b/ets2panda/linter/test/deprecatedapi/ohos_animator.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_animator.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/ohos_animator.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/ohos_animator.ets.arkts2.json new file mode 100755 index 0000000000..004254eb4c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_animator.ets.arkts2.json @@ -0,0 +1,58 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 13, + "endLine": 19, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 10, + "endLine": 21, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 15, + "endLine": 24, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 18, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Animator\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_animator.ets.json b/ets2panda/linter/test/deprecatedapi/ohos_animator.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_animator.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_curves.ets b/ets2panda/linter/test/deprecatedapi/ohos_curves.ets new file mode 100755 index 0000000000..4b8d21ca2c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_curves.ets @@ -0,0 +1,23 @@ +/* + * 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 { curves } from '@kit.ArkUI'; + +class AnimationHelper { + steps() { + curves.steps(9, true); // error + } +} + +curves.spring(10, 1, 228, 30) // error \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_curves.ets.args.json b/ets2panda/linter/test/deprecatedapi/ohos_curves.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_curves.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/ohos_curves.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/ohos_curves.ets.arkts2.json new file mode 100755 index 0000000000..cc2a63ae42 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_curves.ets.arkts2.json @@ -0,0 +1,68 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 18, + "endLine": 19, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 15, + "endLine": 23, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 19, + "endLine": 23, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 22, + "endLine": 23, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 27, + "endLine": 23, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_curves.ets.json b/ets2panda/linter/test/deprecatedapi/ohos_curves.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_curves.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets b/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets new file mode 100755 index 0000000000..f5b77dfb5b --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets @@ -0,0 +1,50 @@ +/* + * 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 { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct Test { + private matrix1 = matrix4 + .scale({ + // error + x: 2, + y: 3, + z: 4, + centerX: 50, + centerY: 50 + }); + private originPoint: number[] = [50, 50]; + private transformPoint = matrix4.transformPoint([this.originPoint[0], this.originPoint[1]]); // error + private matrix2 = matrix4.identity().scale({ x: 2 }); + + build() { + Column() { + Text('Test') + .width("40%") + .height(100) + .transform(this.matrix1) + Text(`矩阵变换后的坐标:[${this.transformPoint}]`) + .fontSize(16) + .margin({ top: 100 }) + Text("test") + .transform(matrix4.combine(this.matrix2))// error + .width("40%") + .height(100) + .margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.args.json b/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.arkts2.json new file mode 100755 index 0000000000..c3cf76ae53 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.arkts2.json @@ -0,0 +1,238 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 21, + "column": 3, + "endLine": 29, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 10, + "endLine": 24, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 10, + "endLine": 25, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 10, + "endLine": 26, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 16, + "endLine": 27, + "endColumn": 18, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 16, + "endLine": 28, + "endColumn": 18, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 36, + "endLine": 30, + "endColumn": 38, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 40, + "endLine": 30, + "endColumn": 42, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 3, + "endLine": 31, + "endColumn": 95, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 3, + "endLine": 32, + "endColumn": 56, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 51, + "endLine": 32, + "endColumn": 52, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 17, + "endLine": 38, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 19, + "endLine": 41, + "endColumn": 21, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 24, + "endLine": 42, + "endColumn": 27, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 17, + "endLine": 46, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 24, + "endLine": 47, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 2, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 5, + "endLine": 35, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 7, + "endLine": 36, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 7, + "endLine": 40, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 7, + "endLine": 43, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.json b/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.json new file mode 100755 index 0000000000..336c0150b8 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_matrix4.ets.json @@ -0,0 +1,48 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 21, + "column": 3, + "endLine": 29, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 3, + "endLine": 31, + "endColumn": 95, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 3, + "endLine": 32, + "endColumn": 56, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets b/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets new file mode 100755 index 0000000000..dd82bbcdc3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets @@ -0,0 +1,130 @@ +/* + * 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 prompt from '@ohos.prompt'; + +const toastOptions: prompt.ShowToastOptions = { + message: 'Message Info', //error + duration: 2000 +}; + +prompt.showDialog(toastOptions)//error + .then(data => { + console.info('showDialog success, click button: ' + data.index); + }) + .catch((err: Error) => { + console.info('showDialog error: ' + err); + }) + +const dialogOptions: prompt.ShowDialogOptions = { // error + title: 'Title Info', + message: 'Message Info' +}; + +prompt.showDialog(dialogOptions)// error + .then(data => { + console.info('showDialog success'); + }) + +prompt.showDialog({ + title: 'showDialog Title Info', // error + message: 'Message Info', + buttons: [ + { + text: 'button1', + color: '#000000' + }, + { + text: 'button2', + color: '#000000' + } + ] +}, (err, data) => { + if (err) { + console.info('showDialog err: ' + err); + return; + } + console.info('showDialog success callback, click button: ' + data.index); // error +}); +prompt.showActionMenu({ + title: 'Title Info', + buttons: [// error + { + text: 'button1', + color: '#000000' + }, + { + text: 'button2', + color: '#000000' + } + ], +}) + .then(data => { + console.info('showActionMenu success, click button: ' + data.index); + }) + .catch((err: Error) => { + console.info('showActionMenu error: ' + err); + }) + +const button: prompt.Button = { + text: 'test', + color: 'red' // error +}; + +prompt.showDialog({ + title: 'Title Info', + message: 'Message Info', + buttons: [button], +}) + .then(data => { + console.info('showDialog success, click button: ' + data.index); + }) + .catch((err: Error) => { + console.info('showDialog error: ' + err); + }) + +prompt.showToast({ // error + message: 'Message Info', + duration: 2000 +}); + +let response: Promise = prompt.showDialog({ // error + title: 'Title Info', + message: 'Message Info', + buttons: [ + { + text: 'button1', + color: '#000000' + }, + { + text: 'button2', + color: '#000000' + } + ], +}) + .then(data => { + console.info('showDialog success, click button: ' + data.index); + return data; + }) + .catch((err: Error) => { + console.info('showDialog error: ' + err); + throw err; + }); + +prompt.showToast({ // error + message: 'Message Info', + duration: 2000 +}); + diff --git a/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.args.json b/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.arkts2.json new file mode 100755 index 0000000000..a77d3677c3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.arkts2.json @@ -0,0 +1,128 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 13, + "endLine": 20, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 9, + "endLine": 24, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 9, + "endLine": 37, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 5, + "endLine": 54, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 10, + "endLine": 54, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 74, + "column": 9, + "endLine": 74, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 91, + "column": 9, + "endLine": 91, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 100, + "column": 13, + "endLine": 100, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 9, + "endLine": 120, + "endColumn": 4, + "problem": "LimitedReturnTypeInference", + "suggest": "", + "rule": "Function return type inference is limited (arkts-no-implicit-return-types)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 9, + "endLine": 117, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 128, + "column": 13, + "endLine": 128, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.json b/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.json new file mode 100755 index 0000000000..642f794c6c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_prompt.ets.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 24, + "column": 9, + "endLine": 24, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 9, + "endLine": 37, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 5, + "endLine": 54, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 10, + "endLine": 54, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 74, + "column": 9, + "endLine": 74, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 91, + "column": 9, + "endLine": 91, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 9, + "endLine": 120, + "endColumn": 4, + "problem": "LimitedReturnTypeInference", + "suggest": "", + "rule": "Function return type inference is limited (arkts-no-implicit-return-types)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 9, + "endLine": 117, + "endColumn": 13, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_router.ets b/ets2panda/linter/test/deprecatedapi/ohos_router.ets new file mode 100755 index 0000000000..ae611f9ff3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_router.ets @@ -0,0 +1,35 @@ +/* + * 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 router from '@ohos.router'; + +router.enableAlertBeforeBackPage({ // error + message: 'Message Info' +}); + +class routerParams { + data1: string; + + constructor(str: string) { + this.data1 = str; + } +} + +router.replace({ // error + url: 'pages/detail', + params: new routerParams('message') +}); + +router.disableAlertBeforeBackPage(); // error \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_router.ets.args.json b/ets2panda/linter/test/deprecatedapi/ohos_router.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_router.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/ohos_router.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/ohos_router.ets.arkts2.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_router.ets.arkts2.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/ohos_router.ets.json b/ets2panda/linter/test/deprecatedapi/ohos_router.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/ohos_router.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets b/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets new file mode 100755 index 0000000000..bf817a2f48 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets @@ -0,0 +1,41 @@ +/* + * 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 {PanelMode} from './sdk/api/panel'; + +@Entry +@Component +struct PanelExample { + @State show: boolean = false + + build() { + Column() { + Panel(this.show) { + Column() { + } + } + .mode(PanelMode.Mini) //error + Panel(this.show) { + Column() { + } + } + .mode(PanelMode.Half) //error + Panel(this.show) { + Column() { + } + } + .mode(PanelMode.Full) //error + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.arkts2.json new file mode 100755 index 0000000000..14b1f5d64e --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.arkts2.json @@ -0,0 +1,178 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 28, + "column": 13, + "endLine": 28, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 23, + "endLine": 28, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 13, + "endLine": 33, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 23, + "endLine": 33, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 13, + "endLine": 38, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 23, + "endLine": 38, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 5, + "endLine": 23, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Panel\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 9, + "endLine": 25, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 7, + "endLine": 29, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Panel\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 9, + "endLine": 30, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 7, + "endLine": 34, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Panel\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 9, + "endLine": 35, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.json b/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/panelModePanelMode_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets b/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets new file mode 100755 index 0000000000..a15ecce3cf --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets @@ -0,0 +1,18 @@ +/* + * 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 { PersistentStorage } from './sdk/api/common_ts_ets_api'; + +PersistentStorage.PersistProps([{ key: 'highScore', defaultValue: '0' }, { key: 'wightScore', defaultValue: '1' }]); //error +PersistentStorage.Keys(); //error \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.arkts2.json new file mode 100755 index 0000000000..61e8ea37de --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.arkts2.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 19, + "endLine": 17, + "endColumn": 31, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 19, + "endLine": 18, + "endColumn": 23, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.json b/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/persistentStoragePersistProps_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/progress.ets b/ets2panda/linter/test/deprecatedapi/progress.ets new file mode 100755 index 0000000000..523cdab0b9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/progress.ets @@ -0,0 +1,36 @@ +/* + * 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. + */ + +@Entry +@Component +struct ProgressExample { + private gradientColor: LinearGradient = new LinearGradient([{ color: Color.Yellow, offset: 0.5 }, + { color: Color.Orange, offset: 1.0 }]) + private progress: ProgressOptions = { + value: 70, + total: 100, + type: ProgressType.Ring, + style: ProgressStyle.Linear // error + }; + + build() { + Column({ space: 15 }) { + Text('Gradient Color').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress(this.progress) + .width(100).style({ strokeWidth: 20 }) + .color(this.gradientColor) + }.width('100%').padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/progress.ets.args.json b/ets2panda/linter/test/deprecatedapi/progress.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/progress.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/progress.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/progress.ets.arkts2.json new file mode 100755 index 0000000000..474b79dc90 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/progress.ets.arkts2.json @@ -0,0 +1,248 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 26, + "endLine": 19, + "endColumn": 40, + "problem": "DuplicateDeclNameFromSdk", + "suggest": "", + "rule": "API path have changed - please update your imports accordingly (sdk-no-decl-with-duplicate-name)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 47, + "endLine": 19, + "endColumn": 61, + "problem": "DuplicateDeclNameFromSdk", + "suggest": "", + "rule": "API path have changed - please update your imports accordingly (sdk-no-decl-with-duplicate-name)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 47, + "endLine": 19, + "endColumn": 61, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 12, + "endLine": 22, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 12, + "endLine": 23, + "endColumn": 15, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 21, + "endLine": 29, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 39, + "endLine": 30, + "endColumn": 40, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 16, + "endLine": 32, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 42, + "endLine": 32, + "endColumn": 44, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 36, + "endLine": 34, + "endColumn": 37, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 2, + "endLine": 16, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 26, + "endLine": 19, + "endColumn": 40, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"LinearGradient\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 47, + "endLine": 19, + "endColumn": 61, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"LinearGradient\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 72, + "endLine": 19, + "endColumn": 77, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Color\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 14, + "endLine": 20, + "endColumn": 19, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Color\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 21, + "endLine": 21, + "endColumn": 36, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ProgressOptions\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 37, + "endLine": 21, + "endColumn": 49, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ProgressType\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 11, + "endLine": 24, + "endColumn": 23, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ProgressType\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 12, + "endLine": 25, + "endColumn": 25, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"ProgressStyle\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 5, + "endLine": 29, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 7, + "endLine": 30, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 7, + "endLine": 31, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Progress\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/progress.ets.json b/ets2panda/linter/test/deprecatedapi/progress.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/progress.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/prompts_api.ets b/ets2panda/linter/test/deprecatedapi/prompts_api.ets new file mode 100755 index 0000000000..c6f549d289 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/prompts_api.ets @@ -0,0 +1,73 @@ +/* + * 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 prompt from './sdk/api/@ohos.prompt' + +prompt.showToast({ + message: 'www', + duration: 2000, + bottom: 20, +}); + +prompt.showDialog({ + title: 'Title Info', + message: 'Message Info', + buttons: [ + { + text: 'button1', + color: '#000000' + }, + ], +}) + +prompt.showActionMenu({ + title: 'Title Info', + buttons: [ + { + text: 'item1', + color: '#666666' + }, + { + text: 'item2', + color: '#000000' + }, + ] +}, (err, data) => { + if (err) { + console.info('showActionMenu err: ' + err); + return; + } + console.info('showActionMenu success callback, click button: ' + data.index); +}) + +prompt.showDialog({ + title: 'showDialog Title Info', + message: 'Message Info', + buttons: [ + { + text: 'button1', + color: '#000000' + }, + { + text: 'button2', + color: '#000000' + } + ] +}, (err, data) => { + if (err) { + console.info('showDialog err: ' + err); + return; + } + console.info('showDialog success callback, click button: ' + data.index); +}); \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/prompts_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/prompts_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/prompts_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/prompts_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/prompts_api.ets.arkts2.json new file mode 100755 index 0000000000..948a105791 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/prompts_api.ets.arkts2.json @@ -0,0 +1,248 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 8, + "endLine": 17, + "endColumn": 17, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 3, + "endLine": 18, + "endColumn": 10, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 3, + "endLine": 19, + "endColumn": 11, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 13, + "endLine": 19, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 3, + "endLine": 20, + "endColumn": 9, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 11, + "endLine": 20, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 8, + "endLine": 23, + "endColumn": 18, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 3, + "endLine": 24, + "endColumn": 8, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 3, + "endLine": 25, + "endColumn": 10, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 7, + "endLine": 29, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 8, + "endLine": 34, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 3, + "endLine": 36, + "endColumn": 10, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 7, + "endLine": 39, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 7, + "endLine": 43, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 5, + "endLine": 46, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 10, + "endLine": 46, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 8, + "endLine": 54, + "endColumn": 18, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 55, + "column": 3, + "endLine": 55, + "endColumn": 8, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 3, + "endLine": 56, + "endColumn": 10, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 60, + "column": 7, + "endLine": 60, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 64, + "column": 7, + "endLine": 64, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 5, + "endLine": 67, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 10, + "endLine": 67, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/prompts_api.ets.json b/ets2panda/linter/test/deprecatedapi/prompts_api.ets.json new file mode 100755 index 0000000000..bf8516a85b --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/prompts_api.ets.json @@ -0,0 +1,58 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 46, + "column": 5, + "endLine": 46, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 10, + "endLine": 46, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 5, + "endLine": 67, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 10, + "endLine": 67, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/refresh.ets b/ets2panda/linter/test/deprecatedapi/refresh.ets new file mode 100644 index 0000000000..f58c225b7c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/refresh.ets @@ -0,0 +1,66 @@ +/* + * 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. + */ + +@Entry +@Component +struct RefreshExample { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, offset: 1 }) { //error + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()); + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }) + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/refresh.ets.json b/ets2panda/linter/test/deprecatedapi/refresh.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/refresh.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets b/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets new file mode 100755 index 0000000000..542dae4405 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets @@ -0,0 +1,53 @@ +/* + * 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 Router from './sdk/api/@system.router'; + +class Z{ + disableAlertBeforeBackPage() { + Router.disableAlertBeforeBackPage({ + success: () => { + console.log('success'); + }, + cancel: () => { + console.log('cancel'); + }, + complete: () => { + console.log('cancel'); + } + }); + } +} +export default new Z() + +class C{ + replacePage() { + Router.replace({ + uri: 'pages/detail/detail', + params: { + data1: 'message' + } + }); + } +} +export default new C() + +class I{ + clearPage() { + Router.clear(); + } +} +export default new I() + +Router \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.arkts2.json new file mode 100755 index 0000000000..09884303b5 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.arkts2.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 12, + "endLine": 19, + "endColumn": 38, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 7, + "endLine": 20, + "endColumn": 14, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 7, + "endLine": 26, + "endColumn": 15, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 12, + "endLine": 36, + "endColumn": 19, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 7, + "endLine": 37, + "endColumn": 10, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 7, + "endLine": 38, + "endColumn": 13, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 48, + "column": 12, + "endLine": 48, + "endColumn": 17, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 1, + "endLine": 53, + "endColumn": 7, + "problem": "ClassAsObjectError", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.json b/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.json new file mode 100755 index 0000000000..bc846022c1 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerDisableAlertBeforeBackPage_api.ets.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 53, + "column": 1, + "endLine": 53, + "endColumn": 7, + "problem": "ClassAsObject", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)", + "severity": "WARNING" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets b/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets new file mode 100755 index 0000000000..0a37728e9f --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets @@ -0,0 +1,22 @@ +/* + * 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 router from './sdk/api/@system.router'; + +class H{ + backToDetail() { + router.back({uri:'pages/detail/detail'}); + } +} +export default new H() \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.arkts2.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.arkts2.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.json b/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerOptionsUri_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerPush_api.ets b/ets2panda/linter/test/deprecatedapi/routerPush_api.ets new file mode 100755 index 0000000000..e8b1028e94 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerPush_api.ets @@ -0,0 +1,38 @@ +/* + * 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 { router } from './sdk/api/@ohos.router'; + +class innerParams { + data3: number[]; + + constructor(tuple: number[]) { + this.data3 = tuple; + } +} + +class routerParams { + data1: string; + data2: innerParams; + + constructor(str: string, tuple: number[]) { + this.data1 = str; + this.data2 = new innerParams(tuple); + } +} + +router.push({ + url: 'pages/routerpage2', + params: new routerParams('message', [123, 456, 789]) +}); \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerPush_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/routerPush_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerPush_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/routerPush_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/routerPush_api.ets.arkts2.json new file mode 100755 index 0000000000..f0f575da71 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerPush_api.ets.arkts2.json @@ -0,0 +1,58 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 35, + "column": 8, + "endLine": 35, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 40, + "endLine": 37, + "endColumn": 43, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 45, + "endLine": 37, + "endColumn": 48, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 50, + "endLine": 37, + "endColumn": 53, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerPush_api.ets.json b/ets2panda/linter/test/deprecatedapi/routerPush_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerPush_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets b/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets new file mode 100755 index 0000000000..8bc04f1c26 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets @@ -0,0 +1,22 @@ +/* + * 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 RouterState from './sdk/api/@system.router'; + +class K{ + getState() { + let page = RouterState.getState().index; + } +} +export default new K() \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.arkts2.json new file mode 100755 index 0000000000..bd4e05e281 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.arkts2.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 9, + "endLine": 19, + "endColumn": 44, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.json b/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.json new file mode 100755 index 0000000000..bd4e05e281 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/routerStateIndex_api.ets.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 9, + "endLine": 19, + "endColumn": 44, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/scroll_api.ets b/ets2panda/linter/test/deprecatedapi/scroll_api.ets new file mode 100755 index 0000000000..0e584adacc --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/scroll_api.ets @@ -0,0 +1,30 @@ +/* + * 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 {ScrollDirection,Scroller,ScrollAttribute} from './sdk/api/scroll'; + +const scroller: Scroller = new Scroller() +@Entry +@Component +struct ScrollExample { + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(scroller) + .scrollable(ScrollDirection.Free) //error + Column() { + }.width('100%') + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/scroll_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/scroll_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/scroll_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/scroll_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/scroll_api.ets.arkts2.json new file mode 100755 index 0000000000..f32e2bf1c3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/scroll_api.ets.arkts2.json @@ -0,0 +1,88 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 25, + "column": 37, + "endLine": 25, + "endColumn": 41, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 2, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 5, + "endLine": 23, + "endColumn": 10, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Stack\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 27, + "endLine": 23, + "endColumn": 36, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Alignment\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Scroll\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 9, + "endLine": 26, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/scroll_api.ets.json b/ets2panda/linter/test/deprecatedapi/scroll_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/scroll_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.animator.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.animator.d.ts new file mode 100644 index 0000000000..3fea7915ea --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.animator.d.ts @@ -0,0 +1,72 @@ +/* + * 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 declare class Animator { + static createAnimator(options: AnimatorOptions): AnimatorResult; + static create(options: AnimatorOptions): AnimatorResult; +} + +export interface AnimatorOptions { + duration: number; + easing: string; + delay: number; + fill: "none" | "forwards" | "backwards" | "both"; + direction: "normal" | "reverse" | "alternate" | "alternate-reverse"; + iterations: number; + begin: number; + end: number; +} + +export interface AnimatorResult { + update(options: AnimatorOptions): void; + reset(options: AnimatorOptions): void; + reset(options: AnimatorOptions | SimpleAnimatorOptions): void; + play(): void; + finish(): void; + pause(): void; + cancel(): void; + reverse(): void; + onframe: (progress: number) => void; + onFrame: (progress: number) => void; + onfinish: () => void; + onFinish: () => void; + oncancel: () => void; + onCancel: () => void; + onrepeat: () => void; + onRepeat: () => void; + setExpectedFrameRateRange(rateRange: ExpectedFrameRateRange): void; +} + +export declare class SimpleAnimatorOptions { + duration(duration: number): SimpleAnimatorOptions; + easing(curve: string): SimpleAnimatorOptions; + delay(delay: number): SimpleAnimatorOptions; + fill(fillMode: FillMode): SimpleAnimatorOptions; + direction(direction: PlayMode): SimpleAnimatorOptions; + iterations(iterations: number): SimpleAnimatorOptions; +} + +declare enum PlayMode { + Normal, + Reverse, + Alternate, + AlternateReverse +} + +declare interface ExpectedFrameRateRange { + min: number; + max: number; + expected: number; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.curves.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.curves.d.ts new file mode 100755 index 0000000000..8d7164186c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.curves.d.ts @@ -0,0 +1,18 @@ +/* + * 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 declare namespace curves { + function init(curve?: Curve): string; +} diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.font.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.font.d.ts new file mode 100755 index 0000000000..d8a7e565ce --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.font.d.ts @@ -0,0 +1,19 @@ +/* + * 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 declare namespace font { + function getFontByName(fontName: string): FontInfo; + function getSystemFontList(): Array; + function registerFont(options: FontOptions): void; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.matrix4.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.matrix4.d.ts new file mode 100755 index 0000000000..29f253a989 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.matrix4.d.ts @@ -0,0 +1,20 @@ +/* + * 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 declare namespace matrix4 { + function rotate(options: RotateOption): Matrix4Transit; + function copy(): Matrix4Transit; + function translate(options: TranslateOption): Matrix4Transit; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.prompt.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.prompt.d.ts new file mode 100755 index 0000000000..d8a0fae2aa --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.prompt.d.ts @@ -0,0 +1,58 @@ +/* + * 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. + */ +declare namespace prompt { + + interface ShowToastOptions { + message: string; + duration?: number; + bottom?: string | number; + } + interface Button { + text: string; + color: string; + } + interface ShowDialogSuccessResponse { + index: number; + } + interface ShowDialogOptions { + title?: string; + message?: string; + buttons?: [ + Button, + Button?, + Button? + ]; + } + interface ActionMenuSuccessResponse { + index: number; + } + interface ActionMenuOptions { + title?: string; + buttons: [ + Button, + Button?, + Button?, + Button?, + Button?, + Button? + ]; + } + function showToast(options: ShowToastOptions): void; + function showDialog(options: ShowDialogOptions, callback: AsyncCallback): void; + function showDialog(options: ShowDialogOptions): Promise; + function showActionMenu(options: ActionMenuOptions, callback: AsyncCallback): void; + function showActionMenu(options: ActionMenuOptions): Promise; +} +export default prompt; diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.router.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.router.d.ts new file mode 100755 index 0000000000..9c2e6dc51a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/@ohos.router.d.ts @@ -0,0 +1,23 @@ +/* + * 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 declare namespace router { + function push(options: RouterOptions): void; +} + +export interface BackRouterOptions { + uri?: string; + params?: Object; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/@system.app.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/@system.app.d.ts new file mode 100755 index 0000000000..274e07311c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/@system.app.d.ts @@ -0,0 +1,20 @@ +/* + * 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 default class App { + static setImageCacheCount(value: number): void; + static setImageRawDataCacheSize(value: number): void; + static setImageFileCacheSize(value: number): void; + static screenOnVisible(options?: ScreenOnVisibleOptions): void; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/@system.prompt.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/@system.prompt.d.ts new file mode 100755 index 0000000000..cf2a916ea8 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/@system.prompt.d.ts @@ -0,0 +1,17 @@ +/* + * 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 default class Prompt { + static showToast(options: ShowToastOptions): void; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/@system.router.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/@system.router.d.ts new file mode 100644 index 0000000000..771cd69199 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/@system.router.d.ts @@ -0,0 +1,37 @@ +/* + * 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 default class Router { + static enableAlertBeforeBackPage(options: EnableAlertBeforeBackPageOptions): void; + static disableAlertBeforeBackPage(options?: DisableAlertBeforeBackPageOptions): void; + static replace(options: RouterOptions): void; + static clear(): void; +} + +export interface DisableAlertBeforeBackPageOptions { + success?: (errMsg: string) => void; + complete?: () => void; +} + +export interface RouterState { + index: number; + name: string; + path: string; +} + +export interface RouterOptions { + uri: string; + params?: Object; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/ChipGroup.d.ets b/ets2panda/linter/test/deprecatedapi/sdk/api/ChipGroup.d.ets new file mode 100644 index 0000000000..552b88513c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/ChipGroup.d.ets @@ -0,0 +1,17 @@ +/* + * 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 ChipGroupItemOptions { + suffixIcon?: IconOptions; +} diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/action_sheet.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/action_sheet.d.ts new file mode 100644 index 0000000000..5ad8ab60c9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/action_sheet.d.ts @@ -0,0 +1,24 @@ +/* + * 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 ActionSheetOptions { + autoCancel?: boolean; + showInSubWindow?: boolean; + isModal?: boolean; +} + +export declare class ActionSheet { + static show(value: ActionSheetOptions); +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/alert_dialog.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/alert_dialog.d.ts new file mode 100644 index 0000000000..a26a6671d4 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/alert_dialog.d.ts @@ -0,0 +1,39 @@ +/* + * 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 declare class AlertDialog { + static show(value: AlertDialogParamWithConfirm | AlertDialogParamWithButtons | AlertDialogParamWithOptions); +} + +declare interface AlertDialogParamWithConfirm extends AlertDialogParam { + confirm?: AlertDialogButtonBaseOptions; +} + +declare interface AlertDialogParamWithButtons extends AlertDialogParam { + primaryButton: AlertDialogButtonBaseOptions; + secondaryButton: AlertDialogButtonBaseOptions; +} + +declare interface AlertDialogParamWithOptions extends AlertDialogParam { + buttons: Array; +} + +declare interface AlertDialogButtonBaseOptions {} + +declare interface AlertDialogParam {} + +declare interface AlertDialogButtonOptions extends AlertDialogButtonBaseOptions { + primary?: boolean; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/common.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/common.d.ts new file mode 100755 index 0000000000..ab9ed204bd --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/common.d.ts @@ -0,0 +1,31 @@ +/* + * 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 declare interface CustomPopupOptions { + maskColor?: Color | string | Resource | number; +} + +export declare interface DragEvent { + getX(): number; + getY(): number; +} +declare class CommonMethod { + gridSpan(value: number): T; + gridOffset(value: number): T; +} +export declare interface LayoutInfo {} +export declare interface LayoutChild {} +export declare interface LayoutBorderInfo {} +export declare interface TransitionOptions {} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/common_ts_ets_api.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/common_ts_ets_api.d.ts new file mode 100644 index 0000000000..4498350f03 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/common_ts_ets_api.d.ts @@ -0,0 +1,44 @@ +/* + * 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 declare class LocalStorage { + constructor(initializingProperties?: Object); + static getShared(): LocalStorage; +} + +export declare class Environment { + static EnvProp(key: string, value: S): boolean; + static Keys(): Array; + static EnvProps(props: { + key: string; + defaultValue: any; + }[]): void; +} + +export declare class AppStorage { + static IsMutable(propName: string): boolean; + static Get(propName: string): T | undefined; + static Clear(): boolean; + static Delete(propName: string): boolean; + static Size(): number; +} + +export declare class PersistentStorage { + static PersistProps(properties: { + key: string; + defaultValue: any; + }[]): void; + static Keys(): Array; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/enums.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/enums.d.ts new file mode 100755 index 0000000000..f08eae1aea --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/enums.d.ts @@ -0,0 +1,21 @@ +/* + * 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 declare enum XComponentType { + SURFACEE, + COMPONENT, + TEXTURE, + NODE +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/grid.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/grid.d.ts new file mode 100755 index 0000000000..49c677c793 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/grid.d.ts @@ -0,0 +1,18 @@ +/* + * 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 declare class GridAttribute extends ScrollableCommonMethod { + onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): GridAttribute; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/grid_container.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/grid_container.d.ts new file mode 100755 index 0000000000..6cbc689ddd --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/grid_container.d.ts @@ -0,0 +1,37 @@ +/* + * 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 GridContainerInterface { + + (value?: GridContainerOptions): GridContainerAttribute; +} + +export declare class GridContainerAttribute extends ColumnAttribute { +} + +export declare enum SizeType { + Auto, + XS, + SM, + MD, + LG +} + +export declare interface GridContainerOptions { + columns?: number | "auto"; + sizeType?: SizeType; + gutter?: number | string; + margin?: number | string; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/list_item.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/list_item.d.ts new file mode 100644 index 0000000000..d8394f36ba --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/list_item.d.ts @@ -0,0 +1,31 @@ +/* + * 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 declare class ListItemAttribute extends CommonMethod { + sticky(value: Sticky): ListItemAttribute; + editable(value: boolean | EditMode): ListItemAttribute; +} + +export declare enum Sticky { + None, + Normal, + Opacity +} + +export declare enum EditMode { + None, + Deletable, + Movable +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/nav_router.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/nav_router.d.ts new file mode 100644 index 0000000000..ddce579ce4 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/nav_router.d.ts @@ -0,0 +1,38 @@ +/* + * 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 declare const NavRouterInstance: NavRouterAttribute; +export declare const NavRouter: NavRouterInterface; + +export declare class NavRouterAttribute extends CommonMethod { + mode(mode: NavRouteMode): NavRouterAttribute; + onStateChange(callback: (isActivated: boolean) => void): NavRouterAttribute; +} + +export declare enum NavRouteMode{ + PUSH_WITH_RECREATE, + PUSH, + REPLACE +} + +export declare interface NavRouterInterface { + (): NavRouterAttribute + (value: RouteInfo): NavRouterAttribute; +} + +export declare interface RouteInfo { + name: string; + param?: unknown; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/navigator.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/navigator.d.ts new file mode 100644 index 0000000000..7a9894459b --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/navigator.d.ts @@ -0,0 +1,24 @@ +/* + * 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 declare const NavigatorInstance: NavigatorAttribute; +export declare const Navigator: NavigatorInterface; + +export declare class NavigatorAttribute extends CommonMethod { + active(value: boolean): NavigatorAttribute; + type(value: NavigationType): NavigatorAttribute; + target(value: string): NavigatorAttribute; + params(value: object): NavigatorAttribute; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/panel.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/panel.d.ts new file mode 100755 index 0000000000..b011566efa --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/panel.d.ts @@ -0,0 +1,29 @@ +/* + * 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 declare enum PanelHeight { + WRAP_CONTENT = 'wrapContent' +} +export declare enum PanelType { + Minibar = 0, + Foldable = 1, + Temporary = 2, + CUSTOM = 3 +} +export declare enum PanelMode { + Mini, + Half, + Full +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/scroll.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/scroll.d.ts new file mode 100644 index 0000000000..96bb53c648 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/scroll.d.ts @@ -0,0 +1,32 @@ +/* + * 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 declare class ScrollAttribute extends ScrollableCommonMethod { + onScroll(event: (xOffset: number, yOffset: number) => void): ScrollAttribute; + onScrollEnd(event: () => void): ScrollAttribute; +} + +export declare enum ScrollDirection { + Vertical, + Horizontal, + Free, + None +} +export declare class Scroller{ + scrollPage(value: { + next: boolean; + direction?: Axis; + }); +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/slider.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/slider.d.ts new file mode 100644 index 0000000000..f2aae70dd8 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/slider.d.ts @@ -0,0 +1,18 @@ +/* + * 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 declare class SliderAttribute extends CommonMethod { + minLabel(value: string): SliderAttribute; + maxLabel(value: string): SliderAttribute; +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sdk/api/swiper.d.ts b/ets2panda/linter/test/deprecatedapi/sdk/api/swiper.d.ts new file mode 100644 index 0000000000..0c33e754d3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sdk/api/swiper.d.ts @@ -0,0 +1,35 @@ +/* + * 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 declare interface IndicatorStyle { + left?: Length; + top?: Length; + right?: Length; + bottom?: Length; + size?: Length; + mask?: boolean; + color?: ResourceColor; + selectedColor?: ResourceColor; +} +export declare class SwiperAttribute extends CommonMethod { + indicatorStyle(value?: IndicatorStyle): SwiperAttribute; +} + +export declare enum SwiperDisplayMode { + Stretch, + AutoLinear, + STRETCH, + AUTO_LINEAR +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets b/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets new file mode 100755 index 0000000000..2adcbc65c5 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets @@ -0,0 +1,21 @@ +/* + * 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 App from './sdk/api/@system.app'; + +export default class Req { + requestFullWindow() { + App.setImageCacheCount(104857600); + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.arkts2.json new file mode 100755 index 0000000000..d53d7bd350 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.arkts2.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 9, + "endLine": 19, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 28, + "endLine": 19, + "endColumn": 37, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.json b/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.json new file mode 100755 index 0000000000..9f305c86d7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageCacheCount_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets b/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets new file mode 100755 index 0000000000..d391c2718c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets @@ -0,0 +1,21 @@ +/* + * 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 App from './sdk/api/@system.app'; + +export default class Req { + requestFullWindow() { + App.setImageFileCacheSize(104857600); + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.arkts2.json new file mode 100755 index 0000000000..5f505ff2ec --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.arkts2.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 9, + "endLine": 19, + "endColumn": 30, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 31, + "endLine": 19, + "endColumn": 40, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.json b/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.json new file mode 100755 index 0000000000..9f305c86d7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageFileCacheSize_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets b/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets new file mode 100755 index 0000000000..8e717bba1f --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets @@ -0,0 +1,21 @@ +/* + * 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 App from './sdk/api/@system.app'; + +export default class Req { + requestFullWindow() { + App.setImageRawDataCacheSize(104857600); + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.arkts2.json new file mode 100755 index 0000000000..ea7d95ceec --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.arkts2.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 19, + "column": 9, + "endLine": 19, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 34, + "endLine": 19, + "endColumn": 43, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.json b/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.json new file mode 100755 index 0000000000..9f305c86d7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/setImageRawDataCacheSize_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/shortName.ets b/ets2panda/linter/test/deprecatedapi/shortName.ets new file mode 100755 index 0000000000..a51ac48ceb --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/shortName.ets @@ -0,0 +1,19 @@ +/* + * 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 { ElementName } from './sdk/api/elementName'; + +funtion a() { + console.log(ElementName.shortName) +} diff --git a/ets2panda/linter/test/deprecatedapi/shortName.ets.args.json b/ets2panda/linter/test/deprecatedapi/shortName.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/shortName.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/shortName.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/shortName.ets.arkts2.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/shortName.ets.arkts2.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/shortName.ets.json b/ets2panda/linter/test/deprecatedapi/shortName.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/shortName.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/showActionMenu.ets b/ets2panda/linter/test/deprecatedapi/showActionMenu.ets new file mode 100755 index 0000000000..543db4aed1 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/showActionMenu.ets @@ -0,0 +1,52 @@ +/* + * 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 prompt from './sdk/api/@ohos.prompt'; + + +prompt.showActionMenu({ + title: 'Title Info', + buttons: [ + { + text: 'item1', + color: '#666666' + }, + { + text: 'item2', + color: '#000000' + }, + ] +}, (err, data) => { + if (err) { + console.info('showActionMenu err: ' + err); + return; + } + console.info('showActionMenu success callback, click button: ' + data.index); +}) + +prompt.showActionMenu({ + title: 'Title Info', + buttons: [ + { + text: 'item1', + color: '#666666' + }, + { + text: 'item2', + color: '#000000' + }, + ] +}).then(()=>{ + +}) \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/showActionMenu.ets.args.json b/ets2panda/linter/test/deprecatedapi/showActionMenu.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/showActionMenu.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/showActionMenu.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/showActionMenu.ets.arkts2.json new file mode 100755 index 0000000000..b44f244961 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/showActionMenu.ets.arkts2.json @@ -0,0 +1,118 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 18, + "column": 8, + "endLine": 18, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 3, + "endLine": 20, + "endColumn": 10, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 7, + "endLine": 27, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 5, + "endLine": 30, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 10, + "endLine": 30, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 8, + "endLine": 38, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 3, + "endLine": 40, + "endColumn": 10, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 7, + "endLine": 43, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 7, + "endLine": 47, + "endColumn": 12, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/showActionMenu.ets.json b/ets2panda/linter/test/deprecatedapi/showActionMenu.ets.json new file mode 100755 index 0000000000..496f2c021f --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/showActionMenu.ets.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 30, + "column": 5, + "endLine": 30, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 10, + "endLine": 30, + "endColumn": 14, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/showToast_api.ets b/ets2panda/linter/test/deprecatedapi/showToast_api.ets new file mode 100755 index 0000000000..a59df53bff --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/showToast_api.ets @@ -0,0 +1,22 @@ +/* + * 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 Prompt from "./sdk/api/@system.prompt" +class A{ + showToast() { + Prompt.showToast({ + message: 'Message Info', + }); + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/showToast_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/showToast_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/showToast_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/showToast_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/showToast_api.ets.arkts2.json new file mode 100755 index 0000000000..9f33816e3c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/showToast_api.ets.arkts2.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/showToast_api.ets.json b/ets2panda/linter/test/deprecatedapi/showToast_api.ets.json new file mode 100755 index 0000000000..9f33816e3c --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/showToast_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/sizeType.ets b/ets2panda/linter/test/deprecatedapi/sizeType.ets new file mode 100755 index 0000000000..ec52efea3e --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sizeType.ets @@ -0,0 +1,45 @@ +/* + * 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 { SizeType } from './sdk/api/grid_container' + +@Entry +@Component +struct GridContainerExample { + @State sizeType: SizeType = SizeType.XS + + build() { + Column({ space: 5 }) { + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('XS') + .onClick(() => { + this.sizeType = SizeType.XS + }).backgroundColor(0x317aff) + Button('SM') + .onClick(() => { + this.sizeType = SizeType.SM + }).backgroundColor(0x317aff) + Button('MD') + .onClick(() => { + this.sizeType = SizeType.MD + }).backgroundColor(0x317aff) + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG + }).backgroundColor(0x317aff) + } + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sizeType.ets.args.json b/ets2panda/linter/test/deprecatedapi/sizeType.ets.args.json new file mode 100755 index 0000000000..1b80aa9e73 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sizeType.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } + } \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sizeType.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/sizeType.ets.arkts2.json new file mode 100644 index 0000000000..d3824f7d72 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sizeType.ets.arkts2.json @@ -0,0 +1,248 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 31, + "endLine": 20, + "endColumn": 39, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 40, + "endLine": 20, + "endColumn": 42, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 21, + "endLine": 23, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 66, + "endLine": 24, + "endColumn": 67, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 29, + "endLine": 28, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 38, + "endLine": 28, + "endColumn": 40, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 29, + "endLine": 32, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 38, + "endLine": 32, + "endColumn": 40, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 29, + "endLine": 36, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 38, + "endLine": 36, + "endColumn": 40, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 29, + "endLine": 40, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 38, + "endLine": 40, + "endColumn": 40, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 35, + "endLine": 43, + "endColumn": 36, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 5, + "endLine": 23, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 7, + "endLine": 25, + "endColumn": 10, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 9, + "endLine": 26, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 9, + "endLine": 30, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 9, + "endLine": 34, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 9, + "endLine": 38, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Button\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sizeType.ets.json b/ets2panda/linter/test/deprecatedapi/sizeType.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sizeType.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets b/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets new file mode 100755 index 0000000000..9f6cc8207d --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets @@ -0,0 +1,28 @@ +/* + * 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 {SizeType} from './sdk/api/grid_container'; + +@Entry +@Component +struct ResponsiveExample { + @StorageLink('currentSizeType') currentSizeType: SizeType = SizeType.SM; + + build() { + Column() { + if (this.currentSizeType === SizeType.XS) { + } + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.arkts2.json new file mode 100755 index 0000000000..969b9eb44b --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.arkts2.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 20, + "column": 63, + "endLine": 20, + "endColumn": 71, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 72, + "endLine": 20, + "endColumn": 74, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 36, + "endLine": 24, + "endColumn": 44, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 45, + "endLine": 24, + "endColumn": 47, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 2, + "endLine": 17, + "endColumn": 7, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 15, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"StorageLink\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 5, + "endLine": 23, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.json b/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/sizeTypeXS_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/slider_api.ets b/ets2panda/linter/test/deprecatedapi/slider_api.ets new file mode 100644 index 0000000000..9ec3620c2e --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/slider_api.ets @@ -0,0 +1,30 @@ +/* + * 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 {SliderAttribute} from './sdk/api/slider'; + +@Entry +@Component +struct SliderExample { + build() { + Column({ space: 8 }) { + Row() { + Slider() + .minLabel('aa') //error + .maxLabel('bb') //error + } + .width('100%') + }.width('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/slider_api.ets.json b/ets2panda/linter/test/deprecatedapi/slider_api.ets.json new file mode 100755 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/slider_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/swiper_api.ets b/ets2panda/linter/test/deprecatedapi/swiper_api.ets new file mode 100755 index 0000000000..07a2506def --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/swiper_api.ets @@ -0,0 +1,52 @@ +/* + * 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 {IndicatorStyle,SwiperDisplayMode} from './sdk/api/swiper'; + +class Test extends Test implements IndicatorStyle{ //error + layoutInfo: IndicatorStyle|undefined = undefined;//error + get(option:Map){//error + option.set('',{top:100,color:1111});//error + option.set('',{bottom:SwiperDisplayMode.Stretch})//error + } + getInfo(){ + return this.layoutInfo; + } + set(){ + typeof this.layoutInfo?.left//error + this.layoutInfo?.right == 100//error + this.layoutInfo?.color?.toString()//error + const info = this.layoutInfo; + console.log(info?.selectedColor+'');//error + this.getInfo()?.mask//error + this.layoutInfo?.bottom//error + setTop(this.getInfo()) + } + setSize(layoutInfo: IndicatorStyle|undefined){//error + layoutInfo?.size ;//error + } +} +function setTop(layoutInfo: IndicatorStyle|undefined ){//error + layoutInfo?.top == 0;//error +} +function getBotton(){ + new Test().getInfo()?.bottom;//error + const test = new Test(); + return test.layoutInfo?.bottom;//error +} +function get(){ + const AutoLinear = SwiperDisplayMode.AutoLinear//error + typeof SwiperDisplayMode.Stretch;//error + return SwiperDisplayMode.AUTO_LINEAR;//error +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/swiper_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/swiper_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/swiper_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/swiper_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/swiper_api.ets.arkts2.json new file mode 100755 index 0000000000..9aeb20fcec --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/swiper_api.ets.arkts2.json @@ -0,0 +1,298 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 37, + "endLine": 17, + "endColumn": 51, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 15, + "endLine": 18, + "endColumn": 29, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 25, + "endLine": 19, + "endColumn": 39, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 20, + "endLine": 20, + "endColumn": 23, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 24, + "endLine": 20, + "endColumn": 27, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 28, + "endLine": 20, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 34, + "endLine": 20, + "endColumn": 38, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 20, + "endLine": 21, + "endColumn": 26, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 45, + "endLine": 21, + "endColumn": 52, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 29, + "endLine": 27, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 22, + "endLine": 28, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 31, + "endLine": 28, + "endColumn": 34, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 22, + "endLine": 29, + "endColumn": 27, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 23, + "endLine": 31, + "endColumn": 36, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 21, + "endLine": 32, + "endColumn": 25, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 22, + "endLine": 33, + "endColumn": 28, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 23, + "endLine": 36, + "endColumn": 37, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 17, + "endLine": 37, + "endColumn": 21, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 29, + "endLine": 40, + "endColumn": 43, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 15, + "endLine": 41, + "endColumn": 18, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 22, + "endLine": 41, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 10, + "endLine": 43, + "endColumn": 19, + "problem": "LimitedReturnTypeInference", + "suggest": "", + "rule": "Function return type inference is limited (arkts-no-implicit-return-types)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 25, + "endLine": 44, + "endColumn": 31, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 27, + "endLine": 46, + "endColumn": 33, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 49, + "column": 9, + "endLine": 49, + "endColumn": 50, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 49, + "column": 40, + "endLine": 49, + "endColumn": 50, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 28, + "endLine": 50, + "endColumn": 35, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 28, + "endLine": 51, + "endColumn": 39, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/swiper_api.ets.json b/ets2panda/linter/test/deprecatedapi/swiper_api.ets.json new file mode 100755 index 0000000000..828c0d03a2 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/swiper_api.ets.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 43, + "column": 10, + "endLine": 43, + "endColumn": 19, + "problem": "LimitedReturnTypeInference", + "suggest": "", + "rule": "Function return type inference is limited (arkts-no-implicit-return-types)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/system_prompt.ets b/ets2panda/linter/test/deprecatedapi/system_prompt.ets new file mode 100755 index 0000000000..af14dd8352 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/system_prompt.ets @@ -0,0 +1,30 @@ +/* + * 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 prompt, { ShowToastOptions } from '@system.prompt'; + +class A { + private options: ShowToastOptions = { // error + message: 'Message Info', // error + duration: 2000, // error + bottom: 10 // error + } + + showToast() { + prompt.showToast(this.options); + } +} + +export default new A() diff --git a/ets2panda/linter/test/deprecatedapi/system_prompt.ets.args.json b/ets2panda/linter/test/deprecatedapi/system_prompt.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/system_prompt.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/system_prompt.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/system_prompt.ets.arkts2.json new file mode 100755 index 0000000000..bd5ae47f21 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/system_prompt.ets.arkts2.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 21, + "column": 15, + "endLine": 21, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 13, + "endLine": 22, + "endColumn": 15, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/system_prompt.ets.json b/ets2panda/linter/test/deprecatedapi/system_prompt.ets.json new file mode 100755 index 0000000000..7633c79b6a --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/system_prompt.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/system_router.ets b/ets2panda/linter/test/deprecatedapi/system_router.ets new file mode 100755 index 0000000000..fd53ea0ce3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/system_router.ets @@ -0,0 +1,103 @@ +/* + * 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 router, { + BackRouterOptions, + DisableAlertBeforeBackPageOptions, + EnableAlertBeforeBackPageOptions, RouterOptions, RouterState } from '@system.router'; + +class K { + private router: RouterOptions = { + uri: 'pages/routerpage2/routerpage2', + params: { // error + data1: 'message', + data2: { + data3: [123, 456, 789] + } + } + } + + private options: BackRouterOptions = { + uri: 'pages/detail/detail', // error + params: { // error + data1: 'message' + } + } + + getState() { + let page: RouterState = router.getState(); // error + console.log('current index = ' + page.index); // error + console.log('current name = ' + page.name); // error + console.log('current path = ' + page.path); // error + } + + pushPage() { + router.push(this.router); // error + } + + defaultBack() { + router.back(this.options); // error + } +} + +export default new K() + +class L { + private options: EnableAlertBeforeBackPageOptions = { + message: 'Message Info', + success: () => { + console.log('success'); + }, + cancel: () => { // error + console.log('cancel'); + }, + complete: () => { // error + console.log('complete'); + } + } + + enableAlertBeforeBackPage() { + router.enableAlertBeforeBackPage(this.options); + } +} + +class M { + enableAlertBeforeBackPage() { + router.enableAlertBeforeBackPage({ + message: 'Message Info', + success: () => { // error + console.log('success'); + }, + cancel: () => { + console.log('cancel'); + } + }); + } +} + +class Z { + private options: DisableAlertBeforeBackPageOptions = { // error + success: () => { + console.log('success'); + }, + cancel: () => { + console.log('cancel'); + } + } + + disableAlertBeforeBackPage() { + router.disableAlertBeforeBackPage(this.options); + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/system_router.ets.args.json b/ets2panda/linter/test/deprecatedapi/system_router.ets.args.json new file mode 100755 index 0000000000..4dfa4f2017 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/system_router.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/system_router.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/system_router.ets.arkts2.json new file mode 100755 index 0000000000..3379c9304b --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/system_router.ets.arkts2.json @@ -0,0 +1,78 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 24, + "column": 13, + "endLine": 24, + "endColumn": 14, + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 14, + "endLine": 26, + "endColumn": 15, + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 17, + "endLine": 27, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 22, + "endLine": 27, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 27, + "endLine": 27, + "endColumn": 30, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 13, + "endLine": 34, + "endColumn": 14, + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/system_router.ets.json b/ets2panda/linter/test/deprecatedapi/system_router.ets.json new file mode 100755 index 0000000000..bc7f37b6ed --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/system_router.ets.json @@ -0,0 +1,48 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 24, + "column": 13, + "endLine": 24, + "endColumn": 14, + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 14, + "endLine": 26, + "endColumn": 15, + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 13, + "endLine": 34, + "endColumn": 14, + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/temporary_api.ets b/ets2panda/linter/test/deprecatedapi/temporary_api.ets new file mode 100755 index 0000000000..014b717110 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/temporary_api.ets @@ -0,0 +1,28 @@ +/* + * 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 {PanelType} from './sdk/api/panel' + +@@Entry +@Component +struct WrapContentPanelExample { + @State isVisible: boolean = true + build() { + Column() { + Panel(this.isVisible) + .type(PanelType.Temporary) // error + } + + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/temporary_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/temporary_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/temporary_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/temporary_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/temporary_api.ets.arkts2.json new file mode 100755 index 0000000000..6a24afa2aa --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/temporary_api.ets.arkts2.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 2, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 13, + "endLine": 24, + "endColumn": 22, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 23, + "endLine": 24, + "endColumn": 32, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 3, + "endLine": 17, + "endColumn": 8, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 5, + "endLine": 22, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Panel\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/deprecatedapi/temporary_api.ets.json b/ets2panda/linter/test/deprecatedapi/temporary_api.ets.json new file mode 100755 index 0000000000..9f305c86d7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/temporary_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/text_input.ets b/ets2panda/linter/test/deprecatedapi/text_input.ets new file mode 100644 index 0000000000..34ea448f84 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/text_input.ets @@ -0,0 +1,28 @@ +/* + * 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. + */ + +@Entry +@Component +struct TextInputExample { + controller: TextInputController = new TextInputController(); + + build() { + Column() { + TextInput({ controller: this.controller }) + .onEditChanged((isEditing: boolean) => { //error + }) + } + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/text_input.ets.json b/ets2panda/linter/test/deprecatedapi/text_input.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/text_input.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/text_picker.ets b/ets2panda/linter/test/deprecatedapi/text_picker.ets new file mode 100644 index 0000000000..9cf5d2196f --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/text_picker.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct TextPickerExample { + private select: number = 1; + private fruits: string[] = ['apple1', 'orange2', 'peach3', 'grape4']; + + + build() { + Column() { + Button("TextPickerDialog") + .margin(20) + .onClick(() => { + TextPickerDialog.show() //error + }) + + TextPicker({ + range: this.fruits, + selected: this.select, + value: this.fruits[this.select] + }).onAccept(()=> {}) //error + .onCancel(()=> {}) //error + + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/text_picker.ets.json b/ets2panda/linter/test/deprecatedapi/text_picker.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/text_picker.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets b/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets new file mode 100755 index 0000000000..34cec151b3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets @@ -0,0 +1,28 @@ +/* + * 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 {PanelHeight} from './sdk/api/panel' + +@@Entry +@Component +struct WrapContentPanelExample { + @State isVisible: boolean = true + build() { + Column() { + Panel(this.isVisible) + .height(PanelHeight.WRAP_CONTENT) //error + } + + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.args.json b/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.args.json new file mode 100755 index 0000000000..948b846fe0 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.arkts2.json b/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.arkts2.json new file mode 100755 index 0000000000..2e6eb36ba3 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.arkts2.json @@ -0,0 +1,98 @@ +{ + "copyright": [ + "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." + ], + "result": [ + { + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 2, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 15, + "endLine": 24, + "endColumn": 26, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 27, + "endLine": 24, + "endColumn": 39, + "problem": "NoDeprecatedApi", + "suggest": "", + "rule": "ArkUI deprecated api check (arkui-no-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 3, + "endLine": 17, + "endColumn": 8, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 2, + "endLine": 18, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 4, + "endLine": 20, + "endColumn": 9, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 5, + "endLine": 22, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Panel\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.json b/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.json new file mode 100755 index 0000000000..9f305c86d7 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/wrap_content_api.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} diff --git a/ets2panda/linter/test/deprecatedapi/xcomponent.ets b/ets2panda/linter/test/deprecatedapi/xcomponent.ets new file mode 100644 index 0000000000..89b2897eec --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/xcomponent.ets @@ -0,0 +1,34 @@ +/* + * 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. + */ + +@Entry +@Component +struct PreviewArea { + xcomponentController: XComponentController = new XComponentController() + build() { + Row() { + XComponent({ + id: 'xcomponent', + type: 'type', + controller: this.xcomponentController + }) + .onLoad(() => { + this.xcomponentController.setXComponentSurfaceSize({surfaceWidth:1920,surfaceHeight:1080}); //error + }) + } + .backgroundColor(Color.Black) + .position({x: 0, y: 48}) + } +} \ No newline at end of file diff --git a/ets2panda/linter/test/deprecatedapi/xcomponent.ets.json b/ets2panda/linter/test/deprecatedapi/xcomponent.ets.json new file mode 100644 index 0000000000..ca88f857e9 --- /dev/null +++ b/ets2panda/linter/test/deprecatedapi/xcomponent.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/main/undefined_check_calls.ets.json b/ets2panda/linter/test/main/undefined_check_calls.ets.json index 5f20af3a44..65d18bdd6c 100644 --- a/ets2panda/linter/test/main/undefined_check_calls.ets.json +++ b/ets2panda/linter/test/main/undefined_check_calls.ets.json @@ -30,8 +30,8 @@ "endLine": 51, "endColumn": 60, "problem": "StrictDiagnostic", - "suggest": "Argument of type 'string | undefined' is not assignable to parameter of type 'ResourceStr'.", - "rule": "Argument of type 'string | undefined' is not assignable to parameter of type 'ResourceStr'.", + "suggest": "Argument of type 'string | undefined' is not assignable to parameter of type 'ResourceStr'.\n Type 'undefined' is not assignable to type 'ResourceStr'.", + "rule": "Argument of type 'string | undefined' is not assignable to parameter of type 'ResourceStr'.\n Type 'undefined' is not assignable to type 'ResourceStr'.", "severity": "ERROR" }, { @@ -100,8 +100,8 @@ "endLine": 92, "endColumn": 15, "problem": "StrictDiagnostic", - "suggest": "Type 'TestClassC' is not assignable to type 'TestClassD'.", - "rule": "Type 'TestClassC' is not assignable to type 'TestClassD'.", + "suggest": "Type 'TestClassC' is not assignable to type 'TestClassD'.\n Types of property 'ccc' are incompatible.\n Type 'null' is not assignable to type 'string'.", + "rule": "Type 'TestClassC' is not assignable to type 'TestClassD'.\n Types of property 'ccc' are incompatible.\n Type 'null' is not assignable to type 'string'.", "severity": "WARNING" }, { @@ -120,8 +120,8 @@ "endLine": 99, "endColumn": 15, "problem": "StrictDiagnostic", - "suggest": "Type 'TestClassC' is not assignable to type 'TestClassD'.", - "rule": "Type 'TestClassC' is not assignable to type 'TestClassD'.", + "suggest": "Type 'TestClassC' is not assignable to type 'TestClassD'.\n Types of property 'ccc' are incompatible.\n Type 'null' is not assignable to type 'string'.", + "rule": "Type 'TestClassC' is not assignable to type 'TestClassD'.\n Types of property 'ccc' are incompatible.\n Type 'null' is not assignable to type 'string'.", "severity": "ERROR" }, { @@ -130,8 +130,8 @@ "endLine": 105, "endColumn": 15, "problem": "StrictDiagnostic", - "suggest": "Type 'TestClassC' is not assignable to type 'TestClassD'.", - "rule": "Type 'TestClassC' is not assignable to type 'TestClassD'.", + "suggest": "Type 'TestClassC' is not assignable to type 'TestClassD'.\n Types of property 'ccc' are incompatible.\n Type 'null' is not assignable to type 'string'.", + "rule": "Type 'TestClassC' is not assignable to type 'TestClassD'.\n Types of property 'ccc' are incompatible.\n Type 'null' is not assignable to type 'string'.", "severity": "ERROR" }, { @@ -140,8 +140,8 @@ "endLine": 106, "endColumn": 15, "problem": "StrictDiagnostic", - "suggest": "Type 'TestClassC' is not assignable to type 'TestClassD'.", - "rule": "Type 'TestClassC' is not assignable to type 'TestClassD'.", + "suggest": "Type 'TestClassC' is not assignable to type 'TestClassD'.\n Types of property 'ccc' are incompatible.\n Type 'null' is not assignable to type 'string'.", + "rule": "Type 'TestClassC' is not assignable to type 'TestClassD'.\n Types of property 'ccc' are incompatible.\n Type 'null' is not assignable to type 'string'.", "severity": "ERROR" } ] -- Gitee